:root {
  /* 基础色板 */
  --bg-dark: #231334;
  --bg-paper: #E9E8EA;
  --bg-paper-light: #F4F3F5;
  --text-body: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  --text-on-dark: #E9E8EA;
  --text-on-accent: #231334;

  /* 结构性 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
}

/* 面层级变量覆盖 */
.bg-dark {
  --bg-surface: var(--bg-dark);
  --text-primary: var(--text-on-dark);
  --text-secondary: var(--text-on-dark);
  --label-color: var(--accent);
  --hl-color: var(--accent);
}
.bg-paper {
  --bg-surface: var(--bg-paper);
  --text-primary: var(--text-body);
  --text-secondary: var(--text-body);
  --label-color: var(--brand);
  --hl-color: var(--brand);
}
.bg-paper-light {
  --bg-surface: var(--bg-paper-light);
  --text-primary: var(--text-body);
  --text-secondary: var(--text-body);
  --label-color: var(--brand);
  --hl-color: var(--brand);
}

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 排版 */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.6em; }
p { margin-bottom: 1em; max-width: 38em; }
.label {
  display: block; font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--label-color); margin-bottom: 0.5em;
}
.hl { color: var(--hl-color); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); background: var(--bg-surface); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.75em 1.5em; border-radius: var(--radius-btn); font-weight: 600; cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease; height: 48px; font-size: 1rem;
  border: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-secondary { background: transparent; border: 1px solid var(--text-primary); color: var(--text-primary); }
.bg-dark .btn-secondary { border-color: var(--text-on-dark); color: var(--text-on-dark); }

/* 组件：卡片 */
.card {
  background: var(--bg-surface); border: var(--card-border); box-shadow: var(--card-shadow);
  border-radius: var(--radius-card); padding: var(--gap); position: relative;
}
.bg-dark .card { background: rgba(255, 255, 255, 0.06); }
.bg-dark .card p { color: var(--text-on-dark); }
.bg-paper-light .card { background: #FFFFFF; }

/* 组件：表格 */
table { width: 100%; border-collapse: collapse; margin: 1em 0; min-width: 0; }
th, td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(128, 128, 128, 0.25); white-space: normal; word-break: break-word; }
th { font-weight: 700; }

/* 组件：FAQ */
details { margin-bottom: 1.2em; border-bottom: 1px solid rgba(128, 128, 128, 0.2); padding-bottom: 1em; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5em; }
summary::marker { display: none; }
summary::before { content: '+'; position: absolute; left: 0; color: var(--label-color); font-weight: 700; }
details[open] summary::before { content: '−'; }

/* 组件：步骤条 */
.step-list { counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 2.8em; margin-bottom: 1.5em; }
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2em; height: 2em; background: var(--label-color); color: var(--bg-surface);
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 700; font-size: 0.95em;
}

/* 页头页脚 */
header {
  position: sticky; top: 0; z-index: 100; background: var(--bg-surface);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15); backdrop-filter: blur(8px);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.nav-links { display: flex; gap: 1.5em; }
.nav-links a { font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--label-color); }
.footer { padding: 3em 0; border-top: 1px solid rgba(128, 128, 128, 0.15); text-align: center; font-size: 0.9rem; opacity: 0.85; }

/* SVG 视觉面板基类 */
.svg-visual { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.svg-panel { width: 100%; aspect-ratio: 4/3; background: var(--bg-surface); border-radius: var(--radius-card); padding: var(--gap); position: relative; }

/* SVG 动效 Keyframes */
@keyframes dash-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse-opacity { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes flow-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-in 2.5s ease forwards; }
.anim-flow { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: flow-line 4s ease-in-out infinite alternate; }
.anim-float { animation: float-y 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-pulse { animation: pulse-opacity 3s ease-in-out infinite; }
.anim-slide { animation: slide-up 0.8s ease forwards; }

/* 减少动态效果适配 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .step-list li { padding-left: 0; padding-top: 2.5em; }
  .step-list li::before { top: 0; left: 0; }
}
