/* === 设计变量 === */
:root {
  --color-deep: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;
  --text-rgb: 21, 24, 35;
  --paper-rgb: 252, 252, 253;

  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(var(--text-rgb), 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;

  /* 默认纸面取色 */
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --text-muted: rgba(var(--text-rgb), 0.6);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --accent-highlight: var(--color-brand);
  --border-color: rgba(var(--text-rgb), 0.12);
  --shadow-color: rgba(var(--text-rgb), 0.3);
}

/* 深色面取色覆盖 */
.bg-deep {
  --bg-surface: var(--color-deep);
  --text-primary: var(--color-paper);
  --text-secondary: var(--color-paper);
  --text-muted: rgba(var(--paper-rgb), 0.7);
  --heading-color: var(--color-paper);
  --link-color: var(--color-accent);
  --accent-highlight: var(--color-accent);
  --border-color: rgba(var(--paper-rgb), 0.15);
  --shadow-color: rgba(var(--paper-rgb), 0.2);
}

/* 卡片内部恢复纸面取色 */
.card {
  --bg-surface: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: var(--color-text);
  --text-muted: rgba(var(--text-rgb), 0.6);
  --heading-color: var(--color-text);
  --link-color: var(--color-brand);
  --accent-highlight: var(--color-brand);
  --border-color: rgba(var(--text-rgb), 0.12);
  --shadow-color: rgba(var(--text-rgb), 0.3);
}

/* === 基础排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg-surface);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link-color); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
:focus-visible { outline: 2px solid var(--link-color); outline-offset: 2px; border-radius: 2px; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* === 区块与分节 === */
.section {
  padding-block: var(--section-y);
  background: var(--bg-surface);
  position: relative;
}
.section-divider {
  border-top: 1px solid var(--border-color);
  margin-block: var(--section-y);
}
.section-header {
  margin-bottom: var(--gap);
}
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-highlight);
  margin-bottom: 0.5em;
  text-transform: uppercase;
}
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading-color);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--heading-color);
  margin-bottom: 0.6em;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading-color);
  margin-bottom: 0.5em;
}
p { margin-bottom: 1em; max-width: 38em; }
.text-muted { color: var(--text-muted); font-size: 0.95em; }
.hl { color: var(--accent-highlight); font-weight: 600; }

/* === 按钮 === */
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5em; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
  border: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-deep);
}
.btn-primary:hover { background: #5ddfb0; transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
}
.bg-deep .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: rgba(var(--text-rgb), 0.05); transform: translateY(-1px); }
.bg-deep .btn-secondary:hover { background: rgba(var(--paper-rgb), 0.1); }

/* === 头部与导航 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  padding: 12px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--heading-color); }
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; list-style: none; gap: 24px; }
nav a { color: var(--text-primary); font-size: 0.95rem; font-weight: 500; }
nav a[aria-current="page"] { color: var(--accent-highlight); }
@media (max-width: 768px) {
  nav ul { gap: 16px; font-size: 0.9rem; }
}

/* === 网格与卡片 === */
.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(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  color: var(--text-primary);
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 0; }

/* === 表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  color: var(--text-primary);
}
th, td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
th { font-weight: 600; background: rgba(var(--text-rgb), 0.03); }
td { vertical-align: top; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px;
  background: var(--bg-surface);
  transition: background 0.2s;
}
details[open] { background: rgba(var(--text-rgb), 0.02); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(90deg); }
details p { margin-top: 12px; margin-bottom: 0; color: var(--text-secondary); }

/* === 时间线 === */
.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--border-color); }
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: attr(data-step);
  position: absolute;
  left: -44px;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-deep);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.timeline-item h3 { margin-bottom: 0.4em; }

/* === SVG 容器 === */
.svg-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
  position: relative;
}
.svg-panel svg {
  width: 100%;
  height: auto;
  max-width: 600px;
  margin: 0 auto;
  display: block;
}
.svg-panel svg path, .svg-panel svg circle, .svg-panel svg rect {
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === SVG 动效 === */
@keyframes draw-flow {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes float-layer {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.draw-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-flow 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.flow-dot {
  fill: var(--accent-highlight);
  stroke: none;
  animation: pulse-dot 3s ease-in-out infinite;
}
.float-layer {
  animation: float-layer 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* === 减少动态效果 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw-path { stroke-dashoffset: 0; }
}

/* === 页脚 === */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-primary); }
