:root {
  --color-dark: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --header-h: 64px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* 面色变量体系 */
.paper-surface {
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: rgba(21, 23, 35, 0.75);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
  --border-subtle: rgba(21, 23, 35, 0.08);
}
.dark-surface {
  --bg-surface: var(--color-dark);
  --text-primary: var(--color-paper);
  --text-secondary: rgba(252, 252, 253, 0.8);
  --accent: var(--color-accent);
  --brand: var(--color-accent);
  --border-subtle: rgba(252, 252, 253, 0.1);
}
.light-card {
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: rgba(21, 23, 35, 0.75);
  --accent: var(--color-accent);
  --brand: var(--color-brand);
  --border-subtle: rgba(21, 23, 35, 0.08);
}

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.content-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--gap);
  align-items: start;
  overflow-x: hidden;
}
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
}

/* 排版基础 */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; color: var(--text-primary); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin: calc(var(--gap) * 0.75) 0 var(--gap); }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--brand); }
.dark-surface .hl { color: var(--accent); }
眉标 {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}
.dark-surface 眉标 { color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; height: 48px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent); color: var(--color-dark); border: none;
}
.btn-primary:hover { transform: translateY(-2px); background: #5a9ad6; }
.btn-secondary {
  background: transparent; color: var(--text-primary); border: 1px solid var(--text-primary);
}
.dark-surface .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { opacity: 0.85; transform: translateY(-2px); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* 卡片与表格 */
.card {
  background: var(--bg-surface); border: var(--card-border) solid var(--border-subtle);
  box-shadow: var(--card-shadow); border-radius: var(--radius-card); padding: 1.5rem;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-subtle); }
th { font-weight: 600; color: var(--text-primary); }
td { color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: 1px solid var(--border-subtle); border-radius: var(--radius-card); margin-bottom: 0.75rem; overflow: hidden; }
summary {
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; color: var(--text-primary);
  list-style: none; position: relative; user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%);
  color: var(--brand); font-weight: 400;
}
.dark-surface summary::after { color: var(--accent); }
details[open] summary::after { content: "-"; }
details p { padding: 0 1.25rem 1rem; color: var(--text-secondary); margin: 0; }

/* 步骤条 */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }
.step-item { display: flex; flex-direction: column; gap: 0.75rem; }
.step-badge {
  width: 32px; height: 32px; background: var(--accent); color: var(--color-dark);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.step-content h3 { margin: 0; font-size: 1.1rem; }
.step-content p { margin: 0; font-size: 0.95rem; color: var(--text-secondary); }

/* Tab 结构 (纯 CSS) */
.tabs-nav { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; }
.tab-radio { display: none; }
.tab-label {
  padding: 0.75rem 1.25rem; cursor: pointer; font-weight: 600; color: var(--text-secondary);
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.tab-radio:checked + .tab-label { color: var(--text-primary); border-bottom-color: var(--accent); }
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-radio:checked ~ .tab-panel { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle); height: var(--header-h);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-wrap img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-secondary); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text-primary); }
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
  padding: 2rem 0; margin-top: var(--section-y);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-links a { display: block; color: var(--text-secondary); text-decoration: none; margin-bottom: 0.5rem; }
.footer-links a:hover { color: var(--text-primary); }
.copyright { color: var(--text-secondary); font-size: 0.9rem; margin-top: 1.5rem; }

/* SVG 动效基础 */
.svg-container { width: 100%; height: auto; max-width: 100%; overflow: hidden; }
.svg-container svg { width: 100%; height: auto; display: block; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowDash 4s linear infinite; }
.anim-bubble { animation: floatBubble 5s ease-in-out infinite; }
.anim-slide { animation: slideIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.anim-pulse { animation: pulseDot 3s ease-in-out infinite; }
[data-svg-group] { transform-box: fill-box; transform-origin: center; }

@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-6px); opacity: 0.85; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.3; r: 2; }
  50% { opacity: 1; r: 3.5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .anim-flow, .anim-bubble, .anim-slide, .anim-pulse { animation: none !important; }
}
