:root {
  /* 配色系统 */
  --bg-dark: #140E25;
  --bg-paper: #FCFCFD;
  --text-main: #191523;
  --brand: #5214EB;
  --accent: #6EEDD2;
  --border-light: rgba(25, 21, 35, 0.12);

  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--text-main);
  --card-shadow: 4px 4px 0 var(--text-main);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 排版 Token */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --body-size: clamp(1rem, 1.1vw, 1.125rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: 1.75;
  color: var(--text-main);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding: var(--section-y) 0; position: relative; }
section:not(.hero):not(.cta) { border-bottom: 1px solid var(--border-light); }
section:last-of-type { border-bottom: none; }

/* 排版组件 */
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: 0; }
h1 { font-size: var(--h1-size); margin-bottom: 1.5rem; }
h2 { font-size: var(--h2-size); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 1rem; }
p { margin-bottom: 1.25rem; max-width: 38em; }
.lead { font-size: 1.1rem; line-height: 1.6; margin-bottom: 2rem; }
.hl { color: var(--brand); }
section.dark-surface .hl { color: var(--accent); }
.subtitle-label {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 0.75rem; color: var(--brand);
}
section.dark-surface .subtitle-label { color: var(--accent); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.875rem 1.75rem; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); cursor: pointer; text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-secondary { background: transparent; border: 2px solid var(--text-main); color: var(--text-main); }
section.dark-surface .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 卡片 */
.card {
  background: var(--bg-paper); border: var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: 1.5rem; margin-bottom: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-light); }
th { font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* FAQ */
details { margin-bottom: 1rem; border: 1px solid var(--border-light); border-radius: var(--radius-card); 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; }
details[open] summary::after { content: '−'; }
details[open] summary { border-bottom: 1px solid var(--border-light); background: rgba(0,0,0,0.02); }
details p { padding: 1rem; margin: 0; }

/* 深色面工具类 */
.dark-surface { background-color: var(--bg-dark); color: var(--bg-paper); }
.dark-surface .card { background: var(--bg-paper); color: var(--text-main); border-color: var(--text-main); }
.dark-surface .hl { color: var(--accent); }
.dark-surface .subtitle-label { color: var(--accent); }

/* 页头与页脚 */
header { position: sticky; top: 0; z-index: 100; background: var(--bg-paper); border-bottom: 1px solid var(--border-light); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding: 1rem var(--gap); max-width: var(--content-max); margin: 0 auto; }
.logo img { height: 32px; width: auto; vertical-align: middle; }
.logo span { margin-left: 0.5rem; font-weight: 700; font-size: 1.1rem; }
nav ul { display: flex; gap: 1.5rem; list-style: none; }
nav a { text-decoration: none; color: var(--text-main); font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
footer { background: var(--bg-dark); color: var(--bg-paper); padding: 3rem 0; margin-top: var(--section-y); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: var(--bg-paper); text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

/* SVG 动效核心样式 */
.hero-svg { width: 100%; height: auto; max-width: 600px; }
.flow-path { offset-path: url(#path-flow); offset-rotate: 0deg; }
.travel-dot { animation: dot-travel 6s linear infinite; }

@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes slide-in-right {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes dot-travel {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

.draw-line {
  stroke-dasharray: 1; stroke-dashoffset: 0;
  animation: dash-flow 4s ease-in-out infinite alternate;
}
.float-bubble { animation: float-up 5s ease-in-out infinite; }
.pulse-dot { animation: pulse-opacity 3s ease-in-out infinite; }
.slide-in { animation: slide-in-right 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@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;
  }
  .travel-dot { display: none; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .nav-inner { flex-direction: column; gap: 1rem; }
  nav ul { flex-wrap: wrap; justify-content: center; }
  .two-col-layout { display: block; }
  .sidebar-toc { position: static; margin-top: 1rem; }
}

/* 兜底：裁掉横向溢出 */
dl,
div.two-col-layout,
#platforms {
  overflow-x: clip;
}
