/* === 设计变量与基础重置 === */
:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --color-card-dark: #231A42;
  --color-card-paper: #FFFFFF;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --lh-text: 1.55;
  --lh-title: 1.15;
  --fw-title: 500;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === 排版系统 === */
h1, h2, h3 { font-weight: var(--fw-title); line-height: var(--lh-title); letter-spacing: -0.02em; }
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: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.75); }
p { max-width: 38em; margin-bottom: var(--gap); }
ul, ol { padding-left: 1.2em; margin-bottom: var(--gap); }
li { margin-bottom: calc(var(--gap) * 0.5); }
strong { font-weight: 600; }

/* === 表面上下文着色 === */
.surface-dark { background: var(--color-dark); color: var(--color-paper); }
.surface-dark a { color: var(--color-accent); }
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .badge { color: var(--color-accent); background: rgba(153, 119, 238, 0.15); }
.surface-dark table th { color: var(--color-accent); }

.surface-paper { background: var(--color-paper); color: var(--color-text); }
.surface-paper .hl { color: var(--color-brand); }
.surface-paper .badge { color: var(--color-brand); background: rgba(82, 20, 235, 0.1); }
.surface-paper table th { color: var(--color-brand); }

/* 浅色卡片覆盖层 */
.card-light {
  background: var(--color-card-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
}
.card-light .hl { color: var(--color-brand); }
.card-light .badge { color: var(--color-brand); background: rgba(82, 20, 235, 0.1); }

/* === 布局容器 === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* === 组件：按钮 === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600; font-size: 16px;
  cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none; border: none;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); background: #8a68e0; }
.btn-secondary { background: transparent; border: 2px solid currentColor; color: inherit; }
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* === 组件：卡片与面板 === */
.panel {
  background: var(--bg-panel, var(--color-card-dark));
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
}
.panel svg { width: 100%; height: auto; display: block; }

/* === 组件：表格 === */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; min-width: 400px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.15); }
th { font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* === 组件：FAQ === */
details { margin-bottom: var(--gap); border-radius: var(--radius-card); border: var(--card-border); background: rgba(128,128,128,0.05); }
summary { padding: 16px; cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-left: 28px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-60%) rotate(45deg); transition: transform 0.2s ease; }
details[open] summary::before { transform: translateY(-40%) rotate(-45deg); }
details p { padding: 0 16px 16px; max-width: 100%; }

/* === 组件：眉标与徽标 === */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 6px; margin-bottom: calc(var(--gap) * 0.5); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--color-accent); color: var(--color-dark); font-weight: 700; border-radius: 8px; margin-right: 8px; }

/* === 页头与页脚 === */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.08); }
.surface-dark .site-header { background: rgba(27,18,49,0.9); border-bottom: 1px solid rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-img { height: 32px; width: auto; object-fit: contain; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { color: inherit; font-weight: 500; opacity: 0.85; transition: opacity 0.2s; }
nav a:hover, nav a[aria-current="page"] { opacity: 1; color: var(--color-accent); }
.site-footer { padding-block: 48px; border-top: 1px solid rgba(128,128,128,0.15); margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-weight: 600; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-bottom { margin-top: 32px; text-align: center; opacity: 0.7; font-size: 0.9rem; }

/* === SVG 动效体系 === */
svg { width: 100%; height: auto; display: block; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashDraw 5s ease-in-out infinite alternate; }
.anim-breathe { animation: breathe 6s ease-in-out infinite alternate; }
.anim-float { animation: floatUp 7s ease-in-out infinite alternate; }
.anim-pulse { animation: pulseOpacity 4s ease-in-out infinite alternate; }
.anim-orbit { animation: orbitSpin 12s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-orbit-reverse { animation: orbitSpinReverse 15s linear infinite; transform-box: fill-box; transform-origin: center; }

@keyframes dashDraw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes breathe {
  0% { opacity: 0.6; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}
@keyframes floatUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}
@keyframes pulseOpacity {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}
@keyframes orbitSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes orbitSpinReverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner nav ul { display: none; } /* 移动端简化导航示意 */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-breathe, .anim-float, .anim-pulse, .anim-orbit, .anim-orbit-reverse {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
