:root {
  --c-dark: #10112D;
  --c-paper: #F5F0E5;
  --c-body: #151523;
  --c-brand: #1416EB;
  --c-accent: #89ED6E;
  --c-border: rgba(21, 21, 35, 0.16);
  --c-border-light: rgba(255, 255, 255, 0.12);

  --r-card: 24px;
  --r-btn: 999px;
  --sec-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --max-w: 960px;

  --font-main: "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-family: var(--font-main); line-height: 1.65; color: var(--c-body); background: var(--c-paper); }
body { min-height: 100vh; display: flex; flex-direction: column; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 表面层取色规则 */
.surface-paper { background: var(--c-paper); color: var(--c-body); }
.surface-dark { background: var(--c-dark); color: var(--c-paper); }
.surface-dark .hl { color: var(--c-accent); }
.surface-dark .badge { color: var(--c-accent); }
.surface-dark a.link { color: var(--c-accent); text-decoration: underline; text-underline-offset: 4px; }
.surface-paper .hl { color: var(--c-brand); }
.surface-paper .badge { color: var(--c-brand); }
.surface-paper a.link { color: var(--c-brand); text-decoration: underline; text-underline-offset: 4px; }

/* 深色面内的浅色卡片恢复纸面取色 */
.surface-dark .card { background: var(--c-paper); color: var(--c-body); border: 1px solid var(--c-border); border-radius: var(--r-card); }
.surface-dark .card .badge { color: var(--c-brand); }
.surface-dark .card a.link { color: var(--c-brand); }

/* 布局容器 */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--sec-y); padding-bottom: var(--sec-y); }

/* 排版 */
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; line-height: 1.15; letter-spacing: 0.02em; margin-bottom: 1.5rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.25; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.5rem; }
.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-sm { gap: 8px; }
.mt-lg { margin-top: 2rem; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 52px; padding: 0 24px; border-radius: var(--r-btn); font-weight: 600; font-size: 1rem; cursor: pointer; border: none; transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-secondary { background: transparent; border: 1px solid currentColor; color: inherit; }
.surface-paper .btn-secondary { border-color: var(--c-body); color: var(--c-body); }
.surface-dark .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

/* 网格与卡片 */
.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); }
.card { padding: var(--gap); border-radius: var(--r-card); }
.card-icon { width: 40px; height: 40px; margin-bottom: 12px; color: var(--c-brand); }
.surface-dark .card-icon { color: var(--c-accent); }

/* 表格 */
.table-wrap { overflow-x: auto; margin: var(--gap) 0; border-radius: 12px; border: 1px solid var(--c-border); }
.surface-dark .table-wrap { border-color: var(--c-border-light); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { font-weight: 600; white-space: nowrap; }
td { white-space: nowrap; }
.surface-dark table { border-color: var(--c-border-light); }
.surface-dark th, .surface-dark td { color: var(--c-paper); }

/* FAQ */
details { margin-bottom: 1rem; border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
summary { padding: 16px 20px; 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.2rem; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 20px 16px; margin: 0; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(245, 240, 229, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; }
nav ul { display: flex; gap: 24px; }
nav a { font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
footer { border-top: 1px solid var(--c-border); padding: 48px 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; gap: 24px; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 0.9rem; opacity: 0.8; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* SVG 动效系统 */
.svg-visual { width: 100%; max-width: 520px; aspect-ratio: 4/3; position: relative; }
.svg-visual svg { width: 100%; height: 100%; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw-line { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
.anim-draw.active { animation: draw-line 4s ease-in-out infinite alternate; }

.anim-rotate { transform-box: fill-box; transform-origin: center; }
@keyframes rotate-assemble { 0%, 100% { transform: rotate(0deg) scale(0.92); opacity: 0.6; } 50% { transform: rotate(180deg) scale(1.05); opacity: 1; } }
.anim-rotate.slow { animation: rotate-assemble 14s linear infinite alternate; }
.anim-rotate.fast { animation: rotate-assemble 9s linear infinite alternate-reverse; }

.anim-float { transform-box: fill-box; transform-origin: center; }
@keyframes float-bubble { 0%, 100% { transform: translateY(0); opacity: 0.8; } 50% { transform: translateY(-6px); opacity: 1; } }
.anim-float.d1 { animation: float-bubble 4s ease-in-out infinite 0.5s; }
.anim-float.d2 { animation: float-bubble 5s ease-in-out infinite 1.8s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-draw, .anim-rotate, .anim-float { animation: none !important; opacity: 1 !important; transform: none !important; }
}
