/* ==========================================================
   themes.css · MoviesMatrix 六套彩色模式
   加载顺序：2（依赖 tokens.css）
   主题：晨光 / 正午 / 黄昏 / 夜读 / 静默 / 活力
   ========================================================== */

/* ---------- M1 · 晨光 Dawn ---------- */
[data-theme="dawn"] {
  --color-bg:             hsl(35, 30%, 98%);
  --color-surface:        hsl(35, 25%, 96%);
  --color-surface-hover:  hsl(35, 25%, 92%);
  --color-text-primary:   hsl(30, 15%, 15%);
  --color-text-secondary: hsl(30, 10%, 45%);
  --color-text-tertiary:  hsl(30, 10%, 60%);
  --color-accent:         hsl(25, 70%, 55%);
  --color-border:         hsl(35, 20%, 88%);
  --color-border-strong:  hsl(35, 20%, 78%);
}

/* ---------- M2 · 正午 Noon ---------- */
[data-theme="noon"] {
  --color-bg:             hsl(0, 0%, 100%);
  --color-surface:        hsl(0, 0%, 97%);
  --color-surface-hover:  hsl(0, 0%, 94%);
  --color-text-primary:   hsl(220, 15%, 12%);
  --color-text-secondary: hsl(220, 10%, 45%);
  --color-text-tertiary:  hsl(220, 10%, 60%);
  --color-accent:         hsl(220, 65%, 45%);
  --color-border:         hsl(220, 15%, 90%);
  --color-border-strong:  hsl(220, 15%, 80%);
}

/* ---------- M3 · 黄昏 Dusk ---------- */
[data-theme="dusk"] {
  --color-bg:             hsl(38, 25%, 94%);
  --color-surface:        hsl(38, 20%, 90%);
  --color-surface-hover:  hsl(38, 20%, 86%);
  --color-text-primary:   hsl(30, 20%, 18%);
  --color-text-secondary: hsl(30, 15%, 45%);
  --color-text-tertiary:  hsl(30, 15%, 60%);
  --color-accent:         hsl(35, 65%, 50%);
  --color-border:         hsl(38, 18%, 84%);
  --color-border-strong:  hsl(38, 18%, 74%);
}

/* ---------- M4 · 夜读 Night ---------- */
[data-theme="night"] {
  --color-bg:             hsl(220, 15%, 10%);
  --color-surface:        hsl(220, 12%, 14%);
  --color-surface-hover:  hsl(220, 12%, 18%);
  --color-text-primary:   hsl(35, 15%, 85%);
  --color-text-secondary: hsl(35, 10%, 60%);
  --color-text-tertiary:  hsl(35, 10%, 45%);
  --color-accent:         hsl(35, 70%, 60%);
  --color-border:         hsl(220, 12%, 22%);
  --color-border-strong:  hsl(220, 12%, 32%);
}

/* ---------- M5 · 静默 Silent ---------- */
[data-theme="silent"] {
  --color-bg:             hsl(0, 0%, 96%);
  --color-surface:        hsl(0, 0%, 93%);
  --color-surface-hover:  hsl(0, 0%, 90%);
  --color-text-primary:   hsl(0, 0%, 15%);
  --color-text-secondary: hsl(0, 0%, 45%);
  --color-text-tertiary:  hsl(0, 0%, 60%);
  --color-accent:         hsl(0, 0%, 35%);
  --color-border:         hsl(0, 0%, 88%);
  --color-border-strong:  hsl(0, 0%, 78%);
}

/* ---------- M6 · 活力 Vivid ---------- */
[data-theme="vivid"] {
  --color-bg:             hsl(0, 0%, 100%);
  --color-surface:        hsl(280, 20%, 97%);
  --color-surface-hover:  hsl(280, 20%, 94%);
  --color-text-primary:   hsl(260, 20%, 12%);
  --color-text-secondary: hsl(260, 15%, 45%);
  --color-text-tertiary:  hsl(260, 15%, 60%);
  --color-accent:         hsl(320, 80%, 50%);
  --color-border:         hsl(280, 15%, 90%);
  --color-border-strong:  hsl(280, 15%, 80%);
}

/* ---------- 全局过渡（主题切换动画） ---------- */
html {
  transition: background-color var(--duration-slow) var(--ease-in-out);
}
body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  transition: background-color var(--duration-slow) var(--ease-in-out),
              color var(--duration-slow) var(--ease-in-out);
}

/* ---------- 移动端 OLED 夜读优化 ---------- */
@media (max-width: 768px) {
  [data-theme="night"] {
    --color-bg:            hsl(0, 0%, 0%);
    --color-surface:       hsl(220, 10%, 8%);
    --color-surface-hover: hsl(220, 10%, 12%);
    --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%);
  --color-border:       hsl(0, 0%, 70%);
  --color-border-strong: hsl(0, 0%, 50%);
}

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

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html, body {
    transition: none;
  }
}
