:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-paper-alt: #E8E6EF;

  /* 结构 token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-body);
  --card-shadow: 4px 4px 0 var(--color-body);

  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 字体与行高 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --lh-body: 1.65;
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-body);
  background: var(--color-paper);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 容器 */
.container {
  width: min(var(--content-max), 100% - 32px);
  margin-inline: auto;
}

/* 背景上下文变量控制 */
.bg-paper { --text-primary: var(--color-body); --text-highlight: var(--color-brand); --eyebrow-color: var(--color-brand); --btn-primary-bg: var(--color-brand); --btn-primary-text: var(--color-paper); --btn-secondary-border: var(--color-body); --btn-secondary-text: var(--color-body); }
.bg-dark { --text-primary: var(--color-paper); --text-highlight: var(--color-accent); --eyebrow-color: 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-light { background: var(--color-paper); color: var(--color-body); border: var(--card-border); box-shadow: var(--card-shadow); }

/* 排版 */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: 0.02em; font-weight: 700; color: var(--text-primary); }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -0.02em; font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* 眉标与高亮 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--eyebrow-color);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.hl { color: var(--text-highlight); }

/* 区块布局 */
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section-grid {
  display: grid;
  gap: var(--gap);
  align-items: center;
}
@media (min-width: 900px) {
  .section-grid { grid-template-columns: 1fr 1fr; }
  .section-grid.reverse { direction: rtl; }
  .section-grid.reverse > * { direction: ltr; }
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-secondary {
  background: transparent;
  border-color: var(--btn-secondary-border);
  color: var(--btn-secondary-text);
}
.btn-secondary:hover { background: rgba(128,128,128,0.08); }
.btn:focus-visible { outline: 3px solid var(--text-highlight); outline-offset: 4px; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 卡片 */
.card {
  background: var(--card-bg, var(--color-paper));
  color: var(--card-text, var(--color-body));
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.card-grid {
  display: grid;
  gap: var(--gap);
}
@media (min-width: 768px) { .card-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid currentColor; }
th { font-weight: 700; }
td:first-child { font-weight: 600; white-space: nowrap; }

/* FAQ */
details {
  border: 1px solid var(--text-primary);
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 16px;
  background: var(--card-bg, var(--color-paper));
  color: var(--card-text, var(--color-body));
}
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
details[open] summary { margin-bottom: 8px; }
details p { margin-top: 8px; margin-bottom: 0; opacity: 0.9; }

/* 导航 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}
.bg-dark .header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.08); }
.nav-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; }
.brand img { height: 28px; width: auto; }
.nav-links { display: none; gap: 24px; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-link { font-size: 0.95rem; font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; color: var(--text-highlight); }
.footer {
  padding-block: 48px;
  border-top: 1px solid currentColor;
  margin-top: 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-copy { font-size: 0.85rem; opacity: 0.7; }

/* SVG 基础 */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.svg-panel svg { width: 100%; height: auto; }
.svg-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* 动画 Keyframes */
@keyframes flow-dash {
  0% { stroke-dashoffset: 1; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-up {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.anim-draw { animation: flow-dash 6s ease-in-out infinite; }
.anim-float { animation: float-y 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-breathe { animation: breathe 3.5s ease-in-out infinite; }
.anim-delay-1 { animation-delay: 0.8s; }
.anim-delay-2 { animation-delay: 1.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-name: none !important;
  }
}
