:root {
  --color-dark: #251943;
  --color-paper: #DBD4ED;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED6E89;
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

section {
  padding: var(--section-y) 0;
}

.surface-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}

.surface-paper {
  background: var(--color-paper);
  color: var(--color-text);
}

/* 排版 */
h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: calc(var(--gap) * 1.5);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: var(--gap);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: calc(var(--gap) * 0.75);
}

p {
  margin-bottom: var(--gap);
  max-width: 38em;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.surface-paper .tag { color: var(--color-brand); }
.surface-dark .tag { color: var(--color-accent); }

.hl { font-weight: 600; }
.surface-paper .hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border-radius: var(--radius-btn);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  border: 1px solid currentColor;
  background: transparent;
}

.surface-paper .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.surface-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 布局网格 */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}

@media (max-width: 768px) {
  .hero-layout { grid-template-columns: 1fr; }
}

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border-radius: var(--radius-card);
}

.surface-dark .card {
  background: var(--color-paper);
  color: var(--color-text);
}

.visual-panel {
  background: var(--color-dark);
  padding: var(--gap);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
  display: block;
  overflow-x: auto;
}

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

th { font-weight: 600; }
.surface-dark th, .surface-dark td { border-color: rgba(219, 212, 237, 0.2); }

/* 步骤条 */
.steps {
  display: flex;
  gap: var(--gap);
  counter-reset: step;
}

.step {
  flex: 1;
  counter-increment: step;
  position: relative;
  padding-top: 36px;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
}

/* 导航与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  padding: 16px 0;
}

.surface-dark.site-header {
  background: var(--color-dark);
  border-bottom-color: rgba(219, 212, 237, 0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  gap: calc(var(--gap) * 1.5);
}

.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; }

.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid rgba(25, 21, 35, 0.1);
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

/* SVG 动效基础 */
.svg-anim {
  width: 100%;
  height: auto;
  max-width: 600px;
}

.node {
  fill: var(--color-brand);
  opacity: 0.2;
  transform-box: fill-box;
  transform-origin: center;
}

.surface-dark .node { fill: var(--color-accent); }

@keyframes node-glow {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.node-1 { animation: node-glow 8s ease-in-out infinite 0s; }
.node-2 { animation: node-glow 8s ease-in-out infinite 1.6s; }
.node-3 { animation: node-glow 8s ease-in-out infinite 3.2s; }
.node-4 { animation: node-glow 8s ease-in-out infinite 4.8s; }
.node-5 { animation: node-glow 8s ease-in-out infinite 6.4s; }

.line-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  stroke: currentColor;
}

@keyframes draw-loop {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}

.line-anim { animation: draw-loop 6s linear infinite; }

.bubble-float {
  animation: float 4s ease-in-out infinite alternate;
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.news-card {
  border: 1px solid rgba(25, 21, 35, 0.1);
  padding: var(--gap);
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-card);
}

.surface-dark .news-card {
  background: rgba(219, 212, 237, 0.1);
  border-color: rgba(219, 212, 237, 0.2);
}

.time-tag {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  display: block;
}

/* FAQ */
details {
  border: 1px solid rgba(25, 21, 35, 0.15);
  padding: 16px;
  margin-bottom: var(--gap);
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-card);
}

.surface-dark details {
  background: rgba(219, 212, 237, 0.08);
  border-color: rgba(219, 212, 237, 0.2);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }

summary::before {
  content: "+";
  margin-right: 8px;
  display: inline-block;
  width: 16px;
  text-align: center;
  font-weight: 700;
}

details[open] summary::before { content: "-"; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
