:root {
  /* 色板 */
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;

  /* 设计 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-body: 1.55;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section.dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.section.light {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: center;
  flex-wrap: wrap;
}

.flex-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 排版组件 */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 2);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--gap);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) / 2);
}

.light .eyebrow { color: var(--color-brand); }
.dark .eyebrow { color: var(--color-accent); }

.hl { color: var(--color-brand); }
.dark .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
  height: 52px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  border: 1px solid var(--color-text);
  background: transparent;
  color: var(--color-text);
}

.dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}

.dark .card {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel {
  background: var(--color-dark);
  padding: var(--gap);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dark th, .dark td {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

th {
  font-weight: 700;
  background: rgba(0, 0, 0, 0.02);
}

.dark th {
  background: rgba(255, 255, 255, 0.04);
}

/* FAQ */
details {
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: var(--gap);
  padding: 1rem;
  border-radius: var(--radius-card);
}

.dark details {
  border-color: rgba(255, 255, 255, 0.08);
}

summary {
  cursor: pointer;
  font-weight: 700;
  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 { margin-top: var(--gap); opacity: 0.9; }

/* 页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 1rem 0;
  backdrop-filter: blur(8px);
}

.dark header {
  background: var(--color-dark);
  border-color: rgba(255, 255, 255, 0.06);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.nav-link:hover { border-bottom-color: currentColor; }
.nav-link[aria-current="page"] { font-weight: 700; }
.light .nav-link[aria-current="page"] { color: var(--color-brand); border-bottom-color: var(--color-brand); }
.dark .nav-link[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }

footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: var(--section-y);
  font-size: 0.9rem;
  opacity: 0.85;
}

.dark footer { border-top-color: rgba(255, 255, 255, 0.06); }

/* SVG 动效 */
@keyframes node-glow {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

.node {
  animation: node-glow 4s ease-in-out infinite;
}

.d1 { animation-delay: 0s; }
.d2 { animation-delay: 0.4s; }
.d3 { animation-delay: 0.8s; }
.d4 { animation-delay: 1.2s; }
.d5 { animation-delay: 1.6s; }

@keyframes flow-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

.flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flow-line 6s linear infinite;
}

.hero-svg {
  width: 100%;
  height: auto;
  max-width: 520px;
  margin: 0 auto;
}

.hero-svg circle, .hero-svg rect, .hero-svg path {
  transform-box: fill-box;
  transform-origin: center;
}

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-list { gap: 1rem; }
  .hero-layout { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .node { opacity: 1 !important; transform: none !important; }
  .flow { stroke-dashoffset: 0 !important; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
