I recommend the novel,'A Concubine in Power: The Cold Emperor Loves to Act Coquettie', to you. The plot is very similar to what you described. The female protagonist started off with the second male prince, and the male emperor became interested in the female protagonist. In the end, the two of them got together. The male protagonist in this book was a cold emperor but loved to act coquettishly. The female protagonist was a smart and capable character. The love story between the two was very exciting. I hope you like my recommendation.