/* ==================== 设计变量与基础重置 ==================== */
:root {
  /* 色板 */
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --color-bg-lighter: #EDE8F5;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --lh-body: 1.75;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--text-main, var(--color-body));
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

/* ==================== 主题上下文变量覆盖 ==================== */
.bg-dark {
  --text-main: #DBD4ED;
  --text-muted: #A8A0C9;
  --accent: #ED6E89;
  --link: #ED6E89;
  --icon: #ED6E89;
  background: var(--color-dark);
  color: var(--text-main);
}
.bg-paper {
  --text-main: var(--color-body);
  --text-muted: #4A455A;
  --accent: var(--color-brand);
  --link: var(--color-brand);
  --icon: var(--color-brand);
  background: var(--color-paper);
  color: var(--text-main);
}
.bg-lighter {
  --text-main: var(--color-body);
  --text-muted: #4A455A;
  --accent: var(--color-brand);
  --link: var(--color-brand);
  --icon: var(--color-brand);
  background: var(--color-bg-lighter);
  color: var(--text-main);
}

/* ==================== 排版与通用组件 ==================== */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-top: 0;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: 1.25rem; margin-bottom: 0.75em; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.85; }

/* 眉标 */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.label::before {
  content: "";
  display: block;
  width: 1.2em;
  height: 2px;
  background: currentColor;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--color-dark);
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--text-main);
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }

/* 图标 */
.icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
}

/* 卡片 */
.card {
  border: var(--card-border);
  background: inherit;
  padding: var(--gap);
  border-radius: var(--radius-card);
}

/* 表格 */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
th { font-weight: 600; }
td a { white-space: nowrap; }

/* 列表 */
ul, ol { padding-left: 1.5em; }
li { margin-bottom: 0.5em; }

/* FAQ */
details {
  border: var(--card-border);
  margin-bottom: 12px;
  padding: 16px;
  border-radius: var(--radius-card);
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  font-weight: 700;
  color: var(--accent);
}
details[open] summary::before { content: "-"; }
details p { margin-top: 0.75em; margin-bottom: 0; }

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(219, 212, 237, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}
.site-footer {
  border-top: 1px solid var(--card-border);
  padding-block: var(--gap);
  font-size: 0.9rem;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav { display: flex; gap: 24px; }
.nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
}
.nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-grid a { display: block; margin-bottom: 8px; color: var(--text-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--text-main); }

/* ==================== SVG 动效系统 ==================== */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}
svg { display: block; width: 100%; height: auto; }

/* 描边绘制 */
.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

/* 呼吸点 */
.breathe-dot {
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 气泡浮现 */
.pop-bubble {
  animation: popIn 5s ease-out infinite;
}
@keyframes popIn {
  0%, 10% { transform: scale(0.8); opacity: 0; }
  20%, 80% { transform: scale(1); opacity: 1; }
  90%, 100% { transform: scale(0.8); opacity: 0; }
}

/* 轻微漂浮 */
.float-layer {
  animation: floatUp 7s ease-in-out infinite;
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
