/* ============================================================
   themes.css · 六套彩色模式
   项目：offroadupgrades.com
   加载顺序：2（必须在 tokens.css 之后）
   ============================================================ */

/* ---------- M1 · 晨光 Dawn · 暖白底+暖橙强调 ---------- */
[data-theme="dawn"] {
  --color-bg:             hsl(35, 30%, 98%);
  --color-surface:        hsl(35, 25%, 96%);
  --color-text-primary:   hsl(30, 15%, 15%);
  --color-text-secondary: hsl(30, 10%, 45%);
  --color-accent:         hsl(25, 70%, 55%);
  --color-border:         hsl(35, 20%, 88%);
}

/* ---------- M2 · 正午 Noon · 纯白底+钴蓝强调 ---------- */
[data-theme="noon"] {
  --color-bg:             hsl(0, 0%, 100%);
  --color-surface:        hsl(0, 0%, 97%);
  --color-text-primary:   hsl(220, 15%, 12%);
  --color-text-secondary: hsl(220, 10%, 45%);
  --color-accent:         hsl(220, 65%, 45%);
  --color-border:         hsl(220, 15%, 90%);
}

/* ---------- M3 · 黄昏 Dusk · 米色底+琥珀强调 ---------- */
[data-theme="dusk"] {
  --color-bg:             hsl(38, 25%, 94%);
  --color-surface:        hsl(38, 20%, 90%);
  --color-text-primary:   hsl(30, 20%, 18%);
  --color-text-secondary: hsl(30, 15%, 45%);
  --color-accent:         hsl(35, 65%, 50%);
  --color-border:         hsl(38, 18%, 84%);
}

/* ---------- M4 · 夜读 Night · 深灰底+暖黄强调 ---------- */
[data-theme="night"] {
  --color-bg:             hsl(220, 15%, 10%);
  --color-surface:        hsl(220, 12%, 14%);
  --color-text-primary:   hsl(35, 15%, 85%);
  --color-text-secondary: hsl(35, 10%, 60%);
  --color-accent:         hsl(35, 70%, 60%);
  --color-border:         hsl(220, 12%, 22%);
}

/* ---------- M5 · 静默 Silent · 纯灰底+极低饱和强调 ---------- */
[data-theme="silent"] {
  --color-bg:             hsl(0, 0%, 96%);
  --color-surface:        hsl(0, 0%, 93%);
  --color-text-primary:   hsl(0, 0%, 15%);
  --color-text-secondary: hsl(0, 0%, 45%);
  --color-accent:         hsl(0, 0%, 35%);
  --color-border:         hsl(0, 0%, 88%);
}

/* ---------- M6 · 活力 Vivid · 白底+高饱和撞色强调 ---------- */
[data-theme="vivid"] {
  --color-bg:             hsl(0, 0%, 100%);
  --color-surface:        hsl(280, 20%, 97%);
  --color-text-primary:   hsl(260, 20%, 12%);
  --color-text-secondary: hsl(260, 15%, 45%);
  --color-accent:         hsl(320, 80%, 50%);
  --color-border:         hsl(280, 15%, 90%);
}

/* ---------- 移动端 OLED 夜读优化 ---------- */
@media (max-width: 768px) {
  [data-theme="night"] {
    --color-bg:             hsl(0, 0%, 0%);
    --color-surface:        hsl(220, 10%, 8%);
    --color-text-primary:   hsl(35, 12%, 80%);
    --color-accent:         hsl(35, 60%, 55%);
  }
}

/* ---------- 户外高对比度模式 ---------- */
[data-theme="dawn"][data-outdoor="true"],
[data-theme="noon"][data-outdoor="true"] {
  --color-text-primary: hsl(30, 20%, 5%);
  --color-bg:           hsl(0, 0%, 100%);
  --color-accent:       hsl(25, 85%, 45%);
}

/* ---------- P3 广色域适配 ---------- */
@media (color-gamut: p3) {
  :root {
    --color-accent: color(display-p3 0.95 0.45 0.15);
  }
}

/* ---------- 主题切换过渡 ---------- */
html {
  transition: background-color var(--duration-slow) var(--ease-in-out),
              color var(--duration-slow) var(--ease-in-out);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
}
