I have a 14 year old freshman daughter with a phone. I will start by saying that all her family is in one home (dad and I are married) so she doesn't have the element of changing homes and different rules.
And, all kids are different. Their friends are different, their habits and personalities are different, their temperaments are different, and so on. So, one size fits all doesn't work. I also have a 17 year old son. He got his phone only one year before his sister did, even though they are 3 years apart in age. They are different kids with different needs.
Fortunately, our daughter has a good group of friends and so far she has managed to avoid most (if not all?) of the drama I hear so much about in middle and high school. There's been pretty much ZERO. Of course, that may not be true for all of her friends, but my daughter hasn't been sucked into any of it if it does exist among her group of friends. Choosing friends isn't an easy thing. And changing friend is near impossible at this age. Your daughter can't just wake up one day and *decide* "I'm going to be friends with THAT kid over there... because she seems like a good student with high morals and values the things I want to value." THAT kid over there may not like your daughter. Or share any common interests. Or classes. Or aptitudes. So it just isn't that easy.
She needs help learning how to navigate through the issues with the friends she has. If her friends are into dangerous things, then you may have to take more definitive steps... but if they are just into drama (as lots of kids apparently are at this age/stage) then she needs to work through navigating it. She *can* tell her friends, "I don't like this level of drama, so if you don't have something nice to say about (whomever is the object of discussion) then I don't want to hear about it. Can we talk about something else?" Or however you think is best to change direction. It could be good for ALL of them to have someone actually say it out loud. Food for thought for them all. It's easy to get sucked in and not even realize what is going on.
Same thing with apps/phone/online. Ignore damaging, hurtful posts, or ask not to be including on the list of recipients if they are going to be mean to someone. Perhaps it will help her friends (and herself) pause to actually THINK about what they are sending before they hit the send button.
But taking her phone when she gets home? Meh.. I don't take my daughter's. She takes a break from school when she first gets home. She ALWAYS gets her work done, but does best when she has decompression time first, then comes back to the work later on. She determines those time periods. She knows how much (or little) work she has on a given day. I don't even take her phone at night any more, because she is disciplined enough to go to sleep when she needs to go to sleep, and she uses it for her alarm clock in the morning (she gets up on her own and gets showered and ready for school completely on her own).
Maybe that isn't the case with your daughter. I had son turn his phone in at night for awhile last year b/c it was a problem. But he learned and now it isn't a problem anymore. So, think about what you are trying to accomplish. Are you trying to punish her or are you trying to teach her? Then see what works best to accomplish your goal.
Good luck.