/* 官网和后台共用外观偏好；无脚本时仍跟随系统。 */
:root {
  --paper: #faf8f5;
  --surface: #fff;
  --ink: #1c1b1a;
  --muted: #6b6560;
  --line: #e2ded9;
  --link: #2a5d8f;
  --accent: #4353c7;
  --mine: #eef0fd;
  --soon: #a93f53;
  --soon-bg: #fdecef;
  --bad: #a8321e;
  --warn: #8a6d1f;
  --danger-bg: #fbe9e6;
  --success-bg: #eaf3e8;
  --success: #2f6b2a;
  --warning-bg: #fdf6e3;
  --subtle: #f6f3ef;
  --hover: #fcfaf7;
  --info-bg: #e8f0f8;
  --purple: #4a4f9e;
  --purple-bg: #eef0fb;
  --high: #a35a12;
  --high-bg: #fdeee0;
  --focus: #bcd3e6;
  --cooling-line: #b9c0ec;
}

:root { color-scheme: light; }
:root[data-theme="dark"] {
  --paper: #191817;
  --surface: #242321;
  --ink: #f4efe9;
  --muted: #bdb4ab;
  --line: #49433e;
  --link: #9ecbfa;
  --accent: #b7beff;
  --mine: #30344f;
  --soon: #ffadc0;
  --soon-bg: #482a33;
  --bad: #ffb4a4;
  --warn: #edcc81;
  --danger-bg: #482b26;
  --success-bg: #263d2b;
  --success: #a6dba0;
  --warning-bg: #403621;
  --subtle: #2d2a27;
  --hover: #302d29;
  --info-bg: #263c51;
  --purple: #c2bdff;
  --purple-bg: #34304f;
  --high: #ffc48d;
  --high-bg: #453322;
  --focus: #9ecbfa;
  --cooling-line: #858ecb;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --paper: #191817;
  --surface: #242321;
  --ink: #f4efe9;
  --muted: #bdb4ab;
  --line: #49433e;
  --link: #9ecbfa;
  --accent: #b7beff;
  --mine: #30344f;
  --soon: #ffadc0;
  --soon-bg: #482a33;
  --bad: #ffb4a4;
  --warn: #edcc81;
  --danger-bg: #482b26;
  --success-bg: #263d2b;
  --success: #a6dba0;
  --warning-bg: #403621;
  --subtle: #2d2a27;
  --hover: #302d29;
  --info-bg: #263c51;
  --purple: #c2bdff;
  --purple-bg: #34304f;
  --high: #ffc48d;
  --high-bg: #453322;
  --focus: #9ecbfa;
  --cooling-line: #858ecb;
}
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

.theme-switch { display: inline-flex; align-items: center; gap: .5rem; margin: 0; color: var(--muted); font: inherit; font-size: .85rem; white-space: nowrap; }
.theme-switch select { min-height: 44px; max-width: 100%; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .4rem; font: inherit; color: var(--ink); background: var(--surface); cursor: pointer; }
.theme-switch select:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
