:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  
  --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: 1280px;
  
  --font-body: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --line-height-base: 1.65;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-base);
  font-size: 16px;
  overflow-x: hidden;
}

/* Layout Utilities */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.grid-auto {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* Typography */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}
.section-dark .label { color: var(--color-accent); }
.section-dark .hl { color: var(--color-accent); }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 calc(var(--gap) * 0.75) 0;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 1rem 0; max-width: 38em; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s ease; }
.section-dark a { color: var(--color-accent); }
a:hover { opacity: 0.85; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 2px; }
.section-dark a:focus-visible { outline-color: var(--color-accent); }

.hl { color: var(--color-brand); font-weight: 800; }
.section-dark .hl { color: var(--color-accent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding-inline: 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(137, 237, 110, 0.4); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.section-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { transform: translateY(-2px); background-color: rgba(23, 21, 35, 0.05); }
.section-dark .btn-secondary:hover { background-color: rgba(247, 245, 243, 0.1); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Cards */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.section-dark .card { background: var(--color-dark); color: var(--color-paper); }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.4); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--gap); }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); }
th { font-weight: 700; background: rgba(23, 21, 35, 0.03); }
.section-dark th, .section-dark td { border-bottom-color: rgba(247, 245, 243, 0.15); }
.section-dark th { background: rgba(247, 245, 243, 0.05); }

/* FAQ / Details */
details {
  background: var(--color-paper);
  border: 1px solid rgba(23, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}
.section-dark details { background: var(--color-dark); border-color: rgba(247, 245, 243, 0.15); }
details[open] { box-shadow: var(--card-shadow); }
summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  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; transition: transform 0.2s ease; }
details[open] summary::after { transform: rotate(45deg); }
.summary-content { padding: 0 20px 16px 20px; }

/* Lists */
ul, ol { padding-left: 1.5rem; margin: 0 0 1rem 0; }
li { margin-bottom: 0.5rem; }
.step-list { counter-reset: step; list-style: none; padding-left: 0; }
.step-list li { position: relative; padding-left: 2.5rem; margin-bottom: 1.25rem; }
.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 28px; height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  display: grid; place-items: center;
}
.section-dark .step-list li::before { background: var(--color-accent); }

/* Sections & Color Contexts */
.section-dark { background-color: var(--color-dark); color: var(--color-paper); }
.section-dark .card { background: var(--color-paper); color: var(--color-text); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .btn-primary { background-color: var(--color-accent); color: var(--color-dark); }
.section-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

.section-header { margin-bottom: calc(var(--gap) * 1.5); }
.section-header p { margin-top: 0.5rem; opacity: 0.85; }

/* SVG Container */
.svg-visual { width: 100%; height: auto; max-width: 600px; margin: 0 auto; }
.svg-visual svg { width: 100%; height: auto; display: block; }

/* Header & Footer */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 243, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(23, 21, 35, 0.08);
  padding: 12px 0;
}
.section-dark .site-header { background: rgba(19, 16, 45, 0.9); border-bottom-color: rgba(247, 245, 243, 0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: inherit; text-decoration: none; }
.logo img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.section-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }
.footer { padding: 48px 0 24px 0; border-top: 1px solid rgba(23, 21, 35, 0.1); margin-top: 64px; }
.section-dark .footer { border-top-color: rgba(247, 245, 243, 0.1); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; opacity: 0.8; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 0.9rem; opacity: 0.8; }
.footer-col a:hover { opacity: 1; }
.copyright { font-size: 0.85rem; opacity: 0.6; text-align: center; }

/* SVG Animations */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease-in-out infinite;
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.anim-flow {
  pathLength: 1;
  stroke-dasharray: 0.15 0.85;
  stroke-dashoffset: 0;
  animation: flowPath 3s linear infinite;
}
@keyframes flowPath {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -1; }
}

.anim-float {
  animation: floatUp 5s ease-in-out infinite;
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.anim-slide {
  animation: slideIn 6s ease-in-out infinite;
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(12px); opacity: 0.8; }
  60% { transform: translateX(-12px); opacity: 0.8; }
}

.anim-pulse-dot {
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { r: 3; opacity: 0.6; }
  50% { r: 5; opacity: 1; }
}

/* 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;
  }
  .anim-draw, .anim-flow, .anim-float, .anim-breathe, .anim-slide, .anim-pulse-dot {
    animation: none !important;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .hero-layout { flex-direction: column; }
  .scenario-layout { flex-direction: column; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}
