:root {
  /* 色板 */
  --c-dark: #140E25;
  --c-paper: #F5F0E5;
  --c-body: #191523;
  --c-brand: #5214EB;
  --c-accent: #C8ED6E;

  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --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;
  --line-height-body: 1.75;

  /* 排版基线 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --base-size: 16px;
}

/* 面级变量覆盖 */
.bg-dark {
  --c-text-main: var(--c-paper);
  --c-text-muted: rgba(245, 240, 229, 0.8);
  --c-link: var(--c-accent);
  --c-highlight: var(--c-accent);
  --c-border-subtle: rgba(245, 240, 229, 0.12);
  background-color: var(--c-dark);
  color: var(--c-text-main);
}

.bg-paper {
  --c-text-main: var(--c-body);
  --c-text-muted: rgba(25, 21, 35, 0.65);
  --c-link: var(--c-brand);
  --c-highlight: var(--c-brand);
  --c-border-subtle: rgba(25, 21, 35, 0.12);
  background-color: var(--c-paper);
  color: var(--c-text-main);
}

.card-light {
  --c-text-main: var(--c-body);
  --c-text-muted: rgba(25, 21, 35, 0.65);
  --c-link: var(--c-brand);
  --c-highlight: var(--c-brand);
  background-color: var(--c-paper);
  color: var(--c-text-main);
}

/* 重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--base-size); scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-body);
  color: var(--c-body);
  background-color: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--c-link); text-decoration: none; transition: color 0.2s ease; }
a:hover { opacity: 0.85; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; border-radius: 2px; }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); min-width: 0; }
.page-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--gap);
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.page-grid > * {
  min-width: 0;
}
@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; }
  .page-nav { position: sticky; top: 0; z-index: 10; background: var(--c-paper); padding: 12px var(--gap); border-bottom: 1px solid var(--c-border-subtle); width: 100%; box-sizing: border-box; }
  .page-nav ul { display: flex; gap: 12px; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; width: 100%; box-sizing: border-box; }
  .page-nav li a { font-size: 0.85rem; padding: 6px 12px; border-radius: var(--radius-btn); background: rgba(25,21,35,0.05); }
}
@media (min-width: 769px) {
  .page-nav { position: sticky; top: 80px; height: calc(100vh - 80px); overflow-y: auto; padding: 24px 0; }
  .page-nav ul { flex-direction: column; gap: 8px; }
  .page-nav li a { display: block; padding: 10px 16px; border-radius: var(--radius-btn); }
  .page-nav li a:hover, .page-nav li a[aria-current="page"] { background: rgba(25,21,35,0.06); font-weight: 600; }
}

/* 页头 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border-subtle);
  padding: 12px 0;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.brand img { height: 32px; width: auto; }
.nav-list { display: flex; gap: 24px; list-style: none; }
.nav-list a { font-size: 0.95rem; font-weight: 500; color: var(--c-body); }
.nav-list a:hover { color: var(--c-brand); }
@media (max-width: 600px) { .nav-list { display: none; } }

/* 页脚 */
.site-footer {
  background: var(--c-dark);
  color: var(--c-paper);
  padding: 48px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px;
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap);
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; color: var(--c-accent); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(245,240,229,0.8); font-size: 0.9rem; }
.footer-copy { text-align: center; margin-top: 32px; font-size: 0.85rem; color: rgba(245,240,229,0.5); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px;
  font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer; border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--c-accent); color: var(--c-dark);
}
.btn-primary:hover { background: #d4f585; }
.btn-secondary {
  background: transparent;
  color: var(--c-body); border: 1px solid var(--c-body);
}
.bg-dark .btn-secondary { color: var(--c-paper); border-color: var(--c-paper); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* 通用组件 */
.section { padding-block: var(--section-y); }
.badge-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 12px;
}
.bg-dark .badge-label { color: var(--c-accent); }
.bg-paper .badge-label { color: var(--c-brand); }
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500; line-height: 1.25; margin-bottom: 24px;
}
h3 {
  font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 12px; margin-top: 24px;
}
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--c-highlight); }
.card {
  background: var(--c-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.card.dark-card { background: rgba(255,255,255,0.05); border-color: var(--c-border-subtle); }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--c-border-subtle); }
.data-table th { font-weight: 600; font-size: 0.9rem; color: var(--c-text-muted); }
.data-table td { font-size: 1rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--c-border-subtle); }
.faq-item summary {
  padding: 16px 0; cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 16px; font-size: 0.95rem; color: var(--c-text-muted); }

/* SVG 动效基础 */
.svg-panel { width: 100%; height: auto; max-width: 100%; }
.anim-float { animation: float-cycle 6s ease-in-out infinite; }
.anim-float-alt { animation: float-cycle 6s ease-in-out infinite 2s; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-cycle 4s ease-in-out infinite alternate; }
.anim-breathe { animation: breathe-cycle 4s ease-in-out infinite; }
.anim-slide-in { animation: slide-cycle 5s ease-in-out infinite alternate; }

@keyframes float-cycle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes draw-cycle {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes breathe-cycle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes slide-cycle {
  0% { transform: translateX(0); opacity: 0.8; }
  100% { transform: translateX(6px); opacity: 1; }
}

/* 减少动态效果 */
@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;
  }
}
