/* ═══════════════════════════════════════════════════════════════
   登基：只换宫廷皮肤，不改聊天、长按、侧滑和数据流。
   ═══════════════════════════════════════════════════════════════ */
@font-face {
  font-family: "Becoming Imperial Xing";
  src: url("/static/imperial/fonts/MaShanZheng-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.imperial-plaque-title,
.imperial-character-art {
  display: none;
}

.imperial-composer-input {
  display: none;
}
html[data-theme="imperial"] {
  --nav-h: 90px;
  --nav-safe-bottom: env(safe-area-inset-bottom, 0px);
  --imperial-heading-font: "Becoming Imperial Xing", "Xingkai SC", "Xingkai TC", "Kaiti SC", "STKaiti-SC-Regular", "STKaiti", "KaiTi", "KaiTi_GB2312", "BiauKai", "DFKai-SB", cursive;
  background: #2a1009;
}

html[data-theme="imperial"] body {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  background: #2a1009;
}

html[data-theme="imperial"] :is(
  #singleListView,
  #singleChatView,
  #groupView,
  #memoryView,
  #momentsView,
  #moreView
) {
  --imperial-gold: #d9ac4a;
  --imperial-deep-gold: #8b5a19;
  --imperial-lacquer: #571711;
  --imperial-ink: #3a2115;
  --imperial-paper: #f1dfad;
}

/* 上朝：背景直出，不叠通用水彩蒙版。 */
html[data-theme="imperial"] #singleListView {
  background: #1b0c06;
}

html[data-theme="imperial"] #charListContainer {
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #1b0c06;
  background-image: url("/static/imperial/court.webp");
  background-size: cover;
  background-position: center center;
  isolation: isolate;
}

html[data-theme="imperial"] #charListContainer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 220, 128, .04), rgba(31, 10, 5, .16) 78%),
    linear-gradient(to bottom, rgba(28, 7, 3, .06), transparent 28%, rgba(24, 7, 3, .22));
  pointer-events: none;
}

html[data-theme="imperial"] #singleListHeader {
  position: absolute;
  z-index: 20;
  top: clamp(5px, 1.2dvh, 14px);
  left: 50%;
  width: min(58vw, 320px);
  height: clamp(76px, 12dvh, 112px);
  padding: 0;
  overflow: visible;
  background: transparent;
  transform: translateX(-50%);
  pointer-events: none;
}

html[data-theme="imperial"] #singleListHeader::before {
  display: none;
}

html[data-theme="imperial"] #singleListHeader :is(.header-paw, .becoming-title) {
  display: none;
}

html[data-theme="imperial"] .imperial-plaque-title {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(7px, 1.1dvh, 11px) 18% 0;
  background: url("/static/imperial/plaque.png") center / contain no-repeat;
  color: #2c1608;
  font-family: var(--imperial-heading-font);
  font-size: clamp(18px, 5vw, 32px);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .16em;
  text-shadow: 0 1px rgba(255, 229, 137, .54);
  filter: drop-shadow(0 5px 5px rgba(17, 4, 1, .38));
}

html[data-theme="imperial"] .char-list-row {
  --court-size: clamp(100px, 25vw, 165px);
  position: absolute;
  z-index: 2;
  width: var(--court-size);
  height: var(--court-size);
  padding: 0;
  display: block;
  border: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  transition: filter 150ms ease, transform 150ms ease;
}

html[data-theme="imperial"] .char-list-row::after,
html[data-theme="imperial"] .char-list-avatar-wrap,
html[data-theme="imperial"] .char-list-preview {
  display: none;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiezhian"] {
  --court-size: clamp(94px, 24vw, 148px);
  --imperial-badge-top: 15%;
  --imperial-badge-left: 51%;
  z-index: 2;
  top: 15%;
  left: 17%;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiezhidu"] {
  --court-size: clamp(94px, 24vw, 148px);
  --imperial-badge-top: 16.5%;
  --imperial-badge-left: 48.5%;
  z-index: 2;
  top: 15%;
  right: 17%;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiechengle"] {
  --court-size: clamp(130px, 34vw, 212px);
  --imperial-badge-top: 12.5%;
  --imperial-badge-left: 50%;
  z-index: 4;
  top: 37%;
  left: 5%;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiezhihai"] {
  --court-size: clamp(130px, 34vw, 212px);
  --imperial-badge-top: 12.5%;
  --imperial-badge-left: 51%;
  z-index: 4;
  top: 37%;
  right: 5%;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiezhiping"] {
  --court-size: clamp(178px, 46vw, 284px);
  --imperial-badge-top: 15%;
  --imperial-badge-left: 51%;
  z-index: 6;
  bottom: -2%;
  left: -3%;
}

html[data-theme="imperial"] .char-list-row[data-character-id="xiezhijiang"] {
  --court-size: clamp(178px, 46vw, 284px);
  --imperial-badge-top: 18.5%;
  --imperial-badge-left: 47.5%;
  z-index: 6;
  right: -3%;
  bottom: -2%;
}

html[data-theme="imperial"] .imperial-character-art {
  position: absolute;
  display: block;
  inset: 0;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  user-select: none;
}

html[data-theme="imperial"] .imperial-character-figure {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 8px 7px rgba(13, 3, 1, .52));
}

html[data-theme="imperial"] .imperial-character-art.asset-missing::after {
  content: "候旨";
  position: absolute;
  inset: 20%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 172, 74, .72);
  background: rgba(70, 20, 12, .84);
  color: #f3d889;
}

html[data-theme="imperial"] .imperial-model-badge {
  position: absolute;
  z-index: 4;
  top: var(--imperial-badge-top, 13%);
  left: var(--imperial-badge-left, 50%);
  width: clamp(27px, calc(var(--court-size) * .25), 60px);
  height: clamp(27px, calc(var(--court-size) * .25), 60px);
  display: grid;
  place-items: center;
  padding: clamp(4px, 1.25vw, 7px);
  border: clamp(1px, .35vw, 2px) solid rgba(231, 191, 90, .92);
  border-radius: 50%;
  background: rgba(250, 244, 220, .94);
  box-shadow: 0 3px 8px rgba(31, 7, 2, .44), inset 0 0 0 1px rgba(105, 55, 16, .25);
  transform: translateX(-50%);
  pointer-events: none;
}

html[data-theme="imperial"] .imperial-model-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}

html[data-theme="imperial"] .imperial-model-grok {
  padding: clamp(2px, .75vw, 4px);
  background: #f7efda;
}

html[data-theme="imperial"] .imperial-model-badge.asset-missing::after {
  content: "?";
  color: var(--imperial-lacquer);
  font-weight: 800;
}

html[data-theme="imperial"] .imperial-model-badge.asset-missing img {
  display: none;
}

html[data-theme="imperial"] .imperial-unread-dot {
  top: 9%;
  right: 11%;
  width: clamp(10px, 3vw, 15px);
  height: clamp(10px, 3vw, 15px);
  border-color: #f1d88c;
  background: #d5392e;
}

html[data-theme="imperial"] .char-list-row > .char-list-info {
  position: absolute;
  z-index: 5;
  top: 61%;
  left: 50%;
  width: max-content;
  max-width: 92%;
  margin: 0 !important;
  transform: translateX(-50%);
}

html[data-theme="imperial"] .char-list-name {
  min-width: clamp(60px, calc(var(--court-size) * .55), 132px);
  padding: clamp(3px, .8vw, 6px) clamp(8px, 2vw, 15px);
  overflow: hidden;
  border: 1px solid rgba(218, 175, 69, .92);
  border-radius: 4px 4px 10px 10px;
  background:
    linear-gradient(90deg, rgba(255, 228, 136, .08), transparent 17% 83%, rgba(255, 228, 136, .08)),
    #173c29;
  color: #f7dda0 !important;
  box-shadow: 0 5px 8px rgba(19, 4, 1, .4), inset 0 0 0 1px rgba(47, 15, 5, .44);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(11px, calc(var(--court-size) * .075), 19px);
  font-weight: 700 !important;
  letter-spacing: .08em;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="imperial"] .char-list-row:is(:active, :focus-visible) {
  filter: drop-shadow(0 0 12px rgba(244, 190, 73, .88));
  transform: translateY(-2px) scale(1.025);
}

/* 寝宫：牌匾门头、宣纸气泡、圣旨输入和玉玺发送。 */
html[data-theme="imperial"] :is(#singleChatView, #groupView)::before {
  background-image:
    linear-gradient(to bottom, rgba(37, 7, 3, .12), rgba(37, 7, 3, .03) 44%, rgba(30, 8, 3, .26)),
    var(--chat-background-image, url("/static/imperial/bedroom.webp"));
  background-position: center top;
}

html[data-theme="imperial"] #singleChatView > header {
  min-height: clamp(98px, 14dvh, 126px);
  overflow: visible;
  background: linear-gradient(to bottom, rgba(38, 9, 4, .74), transparent);
}

html[data-theme="imperial"] #singleChatView > header::before,
html[data-theme="imperial"] .group-header::before,
html[data-theme="imperial"] #memoryListHeader::before,
html[data-theme="imperial"] #momentsListHeader::before,
html[data-theme="imperial"] #moreHeader::before {
  display: none;
}

html[data-theme="imperial"] :is(#singleChatView > header, .group-header) .header-paw {
  display: none;
}

html[data-theme="imperial"] #singleChatView .chat-header-bar {
  width: min(82vw, 430px);
  min-height: clamp(72px, 10dvh, 98px);
  margin: 1px auto 0;
  padding: 0 18%;
  background: url("/static/imperial/plaque.png") center / contain no-repeat;
  filter: drop-shadow(0 5px 5px rgba(17, 4, 1, .42));
}

html[data-theme="imperial"] #char-name {
  color: #2c1608;
  font-family: var(--imperial-heading-font);
  font-size: clamp(17px, 4.8vw, 26px);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .1em;
  text-shadow: 0 1px rgba(255, 229, 137, .56);
  transform: translateY(clamp(4px, .7dvh, 7px));
  white-space: nowrap;
}

html[data-theme="imperial"] #backToList {
  position: absolute;
  z-index: 3;
  left: -7vw;
  bottom: 9px;
  width: auto;
  min-width: 48px;
  padding: 6px 8px;
  border: 1px solid rgba(224, 181, 79, .72);
  border-radius: 4px;
  background: rgba(73, 20, 13, .88);
  color: #f4d987;
  font-size: 0;
  box-shadow: 0 4px 8px rgba(20, 4, 1, .28);
}

html[data-theme="imperial"] #backToList::before {
  content: "退朝";
  font-size: 12px;
  letter-spacing: .08em;
}

html[data-theme="imperial"] #searchToggle {
  position: absolute;
  z-index: 3;
  right: -6vw;
  bottom: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(224, 181, 79, .72);
  border-radius: 50%;
  background: rgba(73, 20, 13, .88);
  color: #f4d987;
  font-size: 18px;
}

html[data-theme="imperial"] #char-online {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 7px;
  left: 0;
  padding: 0;
  color: #f2d88d;
  font-size: 10px;
  text-shadow: 0 1px 4px #1c0803;
}

html[data-theme="imperial"] .group-header {
  min-height: clamp(82px, 12dvh, 108px);
  padding: calc(clamp(25px, 4.2dvh, 38px) + 5px) 22% 0;
  border: 0;
  background:
    url("/static/imperial/plaque.png") center / min(74vw, 390px) auto no-repeat,
    linear-gradient(to bottom, rgba(38, 9, 4, .74), transparent);
  color: #2c1608;
  filter: drop-shadow(0 5px 5px rgba(17, 4, 1, .24));
  font-family: var(--imperial-heading-font);
  font-size: clamp(15px, 4.1vw, 22px);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .08em;
  text-shadow: 0 1px rgba(255, 229, 137, .54);
}

html[data-theme="imperial"] :is(#messages, #groupMessages) {
  scrollbar-color: rgba(206, 158, 62, .42) transparent;
}

html[data-theme="imperial"] .bubble {
  border-width: 1px;
  border-color: rgba(113, 62, 18, .48);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(31, 8, 3, .19), inset 0 0 18px rgba(140, 84, 25, .07);
  font-family: "Songti SC", "STSong", serif;
}

html[data-theme="imperial"] .bubble.ai {
  background:
    linear-gradient(100deg, rgba(255, 250, 218, .78), rgba(230, 204, 140, .93)),
    var(--ai-bubble);
  color: #3a2115;
  border-bottom-left-radius: 2px;
}

html[data-theme="imperial"] .bubble.user {
  background: linear-gradient(135deg, #7a241d, #50120e);
  color: #f8e6b6;
  border-color: rgba(222, 178, 75, .62);
  border-bottom-right-radius: 2px;
}

html[data-theme="imperial"] :is(.msg-time, .group-sender-name) {
  color: rgba(246, 226, 166, .78);
  text-shadow: 0 1px 3px rgba(30, 6, 2, .72);
}

html[data-theme="imperial"] .loading-dots::after {
  content: "正在揣摩圣意…";
  margin-left: 4px;
  color: rgba(58, 33, 21, .68);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
}

html[data-theme="imperial"] :is(#inputbar, #groupInputbar) {
  min-height: clamp(86px, 12dvh, 106px);
  padding: 22px clamp(78px, 21vw, 90px) 18px clamp(44px, 12vw, 50px);
  gap: 0;
  overflow: visible;
  border: 0;
  background: linear-gradient(to top, rgba(30, 8, 3, .74), rgba(30, 8, 3, .08));
  isolation: isolate;
}

html[data-theme="imperial"] #inputbar {
  z-index: 110;
}

html[data-theme="imperial"] :is(#inputbar, #groupInputbar)::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px 58px 3px 5px;
  background: url("/static/imperial/edict-composer.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 5px rgba(25, 5, 2, .38));
  pointer-events: none;
}

html[data-theme="imperial"] :is(#inputbar, #groupInputbar)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 22px;
  right: clamp(78px, 21vw, 90px);
  bottom: 18px;
  left: clamp(44px, 12vw, 50px);
  border: 1px solid rgba(143, 78, 24, .68);
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .32), transparent 40%),
    linear-gradient(102deg, #fff8dd, #f7edca 54%, #fff7d9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 205, .58),
    inset 0 0 16px rgba(153, 92, 29, .08),
    0 1px 3px rgba(77, 30, 9, .12);
  pointer-events: none;
}

html[data-theme="imperial"] :is(#input, #groupInput) {
  display: none;
}

html[data-theme="imperial"] .imperial-composer-input {
  position: relative;
  z-index: 1;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  max-height: 126px;
  margin: 0;
  padding: 9px 8px;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #3a2115;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  caret-color: #7b2018;
  scrollbar-width: thin;
}

html[data-theme="imperial"] .imperial-composer-input::placeholder {
  color: rgba(74, 39, 19, .58);
}

html[data-theme="imperial"] :is(#send, #groupSend) {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 9px;
  width: clamp(58px, 16vw, 74px);
  height: clamp(58px, 16vw, 74px);
  border: 0;
  border-radius: 0;
  background: url("/static/imperial/nav-seal.png") center / contain no-repeat;
  color: transparent;
  box-shadow: none;
  filter: drop-shadow(0 5px 4px rgba(30, 5, 2, .42));
}

html[data-theme="imperial"] #send {
  touch-action: none;
}

html[data-theme="imperial"] #pawMenu {
  z-index: 8;
  pointer-events: auto;
  border-color: rgba(132, 73, 22, .62);
  background: #f3e2b7;
  color: #3a2115;
  box-shadow: 0 9px 22px rgba(29, 7, 2, .42);
}

html[data-theme="imperial"] #pawMenu .paw-menu-item {
  color: #3a2115;
  pointer-events: auto;
}

html[data-theme="imperial"] :is(#send, #groupSend) .material-symbols-outlined {
  display: none;
}

html[data-theme="imperial"] :is(#send, #groupSend):active {
  transform: translateY(2px) rotate(-2deg) scale(.96);
  box-shadow: none;
}

/* 奏折阁：总览和详情都卷成圣旨，而不是现代票据。 */
html[data-theme="imperial"] :is(#memoryView, #momentsView, #moreView) {
  background-color: #231008;
  background-image:
    linear-gradient(rgba(31, 11, 5, .44), rgba(31, 11, 5, .58)),
    url("/static/imperial/court.webp");
  background-size: cover;
  background-position: center center;
}

html[data-theme="imperial"] :is(#memoryListHeader, #momentsListHeader, #moreHeader) {
  min-height: clamp(84px, 12dvh, 108px);
  padding: calc(clamp(26px, 4.1dvh, 38px) + 5px) 20% 0;
  overflow: visible;
  border: 0;
  background:
    url("/static/imperial/plaque.png") center / min(72vw, 380px) auto no-repeat,
    linear-gradient(to bottom, rgba(36, 8, 3, .75), transparent);
}

html[data-theme="imperial"] :is(#memoryListHeader, #momentsListHeader, #moreHeader) .header-paw {
  display: none;
}

html[data-theme="imperial"] :is(#memoryListHeader, #momentsListHeader, #moreHeader) .becoming-title {
  color: #2c1608;
  font-family: var(--imperial-heading-font);
  font-size: 0 !important;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: .1em;
  text-shadow: 0 1px rgba(255, 229, 137, .54);
}

html[data-theme="imperial"] #memoryListHeader .becoming-title::after {
  content: "奏折阁";
  font-size: clamp(17px, 4.5vw, 24px);
}

html[data-theme="imperial"] #momentsListHeader .becoming-title::after {
  content: "御花苑";
  font-size: clamp(17px, 4.5vw, 24px);
}

html[data-theme="imperial"] #moreHeader .becoming-title::after {
  content: "内务府";
  font-size: clamp(17px, 4.5vw, 24px);
}

/* 深色宫殿背景上的用量文字用金墨；纸面表单则保持深墨可读。 */
html[data-theme="imperial"] #usagePanel :is(.usage-label, .usage-amt) {
  color: #f1d994;
  text-shadow: 0 1px 3px rgba(24, 5, 1, .78);
}

html[data-theme="imperial"] #usagePanel .usage-row :is(.usage-label, .usage-amt)[style] {
  color: #f8e5aa !important;
}

html[data-theme="imperial"] #moreContent :is(
  #personaPanel,
  #appearancePanel,
  #toolsPanel,
  #schedulerPanel,
  #memoryImportPanel,
  #gestureHelpPanel,
  #voicePanel
) {
  color: #3a2115;
}

html[data-theme="imperial"] #moreContent :is(
  #personaPanel,
  #appearancePanel,
  #toolsPanel,
  #schedulerPanel,
  #memoryImportPanel,
  #gestureHelpPanel,
  #voicePanel
) :is(input[type="text"], input[type="number"], input[type="time"], input[type="url"], input[type="password"], input[type="file"], textarea, select, .provider-picker-trigger) {
  border-color: rgba(132, 73, 22, .46) !important;
  background: #fff3cf !important;
  color: #3a2115 !important;
  -webkit-text-fill-color: #3a2115;
}

html[data-theme="imperial"] #moreContent :is(
  #personaPanel,
  #appearancePanel,
  #toolsPanel,
  #schedulerPanel,
  #memoryImportPanel,
  #gestureHelpPanel,
  #voicePanel
) :is(input, textarea)::placeholder {
  color: rgba(58, 33, 21, .52);
  -webkit-text-fill-color: rgba(58, 33, 21, .52);
}

html[data-theme="imperial"] #schedulerPanel :is(
  .scheduler-limit-grid label,
  .scheduler-time-row label,
  .scheduler-frequency-scale,
  [style*="color:var(--muted)"]
) {
  color: rgba(58, 33, 21, .72) !important;
}

html[data-theme="imperial"] #schedulerPanel .scheduler-limit-input-wrap {
  border-color: rgba(132, 73, 22, .46);
  background: #fff3cf;
  color: #3a2115;
}

html[data-theme="imperial"] #moreContent .persona-close-btn {
  color: #f1d994;
  text-shadow: 0 1px 3px rgba(24, 5, 1, .78);
}

html[data-theme="imperial"] #memoryImportPanel input[type="file"]::file-selector-button {
  border: 1px solid rgba(132, 73, 22, .38);
  background: #ead49b;
  color: #3a2115;
}

html[data-theme="imperial"] #memoryImportPanel input[type="file"]::-webkit-file-upload-button {
  border: 1px solid rgba(132, 73, 22, .38);
  background: #ead49b;
  color: #3a2115;
}

html[data-theme="imperial"] #toolsPanel .mcp-connections-section {
  padding: 12px;
  border: 1px solid rgba(132, 73, 22, .46);
  border-radius: 12px;
  background: #f3e2b7;
  box-shadow: 0 7px 16px rgba(29, 7, 2, .22);
}

html[data-theme="imperial"] #toolsPanel :is(
  .mcp-connections-head > div,
  .mcp-list-empty,
  .custom-mcp-head > div,
  .custom-mcp-field,
  .custom-mcp-status
) {
  color: rgba(58, 33, 21, .78);
  text-shadow: none;
}

/* 御花苑里的纸卡用深墨；没有纸面的宫殿区域才用亮金字。 */
html[data-theme="imperial"] #nestTabs .nest-tab:not(.active) {
  color: rgba(58, 33, 21, .68);
}

html[data-theme="imperial"] .moment-card :is(.moment-time, .moment-delete-btn) {
  color: rgba(58, 33, 21, .56);
}

html[data-theme="imperial"] .moment-card .moment-comment-input::placeholder {
  color: rgba(58, 33, 21, .56);
}

html[data-theme="imperial"] .moment-card .moment-comment-btn {
  border-color: rgba(132, 73, 22, .42);
  color: #3a2115;
}

html[data-theme="imperial"] #readingPane {
  background: transparent;
}

html[data-theme="imperial"] #readingLibraryToolbar :is(h2, p) {
  color: #f1d994;
  text-shadow: 0 1px 3px rgba(24, 5, 1, .78);
}

html[data-theme="imperial"] #readingLibraryToolbar .reading-icon-btn {
  border-color: rgba(132, 73, 22, .55);
  background: #f3e2b7;
  color: #3a2115;
}

html[data-theme="imperial"] .reading-book-row {
  border-bottom-color: rgba(220, 177, 81, .3);
}

html[data-theme="imperial"] .reading-book-row .reading-book-open.swipe-reveal-foreground {
  border: 1px solid rgba(132, 73, 22, .42);
  background: #f3e2b7;
  color: #3a2115;
  box-shadow: 0 6px 14px rgba(29, 7, 2, .2);
}

html[data-theme="imperial"] .reading-book-row :is(.reading-book-title, .reading-book-meta) {
  color: #3a2115;
}

html[data-theme="imperial"] .reading-book-row .reading-book-meta {
  opacity: .68;
}

html[data-theme="imperial"] #readingReaderHeader {
  border-color: rgba(132, 73, 22, .42);
  background: #f3e2b7;
  color: #3a2115;
}

html[data-theme="imperial"] #readingReaderHeader :is(h2, #readingReaderProgress) {
  color: #3a2115;
  text-shadow: none;
}

html[data-theme="imperial"] #readingContent .reading-block {
  color: #f7e3aa;
  text-shadow: 0 1px 3px rgba(24, 5, 1, .78);
}

html[data-theme="imperial"] :is(.memory-card, .memory-entry) {
  position: relative;
  overflow: visible;
  clip-path: none;
  border: 1px solid rgba(135, 77, 23, .58);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(122, 61, 19, .08), transparent 11% 89%, rgba(122, 61, 19, .08)),
    linear-gradient(105deg, #f4e8be, #e8d39b);
  box-shadow: 0 8px 14px rgba(24, 5, 2, .3), inset 0 0 25px rgba(139, 78, 24, .08);
  filter: none;
}

html[data-theme="imperial"] .memory-card {
  margin: 10px 5px 22px;
  padding: 22px 22px 24px;
}

html[data-theme="imperial"] .memory-entry {
  margin: 12px 5px 22px;
  padding: 20px 18px;
}

html[data-theme="imperial"] :is(.memory-card, .memory-entry)::before,
html[data-theme="imperial"] :is(.memory-card, .memory-entry)::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: -8px;
  width: calc(100% + 16px);
  height: 9px;
  border: 1px solid rgba(226, 179, 68, .72);
  border-radius: 999px;
  background: linear-gradient(#8c2a20, #5d130f 55%, #45100c);
  box-shadow: 0 3px 5px rgba(30, 6, 2, .25), inset 0 1px rgba(255, 213, 104, .24);
  pointer-events: none;
}

html[data-theme="imperial"] :is(.memory-card, .memory-entry)::before {
  top: -5px;
}

html[data-theme="imperial"] :is(.memory-card, .memory-entry)::after {
  inset: auto auto -5px -8px;
}

html[data-theme="imperial"] .memory-card > * {
  position: relative;
  z-index: 2;
}

html[data-theme="imperial"] .memory-card-preview {
  border-top-color: rgba(105, 52, 16, .34);
}

html[data-theme="imperial"] :is(.memory-card-date, .memory-entry-head time, .memory-entry-meta > span) {
  color: rgba(67, 37, 19, .66);
}

html[data-theme="imperial"] :is(.memory-card, .memory-entry):active {
  transform: translateY(2px);
  box-shadow: 0 4px 8px rgba(24, 5, 2, .24), inset 0 0 25px rgba(139, 78, 24, .08);
  filter: none;
}

/* 御花苑：朋友圈不是现代白卡，而是一封封压着金线的宫笺。 */
html[data-theme="imperial"] #nestTabs {
  gap: 7px;
  padding: 7px 14px 9px;
  border-top: 1px solid rgba(255, 230, 151, .54);
  border-bottom: 2px solid #8a551a;
  background:
    linear-gradient(90deg, rgba(136, 78, 18, .12), transparent 15% 85%, rgba(136, 78, 18, .12)),
    linear-gradient(#f4e7bd, #e5cf94);
  box-shadow: inset 0 -1px rgba(255, 244, 192, .74), 0 4px 12px rgba(25, 5, 1, .24);
}

html[data-theme="imperial"] #nestTabs .nest-tab {
  position: relative;
  min-height: 36px;
  border: 1px solid rgba(133, 76, 21, .24);
  border-radius: 4px;
  color: rgba(66, 37, 18, .68);
  letter-spacing: .08em;
}

html[data-theme="imperial"] #nestTabs .nest-tab.active {
  border-color: #d8ad4e;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 226, 133, .2), transparent 48%),
    linear-gradient(#6e2018, #48100c);
  color: #f9e7ae;
  box-shadow:
    inset 0 0 0 1px rgba(87, 34, 13, .9),
    inset 0 0 0 2px rgba(236, 195, 90, .36),
    0 3px 7px rgba(45, 9, 3, .28);
  text-shadow: 0 1px 2px #260704;
}

html[data-theme="imperial"] .moment-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 3px 2px 10px;
  padding: 18px 17px 16px;
  border: 2px solid #9a641f;
  border-radius: 6px;
  background:
    radial-gradient(circle at 0 0, rgba(192, 126, 31, .2), transparent 34px),
    radial-gradient(circle at 100% 100%, rgba(192, 126, 31, .18), transparent 38px),
    linear-gradient(105deg, rgba(255, 247, 207, .96), rgba(232, 207, 143, .96));
  box-shadow:
    inset 0 0 0 3px rgba(255, 239, 181, .74),
    inset 0 0 0 4px rgba(128, 72, 18, .26),
    inset 0 0 30px rgba(121, 59, 11, .09),
    0 8px 18px rgba(29, 6, 2, .32);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme="imperial"] .moment-card::before,
html[data-theme="imperial"] .moment-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(128, 72, 18, .66);
  background: rgba(190, 126, 35, .52);
  box-shadow: inset 0 0 0 1px rgba(255, 235, 163, .62);
  transform: rotate(45deg);
  pointer-events: none;
}

html[data-theme="imperial"] .moment-card::before { top: 8px; left: 9px; }
html[data-theme="imperial"] .moment-card::after { right: 9px; bottom: 8px; }

html[data-theme="imperial"] .moment-card .moment-header img {
  border: 2px solid #d2a94e;
  box-shadow: 0 0 0 2px rgba(110, 57, 13, .48), 0 3px 8px rgba(48, 14, 3, .24);
}

html[data-theme="imperial"] .moment-card :is(.moment-comments, .moment-comment-input) {
  border-color: rgba(126, 73, 19, .32);
}

html[data-theme="imperial"] .moment-card .moment-comment-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #bc8b35;
  background: radial-gradient(circle at 35% 30%, #fff2bd, #d1aa59 72%, #8b551b);
  color: #4e1a10;
  box-shadow: inset 0 0 0 2px rgba(255, 241, 178, .62), 0 3px 7px rgba(48, 12, 3, .25);
}

html[data-theme="imperial"] .moment-card .moment-delete-btn {
  padding: 4px 8px;
  border: 1px solid rgba(130, 71, 18, .32);
  border-radius: 3px;
  background: rgba(255, 238, 183, .34);
}

html[data-theme="imperial"] #momentsFab {
  right: 24px;
  width: 49px;
  height: 49px;
  border: 2px solid #e5bd59;
  border-radius: 11px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 199, 103, .16), transparent 32%),
    linear-gradient(145deg, #8a2a1d, #4b100c 72%);
  color: #ffe8a2;
  box-shadow:
    0 0 0 2px rgba(80, 25, 11, .88),
    0 0 0 3px rgba(225, 181, 77, .72),
    0 7px 15px rgba(27, 5, 2, .42),
    inset 0 0 9px rgba(255, 204, 93, .12);
  transform: rotate(45deg);
}

html[data-theme="imperial"] #momentsFab .material-symbols-outlined {
  transform: rotate(-45deg);
}

html[data-theme="imperial"] #momentsFab:active {
  transform: rotate(45deg) scale(.91);
}

html[data-theme="imperial"] #momentWriteCard {
  border: 2px solid #b17927;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(105deg, #f8ecc4, #e7cd8d);
  box-shadow: inset 0 0 0 3px rgba(255, 242, 186, .7), 0 -9px 24px rgba(28, 5, 1, .35);
}

html[data-theme="imperial"] #momentInput {
  border: 1px solid #9b641f;
  border-radius: 4px;
  background: rgba(255, 246, 210, .72);
  box-shadow: inset 0 0 0 2px rgba(255, 231, 157, .52);
}

/* 一起听：唱片像玉盘，播放键像御前金钮，进度像一根卷轴轴杆。 */
html[data-theme="imperial"] #musicPane {
  color: #f4dda0;
}

html[data-theme="imperial"] #musicRoomHeader {
  border-top: 1px solid rgba(235, 194, 91, .52);
  border-bottom: 2px solid #8f5a1b;
  background: linear-gradient(90deg, rgba(62, 14, 8, .84), rgba(232, 199, 123, .76) 48%, rgba(62, 14, 8, .84));
  box-shadow: inset 0 -1px rgba(255, 235, 157, .54), 0 5px 13px rgba(27, 4, 1, .28);
}

html[data-theme="imperial"] #musicRoomHeader :is(.music-room-kicker, #musicTrackMeta strong, #musicTrackMeta span, #musicRoomStats) {
  color: #4a2817;
  text-shadow: 0 1px rgba(255, 236, 171, .58);
}

html[data-theme="imperial"] :is(#musicParticipantsBtn, #musicLibraryPanel > summary) {
  border: 2px solid #b8842d;
  background: radial-gradient(circle at 35% 30%, #fff4c4, #d1aa5e 74%, #875319);
  color: #4c1c11;
  box-shadow: inset 0 0 0 2px rgba(255, 239, 176, .62), 0 4px 9px rgba(43, 10, 2, .3);
}

html[data-theme="imperial"] #musicNowPlaying {
  border-top: 1px solid rgba(242, 205, 104, .48);
  border-bottom: 2px solid rgba(144, 87, 24, .72);
  box-shadow: inset 0 0 42px rgba(38, 8, 3, .2);
}

html[data-theme="imperial"] #musicRecordSleeve {
  border: 6px solid #efd78c;
  background: radial-gradient(circle, #f5e9b8, #b8862f);
  box-shadow:
    0 0 0 2px #6f3c11,
    0 0 0 5px #c99a3c,
    0 0 0 7px rgba(255, 224, 127, .48),
    0 14px 28px rgba(30, 5, 2, .38),
    inset 0 0 0 2px rgba(255, 248, 206, .7);
}

html[data-theme="imperial"] .music-room-avatar {
  border-color: #f0dc98;
  box-shadow: 0 0 0 2px #87521a, 0 6px 13px rgba(39, 8, 2, .32);
}

html[data-theme="imperial"] #musicProgress {
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
}

html[data-theme="imperial"] #musicProgress::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid #6d3a10;
  border-radius: 999px;
  background: linear-gradient(#f2d77f, #9b671f 48%, #5f330f 52%, #c08b32);
  box-shadow: inset 0 1px rgba(255, 244, 186, .76), 0 2px 5px rgba(31, 6, 2, .3);
}

html[data-theme="imperial"] #musicProgress::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid #f1d982;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff9d8, #cab36e 36%, #5c6f45 40%, #263921 100%);
  box-shadow: 0 0 0 2px #704214, 0 3px 8px rgba(34, 7, 2, .42);
  appearance: none;
  -webkit-appearance: none;
}

html[data-theme="imperial"] #musicProgress::-moz-range-track {
  height: 8px;
  border: 1px solid #6d3a10;
  border-radius: 999px;
  background: linear-gradient(#f2d77f, #9b671f 48%, #5f330f 52%, #c08b32);
}

html[data-theme="imperial"] #musicProgress::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid #f1d982;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff9d8, #cab36e 36%, #5c6f45 40%, #263921 100%);
  box-shadow: 0 0 0 2px #704214, 0 3px 8px rgba(34, 7, 2, .42);
}

html[data-theme="imperial"] #musicControls {
  gap: clamp(34px, 11vw, 52px);
  margin-top: 10px;
}

html[data-theme="imperial"] #musicControls button {
  width: 46px;
  height: 46px;
  border: 2px solid #c99b3f;
  background: radial-gradient(circle at 35% 28%, #fff2b8, #d1ad60 58%, #8a571d);
  color: #4a170e;
  box-shadow:
    inset 0 0 0 2px rgba(255, 240, 178, .64),
    0 0 0 2px rgba(96, 47, 13, .72),
    0 5px 10px rgba(32, 6, 2, .34);
}

html[data-theme="imperial"] #musicPlayBtn {
  width: 58px !important;
  height: 58px !important;
  border-color: #edca6a !important;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 207, 102, .2), transparent 34%),
    linear-gradient(145deg, #8b2a1e, #4c100c 74%) !important;
  color: #ffe8a3 !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 201, 82, .18),
    0 0 0 3px #6b3510,
    0 0 0 5px rgba(225, 180, 72, .72),
    0 7px 13px rgba(28, 4, 1, .4) !important;
}

html[data-theme="imperial"] #musicControls button:active,
html[data-theme="imperial"] #musicPlaybackModeBtn:active {
  transform: translateY(2px) scale(.96);
  box-shadow: inset 0 0 0 2px rgba(255, 240, 178, .5), 0 2px 5px rgba(32, 6, 2, .3);
}

html[data-theme="imperial"] #musicPlaybackModeBtn {
  width: 42px;
  height: 42px;
  border: 2px solid #b68331;
  background: radial-gradient(circle at 35% 28%, #fff1b7, #cfab61 65%, #825019);
  color: #542014;
  box-shadow: inset 0 0 0 2px rgba(255, 241, 181, .58), 0 0 0 1px #703d12, 0 4px 9px rgba(35, 7, 2, .3);
}

html[data-theme="imperial"] #musicRoomMessages .music-message-body p {
  border: 1px solid #a9762b;
  border-radius: 4px;
  background: linear-gradient(105deg, rgba(250, 235, 186, .94), rgba(226, 198, 128, .92));
  color: #3a2115;
  box-shadow: inset 0 0 0 2px rgba(255, 244, 199, .48), 0 6px 13px rgba(37, 8, 2, .25);
}

html[data-theme="imperial"] #musicRoomConversation {
  border-top: 2px solid #a66c20;
  background: linear-gradient(rgba(52, 13, 7, .74), rgba(31, 7, 4, .9));
  box-shadow: inset 0 1px rgba(255, 218, 124, .24);
}

html[data-theme="imperial"] #musicMessageForm {
  padding: 4px;
  border: 1px solid rgba(225, 179, 72, .72);
  border-radius: 4px;
  background: rgba(74, 21, 12, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 133, .2);
}

html[data-theme="imperial"] #musicMessageInput {
  border: 1px solid #b5812f;
  border-radius: 3px;
  background: linear-gradient(105deg, #fff1c2, #e5ca86);
  color: #3a2115;
  box-shadow: inset 0 0 0 2px rgba(255, 244, 198, .52);
}

html[data-theme="imperial"] #musicMessageForm button {
  border: 1px solid #e0b64e;
  background: linear-gradient(145deg, #84261b, #4b100c);
  color: #ffe6a0;
  box-shadow: 0 0 0 1px #713c12, 0 3px 7px rgba(31, 5, 2, .38);
}

/* 内务府：入口统一成金漆牌、玉钮与描金册页。 */
html[data-theme="imperial"] #moreContent .more-menu {
  gap: 14px;
  padding: 18px 18px 28px;
}

html[data-theme="imperial"] #moreContent .more-menu-row {
  gap: 12px;
}

html[data-theme="imperial"] #moreContent .more-icon-btn {
  width: 54px;
  height: 54px;
  border: 2px solid #e1b751;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 214, 112, .2), transparent 32%),
    linear-gradient(145deg, #7d251b, #43100c 74%);
  color: #f8dda0;
  box-shadow:
    inset 0 0 0 2px rgba(255, 198, 77, .16),
    0 0 0 2px #6c380f,
    0 5px 11px rgba(30, 5, 2, .38);
}

html[data-theme="imperial"] #moreContent .more-pill {
  position: relative;
  min-height: 52px;
  padding: 13px 34px 13px 30px;
  overflow: hidden;
  border: 2px solid #9f691f;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(132, 72, 17, .12), transparent 14% 86%, rgba(132, 72, 17, .12)),
    linear-gradient(105deg, #f8eabf, #e3c980);
  color: #3d2114;
  box-shadow:
    inset 0 0 0 3px rgba(255, 240, 181, .68),
    inset 0 0 0 4px rgba(130, 70, 17, .2),
    0 6px 13px rgba(30, 6, 2, .3);
  font-family: "Songti SC", "STSong", serif;
  font-weight: 650;
  letter-spacing: .04em;
}

html[data-theme="imperial"] #moreContent .more-pill::before,
html[data-theme="imperial"] #moreContent .more-pill::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(128, 72, 18, .64);
  background: #c28b2e;
  box-shadow: inset 0 0 0 1px rgba(255, 232, 153, .62);
  transform: translateY(-50%) rotate(45deg);
}

html[data-theme="imperial"] #moreContent .more-pill::before { left: 12px; }
html[data-theme="imperial"] #moreContent .more-pill::after { right: 12px; }

html[data-theme="imperial"] #moreContent .more-pill:active,
html[data-theme="imperial"] #moreContent .more-icon-btn:active {
  opacity: 1;
  transform: translateY(2px);
  box-shadow: inset 0 0 0 2px rgba(255, 233, 167, .52), 0 2px 5px rgba(31, 6, 2, .3);
}

html[data-theme="imperial"] #moreContent .more-pill-logout {
  border-color: #d3a33e;
  background: linear-gradient(145deg, #722018, #3f0d0a);
  color: #f4d78b;
  text-shadow: 0 1px #260604;
  box-shadow: inset 0 0 0 3px rgba(231, 179, 66, .16), 0 6px 13px rgba(28, 5, 2, .34);
}

html[data-theme="imperial"] #moreContent .compress-health-card {
  border: 2px solid #9d671f;
  border-radius: 6px;
  background: linear-gradient(105deg, #f7eabe, #e2c77f);
  color: #3a2115;
  box-shadow: inset 0 0 0 3px rgba(255, 241, 185, .65), 0 6px 13px rgba(30, 6, 2, .28);
}

html[data-theme="imperial"] #usagePanel .usage-platform-card {
  border: 1px solid #d0a13e;
  border-radius: 5px;
  background: linear-gradient(145deg, rgba(111, 31, 22, .94), rgba(62, 13, 9, .96));
  color: #f5dda0;
  box-shadow: inset 0 0 0 2px rgba(239, 190, 78, .15), 0 4px 10px rgba(28, 5, 2, .28);
}

html[data-theme="imperial"] #usagePanel .usage-bar-track {
  height: 6px;
  border: 1px solid rgba(122, 69, 18, .64);
  background: rgba(43, 13, 7, .42);
  box-shadow: inset 0 1px 2px rgba(21, 4, 1, .48);
}

html[data-theme="imperial"] #usagePanel .usage-bar-fill {
  background: linear-gradient(90deg, #8c2d20, #d2a346);
}

html[data-theme="imperial"] #usagePanel .usage-bar-thumb {
  border-color: #f0d47a;
  background: #742117;
  color: #f7d986;
  box-shadow: 0 0 0 1px #6c3b11, 0 2px 5px rgba(26, 5, 2, .38);
}

html[data-theme="imperial"] #moreContent .scheduler-feature-link {
  position: relative;
  border: 2px solid #9d671f;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(133, 73, 18, .12), transparent 12% 88%, rgba(133, 73, 18, .12)),
    linear-gradient(105deg, #f7eabd, #e4c981);
  color: #4b2816;
  box-shadow: inset 0 0 0 3px rgba(255, 240, 182, .64), 0 5px 11px rgba(31, 6, 2, .28);
}

html[data-theme="imperial"] #moreContent :is(
  .persona-card,
  .appearance-section,
  .memory-import-card,
  .gesture-help-card,
  .voice-settings-card,
  .provider-status-list
) {
  border: 2px solid #9d671f;
  border-radius: 6px;
  background: linear-gradient(105deg, #f7eabd, #e2c67d);
  box-shadow:
    inset 0 0 0 3px rgba(255, 241, 185, .64),
    inset 0 0 24px rgba(120, 61, 12, .07),
    0 7px 15px rgba(30, 6, 2, .3);
}

/* 笔墨纸砚玉玺：仍然是原五个视图，只改成宫廷导航语言。 */
html[data-theme="imperial"] #bottomNav {
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  justify-content: center;
  gap: clamp(8px, 3.8vw, 24px);
  padding: 4px 10px max(5px, env(safe-area-inset-bottom, 0px));
  align-items: flex-start;
  border-top: 1px solid rgba(224, 177, 69, .62);
  background:
    linear-gradient(90deg, rgba(255, 211, 103, .08), transparent 15% 85%, rgba(255, 211, 103, .08)),
    linear-gradient(#47130e, #260a06);
  box-shadow: 0 -6px 18px rgba(19, 3, 1, .42), inset 0 1px rgba(255, 218, 126, .18);
}

html[data-theme="imperial"] .nav-item {
  top: 0;
  width: min(14.5vw, 64px);
  height: 80px;
  flex: 0 1 64px;
  padding: 0 2px 1px;
  justify-content: flex-start;
  gap: 0;
  color: #d7b25e;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
}

html[data-theme="imperial"] .nav-item > * {
  display: none;
}

html[data-theme="imperial"] .nav-item::before {
  content: "";
  position: relative;
  z-index: 2;
  top: auto;
  left: auto;
  right: auto;
  display: block;
  width: min(12.8vw, 52px);
  height: 54px;
  margin: 0 auto;
  border: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 3px 3px rgba(13, 2, 1, .52));
  opacity: .77;
  transform: none;
  transition: opacity 150ms ease, transform 150ms ease, filter 150ms ease;
}

html[data-theme="imperial"] .nav-item[data-view="singleView"]::before {
  background-image: url("/static/imperial/nav-court.png");
}

html[data-theme="imperial"] .nav-item[data-view="groupView"]::before {
  background-image: url("/static/imperial/nav-council.png");
}

html[data-theme="imperial"] .nav-item[data-view="memoryView"]::before {
  background-image: url("/static/imperial/nav-memory.png");
}

html[data-theme="imperial"] .nav-item[data-view="momentsView"]::before {
  background-image: url("/static/imperial/nav-garden.png");
}

html[data-theme="imperial"] .nav-item[data-view="moreView"]::before {
  background-image: url("/static/imperial/nav-seal.png");
}

html[data-theme="imperial"] .nav-item::after {
  content: attr(data-imperial-label);
  position: relative;
  z-index: 3;
  top: -2px;
  right: auto;
  bottom: auto;
  left: auto;
  display: block;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(238, 208, 132, .72);
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1;
  transition: color 150ms ease;
}

html[data-theme="imperial"] .nav-item.active::before {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(245, 193, 70, .68)) drop-shadow(0 3px 3px rgba(13, 2, 1, .52));
  transform: translateY(-2px) scale(1.06);
}

html[data-theme="imperial"] .nav-item.active::after {
  background: transparent;
  color: #f4d780;
}

html[data-theme="imperial"] .nav-item:active {
  transform: translateY(2px);
}

html[data-theme="imperial"] .nav-item:focus-visible {
  outline: 1px solid #e2b957;
  outline-offset: -4px;
}

@media (max-height: 690px) {
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhian"],
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhidu"] {
    top: 13%;
  }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiechengle"],
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhihai"] {
    top: 35%;
  }
}

@media (min-width: 720px) {
  html[data-theme="imperial"] #charListContainer {
    background-size: min(100%, 720px) auto;
    background-repeat: no-repeat;
    background-color: #1a0904;
  }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhian"] { left: calc(50% - 235px); }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhidu"] { right: calc(50% - 235px); }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiechengle"] { left: calc(50% - 310px); }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhihai"] { right: calc(50% - 310px); }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhiping"] { left: calc(50% - 355px); }
  html[data-theme="imperial"] .char-list-row[data-character-id="xiezhijiang"] { right: calc(50% - 355px); }
}

/* 长列表要滚动，不让 flex 为了塞进一屏而把每张朋友圈压扁。 */
html[data-theme="imperial"] #momentsFeed .moment-card {
  flex: 0 0 auto;
}

/* 龙床背景偏暗且色彩复杂，歌词统一用亮金墨并增加暗色描边。 */
html[data-theme="imperial"] #musicLyrics {
  color: #ffe7a3;
  text-shadow: 0 1px 3px rgba(24, 5, 1, .96), 0 0 8px rgba(24, 5, 1, .72);
}

html[data-theme="imperial"] #musicLyricCurrent {
  opacity: 1;
  font-weight: 650;
}

html[data-theme="imperial"] #musicLyricNext,
html[data-theme="imperial"] #musicLyrics.is-upcoming #musicLyricCurrent {
  opacity: .74;
}
