The name of this anime or novel might be " The Law of the Concubines ". It was about a modern girl who had traveled to ancient times and accidentally traveled to an ancient dynasty and was chosen by the emperor to become his concubine. In the process of becoming a concubine, she gradually discovered the secrets and conspiracies of the dynasty and had many interesting stories with the emperor and other concubines. The female lead was the next concubine chosen by the Emperor. At first, she did not have too deep feelings for the Emperor, but gradually, she developed feelings for him. The second male lead was the female lead's classmate in school. The two of them had some ambiguous relationship in school. Later, the female lead was chosen by the emperor as a concubine and married the second male lead to become the princess. However, the female protagonist found that her feelings for the Emperor did not change. In the end, she chose to return to the Emperor's side and become his personal maid to help him solve various problems. This anime and novel had a compact plot and distinct characters. It was a very popular historical harem theme.