:root {
  /* 色板 */
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  
  /* 结构 token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  
  /* 排版 token */
  --font-body: 16px;
  --lh-body: 1.65;
  --lh-heading: 1.25;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }

/* 布局容器 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: var(--section-y); position: relative; }

/* 面色覆盖 */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark a:not(.btn) { color: var(--color-accent); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .mb { color: var(--color-accent); }
.surface-dark h2, .surface-dark h3, .surface-dark h4 { color: var(--color-paper); }
.surface-dark .card { background: #1f244a; border-color: #2a3060; box-shadow: 4px 4px 0 #0d102b; }
.surface-dark .card h3 { color: var(--color-paper); }
.surface-dark .card p { color: var(--color-paper); }
.surface-dark details { border-color: #2a3060; background: #1a1f40; }
.surface-dark details p { color: var(--color-paper); }

.surface-light { background: var(--color-paper); color: var(--color-text); }
.surface-light .hl { color: var(--color-brand); }
.surface-light .mb { color: var(--color-brand); }

/* 排版 */
h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin-bottom: calc(var(--gap) * 1.5);
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin-bottom: var(--gap);
}
p { max-width: 38em; margin-bottom: 1em; }
.mb { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; }
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 52px; padding-inline: 1.5em; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(128,128,128,0.1); }

/* 卡片 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.card h3 { margin-top: 0; }

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-block: var(--gap); min-width: 400px; }
th, td { padding: 0.75em 1em; border-bottom: 1px solid rgba(128,128,128,0.2); text-align: left; vertical-align: top; }
th { font-weight: 600; }
td code { background: rgba(128,128,128,0.1); padding: 0.2em 0.4em; border-radius: 4px; font-family: monospace; font-size: 0.9em; }

/* FAQ */
details { border: 1px solid rgba(128,128,128,0.3); border-radius: var(--radius-card); padding: 1em; margin-bottom: 0.75em; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2em; flex-shrink: 0; margin-left: 0.5em; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75em; }

/* SVG 动效基础 */
.svg-panel { width: 100%; max-width: 600px; margin: 0 auto; }
svg { width: 100%; height: auto; }

@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.anim-twinkle { animation: twinkle 4s ease-in-out infinite; }
.anim-flow { animation: flowDash 6s linear infinite; stroke-dasharray: 1; stroke-dashoffset: 0; pathLength: 1; }
.anim-float { animation: floatSoft 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  [class*="anim-"] { animation: none !important; }
}

/* 网格与辅助类 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.text-center { text-align: center; }
.mt-gap { margin-top: var(--gap); }

/* 杂志长文侧栏 */
.magazine-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: var(--gap); align-items: start; }
.toc-nav { position: sticky; top: 100px; padding: 1em; background: rgba(128,128,128,0.05); border-radius: var(--radius-card); overflow-x: hidden; width: 100%; max-width: 200px; box-sizing: border-box; }
.toc-nav ul { list-style: none; padding: 0; }
.toc-nav li { margin-bottom: 0.5em; }
.toc-nav a { font-size: 0.9rem; color: inherit; opacity: 0.8; }
.toc-nav a:hover { opacity: 1; text-decoration: underline; }

/* 时间线 */
.timeline-item { display: flex; gap: 1.5em; margin-bottom: 2em; align-items: flex-start; }
.timeline-num { font-size: 2rem; font-weight: 800; color: var(--color-accent); flex-shrink: 0; width: 3em; text-align: center; line-height: 1; }
.timeline-content { flex: 1; }
.timeline-content h4 { margin-bottom: 0.5em; font-weight: 600; }
.timeline-content p { margin-bottom: 0; }

/* 响应式 */
@media (max-width: 768px) {
  .grid-2, .grid-3, .magazine-layout { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; }
  .toc-nav { position: static; margin-bottom: var(--gap); }
}

/* 兜底：裁掉横向溢出 */
div.download-hero,
div.container.magazine-layout {
  overflow-x: clip;
}
