:root {
  --bg-dark: #140E25;
  --bg-paper: #F7F5F3;
  --text-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  color: var(--text-body);
  background: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Layout Utilities */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.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)); }

/* Theme Contexts */
.section {
  padding-block: var(--section-y);
}

.section-dark {
  background: var(--bg-dark);
  color: var(--bg-paper);
}

.section-dark .eyebrow { color: var(--color-accent); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .card {
  background: rgba(247, 245, 243, 0.05);
  border-color: rgba(247, 245, 243, 0.15);
  color: var(--bg-paper);
}
.section-dark th, .section-dark td {
  border-color: rgba(247, 245, 243, 0.15);
}

.section-paper .eyebrow { color: var(--color-brand); }
.section-paper .hl { color: var(--color-brand); }

/* Typography */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  display: block;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 32px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
}

p {
  margin-bottom: 16px;
  max-width: 38em;
}

code {
  background: rgba(25, 21, 35, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--bg-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-body);
  color: var(--text-body);
}

.section-dark .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

/* Cards & Panels */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

th {
  font-weight: 600;
}

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}

summary {
  padding: 16px 24px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.faq-content {
  padding: 16px 24px;
  line-height: 1.6;
}

/* Step Badge */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--color-accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.section-paper .step-badge {
  background: var(--color-brand);
  color: var(--bg-paper);
}

/* Header & Footer */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(25, 21, 35, 0.05);
}

.header-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;
}

.nav {
  display: flex;
  gap: var(--gap);
}

.nav a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-bottom-color: var(--color-brand);
}

.site-footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding: 48px 0;
  border-top: 1px solid rgba(247, 245, 243, 0.1);
}

/* SVG Animations */
.svg-anim {
  width: 100%;
  height: auto;
  overflow: visible;
}

.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease-in-out infinite alternate;
}

.anim-float {
  animation: floatY 6s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-spin-slow {
  animation: spinSlow 12s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-slide-in {
  animation: slideIn 5s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes floatY {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { transform: translateX(-10px); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-float, .anim-spin-slow, .anim-slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .container { padding-inline: 16px; }
}

/* 兜底：裁掉横向溢出 */
div.download-hero {
  overflow-x: clip;
}
