/* === 设计变量与基础重置 === */
:root {
  --c-dark: #2D1438;
  --c-paper: #F6F3F7;
  --c-text: #1F1523;
  --c-brand: #9E13DD;
  --c-accent: #6EEDA8;
  --r-card: 20px;
  --r-btn: 12px;
  --card-border: 1px solid rgba(31, 21, 35, 0.16);
  --card-shadow: none;
  --sec-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 表面层颜色上下文 === */
.surface-dark {
  background: var(--c-dark);
  --txt-main: var(--c-paper);
  --txt-hl: var(--c-accent);
  color: var(--txt-main);
}
.surface-paper {
  background: var(--c-paper);
  --txt-main: var(--c-text);
  --txt-hl: var(--c-brand);
  color: var(--txt-main);
}
.surface-dark a, .surface-dark .link-hl { color: var(--c-accent); }
.surface-paper a, .surface-paper .link-hl { color: var(--c-brand); }
.surface-dark a:hover, .surface-dark .link-hl:hover { opacity: 0.85; }
.surface-paper a:hover, .surface-paper .link-hl:hover { opacity: 0.85; }

/* === 排版系统 === */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-block: var(--sec-y); position: relative; }
.section + .section { border-top: 1px solid rgba(31, 21, 35, 0.12); }
.surface-dark .section + .section { border-top-color: rgba(246, 243, 247, 0.12); }

.heading-sm {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--txt-hl);
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--txt-main);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--txt-main);
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--txt-main);
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--txt-hl); font-weight: 700; }

/* === 布局辅助 === */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.text-side { order: 1; }
.visual-side { order: 2; }
@media (min-width: 768px) {
  .grid-2.reverse .text-side { order: 2; }
  .grid-2.reverse .visual-side { order: 1; }
}
.content-center { text-align: center; }
.content-center p { margin-left: auto; margin-right: auto; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  border: none;
}
.btn-primary {
  background: var(--c-accent);
  color: var(--c-dark);
}
.surface-dark .btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-secondary {
  background: transparent;
  color: var(--txt-main);
  border: 2px solid var(--txt-main);
}
.surface-dark .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }
.btn:hover { transform: translateY(-2px); opacity: 0.9; }
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === 组件：卡片 === */
.card {
  background: var(--c-paper);
  border: var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}
.surface-dark .card { background: rgba(246, 243, 247, 0.08); border-color: rgba(246, 243, 247, 0.15); }
.card:hover { transform: translateY(-4px); }

/* === 组件：表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 320px; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.12); }
.surface-dark th, .surface-dark td { border-bottom-color: rgba(246, 243, 247, 0.12); }
td:first-child { font-weight: 700; color: var(--txt-main); }
td:last-child { color: var(--txt-main); opacity: 0.9; }

/* === 组件：FAQ === */
.faq-item { margin-bottom: 1rem; border: var(--card-border); border-radius: var(--r-card); overflow: hidden; }
.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--txt-main);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 12px; height: 12px;
  border-right: 2px solid var(--txt-hl);
  border-bottom: 2px solid var(--txt-hl);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item .faq-content { padding: 0 1.25rem 1.25rem; color: var(--txt-main); line-height: 1.7; }

/* === 组件：时间轴 === */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid rgba(31, 21, 35, 0.15); }
.surface-dark .timeline { border-left-color: rgba(246, 243, 247, 0.2); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.55rem; top: 0.35rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--txt-hl);
  border: 3px solid var(--bg, var(--c-paper));
}
.timeline-time { font-size: 0.85rem; font-weight: 700; color: var(--txt-hl); margin-bottom: 0.25rem; }
.timeline-desc { color: var(--txt-main); }

/* === 组件：步骤 === */
.step-list { counter-reset: step; }
.step-item { counter-increment: step; margin-bottom: 1.5rem; display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 36px; height: 36px;
  background: var(--c-accent); color: var(--c-dark);
  font-weight: 800; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.surface-dark .step-num { background: var(--c-accent); color: var(--c-dark); }
.step-text { flex: 1; }

/* === SVG 动效体系 === */
.svg-wrap { width: 100%; height: auto; }
.svg-wrap svg { width: 100%; height: auto; }
/* 强制 SVG 标签属性为长度，尺寸由 CSS 控制 */
.svg-wrap svg { width: 24px; height: 24px; }

/* 气泡浮动 */
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.bubble { animation: float-bubble 4s ease-in-out infinite; }
.bubble-delay-1 { animation-delay: 0.8s; }
.bubble-delay-2 { animation-delay: 1.6s; }

/* 输入点呼吸 */
@keyframes breathe-dot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
.dot { animation: breathe-dot 2.4s ease-in-out infinite; }
.dot:nth-child(2) { animation-delay: 0.4s; }
.dot:nth-child(3) { animation-delay: 0.8s; }

/* 通知滑入 */
@keyframes slide-in-notif {
  0%, 100% { transform: translateX(0); opacity: 1; }
  15% { transform: translateX(-12px); opacity: 0.7; }
}
.notif-card { animation: slide-in-notif 6s ease-in-out infinite; }

/* 连接线流动 (stroke-dashoffset) */
@keyframes dash-flow {
  0% { stroke-dashoffset: 1; }
  40% { stroke-dashoffset: 0; }
  60% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 窗口微呼吸 */
@keyframes soft-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
.window-layer { animation: soft-breathe 12s 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;
    animation-delay: 0ms !important;
  }
  .flow-line, .bubble, .dot, .notif-card, .window-layer {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* === 响应式微调 === */
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .text-side, .visual-side { order: unset; }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
}
