/* ============================================================
 * 路普Loop 站点族 · 双主题系统 v1.1（T-CODE-86 · ZCode · 2026-10-26）
 * ------------------------------------------------------------
 * v1.1 自纠：dark 层变量值与现役 family.css v1.0 逐项精确对齐
 *          （v1 为占位色值，若加载会漂移视觉，已作废），
 *          并补齐 cyan/pink/purple 三变量，新增亮色硬编码修正层。
 * 设计：一处定义全站生效。主题= html[data-theme] 上的 CSS 变量层。
 * 默认：dark（现役 VI 原值）；light 为新增可选主题。
 * 接入：<head> 内 family.css 之后引本文件；防闪烁片段见 theme.js 顶部注释。
 * ============================================================ */

:root { --page-max: 1080px; }

/* ---------- 暗色（默认 · = family.css v1.0 原值，零漂移） ---------- */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#0b0f1a; --bg2:#111827; --card:#161e30; --card2:#1b2440;
  --line:rgba(255,255,255,.08); --line2:rgba(255,255,255,.14);
  --mut:#8b93a7; --tx:#e7ecf5;
  --blue:#2563eb; --cyan:#22d3ee; --green:#34d399; --red:#f87171;
  --amber:#fbbf24; --pink:#ec4899; --purple:#a78bfa;
  --shadow:0 1px 3px rgba(0,0,0,.35);
  --top-glass:rgba(11,15,26,.88);
}

/* ---------- 亮色（新增 · 同族色相的深色版，对比度按 WCAG AA 档取值） ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg:#f7f9fc; --bg2:#eef2f8; --card:#ffffff; --card2:#f0f4fa;
  --line:rgba(15,23,42,.12); --line2:rgba(15,23,42,.2);
  --mut:#5b6472; --tx:#1c2433;
  --blue:#1d4ed8; --cyan:#0e7490; --green:#047857; --red:#b91c1c;
  --amber:#92400e; --pink:#9d174d; --purple:#6d28d9;
  --shadow:0 1px 3px rgba(28,36,51,.12);
  --top-glass:rgba(255,255,255,.88);
}

/* ---------- 亮色硬编码修正层（family.css 内三处固定色，dark 不动零漂移） ---------- */
html[data-theme="light"] body {
  background: radial-gradient(1200px 600px at 20% -10%, #e3e9f4 0, transparent 60%), var(--bg);
}
html[data-theme="light"] .top { background: var(--top-glass); }
html[data-theme="light"] .hero h1 {
  background: linear-gradient(90deg, #0f172a, #1d4ed8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 主题过渡（仅切换瞬间感知，尊重 reduced-motion） ---------- */
html.theme-anim, html.theme-anim * { transition: background-color .25s ease, border-color .25s ease, color .25s ease; }

/* ---------- 切换器（theme.js 注入） ---------- */
.theme-toggle{
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: var(--card2); color: var(--tx);
  border: 1px solid var(--line); font: 12.5px/1 'PingFang SC','Microsoft YaHei','Segoe UI',sans-serif;
  box-shadow: var(--shadow); user-select: none;
}
.theme-toggle:hover { border-color: var(--blue); }
.theme-toggle .ico { font-size: 13px; }

@media print { .theme-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { html.theme-anim, html.theme-anim * { transition: none; } }
