:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-bg-card: #EAE9F0;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --lh-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-paper);
  line-height: var(--lh-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--gap);
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin-bottom: var(--gap); max-width: 38em; }

a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark .hl { color: var(--color-accent); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* Header & Nav */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--color-text); }
.logo img { height: 32px; width: auto; }
nav { display: flex; align-items: center; gap: var(--gap); }
nav a { font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px; border-radius: var(--radius-btn);
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: transform 0.2s, opacity 0.2s;
  border: none; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-text); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
.dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

/* Cards */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.card-on-dark { background: var(--color-paper); color: var(--color-text); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 700; }

/* FAQ */
details { margin-bottom: var(--gap); background: var(--color-bg-card); border-radius: var(--radius-card); padding: var(--gap); }
summary { 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.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: var(--gap); font-size: 0.95em; }

/* SVG & Animation Base */
svg { width: 100%; height: auto; overflow: visible; }
svg circle, svg rect, svg path, svg polygon { transform-box: fill-box; transform-origin: center; }
.draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawAnim 3s ease-in-out infinite alternate; }
@keyframes drawAnim { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.float { animation: floatAnim 4s ease-in-out infinite alternate; }
@keyframes floatAnim { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.breathe { animation: breatheAnim 1.5s ease-in-out infinite; }
@keyframes breatheAnim { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.node-light { animation: nodePulse 3s ease-in-out infinite; }
@keyframes nodePulse { 0%, 100% { opacity: 0.3; r: 4; } 50% { opacity: 1; r: 6; fill: var(--color-accent); } }
.grid-node:nth-child(1) { animation-delay: 0s; }
.grid-node:nth-child(2) { animation-delay: 0.4s; }
.grid-node:nth-child(3) { animation-delay: 0.8s; }
.grid-node:nth-child(4) { animation-delay: 1.2s; }
.grid-node:nth-child(5) { animation-delay: 1.6s; }
.grid-node:nth-child(6) { animation-delay: 2.0s; }

@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, .float, .breathe, .node-light { animation: none !important; }
}

/* Utilities */
.text-center { text-align: center; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: var(--gap); }
.mt-lg { margin-top: calc(var(--section-y) * 1.5); }
.mb-md { margin-bottom: var(--gap); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.85rem;
}
.dark .badge { background: var(--color-accent); color: var(--color-dark); }
.section-label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 0.5rem; color: var(--color-brand);
}
.dark .section-label { color: var(--color-accent); }
.dark-section { background: var(--color-dark); color: var(--color-paper); }
.dark-section .hl { color: var(--color-accent); }
.dark-section a { color: var(--color-accent); }
.dark-section .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.dark-section .card-on-dark { background: var(--color-paper); color: var(--color-text); }
.dark-section table th, .dark-section table td { border-bottom-color: rgba(244, 243, 247, 0.15); }
.dark-section details { background: #2D244A; }
.dark-section details p { color: var(--color-paper); }
.dark-section summary { color: var(--color-paper); }
.dark-section summary::after { color: var(--color-accent); }
.dark-section .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.dark-section .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-section a { color: var(--color-accent); }
.dark-section .hl { color: var(--color-accent); }
.dark-section .section-label { color: var(--color-accent); }
.dark-section .badge { background: var(--color-accent); color: var(--color-dark); }
.dark-section table th { color: var(--color-paper); }
.dark-section table td { color: var(--color-paper); }

/* Responsive tweaks */
@media (max-width: 768px) {
  header .container { flex-direction: column; height: auto; padding: 12px 0; gap: 8px; }
  nav { flex-wrap: wrap; justify-content: center; }
  .hero-grid { flex-direction: column; }
  .feature-row { flex-direction: column; }
}
