:root {
  /* 色板 */
  --c-dark: #121531;
  --c-paper: #E8E9EA;
  --c-text: #151723;
  --c-brand: #142CEB;
  --c-accent: #ED7D6E;
  --c-border: rgba(0,0,0,0.12);
  --c-overlay: rgba(18,21,49,0.05);

  /* 设计 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --line-height-base: 1.65;
  --font-weight-title: 600;
  --lh-title: 1.25;
}

/* 表面层变量覆盖 */
.surface-dark {
  --c-surface: var(--c-dark);
  --c-text: var(--c-paper);
  --c-highlight: var(--c-accent);
  --c-link: var(--c-accent);
  --c-icon: var(--c-accent);
  --c-border: rgba(232,233,234,0.15);
}

.surface-light {
  --c-surface: var(--c-paper);
  --c-text: var(--c-text);
  --c-highlight: var(--c-brand);
  --c-link: var(--c-brand);
  --c-icon: var(--c-text);
  --c-border: rgba(0,0,0,0.12);
}

/* 基础重置与排版 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background-color: var(--c-paper);
  color: var(--c-text);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section {
  padding-block: var(--section-y);
}

/* 标题系统 */
h1, h2, h3, h4 {
  font-weight: var(--font-weight-title);
  line-height: var(--lh-title);
  letter-spacing: 0;
  margin-top: 0;
  margin-bottom: 0.75em;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { max-width: 38em; margin-bottom: 1.5em; }
ul, ol { padding-left: 1.5em; margin-bottom: 1.5em; }
li { margin-bottom: 0.5em; }

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  color: var(--c-highlight);
  text-transform: uppercase;
}

.hl { color: var(--c-highlight); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn svg { flex-shrink: 0; width: 20px; height: 20px; }
.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
}
.btn-secondary {
  background-color: transparent;
  color: var(--c-text);
  border-color: var(--c-text);
}
.surface-dark .btn-secondary {
  color: var(--c-paper);
  border-color: var(--c-paper);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }

/* 卡片与面板 */
.card {
  background-color: var(--c-surface);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.panel {
  background-color: var(--c-surface);
  border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5);
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 响应式网格布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.text-col { order: 1; }
.visual-col { order: 2; }
@media (min-width: 768px) {
  .row-alt .text-col { order: 2; }
  .row-alt .visual-col { order: 1; }
}

/* 表格 */
table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
  overflow-wrap: break-word;
  word-break: break-all;
}
th, td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  overflow-wrap: break-word;
  word-break: break-all;
}
th { font-weight: 600; background-color: var(--c-overlay); }
td { vertical-align: top; }

/* 问答组件 */
details {
  margin-bottom: 1rem;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  background: var(--c-surface);
  padding: 1rem 1.25rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
summary::marker, summary::-webkit-details-marker { display: none; }
summary svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--c-highlight); }
details[open] summary svg { transform: rotate(90deg); }
details p { margin-top: 0.75em; margin-bottom: 0; }

/* SVG 响应式容器 */
.svg-responsive {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* SVG 动效类 */
.svg-anim-node {
  fill: var(--c-brand);
  opacity: 0.25;
  animation: nodePulse 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.svg-anim-node.n1 { animation-delay: 0s; }
.svg-anim-node.n2 { animation-delay: 0.6s; }
.svg-anim-node.n3 { animation-delay: 1.2s; }
.svg-anim-node.n4 { animation-delay: 1.8s; }
.svg-anim-node.n5 { animation-delay: 2.4s; }

@keyframes nodePulse {
  0%, 100% { fill: var(--c-brand); opacity: 0.25; transform: scale(0.85); }
  50% { fill: var(--c-accent); opacity: 1; transform: scale(1.15); }
}

.svg-anim-float {
  animation: floatY 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.svg-anim-slide {
  animation: slideIn 7s ease-in-out infinite;
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  20% { transform: translateX(12px); opacity: 1; }
  80% { transform: translateX(12px); opacity: 1; }
}

.svg-anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 8s linear infinite;
}
@keyframes drawPath {
  0% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

.svg-anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--c-paper);
  border-bottom: 1px solid var(--c-border);
  padding: 0.75rem 0;
  transition: box-shadow 0.3s ease;
}
.surface-dark .site-header { background-color: var(--c-dark); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.logo-link img { height: 32px; width: auto; }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a {
  text-decoration: none;
  color: var(--c-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.nav a:hover { background-color: var(--c-overlay); }
.nav a[aria-current="page"] { color: var(--c-highlight); font-weight: 600; }

.site-footer {
  background-color: var(--c-dark);
  color: var(--c-paper);
  padding: 2.5rem 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--c-paper); text-decoration: none; opacity: 0.8; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 移动端适配微调 */
@media (max-width: 600px) {
  .nav { gap: 0.75rem; }
  .nav a span { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .row-alt .text-col { order: 1; }
  .row-alt .visual-col { order: 2; }
}
