:root {
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-body: 1.6;
}

/* 主题层变量覆盖 */
.dark-bg {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --brand: var(--color-accent);
  --link: var(--color-accent);
  --btn-primary-bg: var(--color-accent);
  --btn-primary-text: var(--color-dark);
  --btn-secondary-border: var(--color-paper);
  --btn-secondary-text: var(--color-paper);
  --card-bg: var(--color-dark);
  background: var(--bg);
  color: var(--text);
}

.paper-bg {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --link: var(--color-brand);
  --btn-primary-bg: var(--color-brand);
  --btn-primary-text: var(--color-dark);
  --btn-secondary-border: var(--color-text);
  --btn-secondary-text: var(--color-text);
  --card-bg: var(--color-paper);
  background: var(--bg);
  color: var(--text);
}

.light-card {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --link: var(--color-brand);
  background: var(--bg);
  color: var(--text);
}

/* 基础重置与排版 */
*, *::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(--line-height-body);
  background: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.6em; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding-block: var(--section-y);
}

/* 页头与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}
.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 4px 0;
  position: relative;
}
.nav-links a[aria-current="page"],
.nav-links a:hover { color: var(--color-brand); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0; width: 100%; height: 2px;
  background: var(--color-brand);
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}
.btn:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.btn--secondary {
  background: transparent;
  color: var(--btn-secondary-text);
  border: 1px solid var(--btn-secondary-border);
}
.btn--secondary:hover { background: rgba(0,0,0,0.04); }
.btn__icon { width: 20px; height: 20px; stroke-width: 2; }

/* 眉标 */
.section-marc {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  color: var(--brand);
}
.dark-bg .section-marc { color: var(--brand); }

/* 标题系统 */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; color: var(--text); }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--text);
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.2rem;
}
h3 {
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}
.hl { color: var(--brand); }
.dark-bg .hl { color: var(--brand); }

/* 卡片与面板 */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}
.panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
  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; gap: var(--gap); align-items: center; flex-wrap: wrap; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.data-table th { font-weight: 600; color: var(--text); }
.data-table td { color: var(--text); }
.dark-bg .data-table th, .dark-bg .data-table td { border-bottom-color: rgba(245, 240, 229, 0.1); }

/* FAQ */
details {
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  padding: 16px;
  background: var(--card-bg);
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  font-weight: 700;
  color: var(--brand);
}
details[open] summary::before { content: "−"; }
details p { margin-top: 0.8rem; color: var(--text); line-height: 1.6; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--color-brand);
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  margin-right: 8px;
  flex-shrink: 0;
}
.dark-bg .step-badge { background: var(--color-accent); color: var(--color-dark); }

/* 页脚 */
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-col h4 { color: var(--color-paper); margin-bottom: 12px; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(245, 240, 229, 0.7); }
.footer-col a:hover { color: var(--color-accent); }
.copyright {
  text-align: center;
  margin-top: 32px;
  font-size: 0.85rem;
  color: rgba(245, 240, 229, 0.5);
}

/* SVG 基础与缩放 */
svg { width: 100%; height: auto; }
svg path, svg line, svg polyline, svg circle {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 动效类与关键帧 */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 6s ease-in-out infinite;
}
.anim-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flowDash 4s linear infinite;
}
.anim-float {
  animation: floatY 5s ease-in-out infinite;
}
.anim-pulse {
  animation: pulseScale 3.5s ease-in-out infinite;
}
.anim-bubble {
  animation: popIn 4.5s ease-in-out infinite;
}

@keyframes drawPath {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}
@keyframes flowDash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulseScale {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}
@keyframes popIn {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.9; }
  50% { transform: translateY(-4px) scale(1.02); opacity: 1; }
}

/* 旋转/缩放子元素中心修正 */
svg g[transform], svg circle[transform], svg rect[transform] {
  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; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
