/* 全站统一配色。所有页面（首页、控制台、智商检测、充值）都用这里的变量。
 *
 * 两个开关，挂在 <html> 上，由 /brand/theme.js 负责设置：
 *   夜间模式：class="dark"（和 new-api 控制台用的是同一个 class）
 *   配色：    data-palette="default"（极光紫蓝，默认）或 "claude"（Claude 橙）
 *
 * 变量说明：
 *   --bg / --bg-2            页面背景 / 稍深一层的背景
 *   --surface / --surface-2  卡片 / 卡片里的次级块
 *   --border / --border-2    分隔线 / 更明显的边框
 *   --text / --text-2 / --text-3  主文字 / 次要文字 / 弱提示
 *   --primary / --primary-2  主色 / 辅助色（渐变的另一端）
 *   --primary-ink            主色按钮上的文字颜色
 *   --primary-soft           主色的浅底（选中、悬停）
 *   --glow                   发光、聚焦光圈
 *   --grad                   主色渐变
 *   --ok / --warn / --bad    正常 / 警告 / 错误
 */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* 默认配色 · 日间 */
  --bg: #f6f6fb; --bg-2: #eeedf6;
  --surface: #ffffff; --surface-2: #f3f2fa;
  --border: #e5e3f0; --border-2: #d4d1e6;
  --text: #15141f; --text-2: #53516a; --text-3: #8b89a3;
  --primary: #6d4aff; --primary-2: #1fb3e0; --primary-ink: #ffffff;
  --primary-soft: rgba(109, 74, 255, .10);
  --glow: rgba(109, 74, 255, .32);
  --grad: linear-gradient(120deg, #6d4aff 0%, #4f7bff 50%, #1fb3e0 100%);
  --ok: #12a150; --warn: #d97706; --bad: #dc3a3a;
  --shadow: 0 1px 2px rgba(30, 20, 80, .05), 0 12px 32px -18px rgba(30, 20, 80, .22);
  --shadow-lg: 0 2px 6px rgba(30, 20, 80, .06), 0 30px 60px -30px rgba(30, 20, 80, .35);
  color-scheme: light;
}

/* 默认配色 · 夜间 */
:root.dark {
  --bg: #08080e; --bg-2: #0e0e17;
  --surface: #12121c; --surface-2: #1a1a27;
  --border: #242334; --border-2: #343249;
  --text: #edecf6; --text-2: #a5a3bd; --text-3: #6e6c88;
  --primary: #8c72ff; --primary-2: #3ccff5; --primary-ink: #ffffff;
  --primary-soft: rgba(140, 114, 255, .14);
  --glow: rgba(140, 114, 255, .42);
  --grad: linear-gradient(120deg, #8c72ff 0%, #5d8bff 50%, #3ccff5 100%);
  --ok: #34d17a; --warn: #f5b53d; --bad: #ff6b6b;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -22px rgba(0, 0, 0, .9);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 80px -40px rgba(0, 0, 0, .95);
  color-scheme: dark;
}

/* Claude 橙 · 日间：象牙白底、陶土橙主色、标题用衬线字体 */
:root[data-palette="claude"] {
  --font-display: "Tiempos Headline", Georgia, "Noto Serif SC", "Songti SC", "SimSun", serif;
  --bg: #faf9f5; --bg-2: #f0eee6;
  --surface: #ffffff; --surface-2: #f5f4ee;
  --border: #e8e5da; --border-2: #d8d3c4;
  --text: #141413; --text-2: #5e5d59; --text-3: #8f8d86;
  --primary: #d97757; --primary-2: #e5a67f; --primary-ink: #ffffff;
  --primary-soft: rgba(217, 119, 87, .11);
  --glow: rgba(217, 119, 87, .30);
  --grad: linear-gradient(120deg, #c96442 0%, #d97757 45%, #e9b48c 100%);
  --ok: #4d8a3c; --warn: #c98a1b; --bad: #c4442d;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 12px 32px -18px rgba(60, 40, 20, .20);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, .06), 0 30px 60px -30px rgba(60, 40, 20, .30);
}

/* Claude 橙 · 夜间 */
:root.dark[data-palette="claude"] {
  --bg: #1f1e1d; --bg-2: #262624;
  --surface: #2a2927; --surface-2: #31302e;
  --border: #3a3936; --border-2: #4a4844;
  --text: #f5f4ee; --text-2: #c2c0b6; --text-3: #8f8d86;
  --primary: #e0896a; --primary-2: #efb894; --primary-ink: #1f1e1d;
  --primary-soft: rgba(224, 137, 106, .15);
  --glow: rgba(224, 137, 106, .35);
  --grad: linear-gradient(120deg, #d97757 0%, #e0896a 45%, #efc29e 100%);
  --ok: #7fbf6a; --warn: #e6b04a; --bad: #ef7a62;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 40px -22px rgba(0, 0, 0, .8);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 80px -40px rgba(0, 0, 0, .85);
}

/* 切换主题时颜色平滑过渡（只在切换的那一刻加，平时不影响性能） */
:root.theme-anim, :root.theme-anim * { transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), fill .35s var(--ease) !important; }

/* 主题切换按钮（首页、智商页、充值页的顶栏共用） */
.brand-switch { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.brand-switch button { width: 30px; height: 30px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.brand-switch button:hover { color: var(--text); background: var(--surface-2); }
.brand-switch button svg { width: 16px; height: 16px; }
.brand-switch .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; transition: box-shadow .2s; }
.brand-switch .sw.default { background: linear-gradient(135deg, #6d4aff, #1fb3e0); }
.brand-switch .sw.claude { background: linear-gradient(135deg, #c96442, #e9b48c); }
.brand-switch button[aria-pressed="true"] .sw { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--primary); }
