:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #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: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: color .2s; }
a:hover { color: #3a0db8; }
ul, ol { list-style: none; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; border-bottom: 1px solid rgba(25,21,35,0.1); }
section:last-of-type { border-bottom: none; }

/* Typography */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: 0; margin-bottom: var(--gap); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-top: calc(var(--section-y) * 0.6); margin-bottom: var(--gap); text-wrap: balance; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.25; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--color-brand); }

.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); }
.section-dark .badge { color: var(--color-accent); }
.section-dark .hl { color: var(--color-accent); }
.section-dark a { color: var(--color-accent); }
.section-dark a:hover { color: #e0ff9e; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 52px; padding: 0 24px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform .2s, opacity .2s; border: none; text-decoration: none; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }
.btn-secondary { background: transparent; border: 1px solid var(--color-text); color: var(--color-text); }
.section-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* Cards & Panels */
.card { background: #fff; border: var(--card-border); border-radius: var(--radius-card); padding: var(--gap); box-shadow: var(--card-shadow); }
.visual-panel { background: var(--color-dark); border-radius: var(--radius-card); padding: 2rem; overflow: hidden; position: relative; min-height: 320px; }
.section-dark .visual-panel { background: #0d091a; }

/* SVG Base */
.svg-anim { width: 100%; height: auto; max-width: 100%; }
.svg-anim path, .svg-anim rect, .svg-anim circle, .svg-anim polygon { fill: none; stroke: currentColor; stroke-width: 1.5; }
.svg-anim .fill-solid { fill: currentColor; stroke: none; }
.svg-anim .stroke-accent { stroke: var(--color-accent); }
.svg-anim .stroke-brand { stroke: var(--color-brand); }
.svg-anim .stroke-paper { stroke: var(--color-paper); }

/* Animations */
@keyframes rotateAlign {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(14deg) scale(1.03); }
  50% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(-14deg) scale(1.03); }
}
@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
.anim-rotate { animation: rotateAlign 10s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: floatBounce 6s ease-in-out infinite; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease forwards; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Layout Utilities */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-sm { margin-top: var(--gap); }
.mb-md { margin-bottom: var(--gap); }

/* Table */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.75rem; border-bottom: 1px solid var(--card-border); text-align: left; vertical-align: top; }
th { font-weight: 600; width: 35%; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 0.75rem; overflow: hidden; }
summary { padding: 1rem; 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; font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { padding: 0 1rem 1rem; color: var(--color-text); line-height: 1.6; }

/* Header & Footer */
header { position: sticky; top: 0; background: rgba(247,245,243,0.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--card-border); z-index: 100; padding: 0.75rem 0; }
.section-dark header { background: rgba(20,14,37,0.95); border-color: rgba(247,245,243,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.logo { width: 24px; height: 24px; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { color: inherit; font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section-dark nav a[aria-current="page"] { color: var(--color-accent); }

footer { padding: var(--section-y) 0; background: var(--color-dark); color: var(--color-paper); border-top: 1px solid rgba(247,245,243,0.1); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: rgba(247,245,243,0.8); }
.footer-links a:hover { color: var(--color-accent); }
.copyright { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid rgba(247,245,243,0.1); text-align: center; font-size: 0.85rem; color: rgba(247,245,243,0.6); }

/* Responsive */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
  nav ul { gap: 1rem; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
