The basic answer, which you've already been given, is: you can't avoid negative feedback. If you post any writing on-line, especially fiction, it will attract internet trolls, as sure as the sparks fly upward.
Most of the advice offered by the other responses is worthwhile. But I'd like to add a note about a "Mary Sue". This often refers to a character in a story who represents the author, and is typically used with reference to a female author.
Firstly, a Mary Sue is not necessarily a perfect character, who never makes a mistake, despite what one answer says. She - and it is normally a she - is a character through whom the author appears in the story in person. In a 'Star Trek' novella, for instance, she is often a new female Yeoman who has a crush on Captain Kirk: the deadly point being that Captain Kirk returns her affections, when he ought reasonably to be ignoring her.
I've even read published Star Trek novels by professional writers - of the female persuasion - who have written themselves into the novel. It always makes me cringe, so I can't honestly voice any criticism of a reviewer who finds it equally grating. If you must write in Roddenberry's universe, you must obey Roddenberry's Rules: and this goes for any fan fiction. If you subvert the rules of the universe, you are insulting its creator and its fans, and you'll get justifiable criticism. You are entitled to complain about a troll who criticises you for no valid reason, but not about a reviewer who has a legitimate reason to voice (non-abusive) criticism.
And you can do something positive about this, because you have a name that no one I know would recognise as a girl's name. If you are ambiguous about whether you are a girl, or at least are silent on the point, few trolls are likely to realise that one of your characters is a Mary Sue, even if she is one, because they simply won't realise you are a female author. Chances are then pretty good that you won't get criticised on that particular ground.
I'd like to offer you a point of view on style, too.
The most important aspect of your writing is your writing style. If you write fluently, without more than an occasional lapse in spelling, grammar or punctuation, your work will be easy to read, and so less likely to irritate the reader. Try to let your meaning come through clearly: there is nothing more irritating than a good story which is hampered because the punctuation, spelling or grammar makes it difficult to understand what a sentence means.
With fan fiction, it can often be helpful to read what other people are writing. If you read a fan-fiction story by someone else, and notice that something about it irritates you - for whatever reason - try to avoid doing the same thing in your own writing. That way you can learn from someone else's mistakes.
Reading a well-written story may be a pleasure, but probably you won't learn anything from doing so. You'll actually learn more by reading something badly written, because things about it will - hopefully - irritate you, and you can then make a note of something to avoid doing in your own writing.
All I am really saying here is, if you see something that irritates you, try to avoid doing that in your own story.
That requires you to, at the very least, finish writing your story before you post any of it online -- because the final step must always be to re-read it, looking for points that you would object to if it was someone else's story. This is called proof-reading, and no work is fit for publication until it has been proofread.
With regard to criticism, I tend to disagree with most of the other responses posted here. Positive criticism, or perhaps I should say positive feedback, is pretty much just as useless as negative feedback.
If a reviewer gives no reasons, then positive and negative comments are alike useless to you. And most people who post positively give no - or no useful - details of why they responded favourably. The only type of feedback worth a damn is that which gives you some indication of why the reviewer liked or disliked the piece.
Feedback that helps you write your next piece is worth having, even if it's negative. Feedback that doesn't actually tell you anything is only worth ignoring.