:root {
  /* 基础色板 */
  --color-dark-bg: #21163C;
  --color-paper-bg: #E9E8EA;
  --color-body-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-paper-text: #F5F4F6;

  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  /* 排版 Token */
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --title-weight: 800;
  --title-ls: -0.02em;
  --title-lh: 1.1;
  --body-lh: 1.55;
}

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
body {
  background: var(--color-paper-bg);
  color: var(--color-body-text);
  line-height: var(--body-lh);
  font-size: 16px;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 容器与布局 */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 主题覆盖：深色面 */
.surface-dark {
  background: var(--color-dark-bg);
  color: var(--color-paper-text);
}
.surface-dark .btn-primary {
  background: var(--color-accent);
  color: var(--color-dark-bg);
}
.surface-dark .btn-secondary {
  border-color: var(--color-paper-text);
  color: var(--color-paper-text);
}
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .badge { color: var(--color-accent); }

/* 主题覆盖：浅色纸面（默认） */
.surface-light {
  background: var(--color-paper-bg);
  color: var(--color-body-text);
}
.surface-light .btn-primary {
  background: var(--color-accent);
  color: var(--color-dark-bg);
}
.surface-light .btn-secondary {
  border-color: var(--color-body-text);
  color: var(--color-body-text);
}
.surface-light .hl { color: var(--color-brand); }
.surface-light .badge { color: var(--color-brand); }

/* 卡片容器（深色面上的浅色卡片） */
.card-panel {
  background: var(--color-paper-bg);
  color: var(--color-body-text);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.card-panel .hl { color: var(--color-brand); }
.card-panel .badge { color: var(--color-brand); }

/* 排版组件 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-ls);
  line-height: var(--title-lh);
  text-wrap: balance;
  margin-bottom: 0.8em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-ls);
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: 0.6em;
}
h3 {
  font-size: 1.25rem;
  font-weight: var(--title-weight);
  letter-spacing: var(--title-ls);
  line-height: 1.2;
  margin-bottom: 0.5em;
}
p { margin-bottom: 1em; max-width: 38em; }
strong { font-weight: 700; }

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper-bg);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: blur(8px);
}
.surface-dark .site-header { background: rgba(33, 22, 60, 0.85); border-color: rgba(245, 244, 246, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.6em; font-weight: 800; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav { display: flex; gap: var(--gap); align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; padding: 0.4em 0.6em; border-radius: 8px; transition: background 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(25, 21, 35, 0.06); }
.surface-dark .nav a:hover, .surface-dark .nav a[aria-current="page"] { background: rgba(245, 244, 246, 0.1); }

/* 按钮 */
.btn-group { display: flex; flex-wrap: wrap; gap: 0.8em; margin: 1.2em 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 52px;
  padding: 0 1.4em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--color-accent); color: var(--color-dark-bg); border: none; }
.btn-secondary { background: transparent; border: 1px solid; }
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark-bg); }

/* 网格与卡片 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.card {
  background: var(--color-paper-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.card-title { font-weight: 700; margin-bottom: 0.4em; }
.card-meta { font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.6em; }
.card p { font-size: 0.95rem; margin-bottom: 0; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.8em 1em;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  text-align: left;
}
.data-table th { font-weight: 700; width: 40%; }
.surface-dark .data-table th, .surface-dark .data-table td { border-color: rgba(245, 244, 246, 0.1); }

/* FAQ */
.faq-item { border-bottom: 1px solid rgba(25, 21, 35, 0.1); padding: 1em 0; }
.surface-dark .faq-item { border-color: rgba(245, 244, 246, 0.1); }
details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-weight: 400; font-size: 1.2em; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 0.6em; font-size: 0.95rem; line-height: 1.6; }

/* 时间轴 */
.timeline { position: relative; padding-left: 2em; border-left: 2px solid rgba(25, 21, 35, 0.15); }
.surface-dark .timeline { border-color: rgba(245, 244, 246, 0.2); }
.timeline-item { position: relative; margin-bottom: 2em; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35em;
  top: 0.3em;
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--color-accent);
}
.timeline-time { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3em; color: var(--color-brand); }
.surface-dark .timeline-time { color: var(--color-accent); }

/* 定义列表 */
.def-list dt { font-weight: 700; margin-bottom: 0.3em; display: flex; align-items: center; gap: 0.5em; }
.def-list dd { margin-bottom: 1.2em; font-size: 0.95rem; opacity: 0.9; }
.def-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* SVG 动效关键帧 */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.6; }
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes dash-draw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes slide-up {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* 动效类应用 */
.orb { animation: orbit-breathe 6s infinite ease-in-out; transform-box: fill-box; transform-origin: center; }
.bubble { animation: bubble-float 4s infinite ease-in-out; animation-delay: var(--delay, 0s); transform-box: fill-box; transform-origin: center; }
.draw-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dash-draw 2.5s infinite linear; }
.slide-el { animation: slide-up 0.8s ease-out forwards; animation-delay: var(--delay, 0s); }
.pulse-dot { animation: pulse-dot 2s infinite ease-in-out; transform-box: fill-box; transform-origin: center; }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 1em 0; }
  .nav { flex-wrap: wrap; justify-content: center; margin-top: 0.8em; }
  h1 { font-size: clamp(1.8rem, 7vw, 3rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
