By the turn of the first millennium, Chinese rulers had established the most extensive and legalistic administrative structures to be found anywhere in the world. And legalism had seeped into the lives of most ordinary Chinese people, including their relations with the afterlife.