/* ==================== 设计 Token ==================== */
: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: 1280px;
  --line-height-body: 1.75;

  /* 字体 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==================== 基础重置与排版 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
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);
}

/* 面色控制 */
.light-surface {
  --bg: var(--color-paper);
  --fg: var(--color-text);
  --accent: var(--color-brand);
  background: var(--bg);
  color: var(--fg);
}
.dark-surface {
  --bg: var(--color-dark);
  --fg: var(--color-paper);
  --accent: var(--color-accent);
  background: var(--bg);
  color: var(--fg);
}
/* 深色面上的浅色卡片恢复纸面取色 */
.dark-surface .card-light {
  --bg: var(--color-paper);
  --fg: var(--color-text);
  --accent: var(--color-brand);
  background: var(--bg);
  color: var(--fg);
}

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--fg);
}
.btn-secondary:hover { background: rgba(128,128,128,0.08); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ==================== 组件：卡片 ==================== */
.card {
  background: var(--bg);
  border: var(--card-border) solid currentColor;
  box-shadow: var(--card-shadow);
  padding: 24px;
  border-radius: var(--radius-card);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.4); }

/* ==================== 组件：表格 ==================== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(128,128,128,0.25);
}
th { font-weight: 700; letter-spacing: 0.02em; }
td:first-child { font-weight: 600; }

/* ==================== 组件：FAQ ==================== */
details {
  border-bottom: 1px solid rgba(128,128,128,0.25);
  padding: 16px 0;
}
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; font-size: 1.2rem; }
details[open] summary::after { content: "−"; }
details p { margin-top: 12px; color: var(--fg); opacity: 0.9; }

/* ==================== 组件：列表与步骤 ==================== */
.step-list { counter-reset: step; }
.step-item {
  position: relative;
  padding-left: 64px;
  margin-bottom: 32px;
}
.step-item::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 48px; height: 48px;
  background: var(--accent);
  color: var(--color-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
}
.feature-nav a {
  display: inline-block;
  padding: 8px 16px;
  margin-right: 8px;
  border: 1px solid rgba(128,128,128,0.3);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}
.feature-nav a:hover, .feature-nav a:focus-visible { background: rgba(128,128,128,0.1); outline: none; }
.feature-nav a:focus-visible { outline: 2px solid var(--accent); }

/* ==================== 排版辅助 ==================== */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--accent);
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hl { color: var(--accent); }
.max-w-prose { max-width: 38em; }

/* ==================== 页头与页脚 ==================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.dark-surface .site-header { background: rgba(39, 18, 49, 0.95); border-bottom-color: rgba(246, 243, 247, 0.1); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; font-weight: 600; font-size: 0.95rem; }
.nav-links a { opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--accent); }
.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(128,128,128,0.2);
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }

/* ==================== SVG 动效核心 ==================== */
.svg-container { width: 100%; height: auto; }
.svg-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 4s ease-in-out infinite alternate;
}
.svg-grid-node {
  animation: grid-pulse 5s ease-in-out infinite;
}
.svg-grid-node:nth-child(odd) { animation-delay: 0.8s; }
.svg-grid-node:nth-child(3n) { animation-delay: 1.6s; }
.svg-grid-node:nth-child(4n+1) { animation-delay: 2.4s; }
.svg-bubble {
  animation: float-up 6s ease-in-out infinite;
}
.svg-bubble.delay-1 { animation-delay: 1.5s; }
.svg-bubble.delay-2 { animation-delay: 3s; }
.svg-input-dot {
  animation: breathe 2.4s ease-in-out infinite;
}
.svg-input-dot:nth-child(2) { animation-delay: 0.3s; }
.svg-input-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50%, 100% { stroke-dashoffset: 0; }
}
@keyframes grid-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 旋转/缩放子元素中心修正 */
.g-anim { 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: none !important;
  }
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .two-col { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  h1 { font-size: clamp(2rem, 8vw, 3.2rem); }
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }
