:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  --color-border-subtle: rgba(25, 21, 35, 0.12);

  /* 间距与布局 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --header-h: 72px;

  /* 圆角与边界 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  /* 字体 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lh-body: 1.75;
}

/* 面变量覆盖规则 */
.surface-paper {
  --bg-surface: var(--color-paper);
  --text-surface: var(--color-text);
  --accent-surface: var(--color-brand);
  --border-surface: var(--color-border-subtle);
}

.surface-dark {
  --bg-surface: var(--color-dark);
  --text-surface: var(--color-paper);
  --accent-surface: var(--color-accent);
  --border-surface: rgba(255, 255, 255, 0.15);
}

/* 基础重置与排版 */
*, *::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-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.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;
}

/* 眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.eyebrow::before {
  content: "";
  display: block;
  width: 1.2em;
  height: 2px;
  background: currentColor;
}

/* 标题 */
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--accent-surface); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent;
}
.btn:focus-visible { outline: 3px solid var(--accent-surface); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--text-surface);
  border-color: var(--text-surface);
}
.btn-secondary:hover { background: var(--text-surface); color: var(--bg-surface); }

/* 头部与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-border-subtle);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.surface-dark .site-header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.logo { display: flex; align-items: center; gap: 0.75em; font-weight: 700; font-size: 1.1rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { color: var(--accent-surface); }
@media (max-width: 768px) {
  .nav { display: none; }
}

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 0.5em; }
.footer-col a:hover { text-decoration: underline; }
.copyright { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.85rem; opacity: 0.7; }

/* 卡片与面板 */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}
.panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 2rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.surface-paper .panel { background: var(--color-paper); border: 2px solid var(--color-text); box-shadow: var(--card-shadow); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--border-surface);
  text-align: left;
}
.data-table th { font-weight: 600; background: rgba(0,0,0,0.03); }
.surface-dark .data-table th { background: rgba(255,255,255,0.05); }

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border-surface);
  margin-bottom: 0.5rem;
}
.faq-item summary {
  padding: 1rem 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: 1rem; opacity: 0.9; line-height: 1.7; }

/* 时间线 */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--border-surface); }
.timeline-item { position: relative; margin-bottom: 2rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: attr(data-step);
  position: absolute;
  left: -2.6rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent-surface);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* 杂志长文侧栏 */
.magazine-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: var(--gap);
  align-items: start;
}
.toc {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--bg-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1rem;
  font-size: 0.9rem;
}
.toc li { margin-bottom: 0.6em; }
.toc a { opacity: 0.8; transition: opacity 0.2s; }
.toc a:hover { opacity: 1; color: var(--accent-surface); }
@media (max-width: 900px) {
  .magazine-layout { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: var(--gap); }
}

/* SVG 基础与动画 */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
svg.interface-svg { width: 100%; height: auto; }
svg.interface-svg path, svg.interface-svg rect, svg.interface-svg circle {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* 描边绘制动画 */
.anim-draw { animation: draw-path 3s ease-in-out infinite; }
@keyframes draw-path {
  0%, 100% { stroke-dashoffset: 1; }
  20%, 80% { stroke-dashoffset: 0; }
}

/* 呼吸点动画 */
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 卡片层叠漂浮 */
.anim-float-1 { animation: float-1 6s ease-in-out infinite; }
.anim-float-2 { animation: float-2 7.5s ease-in-out infinite 0.5s; }
.anim-float-3 { animation: float-3 8s ease-in-out infinite 1s; }
@keyframes float-1 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float-2 { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-3 { 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;
  }
  .anim-draw, .anim-breathe, .anim-float-1, .anim-float-2, .anim-float-3 {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 640px) {
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .grid-2 { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .container { padding-left: 1rem; padding-right: 1rem; }
}

/* 全局防溢出修正 */
html, body { overflow-x: hidden; max-width: 100vw; }
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; box-sizing: border-box; }
