I recommend a novel to you. The title is "The Legend of the Divine Doctor's Abandoned Concubine". The female protagonist, Gu You Luo, traveled to ancient times. After learning medicine from a master and becoming a poison master, she entered the harem for revenge. However, she fell in love with her enemy and became the most ruthless imperial concubine in history. In the end, she ruled the harem and ruled the world. The plot fits your description. I hope you like my recommendation. Muah ~