/* ================= 设计变量与基础重置 ================= */
:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #D6D4ED;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;

  /* 排版 Token */
  --title-weight: 600;
  --title-lh: 1.25;
  --body-lh: 1.55;
  --header-h: 64px;

  /* 取色上下文变量（默认纸面） */
  --text-main: var(--color-body);
  --text-muted: rgba(23, 21, 35, 0.65);
  --link-color: var(--color-brand);
  --accent-color: var(--color-brand);
  --bg-surface: var(--color-paper);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  line-height: var(--body-lh);
  color: var(--text-main);
  background: var(--bg-surface);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 2px;
}

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;
}

.bg-dark {
  background: var(--color-dark);
  --text-main: var(--color-paper);
  --text-muted: rgba(214, 212, 237, 0.7);
  --link-color: var(--color-accent);
  --accent-color: var(--color-accent);
}

.bg-paper {
  background: var(--color-paper);
  --text-main: var(--color-body);
  --text-muted: rgba(23, 21, 35, 0.65);
  --link-color: var(--color-brand);
  --accent-color: var(--color-brand);
}

/* 纸面上的深色卡片重置为纸面取色 */
.card-light-on-dark {
  background: var(--color-paper);
  color: var(--color-body);
  --text-main: var(--color-body);
  --text-muted: rgba(23, 21, 35, 0.65);
  --link-color: var(--color-brand);
  --accent-color: var(--color-brand);
}

.grid-2 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

/* ================= 排版组件 ================= */
.masthead {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--gap);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.masthead::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--accent-color);
}

h1, h2, h3, h4 {
  font-weight: var(--title-weight);
  line-height: var(--title-lh);
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--gap) * 0.8);
}

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; margin-top: var(--gap); }

p { margin-bottom: var(--gap); max-width: 38em; }

.hl {
  color: var(--accent-color);
  font-weight: 700;
}

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding-inline: 28px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-primary {
  background: var(--accent-color);
  color: var(--color-dark);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(137, 237, 110, 0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--text-main);
}
.btn-secondary:hover {
  background: rgba(128, 128, 128, 0.1);
  transform: translateY(-1px);
}
.btn-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ================= 卡片与面板 ================= */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: calc(var(--gap) * 1.5);
  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);
}

.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}
.panel .card-light-on-dark {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 0;
  box-shadow: none;
}

/* ================= 表格 ================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-card);
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
th, td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--text-muted);
}
th {
  font-weight: 700;
  background: rgba(128, 128, 128, 0.08);
}
td:first-child { font-weight: 600; }

/* ================= FAQ ================= */
details {
  border: 1px solid var(--text-muted);
  border-radius: 12px;
  margin-bottom: var(--gap);
  overflow: hidden;
  transition: background 0.2s ease;
}
details[open] { background: rgba(128, 128, 128, 0.06); }
summary {
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-color);
  color: var(--color-dark);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
details[open] summary::before { content: "−"; }
details p {
  padding: 0 20px 18px;
  color: var(--text-muted);
  line-height: var(--body-lh);
}

/* ================= 页头页脚 ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(214, 212, 237, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--text-muted);
  height: var(--header-h);
}
.bg-dark .header { background: rgba(19, 16, 45, 0.9); border-bottom-color: rgba(214, 212, 237, 0.15); }
.header-inner {
  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;
  color: var(--text-main);
}
.brand img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 24px; }
nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-main);
  position: relative;
}
nav a:hover, nav a[aria-current="page"] { color: var(--color-dark); }
nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
}
.footer {
  padding-block: 48px;
  border-top: 1px solid var(--text-muted);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer h4 { color: var(--text-main); margin-bottom: 16px; font-size: 1rem; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: var(--text-muted); }
.copyright {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--text-muted);
}

/* ================= SVG 动效核心规则 ================= */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.svg-panel path, .svg-panel rect, .svg-panel circle, .svg-panel polyline {
  vector-effect: non-scaling-stroke;
}

/* 描边自绘 */
.draw-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
@keyframes drawStroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* 呼吸缩放 */
.breathe {
  animation: breathe 6s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes breathe {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* 漂浮 */
.float {
  animation: floatUp 5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes floatUp {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* 滑入 */
.slide-in {
  animation: slideIn 3s cubic-bezier(0.2, 0, 0.2, 1) infinite alternate;
}
@keyframes slideIn {
  from { opacity: 0.6; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 点阵呼吸 */
.dot-pulse {
  animation: dotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate;
}
@keyframes dotPulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* 减少动态效果 */
@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;
  }
  .draw-path, .breathe, .float, .slide-in, .dot-pulse {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ================= 响应式适配 ================= */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 12px 0; }
  nav ul { gap: 16px; margin: 8px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .panel { aspect-ratio: 16 / 9; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
