:root {
  /* 色板 */
  --color-dark: #19102D;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;
  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--text);
  --card-shadow: 4px 4px 0 var(--text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  /* 主题变量（默认纸面） */
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --accent: var(--color-accent);
}

/* 主题覆盖 */
.theme-dark {
  --bg: var(--color-dark);
  --text: var(--color-paper);
  --brand: var(--color-accent);
  --accent: var(--color-accent);
}
.theme-paper {
  --bg: var(--color-paper);
  --text: var(--color-text);
  --brand: var(--color-brand);
  --accent: var(--color-accent);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  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: 0.8em; }
p { margin-bottom: 1em; max-width: 38em; }
a { color: var(--brand); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.5em; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  background: var(--bg);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

/* 眉标 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
  color: var(--brand);
}

/* 高亮词 */
.hl { color: var(--brand); }
.theme-dark .hl { color: var(--accent); }

/* 导航与页头 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--text);
  padding: 1rem 0;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-link { font-weight: 600; font-size: 0.95rem; }
.nav-link[aria-current="page"] { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.btn:hover { transform: translateY(-2px); opacity: 0.9; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-icon { width: 20px; height: 20px; stroke-width: 2; }

/* 卡片与面板 */
.card {
  background: var(--bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}
.panel {
  background: var(--bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  min-width: 0;
  table-layout: fixed;
}
th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--text);
  text-align: left;
  min-width: 0;
  overflow-wrap: break-word;
}
th { font-weight: 700; }

/* FAQ */
details {
  margin-bottom: 1rem;
  border: 1px solid var(--text);
  border-radius: var(--radius-card);
  background: var(--bg);
}
summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem;
  list-style: none;
  position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  font-weight: 700;
}
details[open] summary::after { content: "-"; }
details p { padding: 0 1rem 1rem; }

/* SVG 基础 */
.svg-wrap { width: 100%; height: auto; }
.svg-transform { transform-box: fill-box; transform-origin: center; }

/* 动效 Keyframes */
@keyframes grid-light {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 动效类 */
.anim-grid .node { animation: grid-light 6s ease-in-out infinite; }
.anim-grid .node:nth-child(1) { animation-delay: 0s; }
.anim-grid .node:nth-child(2) { animation-delay: 0.5s; }
.anim-grid .node:nth-child(3) { animation-delay: 1.0s; }
.anim-grid .node:nth-child(4) { animation-delay: 1.5s; }
.anim-grid .node:nth-child(5) { animation-delay: 2.0s; }
.anim-float { animation: float 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slide-in 0.8s ease-out forwards; }
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 2.5s ease forwards;
}

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav-list { gap: 1rem; }
  .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-grid .node, .anim-float, .anim-breathe, .anim-slide, .anim-draw {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
