It is the sixth century CE and the Qi Kingdom, in what is now Eastern China, is a land at war.
The young teenage prince Pei Yan Zhi, a prodigal young military talent, is sent to ward off a force of invaders. Although he makes a valiant effort, his army is ultimately ambushed and defeated in a decisive battle. An opportunist foe at the imperial court takes advantage of the situation, forcing Pei Yan Zhi to step down as head of the army – and manages to get a young subservient candidate to take the throne.
Pei Yan Zhi feels he was betrayed. He vows to get to the bottom of the intrigue and goes undercover to investigate, pretending to be a commoner to help him work undetected. On his quest for the truth, he meets a remarkably smart and resourceful young female detective named Su Ci. Together, they form a close bond. They team up with two other quick-witted young sleuths and make a joint bid to discover the scale of the scheming that has undermined the Imperial Palace.