:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 结构变量 */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 */
  --fs-h1: clamp(2rem, 4.6vw, 3.4rem);
  --fs-h2: clamp(1.4rem, 2.8vw, 2rem);
  --fs-h3: 1.125rem;
  --fs-body: 1rem;
  --lh-tight: 1.25;
  --lh-body: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-body);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section { padding-block: var(--section-y); }
.bg-dark { background: var(--color-dark); color: var(--color-paper); }
.bg-dark .card { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); box-shadow: var(--card-shadow); }
.bg-dark .hl, .bg-dark .badge, .bg-dark a { color: var(--color-accent); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

/* 排版 */
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: 0; line-height: var(--lh-tight); margin-top: 0; }
h1 { font-size: var(--fs-h1); margin-bottom: var(--gap); }
h2 { font-size: var(--fs-h2); margin-bottom: calc(var(--gap) * 1.5); }
h3 { font-size: var(--fs-h3); margin-bottom: calc(var(--gap) * 0.5); }
p { margin-bottom: var(--gap); max-width: 38em; }
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: calc(var(--gap) * 0.5);
  color: var(--color-brand);
}
.bg-dark .badge { color: var(--color-accent); }
.hl { font-weight: 700; color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent); }

/* 页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-text);
}
.bg-dark .site-header { background: rgba(25, 16, 45, 0.95); border-color: rgba(244, 243, 247, 0.2); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5em; text-decoration: none; color: inherit; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 32px; width: auto; display: block; }
nav { display: flex; gap: var(--gap); align-items: center; }
nav a { text-decoration: none; color: inherit; font-weight: 500; padding: 0.5em 0; border-bottom: 2px solid transparent; transition: border-color 0.2s; }
nav a:hover, nav a[aria-current="page"] { border-bottom-color: var(--color-brand); }
.bg-dark nav a { color: var(--color-paper); }
.bg-dark nav a:hover, .bg-dark nav a[aria-current="page"] { border-bottom-color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding-inline: 1.5em;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius-btn);
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-text); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(25, 21, 35, 0.05); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.bg-dark .btn-secondary:hover { background: rgba(244, 243, 247, 0.1); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}
.panel {
  background: var(--color-dark);
  padding: calc(var(--gap) * 2);
  border-radius: var(--radius-card);
  position: relative;
  overflow: hidden;
}
.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); }

/* 表格 */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-block: var(--gap); min-width: 600px; }
th, td { border: 2px solid var(--color-text); padding: var(--gap); text-align: left; vertical-align: top; white-space: nowrap; }
th { background: var(--color-paper); font-weight: 600; }
td { background: var(--color-paper); }
.bg-dark th, .bg-dark td { background: var(--color-paper); color: var(--color-text); border-color: var(--color-text); }

/* FAQ */
.faq-item { border: var(--card-border); margin-bottom: var(--gap); background: var(--color-paper); border-radius: var(--radius-card); }
.faq-item details { border: none; margin: 0; padding: var(--gap); background: transparent; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; position: relative; padding-right: 1.5em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 0; font-weight: 700; }
.faq-item details[open] summary::after { content: "-"; }
.faq-item p { margin-bottom: 0; }

/* 时间线与编号 */
.step-list { counter-reset: step; list-style: none; padding: 0; }
.step-list li { position: relative; padding-left: 3rem; margin-bottom: var(--gap); }
.step-list li::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 2rem; height: 2rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
}

/* SVG 动效基础 */
.svg-mockup { width: 100%; height: auto; max-width: 100%; display: block; }
.flow-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashFlow 4s linear infinite; }
.float-bubble { animation: floatY 6s ease-in-out infinite alternate; }
.pulse-dot { animation: pulseOpacity 3s ease-in-out infinite; }
@keyframes dashFlow { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: -1; } }
@keyframes floatY { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
@keyframes pulseOpacity { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.transform-box-fill { transform-box: fill-box; transform-origin: center; }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: var(--gap) 0; }
  nav { flex-wrap: wrap; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero-layout { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
a { color: var(--color-brand); text-underline-offset: 0.2em; }
.bg-dark a { color: var(--color-accent); }
img, svg { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.5em; }
::selection { background: var(--color-brand); color: var(--color-paper); }
:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* 兜底：裁掉横向溢出 */
div.container,
section.section.container,
div.grid-2 {
  overflow-x: clip;
}
