/* === 设计变量 === */
:root {
  --bg-dark: #21163C;
  --bg-paper: #E9E8EA;
  --text-main: #191523;
  --brand-color: #5214EB;
  --accent-color: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-title-weight: 800;
  --font-title-ls: -0.02em;
  --font-title-lh: 1.1;
  --font-body-lh: 1.65;
  --header-h: 64px;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: var(--font-body-lh);
  color: var(--text-main);
  background: var(--bg-paper);
  -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 {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 768px) {
  .section-inner { grid-template-columns: 1fr; }
  .visual-first { order: -1; }
}

/* === 主题表面取色规则 === */
.theme-paper { background: var(--bg-paper); color: var(--text-main); }
.theme-dark { background: var(--bg-dark); color: var(--bg-paper); }
.theme-dark .hl { color: var(--accent-color); }
.theme-dark .badge { color: var(--accent-color); }
.theme-dark a:not(.btn) { color: var(--accent-color); }
.theme-paper .hl { color: var(--brand-color); }
.theme-paper .badge { color: var(--brand-color); }
.theme-paper a:not(.btn) { color: var(--brand-color); }

/* === 排版组件 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: var(--font-title-weight);
  letter-spacing: var(--font-title-ls);
  line-height: var(--font-title-lh);
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: var(--font-title-weight);
  letter-spacing: var(--font-title-ls);
  line-height: var(--font-title-lh);
  margin-bottom: 0.75rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
p { margin-bottom: 1rem; max-width: 38em; }
.text-muted { opacity: 0.8; font-size: 0.9rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border: 2px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-color);
  color: var(--bg-dark);
  border-color: var(--accent-color);
}
.btn-primary:hover { background: #d88460; border-color: #d88460; }
.btn-secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.theme-dark .btn-secondary { border-color: var(--bg-paper); color: var(--bg-paper); }
.theme-dark .btn-secondary:hover { background: rgba(233,232,234,0.1); }

/* === 卡片与面板 === */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.theme-dark .card { background: var(--bg-paper); color: var(--text-main); }
.visual-panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.theme-paper .visual-panel { background: var(--bg-dark); }

/* === 表格 === */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; background: var(--bg-paper); color: var(--text-main); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); }
th { font-weight: 700; background: rgba(0,0,0,0.03); }
tr:last-child td { border-bottom: none; }

/* === FAQ === */
details {
  background: var(--bg-paper);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}
.theme-dark details { background: rgba(233,232,234,0.08); color: var(--bg-paper); }
summary {
  padding: 16px 20px;
  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-weight: 400;
  opacity: 0.6;
}
details[open] summary::after { content: "−"; }
.details-content { padding: 0 20px 16px; line-height: 1.6; }

/* === 页头页脚 === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233,232,234,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  height: var(--header-h);
}
.theme-dark .header { background: rgba(33,22,60,0.9); border-bottom-color: rgba(255,255,255,0.1); }
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 1; color: var(--brand-color); }
.theme-dark .nav-links a { color: var(--bg-paper); }
.theme-dark .nav-links a:hover, .theme-dark .nav-links a[aria-current="page"] { color: var(--accent-color); }
.footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding: 48px 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.9;
}
.footer a { color: var(--accent-color); margin: 0 8px; }

/* === SVG 动效核心 === */
.svg-container { width: 100%; height: auto; }
.node-grid circle {
  fill: rgba(255,255,255,0.15);
  transition: fill 0.3s ease;
}
.node-grid circle.light-on {
  fill: var(--accent-color);
  animation: node-pulse 4s infinite ease-in-out;
}
@keyframes node-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
.bubble {
  animation: float-bubble 6s infinite ease-in-out;
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.flow-line {
  stroke: var(--accent-color);
  stroke-width: 2;
  fill: none;
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 3s infinite linear;
}
@keyframes dash-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
.breath-dot {
  animation: breathe 3s infinite ease-in-out;
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.rotating-icon {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-slow 12s infinite linear;
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === 减少动态效果 === */
@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;
  }
}
