Every story in this library happens inside a three-storey universe.
Heaven (天界) is above: the palace of the Jade Emperor and his celestial bureaucracy, the star-gods, the peach gardens of the Queen Mother of the West, the loom-house of the Weaver Maid. Heaven is imagined less as paradise than as a court — with ranks, posts, promotions and punishments, mirroring the imperial government below. Gods are, in effect, officials.
The mortal realm (人间) is the middle: the world of humans, and also of everything that lives alongside them — animals, trees, rivers, mountains, and the spirits that all of these may grow into. It is the only realm where change is possible: here a human may become an immortal, an animal may become a spirit, a ghost may be reborn. That is why the stories all happen here.
The underworld (地府) is below: the ten courts of the dead, where every soul is judged, assigned its punishments or rewards, and eventually sent back up to be reborn. It is not hell in the Christian sense — it is a processing centre, ruled by magistrates and clerks, as bureaucratic as heaven and considerably more overworked.
The realms are not sealed. Traffic between them is the engine of the whole genre: the Weaver Maid descends to marry a cowherd or pay a debt; a ghost climbs up to haunt a temple; a Taoist ascends in daylight; the Dragon Kings ride the rain between the water-palaces and the sky. Most zhiguai plots can be summarised as something crossed a border that is usually hard to cross — and the drama comes from the rules that crossing breaks.
Two further ideas govern the architecture. Qi (气), the breath-stuff of which everything — mountains, bodies, spirits — is made, flows through all three realms, so the boundary is a matter of density rather than distance. And karma is the passport system: what you did in one realm determines where you wake up in the next. The universe is one state, one law, three floors.