/* 设计变量与基础重置 */
:root {
  --color-dark-bg: #240F29;
  --color-paper: #F6F3F7;
  --color-text: #201523;
  --color-brand: #A711CF;
  --color-accent: #ED6E73;
  --color-border: rgba(32, 21, 35, 0.15);
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* 表面层变量覆盖 */
.surface-dark {
  --bg-surface: var(--color-dark-bg);
  --text-surface: var(--color-paper);
  --accent-surface: var(--color-accent);
  --brand-surface: var(--color-accent);
  background: var(--bg-surface);
  color: var(--text-surface);
}
.surface-dark .hl { color: var(--accent-surface); }
.surface-dark a:not(.btn) { color: var(--accent-surface); text-decoration: underline; }
.surface-dark .badge { color: var(--accent-surface); }

.surface-paper {
  --bg-surface: var(--color-paper);
  --text-surface: var(--color-text);
  --accent-surface: var(--color-brand);
  --brand-surface: var(--color-brand);
  background: var(--bg-surface);
  color: var(--text-surface);
}
.surface-paper .hl { color: var(--brand-surface); }
.surface-paper a:not(.btn) { color: var(--brand-surface); text-decoration: underline; }
.surface-paper .badge { color: var(--brand-surface); }

/* 容器与排版 */
.container { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gap); }
.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--color-border); }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: 0; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; text-wrap: balance; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; margin-top: 1.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.2em;
}
.badge::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 0.6em; height: 0.6em;
  background: currentColor;
}
.hl { font-weight: 700; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.2em;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark-bg);
  border: 2px solid var(--color-accent);
}
.btn-primary:hover { background: #d95c61; border-color: #d95c61; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.surface-dark .btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* 卡片与面板 */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
}
.panel {
  background: var(--bg-surface);
  border: 2px solid currentColor;
  padding: var(--gap);
  position: relative;
}

/* 网格与布局 */
.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); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.text-start { text-align: start; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

/* 表格 */
.table-wrap { overflow-x: auto; width: 100%; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); text-align: start; }
th { font-weight: 700; background: rgba(0,0,0,0.03); }
td strong { font-weight: 600; }

/* 列表与步骤 */
.step-list { counter-reset: step; }
.step-item { position: relative; padding-left: 2.5rem; margin-bottom: 1.5rem; }
.step-item::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem;
  background: var(--accent-surface);
  color: var(--color-dark-bg);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--accent-surface);
}
.tip-list li { position: relative; padding-left: 2rem; margin-bottom: 0.75rem; list-style: none; }
.tip-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.35em;
  width: 1em; height: 1em;
  background-color: transparent;
}
.tip-list li svg {
  position: absolute;
  left: 0; top: 0.25em;
  width: 1em; height: 1em;
  stroke: var(--accent-surface);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* FAQ */
details { border: 1px solid var(--color-border); margin-bottom: 0.75rem; background: var(--bg-surface); }
summary { padding: 1rem; 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.2rem; }
details[open] summary::after { content: "-"; }
details > div { padding: 0 1rem 1rem; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s ease;
}
.site-header.scrolled { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.2rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; position: relative; }
.nav-links a:hover { color: var(--accent-surface); }
.nav-links a[aria-current="page"] { color: var(--accent-surface); font-weight: 700; }
.site-footer { padding: 3rem 0; border-top: 1px solid var(--color-border); background: var(--bg-surface); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { margin-bottom: 0.75rem; font-size: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { color: var(--accent-surface); }
.copyright { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--color-border); font-size: 0.9rem; opacity: 0.8; text-align: center; }

/* SVG 动效基础 */
.svg-visual { width: 100%; height: auto; max-width: 100%; }
.node {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke 0.3s ease;
}
.anim-node { animation: grid-pulse 6s ease-in-out infinite; }
.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1.2s; }
.delay-3 { animation-delay: 2.0s; }
.delay-4 { animation-delay: 2.8s; }
.delay-5 { animation-delay: 3.5s; }
.delay-6 { animation-delay: 4.2s; }

@keyframes grid-pulse {
  0%, 100% { stroke-dashoffset: 1; opacity: 0.3; }
  50% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-anim { animation: float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { padding: 0 var(--gap); }
  .nav-links { gap: 1rem; font-size: 0.9rem; }
  .btn { height: 44px; font-size: 0.9rem; }
}
