/* ═══════════════════════════════════════════════════════════
   ZephyrEyes · Design System
   技术权威感 · 深色主题 · 克制信息密度
   ═══════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Surface */
  --bg:              #0a0a0b;
  --bg-surface:      #141416;
  --bg-elevated:     #1c1c1f;

  /* Text */
  --ink:             #e8e6e3;
  --ink-secondary:   #a0a0a0;
  --muted:           #6a6a6a;

  /* Border */
  --border:          #222224;
  --border-strong:   #333336;

  /* Accent — Indigo */
  --accent:          #818cf8;
  --accent-dim:      #6366f1;
  --accent-glow:     rgba(129, 140, 248, 0.06);
  --accent-text:     #a5b4fc;

  /* Semantic */
  --success:         #34d399;
  --warning:         #fbbf24;

  /* Header glass */
  --header-bg:       rgba(10, 10, 11, 0.85);

  /* Typography */
  --font-display:    'Source Serif 4', 'Noto Serif SC', Georgia, serif;
  --font-body:       -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --space-xs:        0.25rem;
  --space-sm:        0.5rem;
  --space-md:        1rem;
  --space-lg:        1.5rem;
  --space-xl:        2rem;
  --space-2xl:       3rem;
  --space-3xl:       4rem;

  /* Layout */
  --max-w:           720px;
  --max-w-wide:      960px;

  /* Radius */
  --radius-sm:       4px;
  --radius-md:       6px;

  /* Transition */
  --ease:            cubic-bezier(0.25, 0.1, 0.25, 1);
  --duration:        150ms;
}

/* ── Theme: Light ── */
[data-theme="light"] {
  --bg:              #fafaf8;
  --bg-surface:      #f0f0ee;
  --bg-elevated:     #e8e8e6;
  --ink:             #1a1a1a;
  --ink-secondary:   #333;
  --muted:           #666;
  --border:          #ddd;
  --border-strong:   #bbb;
  --accent:          #6366f1;
  --accent-dim:      #4f46e5;
  --accent-glow:     rgba(99, 102, 241, 0.06);
  --accent-text:     #4338ca;
  --header-bg:       rgba(250, 250, 248, 0.92);
}

/* ── Theme: Warm ── */
[data-theme="warm"] {
  --bg:              #f5f0e8;
  --bg-surface:      #ede8df;
  --bg-elevated:     #e5dfd5;
  --ink:             #2c2416;
  --ink-secondary:   #4a3f2e;
  --muted:           #6b5f4e;
  --border:          #d5cbb8;
  --border-strong:   #b8ad96;
  --accent:          #c04a1a;
  --accent-dim:      #a33d15;
  --accent-glow:     rgba(192, 74, 26, 0.06);
  --accent-text:     #c04a1a;
  --header-bg:       rgba(245, 240, 232, 0.92);
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  transition: all var(--duration) var(--ease);
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}


/* ── Article Feed (title list) ── */
.article-feed {
  list-style: none;
}

.article-feed li {
  border-bottom: 1px solid var(--border);
}

.article-feed li a {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  transition: color var(--duration) var(--ease);
}

.article-feed li a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.article-feed .feed-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.article-feed .feed-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


/* ── Base ── */
html {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }

::selection {
  background: var(--accent-dim);
  color: #fff;
}


/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  backdrop-filter: blur(12px);
}

.site-nav {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.site-nav .logo:hover { color: var(--ink); }

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav ul a {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color var(--duration) var(--ease);
}

.site-nav ul a:hover {
  color: var(--ink);
  text-decoration: none;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all var(--duration) var(--ease);
}

.lang-toggle:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}


/* ── Main Content ── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-3xl) var(--space-xl);
}


/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: var(--space-2xl);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.4; }


/* ── Page Header ── */
.page-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.page-header .lead {
  color: var(--ink-secondary);
  font-size: 1rem;
  line-height: 1.5;
}


/* ── Hero (Homepage) ── */
.hero {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.hero p {
  color: var(--ink-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 540px;
}


/* ── Section Title ── */
.section-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-lg);
  font-weight: 500;
}


/* ── Category Nav ── */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}

.cat-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  transition: all var(--duration) var(--ease);
}

.cat-pill:hover {
  border-color: var(--accent-dim);
  color: var(--accent-text);
  background: var(--accent-glow);
  text-decoration: none;
}


/* ── Article Card ── */
.article-card {
  border: 1px solid var(--border);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-md);
  transition: all var(--duration) var(--ease);
  position: relative;
}

.article-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background var(--duration) var(--ease);
}

.article-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.article-card:hover::before {
  background: var(--accent-dim);
}

.article-meta {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-sm);
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.article-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent-text);
  letter-spacing: 0.03em;
}

.article-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.article-card h3 a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.article-card p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}


/* ── Category Card (Homepage) ── */
.category-card {
  border: 1px solid var(--border);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-md);
  transition: all var(--duration) var(--ease);
}

.category-card:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.category-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.category-card h3 a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--muted);
}


/* ── Article Body (Long-form) ── */
.article-body {
  font-size: 0.975rem;
  line-height: 1.8;
}

.article-body section {
  margin-bottom: var(--space-2xl);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
  padding-top: var(--space-sm);
  color: var(--ink);
}

.article-body p {
  margin-bottom: var(--space-md);
  color: var(--ink-secondary);
  line-height: 1.85;
}

.article-body p:last-child { margin-bottom: 0; }


/* ── Article Header ── */
.article-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}


/* ── Article Summary / Blockquote ── */
.article-summary {
  margin-bottom: var(--space-2xl);
}

.article-summary blockquote {
  border-left: 2px solid var(--accent-dim);
  padding: var(--space-md) var(--space-lg);
  background: var(--accent-glow);
}

.article-summary blockquote p {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}


/* ── Health Badge ── */
.health {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-excellent { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.health-good { background: rgba(52, 211, 153, 0.08); color: #6ee7b7; }
.health-fair { background: rgba(251, 191, 36, 0.1); color: var(--warning); }
.health-poor { background: rgba(248, 113, 113, 0.1); color: #f87171; }


/* ── Related Articles ── */
.related-articles {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.related-list {
  display: grid;
  gap: var(--space-md);
}

.related-item {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  transition: all var(--duration) var(--ease);
}

.related-item:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
}

.related-item h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.related-item h3 a:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.related-item p {
  font-size: 0.85rem;
  color: var(--muted);
}


/* ── Article Bottom Nav ── */
.article-bottom-nav {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xl) 0;
  margin-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.article-bottom-nav a { color: var(--muted); }
.article-bottom-nav a:hover { color: var(--accent-text); text-decoration: none; }


/* ── TOC ── */
.toc-nav {
  margin-bottom: var(--space-2xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.toc-nav h3 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.toc-nav ol {
  list-style: decimal inside;
  font-size: 0.85rem;
}

.toc-nav li { margin-bottom: 0.3rem; }
.toc-nav a { color: var(--ink-secondary); }
.toc-nav a:hover { color: var(--accent-text); }


/* ── Muted Text ── */
.muted {
  color: var(--muted);
  font-size: 0.9rem;
}


/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-xl);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}


/* ── Cookie Banner ── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  z-index: 1000;
  font-size: 0.875rem;
  backdrop-filter: blur(12px);
}

#cookie-banner p { margin: 0; color: var(--ink-secondary); flex: 1; }
#cookie-banner a { color: var(--accent-text); text-decoration: underline; }

#cookie-banner button {
  background: var(--accent-dim);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration) var(--ease);
}

#cookie-banner button:hover { background: var(--accent); }


/* ── Article (generic content page) ── */
.article-content h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-sm);
}

.article-content .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-2xl);
  font-family: var(--font-mono);
}

.article-content section {
  margin-bottom: var(--space-2xl);
}

.article-content section h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.article-content section h2:first-child {
  border-top: none;
  padding-top: 0;
}

.article-content section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-md);
  color: var(--ink);
}

.article-content section h3:first-child { margin-top: 0; }

.article-content section p {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
  line-height: 1.75;
}

.article-content section ul,
.article-content section ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.article-content section li {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
  line-height: 1.7;
}

.article-content section a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ── Layers Indicator (Article) ── */
.layers-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  font-size: 0.75rem;
}

.layer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.layer-label { color: var(--muted); font-size: 0.7rem; }
.layer-val { font-weight: 600; font-size: 0.75rem; color: var(--ink); }
.layer-badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; border-radius: 2px; font-weight: 500; }
.badge-good { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.badge-warn { background: rgba(251, 191, 36, 0.1); color: var(--warning); }


/* ── FAQ Section (Article) ── */
.faq-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}


/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header { padding: 1rem; }
  .site-nav { flex-wrap: wrap; gap: var(--space-md); }
  .site-nav ul { gap: var(--space-md); }
  .main-content { padding: var(--space-xl) var(--space-md); }
  .hero h1 { font-size: 1.75rem; }
  .page-header h1 { font-size: 1.5rem; }
  .article-header h1 { font-size: 1.4rem; }
  #cookie-banner { flex-direction: column; gap: 0.75rem; padding: 1rem; }
}
