/* === Design Tokens & Reset === */
:root {
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-body: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-title-lh: 1.25;
  --font-body-lh: 1.55;
  --font-title-weight: 600;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--color-paper);
  color: var(--color-body);
  line-height: var(--font-body-lh);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === Surface Contexts === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }

.surface-dark { background-color: var(--color-dark); color: var(--color-paper); }
.surface-dark h1, .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 a:not(.btn), .surface-dark .badge, .surface-dark summary { 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-paper { background-color: var(--color-paper); color: var(--color-body); }
.surface-paper h1, .surface-paper h2, .surface-paper h3, .surface-paper p, .surface-paper li, .surface-paper td, .surface-paper th { color: var(--color-body); }
.surface-paper .hl, .surface-paper a:not(.btn), .surface-paper .badge, .surface-paper summary { color: var(--color-brand); }
.surface-paper .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-paper .btn-secondary { border-color: var(--color-body); color: var(--color-body); }

/* === Typography === */
h1, h2, h3 { font-weight: var(--font-title-weight); line-height: var(--font-title-lh); letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: calc(var(--gap) * 2); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: var(--gap); }
p { margin-bottom: var(--gap); max-width: 38em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: calc(var(--gap) / 2); }
.hl { font-weight: 700; }

/* === Layout Helpers === */
.grid-2 { display: grid; gap: var(--gap); }
@media(min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 52px; padding: 0 24px; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* === Cards & Panels === */
.card {
  background: var(--color-paper); border: var(--card-border);
  padding: var(--gap); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}
.surface-dark .card { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: var(--color-paper); }
.panel {
  background: var(--color-dark); padding: calc(var(--gap) * 2);
  border-radius: var(--radius-card); position: relative; overflow: hidden;
}
.surface-dark .panel { background: rgba(0,0,0,0.3); }

/* === Tables === */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: calc(var(--gap) * 0.75); border-bottom: var(--card-border); text-align: left; vertical-align: top; }
th { font-weight: 600; }

/* === FAQ Details === */
details { border-bottom: var(--card-border); padding: var(--gap) 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 1.5em; }
summary::before { content: "+"; position: absolute; left: 0; top: 0; transition: transform 0.2s; }
details[open] summary::before { transform: rotate(45deg); }
details p { margin-top: var(--gap); max-width: 100%; }

/* === Header & Footer === */
header { position: sticky; top: 0; z-index: 100; background: var(--color-paper); border-bottom: 1px solid var(--card-border); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.nav-links { display: flex; gap: calc(var(--gap) * 2); }
.nav-links a { font-weight: 500; }
.nav-links a[aria-current="page"] { font-weight: 700; color: var(--color-brand); }
footer { padding-block: var(--section-y); border-top: var(--card-border); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }

/* === SVG Illustrations & Animations === */
.svg-illustration { width: 100%; height: auto; }
.svg-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

@keyframes orbit-breathe-1 { 0%, 100% { transform: scale(1); opacity: 0.4; } 50% { transform: scale(1.05); opacity: 0.7; } }
@keyframes orbit-breathe-2 { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(0.96); opacity: 0.3; } }
@keyframes orbit-breathe-3 { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.08); opacity: 0.8; } }
.svg-orbit-1 { animation: orbit-breathe-1 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.svg-orbit-2 { animation: orbit-breathe-2 8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.svg-orbit-3 { animation: orbit-breathe-3 10s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }

@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.svg-path-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-line 4s linear infinite alternate; }

/* === Accessibility & Reduced Motion === */
@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; }
}
