/* 设计变量与色板 */
:root {
  --color-dark: #271231;
  --color-paper: #F6F3F7;
  --color-text: #1F1523;
  --color-brand: #9E13DD;
  --color-accent: #ED6EC0;
  
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-title: 1.25;
  --lh-body: 1.75;
}

/* 表面层色彩覆盖规则 */
.surface-paper {
  --fg: var(--color-text);
  --bg: var(--color-paper);
  --hl: var(--color-brand);
  --border: rgba(31, 21, 35, 0.1);
  --shadow: var(--card-shadow);
}
.surface-dark {
  --fg: var(--color-paper);
  --bg: var(--color-dark);
  --hl: var(--color-accent);
  --border: rgba(246, 243, 247, 0.15);
  --shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.5);
}
.surface-card {
  --fg: var(--color-text);
  --bg: var(--color-paper);
  --hl: var(--color-brand);
  --border: rgba(31, 21, 35, 0.08);
  --shadow: var(--card-shadow);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
p { margin-bottom: 1em; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
section {
  padding-block: var(--section-y);
}
.section-inner {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 表面层应用 */
.surface-paper, .surface-dark {
  background: var(--bg);
  color: var(--fg);
}
.surface-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-dark .table-row:nth-child(even) { background: rgba(246, 243, 247, 0.05); }

/* 排版层级 */
h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: var(--lh-title);
  letter-spacing: 0;
  margin-bottom: 0.8em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: var(--lh-title);
  margin-bottom: calc(var(--gap) * 0.6);
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: var(--lh-title);
  margin-bottom: 0.5em;
}
.subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hl);
  margin-bottom: 0.5em;
  display: block;
}
.hl { color: var(--hl); }
.text-lead {
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 38em;
  margin-bottom: 1.5em;
}
.text-body {
  max-width: 38em;
}
.text-body p { margin-bottom: 1em; }

/* 组件：按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0 1.5em;
  height: 48px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { border-color: var(--fg); color: var(--fg); }
.btn-icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* 组件：卡片 */
.card {
  background: var(--bg);
  border: var(--card-border);
  box-shadow: var(--shadow);
  padding: 1.5em;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.4); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* 组件：表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th { font-weight: 600; }
.table-row { transition: background 0.15s ease; }
.table-row:hover { background: rgba(158, 19, 221, 0.05); }

/* 组件：步骤条 */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  counter-reset: step;
}
.step-item {
  position: relative;
  padding-left: 2.5em;
}
.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 2em; height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

/* 组件：FAQ */
details {
  border: 1px solid var(--border);
  margin-bottom: 0.5em;
  padding: 1em;
  transition: border-color 0.2s ease;
}
details[open] { border-color: var(--hl); }
summary {
  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.2em; transition: transform 0.2s ease; }
details[open] summary::after { content: "−"; transform: rotate(180deg); }
details p { margin-top: 0.75em; line-height: 1.7; }

/* 网格与图标工具 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.icon-svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.25em 0.75em;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(158, 19, 221, 0.1);
  color: var(--hl);
  margin-bottom: 0.5em;
}

/* SVG 动效核心 */
@keyframes nodeLight {
  0% { stroke-dashoffset: 1; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 1; opacity: 0.4; }
}
.node {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: nodeLight 6s ease-in-out infinite;
}
.flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 4s linear infinite;
}
@keyframes flowDash {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column; }
  .hero-visual { order: -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 兜底：裁掉横向溢出 */
section.surface-dark.download-hero {
  overflow-x: clip;
}
