:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --body-size: 1rem;
  --line-height: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--font-sans); background: var(--color-paper); color: var(--color-body); line-height: var(--line-height); font-size: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); width: 100%; }
section { padding-block: var(--section-y); }

/* 表面色控制 */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark h2, .surface-dark h3, .surface-dark p, .surface-dark li, .surface-dark td, .surface-dark th { color: var(--color-paper); }
.surface-dark .hl, .surface-dark .badge, .surface-dark a:not(.btn) { color: var(--color-accent); }
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-dark .btn-secondary:hover { background: rgba(200, 237, 110, 0.1); }
.surface-dark table { border-color: rgba(247, 245, 243, 0.1); }
.surface-dark details { border-color: rgba(247, 245, 243, 0.15); }
.surface-dark .card { background: var(--color-dark); border: 1px solid rgba(247, 245, 243, 0.1); box-shadow: none; }
.surface-dark .card:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.card-light { background: var(--color-paper); color: var(--color-body); }
.card-light h2, .card-light h3, .card-light p, .card-light li, .card-light td, .card-light th { color: var(--color-body); }
.card-light .hl, .card-light .badge, .card-light a:not(.btn) { color: var(--color-brand); }
.card-light .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.card-light .btn-secondary { border-color: var(--color-body); color: var(--color-body); }
.card-light table { border-color: rgba(25, 21, 35, 0.1); }
.card-light details { border-color: rgba(25, 21, 35, 0.1); }

/* 排版 */
h1 { font-size: var(--h1-size); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: var(--gap); }
h2 { font-size: var(--h2-size); font-weight: 600; line-height: 1.25; margin-bottom: calc(var(--gap) * 0.75); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 600; line-height: 1.3; margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
ul, ol { margin-bottom: var(--gap); padding-left: 1.5em; }
li { margin-bottom: 0.5em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 0.5rem; color: var(--color-brand); }
.hl { color: var(--color-brand); }

/* 按钮 */
.btn-group { display: flex; gap: var(--gap); flex-wrap: wrap; margin-bottom: var(--gap); }
.btn { display: inline-flex; align-items: center; justify-content: 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; border: none; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary { background: transparent; border: 2px solid var(--color-body); color: var(--color-body); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(25, 21, 35, 0.05); }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* 网格与卡片 */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.card { background: var(--color-paper); border-radius: var(--radius-card); padding: var(--gap); box-shadow: var(--card-shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); table-layout: fixed; }
td, th { word-break: break-word; overflow-wrap: anywhere; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 600; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid rgba(25, 21, 35, 0.1); border-radius: var(--radius-card); 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; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 20px 16px; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(247, 245, 243, 0.95); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(25, 21, 35, 0.08); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo img { height: 32px; width: auto; display: block; }
nav { display: flex; align-items: center; }
nav a { margin-left: 24px; text-decoration: none; color: var(--color-body); font-weight: 500; font-size: 0.95rem; }
nav a[aria-current="page"], nav a:hover { color: var(--color-brand); }
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(25, 21, 35, 0.08); margin-top: auto; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); }
.footer-links a { display: block; margin-bottom: 8px; text-decoration: none; color: var(--color-body); font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-brand); }

/* SVG 基础 */
svg { width: 100%; height: auto; max-width: 100%; overflow: visible; }

/* 动效关键帧 */
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes float-bubble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe-dot { 0%, 100% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 1; } }
@keyframes slide-in { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 动效类 */
.anim-star { animation: twinkle 3s ease-in-out infinite; }
.anim-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 2s ease forwards; }
.anim-bubble { animation: float-bubble 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-dot { animation: breathe-dot 2.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-slide { animation: slide-in 1.5s ease-out 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-inner { flex-direction: column; height: auto; padding: 12px 0; }
  nav { margin-top: 12px; flex-wrap: wrap; justify-content: center; }
  nav a { margin: 0 8px; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
}

/* 兜底：裁掉横向溢出 */
div {
  overflow-x: clip;
}
