# Kōkyū

Kōkyū(後宮) is the section of a Japanese Imperial Palace called the Dairi(内裏) where the Imperial Family and court ladies lived.
Many cultured women gathered as wives of Emperors, and court ladies, as well as the maids for these women; court officials often visited these women for influence, literary charm, or romances. Significant contributions to the literature of Japan were created in the Kōkyū during this period: works such as The Tale of Genji by Murasaki Shikibu, The Pillow Book by Sei Shōnagon, and many anthologies of waka poems.

## Conflated definitions

The term "Dairi" refers not only to the buildings in which the Japanese Imperial family resided; it also refers indirectly to the women of the Imperial family (the Kōkyū), to the Imperial court of Japan, or as an indirect (now archaic) way of referring to the Emperor himself.
The names of the several gates in the walls surrounding the Imperial grounds refer not only to the specific wall-openings themselves; these names were also used to refer indirectly to a nearby residence of an empress whose husband had abdicated, or as an indirect way of referring to the Empress Dowager herself, e.g., Empress Dowager Kenrei (建礼門院,, Kenrei-mon-In), whose official home, after the abdication and death of Emperor Takakura, was located near the Kenrei Gate.
In this same way, the term kōkyū has multiple meanings, referring to the group of buildings situated near the sovereign's personal apartments where the consorts resided, and also describing the staff of female palace officials assigned to the service of those consorts. More broadly, the term kōkyū could be used in identifying the array of consorts below the empress.

## Structure

The structure of the royal household and ranks for court ladies were defined in Taihō Code and Yōrō Code. In these Codes, there were originally to have been twelve sections, and the various ranks for ladies' of the Imperial household within the Kōkyū were defined.
Fine distinctions were collapsed or expanded in a gradual re-organization which became formalized during the Heian period. For example, in 806, Emperor Heizei elevated the former Fujiwara no Tarashiko (藤原帯子) (?-794), also known as Taishi, by giving her the Imperial title of Kōgō or empress. This occurred 12 years after her death, and it became the first time this posthumously elevated rank was bestowed.
Many of the court ranks which were not defined in either the Taihō or Yōrō Codes have been in continuous use in the centuries following the early Heian period.

### Imperial Wives and Imperial Women's Titles

* Emperor's Wives
** 1 Empress (Kōgō; 皇后): also called Kōkōgō (皇后宮).
** 1 Empress Consort (Chūgū; 中宮): Originally this word meant the Palace where the Empress Consort lived. Since Emperor Ichijō had two Empress Consorts, one of his Empress Consorts was called this word.
** 2 Consorts (Hi; 妃): Collapsed since the Heian period. Princesses could be appointed.
** 3 Madames (Fujin; 夫人): Collapsed since the Heian period.
** 4 Beauties (Hin; 嬪): Collapsed since the Heian period.
** Court Ladies (Nyōgo; 女御): Not defined in Codes. Daughters of Ministers could be appointed.
** Court Attendant (Koui; 更衣): Not defined in Codes.
* Other Imperial Women
** 1 Empress Dowager (Kōtaigō; 皇太后): Empress Mother (including mother-in-law of Emperor), Empress Dowager, or the former Empress Consort; also called Kōtaikōgō (皇太皇后).
** 1 Grand Empress Dowager (Tai-Kōtaigō; 太皇太后): the former Empress Dowager, also called Tai-Kōtaikōgō (太皇太皇后).
** Ju-Sangū/Ju-Sangō (准三宮/准三后): Kōgō, Kōtaigō, and Tai-Kōtaigō are called Sangū/Sangō (三宮/三后). Ju-Sangū/Ju-Sangō means quasi-Sangū/Sangō. Ju-Sangū/Ju-Sangō got the subequal treatment with Sangū/Sangō. Consorts and princesses, as well as Ministers or high-ranking monks, became Ju-Sangū/Ju-Sangō.
** Nyoin/Nyōin (女院): Wives of the former Emperors or princesses who could receive the same treatment as Daijō Tennō (In, 院).

### Court Ladies

Kōkyū Jūni-Shi (後宮十二司)
* Naishi-no-Tsukasa (内侍司) got involved Imperial ceremonies and communication between Emperor and court officials. They also keep Ummei-den (温明殿) called Naishi-dokoro (内侍所) where the sacred mirror (神鏡) was enshrined.
** Naishi-no-Kami (尚侍) (2 people): Head of Naishi-no-Tsukasa. Usually daughters of Ministers could be appointed. Some of them were the concubines of Emperor, or wives of Crown Prince.
** Naishi-no-Suke (典侍) (4 people): Usually daughters of Dainagon and Chūnagon could be appointed. Some of them were the concubines of Emperor. The nurses of Emperors were also appointed.
** Naishi-no-Jō/Naishi (掌侍/内侍) (4 people).
The following 11 sections were collapsed in the early Heian period.
* Kura-no-Tsukasa (蔵司) treated Imperial treasures.
* Fumi-no-Tsukasa (書司) treated literary tool and books.
* Kusuri-no-Tsukasa (薬司) treated medicine.
* Tsuwamono-no-Tsukasa (兵司) treated arms.
* Mikado-no-Tsukasa (闈司) got involved opening and closing the gates.
* Tonomori-no-Tsukasa (殿司) treated fuel.
* Kanimori-no-Tsukasa (掃司) got involved cleaning.
* Moitori-no-Tsukasa (水司) treated water and rice gruel.
* Kashiwade-no-Tsukasa (膳司) treated meals.
* Sake-no-Tsukasa (酒司) treated liquor.
* Nui-no-Tsukasa (縫司) treated clothes.
Other Titles
* Mikushige-dono-no-Bettō (御匣殿別当): Head of Mikushige-dono where clothes of Emperor were treated. Some of them were the concubines of Emperor.
* Nyo-kurōdo (女蔵人) got involved Imperial ceremonies.
* Uneme (采女): Lower-grade court lady from countries.

## Ministry of the Imperial Household

The Imperial court hierarchy during the Asuka, Nara and Heian periods encompassed a Ministry of the Imperial Household (宮内省,, Kunai-shō). The origin of the current Imperial Household Agency can be traced back to the provisions on the government structure which were put into effect during the reign of Emperor Monmu. There were specific Daijō-kan officials within this ministry structure whose attention was focused primarily on the women of the Imperial household. These were:
* Female physician (女医博士,, Nyo'i hakase). No male physician would be permitted to care for the health of the emperor's women.
* Senior equerry or chamberlain for the women of the Emperor's household (采女正,, Uneme no kami).
* First assistant equerry for the women of the Emperor's household (采女佑,, Uneme no jō).
* Alternate equerries for the women of the Emperor's household (采女令史,, Uneme no sakan).