Many court ladies served in the inner palace during the Heian period.
後宮は男子禁制の空間だった。
The inner palace was a space forbidden to men.
imperial consort
By extension, can refer to the consort herself, though this usage is less common and typically found in historical or literary texts.
彼女は後宮として帝の寵愛を受けた。
She received the emperor's favor as an imperial consort.