:root {
  --bg-dark: #140E25;
  --bg-paper: #F5F0E5;
  --text-body: #191523;
  --brand: #5214EB;
  --accent: #C8ED6E;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --radius-card: 8px;
  --radius-btn: 6px;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--bg-paper);
  color: var(--text-body);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* 容器与排版 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: calc(var(--gap) * 0.8);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: calc(var(--gap) * 0.6);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding-left: 1.2em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.5em;
}

/* 区块基础 */
.section {
  padding: var(--section-y) 0;
}

.light-section {
  background: var(--bg-paper);
  color: var(--text-body);
}

.dark-section {
  background: var(--bg-dark);
  color: var(--bg-paper);
}

.light-section h2 span.hl,
.dark-section h2 span.hl {
  font-weight: 800;
}

.light-section h2 span.hl {
  color: var(--brand);
}

.dark-section h2 span.hl {
  color: var(--accent);
}

.light-section p, .light-section li, .light-section dt, .light-section dd {
  color: var(--text-body);
}

.dark-section p, .dark-section li, .dark-section dt, .dark-section dd {
  color: var(--bg-paper);
}

/* 眉标 */
.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}

.light-section .tag {
  color: var(--brand);
}

.dark-section .tag {
  color: var(--accent);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 52px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--bg-paper);
  outline-offset: 2px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-body);
  color: var(--text-body);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(25, 21, 35, 0.05);
}

.dark-section .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

.dark-section .btn-secondary:hover {
  background: rgba(245, 240, 229, 0.1);
}

/* 卡片 */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5em;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.dark-section .card {
  background: var(--bg-paper);
  color: var(--text-body);
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th, td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: var(--card-border);
}

th {
  font-weight: 700;
  background: rgba(25, 21, 35, 0.03);
}

tr:last-child td {
  border-bottom: none;
}

/* 列表定义 */
dl.compact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5em;
}

dt {
  font-weight: 700;
  margin-bottom: 0.3em;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

dd {
  margin: 0;
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.85;
}

/* 流程条 */
.flow-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-top: 1.5em;
}

.flow-node {
  flex: 1 1 200px;
  text-align: center;
  padding: 1em;
  background: rgba(245, 240, 229, 0.05);
  border-radius: var(--radius-card);
  border: var(--card-border);
}

.flow-arrow {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 2em;
  border-left: 2px solid var(--card-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2em;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-num {
  position: absolute;
  left: -2.6em;
  top: 0;
  width: 2.2em;
  height: 2.2em;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75em;
  background: transparent;
}

summary {
  padding: 1em;
  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[open] summary {
  border-bottom: var(--card-border);
}

.detail-content {
  padding: 1em;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* 页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--card-border);
  padding: 1em 0;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

nav ul {
  display: flex;
  gap: 1.5em;
  list-style: none;
}

nav a {
  font-weight: 500;
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

nav a:hover, nav a[aria-current="page"] {
  border-bottom-color: var(--brand);
}

.dark-section nav {
  background: var(--bg-dark);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1em 0;
  border-bottom: none;
  z-index: 101;
}

.dark-section nav ul a {
  color: var(--bg-paper);
}

.dark-section nav ul a:hover, .dark-section nav ul a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.dark-section nav .btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}

footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding: 4em 0 2em;
  text-align: center;
  border-top: var(--card-border);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2em;
  margin-bottom: 1.5em;
  flex-wrap: wrap;
}

.footer-links a {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
}

.footer-copy {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* SVG 通用 */
svg.interface-svg {
  width: 100%;
  height: auto;
  display: block;
}

svg.interface-svg path,
svg.interface-svg circle,
svg.interface-svg rect {
  transform-box: fill-box;
  transform-origin: center;
}

/* SVG 动效类 */
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashDraw 4s ease-in-out infinite alternate;
}

.anim-flow {
  animation: dotFlow 3s ease-in-out infinite alternate;
}

.anim-float {
  animation: gentleFloat 5s ease-in-out infinite alternate;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes dashDraw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}

@keyframes dotFlow {
  0% { transform: translateX(-8px); opacity: 0.4; }
  100% { transform: translateX(8px); opacity: 1; }
}

@keyframes gentleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

@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-flow, .anim-float, .anim-breathe {
    animation: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .flow-bar {
    flex-direction: column;
  }
  .flow-arrow {
    transform: rotate(90deg);
    flex: 0 0 auto;
  }
  dl.compact {
    grid-template-columns: 1fr;
  }
  nav ul {
    display: none;
  }
  .btn {
    width: 100%;
  }
}
