/* 同一工作台的白天 / 夜晚双主题；仅改变视觉，不复制业务页面。 */
.theme-switch {
  position: absolute;
  z-index: 3;
  top: auto;
  right: calc(21% + 26px);
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 166px;
  height: 40px;
  padding: 2px;
  border: 1px solid rgba(195, 220, 255, .42);
  border-radius: 12px;
  background: rgba(4, 19, 45, .32);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 8px 22px rgba(0, 25, 75, .2);
  transform: none;
  backdrop-filter: blur(10px);
}

.theme-switch button {
  min-height: 34px;
  padding: 5px 7px;
  border: 0;
  border-radius: 8px;
  color: rgba(236, 246, 255, .72);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.theme-switch button[aria-pressed="true"] {
  color: #17335d;
  background: linear-gradient(180deg, #fff9eb, #e8c980);
  box-shadow: 0 4px 12px rgba(0, 18, 55, .25), inset 0 1px #fff;
}

html[data-theme="day"] {
  color-scheme: light;
  --bg: #ece7de;
  --panel: #fffdf8;
  --panel-soft: #f6f1e8;
  --line: #d9cdbb;
  --gold: #b9822c;
  --gold-deep: #8d5d18;
  --text: #242526;
  --muted: #746e65;
  --purple: #b9822c;
  --blue: #b9822c;
  --blue-bright: #c58c31;
  background: #ece7de;
}

html[data-theme="day"] body {
  color: var(--text);
  background:
    linear-gradient(116deg, transparent 0 48%, rgba(179, 131, 55, .06) 48% 57%, transparent 57%),
    radial-gradient(circle at 69% 31%, rgba(190, 145, 70, .12), transparent 31%),
    #ece7de;
}

html[data-theme="day"] body::before {
  background: linear-gradient(162deg, rgba(207, 165, 91, .16), rgba(255, 251, 242, .16) 58%, transparent 58%);
}

html[data-theme="day"] .topbar {
  border-color: #d8bf91;
  background: linear-gradient(145deg, #fffdf8 0%, #f4ede1 68%, #e9dfd0 100%);
  box-shadow: 0 14px 30px rgba(85, 67, 38, .18), inset 0 1px 0 #fff;
}

html[data-theme="day"] .topbar::before {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, .3) 0%, transparent 38%),
    linear-gradient(145deg, #d4a44e 0%, #c18a31 54%, #9e671e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .52), inset 0 -16px 28px rgba(104, 64, 10, .12), 10px 0 22px rgba(91, 67, 28, .14);
}

html[data-theme="day"] .theme-switch {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(110, 70, 15, .18);
  box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 8px 20px rgba(104, 67, 12, .16);
}

html[data-theme="day"] .theme-switch button { color: rgba(255, 252, 244, .78); }
html[data-theme="day"] .theme-switch button[aria-pressed="true"] { color: #6c470e; background: linear-gradient(180deg, #fffdf8, #f1dfbc); }

html[data-theme="day"] .top-actions > .ghost-button {
  border-color: #d8c9b3;
  color: #504739;
  background: linear-gradient(180deg, #fffdf9, #eee5d9);
  box-shadow: inset 0 1px #fff, 0 6px 14px rgba(85, 67, 38, .1);
}

html[data-theme="day"] .top-actions .config-menu-wrap > .ghost-button,
html[data-theme="day"] .gold-button,
html[data-theme="day"] .custom-button,
html[data-theme="day"] .group-action {
  border-color: #c28c35;
  color: #fff;
  background: linear-gradient(180deg, #dbae5b, #b97e25);
  box-shadow: inset 0 1px rgba(255, 255, 255, .42), 0 8px 18px rgba(143, 91, 16, .18);
}

html[data-theme="day"] .top-actions b { color: #fff; }
html[data-theme="day"] .treasury-count b { background: #b9822c; }
html[data-theme="day"] .config-menu { border-color: #d3b37c; background: #fffaf1; box-shadow: 0 16px 40px rgba(76, 55, 25, .2); }
html[data-theme="day"] .config-menu button { color: #4e463a; }
html[data-theme="day"] .config-menu button:hover { color: #7b5012; background: #f5e8d0; }

html[data-theme="day"] .layer-rail {
  border-color: #d5c9b8;
  background: linear-gradient(180deg, #f9f4eb, #e9e1d5);
}

html[data-theme="day"] .layer-rail::before { color: #928777; }
html[data-theme="day"] .layer-rail-button { color: #655f57; }
html[data-theme="day"] .layer-rail-button i { color: #aa7a30; }
html[data-theme="day"] .layer-rail-button.active {
  color: #fff;
  background: linear-gradient(135deg, #d6a54d, #ae7421);
  box-shadow: 0 10px 24px rgba(145, 91, 16, .2);
}

html[data-theme="day"] .layer-card { border-bottom-color: #d7cbbb; }
html[data-theme="day"] .layer-card::before { background: linear-gradient(155deg, rgba(199, 151, 69, .16), rgba(255, 255, 255, .22)); }
html[data-theme="day"] .layer-card::after { color: rgba(155, 112, 43, .09); }
html[data-theme="day"] .layer-symbol { border-color: #d4a04b; color: #fff; background: linear-gradient(145deg, #dcad58, #a96e1d); box-shadow: inset 0 1px rgba(255,255,255,.35), 0 14px 30px rgba(137,85,12,.18); }
html[data-theme="day"] .toggle-layer { border-color: #d3c5b0; color: #554a3a; background: #fffaf2; }
html[data-theme="day"] .layer-description { color: #736d64; }

html[data-theme="day"] .option-group {
  background: rgb(246, 241, 232);
  box-shadow: inset 0 1px #fff, 0 16px 34px rgba(84, 66, 38, .08);
}

html[data-theme="day"] .group-label { color: #3f3a33; }
html[data-theme="day"] .custom-button { color: #775018; background: #ecddc3; box-shadow: none; }
html[data-theme="day"] .option-button { color: #5f5a52; background: rgba(120, 98, 64, .075); }
html[data-theme="day"] .option-button:hover { color: #724c14; background: #efe1c8; }
html[data-theme="day"] .option-button.selected { color: #fff; background: linear-gradient(135deg, #d6a54d, #ad711e); box-shadow: 0 8px 20px rgba(145, 91, 16, .18); }
html[data-theme="day"] .group-hint { color: #8b8378; }

html[data-theme="day"] .primary-input,
html[data-theme="day"] .custom-input,
html[data-theme="day"] .activation-card textarea,
html[data-theme="day"] .code-editor {
  border-color: #d5c6b0;
  color: #2d2a26;
  background: #fffdf9;
}

html[data-theme="day"] .primary-input:focus,
html[data-theme="day"] .custom-input:focus { border-color: #bd8732; box-shadow: 0 0 0 3px rgba(185, 130, 44, .13); }

html[data-theme="day"] .output-panel {
  border-color: #d2c2aa;
  color: #292722;
  background: linear-gradient(155deg, #fffdf8, #eee6da 64%);
  box-shadow: -36px 30px 80px rgba(91, 69, 37, .16);
}

html[data-theme="day"] .output-mode-tabs button { color: #887f72; }
html[data-theme="day"] .output-mode-tabs button.active { border-bottom-color: #b9822c; color: #332e27; }
html[data-theme="day"] .output-heading small { color: #a36d1f; }
html[data-theme="day"] .copy-button { border-color: #c9a66f; color: #6b4918; background: #fffaf0; }
html[data-theme="day"] .output-content { color: #2f2d29; background: rgba(255, 253, 248, .86); scrollbar-color: #c59a59 #eee5d7; }
html[data-theme="day"] .editable-output { caret-color: #2f2d29; }
html[data-theme="day"] .editable-output:focus { outline-color: #b9822c; box-shadow: inset 0 0 0 1px rgba(185, 130, 44, .2); }
html[data-theme="day"] .editable-output.is-manually-edited { border-color: #b9822c; box-shadow: inset 3px 0 #b9822c; }
html[data-theme="day"] .prompt-token.fixed,
html[data-theme="day"] .json-key { color: #292722; }
html[data-theme="day"] .prompt-token.dynamic,
html[data-theme="day"] .json-section .output-content,
html[data-theme="day"] .json-string { color: #9a661c; }
html[data-theme="day"] .json-literal { color: #a44f2d; }

html[data-theme="day"] .footerbar { border-color: #d2c6b5; background: rgba(250, 246, 239, .98); box-shadow: 0 -8px 24px rgba(78, 61, 35, .08); }
html[data-theme="day"] .ghost-button,
html[data-theme="day"] .footer-button { border-color: #d0c2ad; color: #554d42; background: linear-gradient(180deg, #fffdf9, #eee6db); }
html[data-theme="day"] .ghost-button:hover,
html[data-theme="day"] .footer-button:hover { border-color: #bc8430; color: #7c5113; }
html[data-theme="day"] .pager-dot { background: #cfc3b2; }
html[data-theme="day"] .pager-dot.active { background: #b9822c; box-shadow: 0 0 10px rgba(185, 130, 44, .32); }
html[data-theme="day"] .footer-note { color: #786f63; }
html[data-theme="day"] .page-indicator { border-color: #d0c2ad; color: #554d42; background: #fffaf3; }

html[data-theme="day"] .side-drawer,
html[data-theme="day"] .collection-drawer { border-color: #caa76f; color: #312e29; background: #f9f4eb; box-shadow: -20px 0 58px rgba(72, 52, 23, .2), inset 5px 0 18px rgba(185, 130, 44, .08); }
html[data-theme="day"] .collection-toolbar,
html[data-theme="day"] .treasury-toolbar { border-color: #ddd1bf; }
html[data-theme="day"] .collection-toolbar h2,
html[data-theme="day"] .treasury-toolbar h2 { color: #96621a; }
html[data-theme="day"] .collection-tool,
html[data-theme="day"] .favorite-category { border-color: #d6c9b7; color: #5d574e; background: #fffaf2; }
html[data-theme="day"] .collection-tool.active,
html[data-theme="day"] .favorite-category.active { border-color: #bd8732; color: #fff; background: linear-gradient(145deg, #d6a54d, #ad711e); }
html[data-theme="day"] .collection-search-wrap .primary-input { border-color: #d5c6b0; background: #fffdf9; }
html[data-theme="day"] .collection-divider { background: linear-gradient(90deg, #b9822c 0 96%, transparent 96%); }
html[data-theme="day"] .collection-drawer .favorite-card,
html[data-theme="day"] .treasury-card,
html[data-theme="day"] .favorite-card,
html[data-theme="day"] .license-row { border-color: #dbcfbe; color: #312e29; background: #fffaf2; }
html[data-theme="day"] .treasury-card p,
html[data-theme="day"] .favorite-card small,
html[data-theme="day"] .license-row small { color: #7d766d; }
html[data-theme="day"] .favorite-card button,
html[data-theme="day"] .license-row button,
html[data-theme="day"] .admin-tabs button,
html[data-theme="day"] .collection-drawer .favorite-action,
html[data-theme="day"] .treasury-actions .favorite-action { border-color: #d4c5b0; color: #5e5549; background: #f3eadc; }
html[data-theme="day"] .collection-close,
html[data-theme="day"] .icon-button { color: #625a4e; }

html[data-theme="day"] .modal-backdrop { background: rgba(77, 63, 43, .48); }
html[data-theme="day"] .dialog-card,
html[data-theme="day"] .activation-card { border-color: #cda65f; color: #2f2b25; background: #fffaf2; box-shadow: 0 30px 90px rgba(73, 52, 20, .3); }
html[data-theme="day"] .dialog-card > label,
html[data-theme="day"] #admin-login-view > label { color: #4c463d; }
html[data-theme="day"] .activation-gate { background: radial-gradient(circle at 50% 30%, rgba(185, 130, 44, .14), transparent 34%), rgba(239, 233, 223, .98); }
html[data-theme="day"] .activation-card p,
html[data-theme="day"] .license-key { color: #95631d; }
html[data-theme="day"] .activation-note { color: #7b7469; }

@media (max-width: 1400px) {
  .theme-switch { right: calc(21% + 18px); width: 154px; }
  .theme-switch button { padding-inline: 4px; font-size: 11px; }
}
