/* === 设计 Token 与变量 === */
:root {
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --line-h: 1.75;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* 基础色板 */
  --bg-dark: #140E25;
  --bg-paper: #F5F0E5;
  --text-main: #191523;
  --text-light: #F5F0E5;
  --brand: #5214EB;
  --accent: #C8ED6E;
}

/* === 表面层颜色覆盖 === */
.bg-dark {
  --bg-surface: var(--bg-dark);
  --text-primary: var(--text-light);
  --text-secondary: #D1CCE0;
  --brand-color: var(--accent);
  --accent-color: var(--accent);
  --border-color: rgba(245, 240, 229, 0.12);
}
.bg-paper {
  --bg-surface: var(--bg-paper);
  --text-primary: var(--text-main);
  --text-secondary: #4A4558;
  --brand-color: var(--brand);
  --accent-color: var(--accent);
  --border-color: rgba(25, 21, 35, 0.16);
}
.card-light {
  --bg-surface: var(--bg-paper);
  --text-primary: var(--text-main);
  --text-secondary: #4A4558;
  --brand-color: var(--brand);
  --accent-color: var(--accent);
  --border-color: rgba(25, 21, 35, 0.16);
}

/* === 基础重置与排版 === */
*, *::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);
  font-size: 16px;
  line-height: var(--line-h);
  color: var(--text-primary);
  background-color: var(--bg-paper);
  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);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}
.section:last-child { border-bottom: 1px solid var(--border-color); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* === 标题与文本 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--brand-color);
  margin-bottom: 0.5em;
}
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; color: var(--text-primary); }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.8em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.6em; }
p { margin-bottom: 1em; max-width: 38em; color: var(--text-secondary); }
.hl { color: var(--brand-color); }
.bg-dark .hl { color: var(--accent-color); }

/* === 导航与页头 === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 229, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}
.bg-dark header { background-color: rgba(20, 14, 37, 0.9); }
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 1.5rem; }
nav a { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand-color); }
.bg-dark nav a { color: var(--text-light); }
.bg-dark nav a:hover, .bg-dark nav a[aria-current="page"] { color: var(--accent-color); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}
.btn-primary:hover { transform: translateY(-1px); background-color: #B8DC5E; }
.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}
.bg-dark .btn-secondary { color: var(--text-light); border-color: var(--text-light); }
.btn-secondary:hover { background-color: rgba(25, 21, 35, 0.05); }
.bg-dark .btn-secondary:hover { background-color: rgba(245, 240, 229, 0.08); }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* === 卡片与面板 === */
.card {
  background-color: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.panel-dark {
  background-color: var(--bg-dark);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* === 表格 === */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 320px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { font-weight: 600; color: var(--text-primary); }
td { color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }

/* === 流程条 === */
.flow-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.flow-node { flex: 1; min-width: 200px; }
.flow-arrow { width: 24px; height: 24px; stroke: var(--brand-color); flex-shrink: 0; }

/* === FAQ === */
details {
  background-color: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  overflow: hidden;
}
summary {
  padding: 1rem 1.25rem;
  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.25rem; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.25rem 1rem; margin-bottom: 0; }

/* === 时间线 === */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: "";
  position: absolute; left: 0.5rem; top: 0; bottom: 0;
  width: 2px; background-color: var(--border-color);
}
.step { position: relative; margin-bottom: 2rem; }
.step::before {
  content: attr(data-step);
  position: absolute; left: -2rem; top: 0;
  width: 1.5rem; height: 1.5rem;
  background-color: var(--accent-color);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}

/* === 响应式 === */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .flow-row { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
  nav ul { display: none; } /* 简化移动端导航，实际项目可加汉堡菜单 */
}

/* === SVG 动效核心规则 === */
.svg-anim { width: 100%; height: auto; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 4s ease-in-out infinite;
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.bubble-float {
  animation: floatY 4s ease-in-out infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.dot-breathe {
  animation: breathe 1.5s ease-in-out infinite;
}
.dot-breathe:nth-child(2) { animation-delay: 0.2s; }
.dot-breathe:nth-child(3) { animation-delay: 0.4s; }
@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
.node-light {
  animation: nodeGlow 3s ease-in-out infinite;
}
.node-light:nth-child(1) { animation-delay: 0s; }
.node-light:nth-child(2) { animation-delay: 0.3s; }
.node-light:nth-child(3) { animation-delay: 0.6s; }
.node-light:nth-child(4) { animation-delay: 0.9s; }
.node-light:nth-child(5) { animation-delay: 1.2s; }
.node-light:nth-child(6) { animation-delay: 1.5s; }
@keyframes nodeGlow {
  0%, 100% { fill: rgba(200, 237, 110, 0.1); }
  50% { fill: var(--accent-color); }
}
.slide-in {
  animation: slideIn 5s ease-in-out infinite alternate;
}
@keyframes slideIn {
  0% { transform: translateX(0); opacity: 0.8; }
  100% { transform: translateX(12px); opacity: 1; }
}

/* === 减少动态效果 === */
@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-line, .bubble-float, .dot-breathe, .node-light, .slide-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
