:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --color-white: #FFFFFF;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;
  --font-main: 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-main); background-color: var(--color-paper); color: var(--color-text); line-height: 1.65; font-size: 16px; }
img, svg { display: block; max-width: 100%; }
a { color: var(--color-brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.hero-layout { display: flex; flex-direction: row; gap: var(--gap); align-items: center; }
@media (max-width: 768px) { .hero-layout { flex-direction: column-reverse; } }

/* Typography */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: calc(var(--section-y) / 2); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5rem; color: var(--color-brand); }
.section-dark .eyebrow { color: #6FCF57; }
.hl { color: var(--color-brand); }
.section-dark .hl { color: #6FCF57; }

/* Components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0 1.5rem; height: 52px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s; border: none; }
.btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.btn-secondary:hover { background-color: rgba(23, 21, 35, 0.05); }
.section-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.section-dark .btn-secondary:hover { background-color: rgba(247, 245, 243, 0.1); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.card { background: var(--color-white); border-radius: var(--radius-card); box-shadow: var(--card-shadow); padding: var(--gap); border: var(--card-border); transition: transform 0.2s, box-shadow 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -16px rgba(23, 21, 35, 0.35); }
.card-light { background: var(--color-paper); color: var(--color-text); }
.section-dark .card-light { background: var(--color-paper); color: var(--color-text); }
.section-dark .card-light .hl { color: var(--color-brand); }
.section-dark .card-light a { color: var(--color-brand); }

.badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background-color: var(--color-accent); color: var(--color-dark); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.step-list { list-style: none; counter-reset: step; }
.step-list li { position: relative; padding-left: 3rem; margin-bottom: 1.5rem; }
.step-list li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; background: var(--color-accent); color: var(--color-dark); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }

table { width: 100%; min-width: 0; border-collapse: collapse; margin: 1.5rem 0; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(23, 21, 35, 0.1); text-align: left; vertical-align: top; overflow-wrap: break-word; }
th { font-weight: 700; }
.section-dark th, .section-dark td { border-bottom-color: rgba(247, 245, 243, 0.15); }

details { margin-bottom: 1rem; border: 1px solid rgba(23, 21, 35, 0.1); border-radius: 12px; overflow: hidden; }
.section-dark details { border-color: rgba(247, 245, 243, 0.2); }
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: 300; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 1rem 1rem; }

/* Header & Footer */
header { position: sticky; top: 0; z-index: 50; background: rgba(247, 245, 243, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(23, 21, 35, 0.05); }
.section-dark header { background: rgba(19, 16, 45, 0.9); border-bottom-color: rgba(247, 245, 243, 0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 800; font-size: 1.2rem; color: inherit; }
.logo img { height: 32px; width: auto; }
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); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { margin-bottom: 1rem; color: var(--color-accent); }
.footer-col ul { list-style: none; }
.footer-col a { color: rgba(247, 245, 243, 0.8); display: block; margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--color-accent); }

/* SVG Panel Base */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }
.float-y { animation: floatY 5s ease-in-out infinite; }
.pulse-op { animation: pulseOp 4s ease-in-out infinite; }
.slide-in { animation: slideIn 6s ease-in-out infinite; }
.rotate-slow { animation: rotateSlow 12s linear infinite; transform-box: fill-box; transform-origin: center; }

@keyframes drawDash { 0%, 100% { stroke-dashoffset: 1; } 50% { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulseOp { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes slideIn { 0%, 100% { transform: translateX(0); opacity: 0.8; } 50% { transform: translateX(12px); opacity: 1; } }
@keyframes rotateSlow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Apply animations to classes */
.draw-line { animation: drawDash 4s ease-in-out infinite; }
.float-y { animation: floatY 5s ease-in-out infinite; }
.pulse-op { animation: pulseOp 4s ease-in-out infinite; }
.slide-in { animation: slideIn 6s ease-in-out infinite; }
.rotate-slow { animation: rotateSlow 12s linear infinite; }

@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; }
  .draw-line, .float-y, .pulse-op, .slide-in, .rotate-slow { animation: none !important; }
}

/* 兜底：裁掉横向溢出 */
section.container,
div.grid-2 {
  overflow-x: clip;
}
