:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;

  /* 设计 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  --border-subtle: 1px solid rgba(25, 21, 35, 0.12);

  /* 字体与排版 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-brand); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: 0.5em; }

/* 排版层级 */
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap);
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.paper-surface .tag { color: var(--color-brand); }
.dark-surface .tag { color: var(--color-accent); }
.hl { color: var(--color-brand); }
.dark-surface .hl { color: var(--color-accent); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 1rem; }
section { padding: var(--section-y) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* 主题覆盖 */
.dark-surface { background: var(--color-dark); color: var(--color-paper); }
.dark-surface p, .dark-surface li, .dark-surface span { color: var(--color-paper); }
.dark-surface h2, .dark-surface h3 { color: var(--color-paper); }
.dark-surface a:not(.btn) { color: var(--color-accent); }
.paper-card {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}
.paper-card p, .paper-card li { color: var(--color-text); }
.paper-card a { color: var(--color-brand); }
.paper-card h3 { color: var(--color-text); }

/* 组件：按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  justify-content: center;
  white-space: nowrap;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* 组件：表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; min-width: 0; }
th, td { padding: 0.75rem 1rem; border-bottom: var(--border-subtle); text-align: left; vertical-align: top; }
th { font-weight: 700; }
.dark-surface th, .dark-surface td { border-bottom-color: rgba(252, 252, 253, 0.15); }

/* 组件：FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); margin-bottom: 0.75rem; background: var(--color-paper); }
.summary { padding: 1rem; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.summary::-webkit-details-marker { display: none; }
.summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
details[open] .summary::after { content: "−"; }
.details-content { padding: 0 1rem 1rem; line-height: 1.7; }
.dark-surface details { background: var(--color-dark); border-color: rgba(252, 252, 253, 0.2); }
.dark-surface .summary { color: var(--color-paper); }
.dark-surface .details-content { color: var(--color-paper); }

/* 页头与页脚 */
header { position: sticky; top: 0; background: var(--color-paper); z-index: 100; border-bottom: 1px solid rgba(25, 21, 35, 0.1); padding: 0.75rem 0; backdrop-filter: blur(8px); }
.nav-row { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.25rem; color: var(--color-text); text-decoration: none; }
.logo img { height: 32px; width: auto; }
nav { display: flex; gap: 1.5rem; align-items: center; }
nav a { font-weight: 500; }
nav a[aria-current="page"] { font-weight: 700; color: var(--color-brand); }
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; margin-top: var(--section-y); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-grid a { color: var(--color-accent); }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid h4 { color: var(--color-paper); margin-bottom: 0.75rem; font-weight: 700; }

/* 视觉面板容器 */
.panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 1.5rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.dark-surface .panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.panel svg { width: 100%; height: 100%; }

/* SVG 动效基础 */
.anim-svg { width: 100%; height: auto; }
.anim-float { animation: float 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float-delay { animation: float 4s ease-in-out infinite 1.2s; transform-box: fill-box; transform-origin: center; }
.anim-slide-in { animation: slideIn 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; opacity: 0; }
.anim-pulse { animation: pulse 3s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 2.5s linear infinite alternate; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes slideIn { from { transform: translateX(-16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  nav { gap: 1rem; }
  .nav-row { flex-wrap: wrap; }
  .panel { aspect-ratio: 16/10; }
}

@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-float, .anim-float-delay, .anim-slide-in, .anim-pulse, .anim-draw { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* 兜底：裁掉横向溢出 */
li {
  overflow-x: clip;
}
