In the middle and late Northern Song Dynasty, the imperial court emphasized civility over military affairs, bureaucratic corruption, and a loose military system. The Liao Dynasty in the north is eyeing the country, and the Xixia in the northwest often invades the border. Domestic land annexation is serious, refugees are increasing, and social conflicts are gradually emerging.