:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-divider: rgba(25, 21, 35, 0.16);
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid var(--color-divider);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --text-base: 16px;
  --lh-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--text-base); scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  line-height: var(--lh-body);
  color: var(--text-primary, var(--color-text));
  background-color: var(--bg-primary, var(--color-paper));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 取色变量覆盖层 */
.bg-dark {
  --bg-primary: var(--color-dark);
  --text-primary: var(--color-paper);
  --heading-color: var(--color-paper);
  --link-color: var(--color-accent);
  --accent-primary: var(--color-accent);
}
.bg-paper {
  --bg-primary: var(--color-paper);
  --text-primary: var(--color-text);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --accent-primary: var(--color-brand);
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }

/* 排版 */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--heading-color, var(--text-primary)); }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: calc(var(--gap) * 0.6); }
p { margin-bottom: var(--gap); max-width: 38em; }
a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
.text-center { text-align: center; }
.mb-lg { margin-bottom: var(--section-y); }

/* 眉标 */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent-primary); margin-bottom: 0.6rem;
}
.badge::before { content: ""; display: inline-block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; cursor: pointer; border: none;
  transition: transform 0.2s, filter 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 2px; }
.btn-primary { background: var(--accent-primary); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 1.5px solid var(--text-primary); color: var(--text-primary); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(128,128,128,0.08); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 卡片与面板 */
.card {
  background: var(--bg-primary);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.panel {
  background: var(--panel-bg, var(--color-dark));
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.panel.light { --panel-bg: var(--color-paper); --text-primary: var(--color-text); --heading-color: var(--color-text); --link-color: var(--color-brand); --accent-primary: var(--color-brand); }

/* 图文交错布局 */
.split-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--section-y); align-items: center; }
.split-row.reverse .text-col { order: 2; }
.split-row.reverse .visual-col { order: 1; }
@media (max-width: 768px) {
  .split-row { grid-template-columns: 1fr; }
  .split-row.reverse .text-col { order: 1; }
  .split-row.reverse .visual-col { order: 2; }
}

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: var(--card-border); }
th { font-weight: 700; }
td strong { font-weight: 600; color: var(--heading-color); }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: var(--gap); background: var(--bg-primary); }
summary { padding: 16px; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 32px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
details[open] summary::after { content: "-"; }
details .faq-content { padding: 0 16px 16px; color: var(--text-primary); }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-primary); border-bottom: 1px solid var(--divider, var(--color-divider)); backdrop-filter: blur(8px); }
.navbar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--heading-color); text-decoration: none; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-primary); font-weight: 500; }
.nav-links a[aria-current="page"] { color: var(--accent-primary); }
.footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.footer a { color: var(--color-paper); opacity: 0.8; }
.footer a:hover { opacity: 1; }

/* SVG 基础与响应式 */
.svg-illustration { width: 100%; height: auto; display: block; max-width: 100%; }
.svg-illustration path, .svg-illustration circle, .svg-illustration rect { fill: none; stroke: currentColor; stroke-width: 1.5; }
.svg-illustration .fill-solid { fill: currentColor; stroke: none; }
.svg-illustration .stroke-only { stroke: currentColor; stroke-width: 1.5; fill: none; }

/* SVG 动效 Keyframes */
@media (prefers-reduced-motion: no-preference) {
  @keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
  @keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
  @keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
  @keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 0.9; transform: scale(1.15); } }
  @keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  @keyframes dashFlow { to { stroke-dashoffset: -20; } }

  .anim-float { animation: floatY 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-breathe { animation: breathe 4s ease-in-out infinite; }
  .anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 5s ease forwards; }
  .anim-star { animation: twinkle 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  .anim-slide { animation: slideUp 1.2s ease-out forwards; }
  .anim-flow { stroke-dasharray: 10 5; animation: dashFlow 2s linear infinite; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
