:root {
  --color-dark: #1B1231;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-white: #FDFBF7;

  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --lh-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }
p { margin-bottom: 1em; max-width: 38em; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* Typography */
h1, h2, h3 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; color: var(--color-text); }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.5em; }
.eyebrow {
  display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 0.5em; color: var(--color-brand);
}
.hl { color: var(--color-brand); }
.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode p, .dark-mode li, .dark-mode td, .dark-mode th { color: var(--color-paper); }
.dark-mode .eyebrow { color: var(--color-accent); }
.dark-mode .hl { color: var(--color-accent); }
.dark-mode .eyebrow, .dark-mode .hl { color: var(--color-accent); }

/* Header & Footer */
header {
  position: sticky; top: 0; z-index: 100; background: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.08); backdrop-filter: blur(8px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-wrap { display: flex; align-items: center; gap: 0.5em; font-weight: 700; font-size: 1.1rem; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: var(--gap); }
nav a { font-weight: 500; padding: 0.5em 0; position: relative; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-links a { display: block; margin-bottom: 0.5em; opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.75em 1.5em;
  font-weight: 600; border-radius: var(--radius-btn); cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease; font-size: 1rem; border: none;
}
.btn:focus-visible { outline: 2px 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(1.1); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-mode .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }

/* Cards & Panels */
.card {
  background: var(--color-paper); border: var(--card-border); border-radius: var(--radius-card);
  padding: var(--gap); box-shadow: var(--card-shadow); position: relative; overflow: hidden;
}
.panel-dark { background: var(--color-dark); border-radius: var(--radius-card); padding: var(--gap); }
.stagger-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.stagger-row.reverse .text-side { order: 2; }
@media (max-width: 768px) {
  .stagger-row { grid-template-columns: 1fr; }
  .stagger-row.reverse .text-side { order: unset; }
}

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1em 0; }
th, td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); overflow-wrap: break-word; word-break: break-word; min-width: 0; }
th { font-weight: 700; }
.dark-mode th, .dark-mode td { border-color: rgba(255,255,255,0.1); }

/* FAQ */
details { margin-bottom: 1em; border: var(--card-border); border-radius: var(--radius-card); padding: var(--gap); background: var(--color-paper); }
summary { 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.2em; font-weight: 400; }
details[open] summary::after { content: "−"; }
details > div { margin-top: 1em; }

/* SVG Base & Animations */
.svg-wrap { width: 100%; height: auto; }
svg { overflow: visible; }
svg path, svg rect, svg circle, svg polyline, svg line {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-path 3s ease forwards; }
.orbit-ring { transform-origin: center; animation: orbit-pulse 6s ease-in-out infinite alternate; }
.bubble { transform-origin: center; animation: float 4s ease-in-out infinite alternate; }
@keyframes draw-path { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes orbit-pulse { 0% { transform: scale(0.95); opacity: 0.7; } 100% { transform: scale(1.05); opacity: 1; } }
@keyframes float { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .draw-line, .orbit-ring, .bubble { animation: none !important; }
}
