/* === 设计 Token 与基础变量 === */
:root {
  --c-dark: #251943;
  --c-paper: #DBD4ED;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED6E89;
  --r-card: 0;
  --r-btn: 0;
  --c-border: 1px solid rgba(25, 21, 35, 0.16);
  --c-shadow: none;
  --sec-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --max-w: 1120px;
  --lh-body: 1.75;
  --lh-title: 1.1;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === 面层级取色变量 === */
.section-dark {
  --bg: var(--c-dark);
  --fg: var(--c-paper);
  --hl: var(--c-accent);
  --overline: var(--c-accent);
  --link: var(--c-accent);
  --icon: var(--c-accent);
  --btn-text: var(--c-dark);
}
.section-paper {
  --bg: var(--c-paper);
  --fg: var(--c-text);
  --hl: var(--c-brand);
  --overline: var(--c-brand);
  --link: var(--c-brand);
  --icon: var(--c-brand);
  --btn-text: var(--c-text);
}
/* 深色块内的浅色卡片恢复纸面取色 */
.card-light {
  --bg: var(--c-paper);
  --fg: var(--c-text);
  --hl: var(--c-brand);
  --overline: var(--c-brand);
  --link: var(--c-brand);
  --icon: var(--c-brand);
}

/* === 全局重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--c-paper);
  color: var(--c-text);
  line-height: var(--lh-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { line-height: var(--lh-title); letter-spacing: -0.02em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* === 布局容器 === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--sec-y) 0; }
.flex-row { display: flex; gap: var(--gap); align-items: stretch; }
@media (max-width: 900px) { .flex-row { flex-direction: column; } }

/* === 组件：按钮 === */
.btn-group { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0 1.5rem; height: 52px; font-size: 1rem; font-weight: 600;
  border: none; cursor: pointer; text-decoration: none;
  background: var(--c-accent); color: var(--btn-text);
  border-radius: var(--r-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-secondary { background: transparent; border: 1px solid var(--fg); color: var(--fg); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* === 组件：卡片 === */
.card {
  background: var(--bg); border: var(--c-border); box-shadow: var(--c-shadow);
  padding: 1.5rem; border-radius: var(--r-card);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.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); }

/* === 组件：表格 === */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: var(--c-border); }
th { font-weight: 700; }
td:first-child { width: 35%; }

/* === 组件：FAQ === */
details { margin-bottom: 0.5rem; }
details summary {
  cursor: pointer; font-weight: 600; padding: 1rem 0; border-bottom: var(--c-border);
  list-style: none; position: relative;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; position: absolute; right: 0; font-weight: 400; }
details[open] summary::after { content: "−"; }
details[open] summary { margin-bottom: 0.5rem; border-bottom: none; }
details p { padding-top: 0.5rem; }

/* === 组件：眉标与高亮 === */
.overline { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; color: var(--overline); margin-bottom: 0.75rem; }
.hl { color: var(--hl); }

/* === SVG 基础 === */
.svg-panel { width: 100%; height: auto; max-width: 100%; overflow: hidden; }
.svg-panel svg { width: 100%; height: auto; display: block; }

/* === SVG 动效关键帧 === */
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rotate-slow { to { transform: rotate(360deg); } }
@keyframes dash-flow { 0% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0.3; } 100% { stroke-dashoffset: 1; } }
@keyframes fade-slide { 0% { opacity: 0; transform: translateX(12px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 4s ease forwards; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-rotate { animation: rotate-slow 18s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-dash-flow { stroke-dasharray: 0.15 0.85; stroke-dashoffset: 0; animation: dash-flow 2.5s linear infinite; }
.anim-fade { animation: fade-slide 1.5s ease forwards; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }

/* === 减少动态效果 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* === 页头与页脚 === */
header { position: sticky; top: 0; z-index: 100; background: var(--c-paper); border-bottom: var(--c-border); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--c-text); text-decoration: none; font-weight: 500; }
nav a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
footer { background: var(--c-dark); color: var(--c-paper); padding: var(--sec-y) 0; }
.footer-inner { display: flex; flex-direction: column; gap: 1.5rem; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--c-accent); text-decoration: none; }
.footer-copy { font-size: 0.85rem; opacity: 0.8; }
@media (max-width: 600px) { .nav-inner { flex-direction: column; gap: 1rem; height: auto; padding: 1rem 0; } }
