:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 结构与尺寸 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-padding: clamp(64px, 9vw, 120px);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;

  /* 排版 */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-title: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 基础重置 */
*, *::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);
  font-size: 16px;
  line-height: 1.55;
  background: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* 主题面控制 */
.dark-face { background: var(--color-dark); color: var(--color-paper); }
.dark-face h1, .dark-face h2, .dark-face h3, .dark-face p, .dark-face li, .dark-face td, .dark-face th { color: var(--color-paper); }
.dark-face .hl { color: var(--color-accent); }
.dark-face .badge { color: var(--color-accent); }
.dark-face .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.dark-face .card { background: var(--color-paper); color: var(--color-text); }
.dark-face .card h3, .dark-face .card p { color: var(--color-text); }

.paper-face { background: var(--color-paper); color: var(--color-text); }
.paper-face h1, .paper-face h2, .paper-face h3, .paper-face p, .paper-face li, .paper-face td, .paper-face th { color: var(--color-text); }
.paper-face .hl { color: var(--color-brand); }
.paper-face .badge { color: var(--color-brand); }

/* 标题系统 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
h1 {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 1em;
  text-wrap: balance;
}
h2 {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.8em;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 1.5em 0 0.6em;
}
p { margin-bottom: 1em; max-width: 38em; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.8em 1.6em;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  border: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.dark-face .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 卡片 */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  border: var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.35); }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-paper);
  border-radius: var(--radius-card);
  overflow: hidden;
  min-width: 320px;
}
th, td { padding: 0.8em 1em; text-align: left; border-bottom: 1px solid rgba(23, 21, 35, 0.1); }
th { font-weight: 700; background: rgba(23, 21, 35, 0.04); }
.dark-face table { background: var(--color-paper); }
.dark-face th, .dark-face td { color: var(--color-text); border-color: rgba(23, 21, 35, 0.1); }

/* FAQ / Details */
details {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  margin-bottom: var(--gap);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(23, 21, 35, 0.08);
}
summary {
  padding: 1em 1.2em;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-left: 2.5em;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  position: absolute;
  left: 1em;
  top: 50%;
  transform: translateY(-50%);
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.dark-face details { background: var(--color-paper); color: var(--color-text); }
details[open] summary { background: rgba(23, 21, 35, 0.04); }
.detail-content { padding: 0 1.2em 1em; line-height: 1.65; }

/* 网格与辅助 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.mt-2 { margin-top: 2em; }
.mb-2 { margin-bottom: 2em; }

/* SVG 基础控制 */
.svg-panel {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}
.svg-panel svg {
  width: 100%;
  height: auto;
  display: block;
}
/* 动画元素中心点与变换基准 */
.anim-node, .anim-bubble, .anim-line, .anim-card {
  transform-box: fill-box;
  transform-origin: center;
}

/* SVG 动效 Keyframes */
@keyframes grid-light {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes bubble-float {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes line-flow {
  0% { stroke-dashoffset: 1; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 1; opacity: 0.4; }
}
@keyframes card-slide-in {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(4px); opacity: 1; }
}
@keyframes dot-pulse {
  0%, 100% { r: 2; opacity: 0.5; }
  50% { r: 3.5; opacity: 1; }
}

/* 动效类应用 */
.node { animation: grid-light 4s ease-in-out infinite; }
.node:nth-child(3n+1) { animation-delay: 0.2s; }
.node:nth-child(3n+2) { animation-delay: 0.8s; }
.node:nth-child(3n) { animation-delay: 1.4s; }

.bubble { animation: bubble-float 5s ease-in-out infinite; }
.bubble:nth-of-type(1) { animation-delay: 0s; }
.bubble:nth-of-type(2) { animation-delay: 1.2s; }
.bubble:nth-of-type(3) { animation-delay: 2.5s; }

.flow-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: line-flow 6s ease-in-out infinite;
}

.notif-card { animation: card-slide-in 7s ease-in-out infinite; }

.typing-dot { animation: dot-pulse 1.5s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.3s; }
.typing-dot:nth-child(3) { animation-delay: 0.6s; }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .hero-layout { flex-direction: column; }
  .split-layout { flex-direction: column; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .node, .bubble, .flow-line, .notif-card, .typing-dot {
    opacity: 1;
    transform: none;
  }
}
