/* ============================================
   传霜 · 设计系统 v6
   ============================================ */

:root {
  --c-bg: #f8f9fb;
  --c-surface: #ffffff;
  --c-text: #18181b;
  --c-text-heading: #09090b;
  --c-text-secondary: #52525b;
  --c-text-muted: #a1a1aa;
  --c-accent: #3b82f6;
  --c-accent-hover: #2563eb;
  --c-accent-light: #eff6ff;
  --c-accent-muted: #c7d2fe;
  --c-amber: #f59e0b;
  --c-amber-light: #fffbeb;
  --c-green: #22c55e;
  --c-green-light: #f0fdf4;
  --c-purple: #8b5cf6;
  --c-purple-light: #f5f3ff;
  --c-rose: #f43f5e;
  --c-rose-light: #fff1f2;
  --c-orange: #f97316;
  --c-orange-light: #fff7ed;
  --c-border: #e2e6ec;
  --c-border-light: #f1f3f6;
  --c-code-bg: #1e293b;
  --c-code-text: #e2e8f0;

  --font-sans: -apple-system, 'PingFang SC', 'Inter', 'Segoe UI', 'Noto Sans SC', sans-serif;
  --font-serif: 'Noto Serif SC', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-base: 0.9375rem;
  --fs-lg: 1.0625rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem; --fs-3xl: 1.875rem;

  --lh-tight: 1.3; --lh-normal: 1.65; --lh-loose: 1.85;

  --space-xs: 0.25rem; --space-sm: 0.5rem; --space-md: 0.75rem;
  --space-lg: 1rem; --space-xl: 1.5rem; --space-2xl: 2rem; --space-3xl: 3rem;

  --max-width: 960px;
  --content-pad: 32px;

  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);

  --transition: 0.2s ease;
  --toc-width: 220px;

  --c-toc-bg: #fafbfc;
  --c-toc-border: #e8eaee;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-normal);
  color: var(--c-text); background: var(--c-bg); min-height: 100vh;
}

/* --- Scroll Progress --- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--c-accent); z-index: 1000; width: 0;
}

/* ============================================
   HOMEPAGE — Clean Index
   ============================================ */

.index-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3xl) var(--content-pad) var(--space-3xl);
}

.index-header { margin-bottom: var(--space-2xl); }
.index-title {
  font-size: 20px; font-weight: 700; color: var(--c-text-heading);
  margin-bottom: 4px; letter-spacing: -0.01em;
}
.index-lead { font-size: 13px; color: var(--c-text-muted); }

.section { margin-bottom: var(--space-xl); }
.section-head {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-sm); padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--c-border);
}
.section-head svg { width: 16px; height: 16px; flex-shrink: 0; }
.section-name { font-size: 12px; font-weight: 600; color: var(--c-text-secondary); letter-spacing: 0.5px; }
.section-count { font-size: 11px; color: var(--c-text-muted); margin-left: auto; }

.row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-md);
  margin-bottom: 6px; text-decoration: none; color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.row:last-child { margin-bottom: 0; }
.row:hover { border-color: var(--c-accent-muted); box-shadow: var(--shadow-sm); }

.row-icon {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.row-icon svg { width: 16px; height: 16px; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 600; color: var(--c-text-heading); line-height: var(--lh-tight); }
.row-desc { font-size: 12px; color: var(--c-text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-date { font-size: 11px; color: var(--c-text-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: var(--space-3xl) var(--space-xl); }
.empty-state__text { font-size: var(--fs-sm); color: var(--c-text-muted); }

.page-footer {
  text-align: center; font-size: 11px; color: var(--c-text-muted);
  margin-top: var(--space-3xl); padding-top: var(--space-lg);
  border-top: 1px solid var(--c-border);
}
.page-footer__link { color: var(--c-text-muted); text-decoration: none; letter-spacing: 0.1em; transition: color var(--transition); }
.page-footer__link:hover { color: var(--c-accent); }

/* ============================================
   REPORT PAGE
   ============================================ */

/* --- Fixed Left TOC Sidebar --- */
.toc-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--toc-width);
  background: var(--c-toc-bg);
  border-right: 1px solid var(--c-toc-border);
  z-index: 200;
  overflow-y: auto;
  padding: var(--space-xl) var(--space-lg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc-sidebar--open {
  transform: translateX(0);
}

.toc-sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-md); padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--c-toc-border);
}

.toc-sidebar__title {
  font-size: 11px; font-weight: 600; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: var(--space-xs);
}
.toc-sidebar__title svg { width: 14px; height: 14px; }

.toc-sidebar__close {
  width: 22px; height: 22px; border: none;
  background: var(--c-bg); border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); transition: all var(--transition);
}
.toc-sidebar__close:hover { background: var(--c-border); color: var(--c-text); }
.toc-sidebar__close svg { width: 12px; height: 12px; }

.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list__item {
  display: block; padding: 5px 8px; font-size: 12.5px;
  color: var(--c-text-secondary); border-radius: var(--radius-sm);
  transition: all var(--transition); line-height: 1.4;
  text-decoration: none; margin-bottom: 1px;
}
.toc-list__item:hover { color: var(--c-accent); background: var(--c-accent-light); }
.toc-list__item--active { color: var(--c-accent); font-weight: 600; background: var(--c-accent-light); }
.toc-list__item--h3 { padding-left: 20px; font-size: 11.5px; }

/* --- TOC Toggle Tab (left edge) --- */
.toc-toggle {
  position: fixed;
  left: 0; top: 50%; transform: translateY(-50%);
  z-index: 190;
  width: 26px; height: 56px;
  background: var(--c-surface);
  border: 1px solid var(--c-toc-border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  transition: all var(--transition);
}
.toc-toggle:hover { color: var(--c-accent); box-shadow: var(--shadow-lg); width: 30px; }
.toc-toggle svg { width: 14px; height: 14px; }
.toc-toggle--hidden { opacity: 0; pointer-events: none; transform: translateY(-50%) translateX(-8px); }

/* --- Report Content Area --- */
.report-wrap {
  margin: 0 auto;
  padding: var(--space-2xl) var(--content-pad);
}

body.toc-open .report-wrap {
  margin-left: var(--toc-width);
}

/* --- Report Header (clean, no dark bg) --- */
.report-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--c-border);
}

.report-header__breadcrumb {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: var(--fs-sm); color: var(--c-text-muted);
  margin-bottom: var(--space-lg);
}
.report-header__breadcrumb a { color: var(--c-text-muted); text-decoration: none; }
.report-header__breadcrumb a:hover { color: var(--c-accent); }
.report-header__breadcrumb svg { width: 14px; height: 14px; }

.report-header__meta {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-md); flex-wrap: wrap;
}

.report-header__tag {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: 0.25em 0.65em;
  background: var(--c-accent-light);
  color: var(--c-accent);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
}
.report-header__tag svg { width: 13px; height: 13px; }

.report-header__date {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-size: var(--fs-sm); color: var(--c-text-muted);
}
.report-header__date svg { width: 13px; height: 13px; }

.report-header__title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--c-text-heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.report-header__desc {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-normal);
  max-width: 560px;
}

/* --- Typography (report body) --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700; line-height: var(--lh-tight);
  color: var(--c-text-heading); letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-3xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--fs-2xl); margin-bottom: var(--space-md); margin-top: var(--space-2xl); }
h3 { font-size: var(--fs-xl); margin-bottom: var(--space-sm); margin-top: var(--space-xl); }
h4 { font-size: var(--fs-lg); margin-bottom: var(--space-sm); margin-top: var(--space-lg); }
p { margin-bottom: var(--space-md); }
a { color: var(--c-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-accent-hover); }
strong { font-weight: 600; color: var(--c-text-heading); }

blockquote {
  border-left: 3px solid var(--c-accent);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background: var(--c-accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--c-text-secondary);
  font-style: italic;
  position: relative;
}
blockquote::before {
  content: '\201C'; position: absolute; top: -8px; left: 12px;
  font-size: 3rem; color: var(--c-accent-muted); font-family: Georgia, serif; line-height: 1;
}

code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--c-bg); padding: 0.15em 0.4em;
  border-radius: var(--radius-sm); color: var(--c-accent-hover);
  border: 1px solid var(--c-border);
}
pre {
  background: var(--c-code-bg); color: var(--c-code-text);
  padding: var(--space-xl); border-radius: var(--radius-md);
  overflow-x: auto; margin: var(--space-xl) 0; line-height: var(--lh-loose);
}
pre code { background: none; padding: 0; font-size: var(--fs-sm); color: inherit; border: none; }
hr { border: none; height: 1px; background: var(--c-border); margin: var(--space-2xl) 0; }
ul, ol { padding-left: var(--space-xl); margin-bottom: var(--space-md); }
li { margin-bottom: var(--space-xs); line-height: var(--lh-normal); }
img { max-width: 100%; height: auto; border-radius: var(--radius-md); }

table { width: 100%; border-collapse: collapse; margin: var(--space-xl) 0; font-size: var(--fs-sm); }
th, td { text-align: left; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--c-border); }
th { font-weight: 600; color: var(--c-text-secondary); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; background: var(--c-bg); }
tr:hover td { background: var(--c-accent-light); }

/* --- Content Elements --- */
.trend-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-xl);
  margin: var(--space-md) 0 var(--space-lg);
}

.insight-box {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-md); padding: var(--space-lg); margin: var(--space-md) 0;
  position: relative;
}
.insight-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.insight-box h4 { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }

.comparison-table-wrapper {
  overflow-x: auto; margin: var(--space-xl) 0;
  border-radius: var(--radius-md); border: 1px solid var(--c-border);
}
.comparison-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.comparison-table thead th {
  background: var(--c-text-heading); color: #fff; font-weight: 600;
  padding: var(--space-md) var(--space-lg); text-transform: none;
  letter-spacing: 0; font-size: var(--fs-sm); border: none;
}
.comparison-table tbody td { padding: var(--space-sm) var(--space-lg); border-bottom: 1px solid var(--c-border); }
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr:hover td { background: var(--c-accent-light); }

.toc-inline {
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius-md); padding: var(--space-lg) var(--space-xl); margin: var(--space-xl) 0;
}
.toc-inline ol { padding-left: var(--space-xl); margin: 0; column-count: 2; column-gap: var(--space-xl); }
.toc-inline li { margin-bottom: var(--space-xs); }
.toc-inline a { color: var(--c-text-secondary); font-size: var(--fs-sm); }
.toc-inline a:hover { color: var(--c-accent); }

.recommendations { padding-left: var(--space-xl); counter-reset: rec; }
.recommendations li { margin-bottom: var(--space-md); padding-left: var(--space-sm); position: relative; }
.recommendations li::before {
  counter-increment: rec; content: counter(rec);
  position: absolute; left: calc(-1 * var(--space-xl)); top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-size: var(--fs-xs); font-weight: 700; border-radius: 50%;
}

.sources { list-style: none; padding: 0; }
.sources li { padding: var(--space-sm) 0; border-bottom: 1px solid var(--c-border-light); font-size: var(--fs-sm); color: var(--c-text-secondary); }
.sources li:last-child { border-bottom: none; }
.sources em { color: var(--c-text-muted); font-style: normal; }

/* --- Scroll Reveal --- */
[data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal].revealed { opacity: 1; transform: none; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  :root { --toc-width: 220px; }
}

@media (max-width: 768px) {
  :root { --toc-width: 200px; }
  .toc-sidebar { padding: var(--space-lg) var(--space-md); }
  .report-header__title { font-size: var(--fs-2xl); }
  .toc-inline ol { column-count: 1; }
}

@media (max-width: 480px) {
  :root { --content-pad: 16px; }
  .row { padding: 10px 12px; gap: 10px; }
  .row-icon { width: 28px; height: 28px; }
  .row-icon svg { width: 14px; height: 14px; }
  .row-desc { display: none; }
}

/* --- Print --- */
@media print {
  .scroll-progress, .toc-toggle, .toc-sidebar { display: none !important; }
  body.toc-open .report-wrap { margin-left: 0; }
  .page-footer { display: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
