/* base.css — 全局变量 + 主题族 + reset */
:root {
  /* 共享尺寸 */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --tabbar-h: 0px;
  --gutter: clamp(12px, 1.6vw, 22px);
  --warn: #e3a248;
  --err: #ff7b7b;
  /* 默认主题 = midnight */
  --bg: #0a0f1e;
  --bg-elev: #0e1530;
  --panel: rgba(20, 26, 56, .58);
  --panel-border: rgba(140, 160, 240, .14);
  --primary: #7c8cff;
  --primary-2: #b780ff;
  --accent: #5dd39e;
  --text: #e7ebff;
  --muted: #8895c0;
  --topbar-bg: rgba(10, 15, 30, .65);
  --tabbar-bg: rgba(10, 15, 30, .92);
  --glow-a: rgba(124, 140, 255, .18);
  --glow-b: rgba(183, 128, 255, .16);
  font-size: clamp(13px, 1.05vw, 15px);
}

/* ====== 主题预设 ====== */
[data-theme="midnight"] {
  --bg: #0a0f1e; --bg-elev: #0e1530;
  --panel: rgba(20, 26, 56, .58);
  --panel-border: rgba(140, 160, 240, .14);
  --primary: #7c8cff; --primary-2: #b780ff;
  --accent: #5dd39e;
  --text: #e7ebff; --muted: #8895c0;
  --topbar-bg: rgba(10, 15, 30, .65);
  --tabbar-bg: rgba(10, 15, 30, .92);
  --glow-a: rgba(124, 140, 255, .18);
  --glow-b: rgba(183, 128, 255, .16);
}
[data-theme="aurora"] {
  --bg: #06141f; --bg-elev: #082233;
  --panel: rgba(12, 38, 52, .58);
  --panel-border: rgba(120, 220, 200, .14);
  --primary: #5dd39e; --primary-2: #39a0b8;
  --accent: #9bf3c7;
  --text: #e2fbf2; --muted: #79a9a2;
  --topbar-bg: rgba(6, 20, 31, .68);
  --tabbar-bg: rgba(6, 20, 31, .92);
  --glow-a: rgba(93, 211, 158, .18);
  --glow-b: rgba(57, 160, 184, .18);
}
[data-theme="sunset"] {
  --bg: #1a0c1a; --bg-elev: #28132a;
  --panel: rgba(60, 28, 56, .56);
  --panel-border: rgba(255, 155, 110, .14);
  --primary: #ff9b6e; --primary-2: #ff5b81;
  --accent: #ffd166;
  --text: #fff1e9; --muted: #c89fae;
  --topbar-bg: rgba(26, 12, 26, .7);
  --tabbar-bg: rgba(26, 12, 26, .92);
  --glow-a: rgba(255, 155, 110, .18);
  --glow-b: rgba(255, 91, 129, .18);
}
[data-theme="rose"] {
  --bg: #160a1c; --bg-elev: #251030;
  --panel: rgba(54, 22, 70, .56);
  --panel-border: rgba(255, 123, 177, .14);
  --primary: #ff7bb1; --primary-2: #b780ff;
  --accent: #ffce6e;
  --text: #fbe7f4; --muted: #b39ac7;
  --topbar-bg: rgba(22, 10, 28, .7);
  --tabbar-bg: rgba(22, 10, 28, .92);
  --glow-a: rgba(255, 123, 177, .2);
  --glow-b: rgba(183, 128, 255, .18);
}
[data-theme="carbon"] {
  --bg: #08090c; --bg-elev: #111319;
  --panel: rgba(28, 30, 38, .6);
  --panel-border: rgba(180, 190, 220, .1);
  --primary: #9aa3c2; --primary-2: #6b76a8;
  --accent: #c8d0ec;
  --text: #eef0f6; --muted: #8a92a8;
  --topbar-bg: rgba(8, 9, 12, .72);
  --tabbar-bg: rgba(8, 9, 12, .94);
  --glow-a: rgba(154, 163, 194, .12);
  --glow-b: rgba(107, 118, 168, .12);
}
[data-theme="daylight"] {
  --bg: #f3f5fb; --bg-elev: #ffffff;
  --panel: rgba(255, 255, 255, .78);
  --panel-border: rgba(91, 108, 255, .18);
  --primary: #5b6cff; --primary-2: #7c8cff;
  --accent: #2dd07b;
  --text: #1a2238; --muted: #5b6480;
  --topbar-bg: rgba(243, 245, 251, .82);
  --tabbar-bg: rgba(255, 255, 255, .96);
  --glow-a: rgba(91, 108, 255, .14);
  --glow-b: rgba(124, 140, 255, .12);
  --shadow: 0 12px 32px rgba(60, 70, 130, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 80% -10%, var(--glow-a), transparent),
    radial-gradient(900px 600px at -10% 110%, var(--glow-b), transparent),
    var(--bg);
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100%;
  transition: background-color .3s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; padding: 0; margin: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
