:root {
  /* 色板 */
  --color-dark: #17203F;
  --color-paper: #FCFCFD;
  --color-text: #151823;
  --color-brand: #1441EB;
  --color-accent: #6EEDBD;

  /* 结构变量 */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(21, 24, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 排版变量 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --lh-body: 1.65;
  --lh-heading: 1.15;
  --fs-h1: clamp(2.2rem, 5vw, 4rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
main section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* 表面层配色逻辑 */
.surface-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.surface-dark .hl { color: var(--color-accent); }
.surface-dark .badge { color: var(--color-accent); }
.surface-dark a:not(.btn) { color: var(--color-accent); }
.surface-dark h1, .surface-dark h2, .surface-dark h3, .surface-dark p, .surface-dark li, .surface-dark td, .surface-dark th { color: var(--color-paper); }
.surface-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.surface-dark details { border-color: rgba(252, 252, 253, 0.15); }
.surface-dark details summary { color: var(--color-paper); }
.surface-dark .card { background: rgba(252, 252, 253, 0.05); border-color: rgba(252, 252, 253, 0.1); }
.surface-dark .card h3, .surface-dark .card p, .surface-dark .card time { color: var(--color-paper); }

.surface-paper {
  background: var(--color-paper);
  color: var(--color-text);
}
.surface-paper .hl { color: var(--color-brand); }
.surface-paper .badge { color: var(--color-brand); }
.surface-paper a:not(.btn) { color: var(--color-brand); }
.surface-paper h1, .surface-paper h2, .surface-paper h3, .surface-paper p, .surface-paper li, .surface-paper td, .surface-paper th { color: var(--color-text); }
.surface-paper .btn-secondary { border-color: var(--color-text); color: var(--color-text); }
.surface-paper details { border-color: var(--card-border); }
.surface-paper details summary { color: var(--color-text); }
.surface-paper .card { background: var(--color-paper); border-color: var(--card-border); }
.surface-paper .card h3, .surface-paper .card p, .surface-paper .card time { color: var(--color-text); }

/* 基础组件 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
h2 {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 32px;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 16px;
}
p {
  max-width: 38em;
  margin-bottom: 16px;
}
ul, ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
li {
  margin-bottom: 8px;
}
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}
.surface-dark a:focus-visible, .surface-dark button:focus-visible {
  outline-color: var(--color-accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 48px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(110, 237, 189, 0.35);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.btn-secondary:hover {
  background: rgba(21, 24, 35, 0.05);
}

/* 卡片与表格 */
.card {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  background: var(--color-paper);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
  overflow-x: auto;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: var(--card-border);
  word-break: break-word;
}
th { font-weight: 600; }
td { color: inherit; }

/* FAQ Details */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--color-paper);
}
summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; content: ""; }
details[open] summary { border-bottom: var(--card-border); }
details p {
  padding: 16px;
  margin: 0;
  max-width: 100%;
}

/* 网格与排版工具 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }

/* SVG 容器与缩放 */
.svg-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.svg-container svg {
  width: 100%;
  height: auto;
  display: block;
}

/* SVG 动效定义 */
.anim-flow-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 3s ease-in-out infinite alternate;
}
.anim-flow-dot {
  offset-path: path('M 0 0 C 50 20, 100 20, 150 0');
  animation: dotFlow 4s linear infinite;
}
.anim-breathe {
  animation: breathe 2.5s ease-in-out infinite;
}
.anim-slide-up {
  animation: slideUp 0.8s ease-out forwards;
  opacity: 0;
}
.anim-float {
  animation: float 4s ease-in-out infinite;
}
.anim-pulse-ring {
  animation: pulseRing 3s ease-out infinite;
}

@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes dotFlow {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes pulseRing {
  0% { r: 4; opacity: 1; }
  100% { r: 16; opacity: 0; }
}

/* 旋转/缩放 SVG 子元素规范 */
svg .rotator, svg .scaler {
  transform-box: fill-box;
  transform-origin: center;
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-flow-line, .anim-breathe, .anim-slide-up, .anim-float, .anim-pulse-ring {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
}
