:root {
  /* 色板 */
  --color-dark: #2D1438;
  --color-paper: #F6F3F7;
  --color-body: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #6EEDA8;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;

  /* 派生变量（取色规则） */
  --text-primary: var(--color-body);
  --text-inverse: var(--color-paper);
  --accent-on-dark: var(--color-accent);
  --brand-on-light: var(--color-brand);
}

/* 基础重置与排版 */
*, *::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, "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* 容器与区块节奏 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.bg-dark { background: var(--color-dark); color: var(--text-inverse); }
.bg-light { background: var(--color-paper); color: var(--text-primary); }

/* 标题系统 */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.bg-light .label { color: var(--brand-on-light); }
.bg-dark .label { color: var(--accent-on-dark); }

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}
h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--brand-on-light); }
.bg-dark .hl { color: var(--accent-on-dark); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--text-inverse);
  border: 1px solid currentColor;
}
.bg-light .btn-secondary { color: var(--text-primary); }
.btn-secondary:hover { transform: translateY(-1px); background: rgba(128,128,128,0.08); }

/* 卡片与网格 */
.card-grid { display: grid; gap: var(--gap); }
@media (min-width: 768px) { .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  background: inherit;
  box-shadow: var(--card-shadow);
}

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 600; }
td:first-child { font-weight: 600; }

/* 列表与徽章 */
.step-list { list-style: none; counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 1.5rem; }
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--color-accent); color: var(--color-dark);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}

/* 问答组件 */
details { border: var(--card-border); border-radius: var(--radius-card); padding: 16px 20px; margin-bottom: 12px; background: inherit; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
summary::after { content: "+"; margin-left: auto; font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { margin-top: 0.75rem; font-size: 0.95rem; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(246, 243, 247, 0.85); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.bg-dark header { background: rgba(45, 20, 56, 0.9); border-bottom-color: rgba(255,255,255,0.08); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: inherit; }
.brand img { height: 28px; width: auto; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { text-decoration: none; color: inherit; font-weight: 500; opacity: 0.8; }
nav a:hover, nav a[aria-current="page"] { opacity: 1; color: var(--brand-on-light); }
.bg-dark nav a { color: var(--text-inverse); }
.bg-dark nav a:hover, .bg-dark nav a[aria-current="page"] { color: var(--accent-on-dark); }
footer { padding: 48px 0; border-top: 1px solid rgba(0,0,0,0.08); text-align: center; color: rgba(128,128,128,0.7); font-size: 0.9rem; }
.bg-dark footer { border-top-color: rgba(255,255,255,0.08); }

/* SVG 动效体系 */
svg.anim-svg { width: 100%; height: auto; max-width: 100%; overflow: visible; }
svg.anim-svg path, svg.anim-svg circle, svg.anim-svg rect, svg.anim-svg ellipse { vector-effect: non-scaling-stroke; }

@keyframes flow-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes breathe-opacity { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes drift-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

.anim-flow { animation: flow-line 4s linear infinite; }
.anim-float { animation: float-y 5s ease-in-out infinite; }
.anim-breathe { animation: breathe-opacity 3s ease-in-out infinite; }
.anim-drift { animation: drift-x 6s ease-in-out infinite; }

/* 减少动态效果支持 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation: none !important;
  }
}
