:root {
  /* 色板 */
  --bg-dark: #231334;
  --bg-paper: #E9E8EA;
  --text-main: #1C1523;
  --brand-color: #7D14EB;
  --accent-color: #EDD26E;

  /* 设计 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 2px solid var(--text-main);
  --card-shadow: 4px 4px 0 var(--text-main);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --title-weight: 600;
  --title-lh: 1.25;
  --body-lh: 1.75;

  /* 默认纸面取色 */
  --page-bg: var(--bg-paper);
  --text-primary: var(--text-main);
  --text-secondary: var(--text-main);
  --accent-text: var(--brand-color);
  --link-color: var(--brand-color);
  --border-color: var(--text-main);
}

/* 深色面覆盖 */
.dark-surface {
  --page-bg: var(--bg-dark);
  --text-primary: var(--bg-paper);
  --text-secondary: var(--bg-paper);
  --accent-text: var(--accent-color);
  --link-color: var(--accent-color);
  --border-color: var(--bg-paper);
}

/* 浅色卡片在深色面上覆盖回纸面取色 */
.paper-card-in-dark {
  --page-bg: var(--bg-paper);
  --text-primary: var(--text-main);
  --text-secondary: var(--text-main);
  --accent-text: var(--brand-color);
  --link-color: var(--brand-color);
  --border-color: var(--text-main);
}

/* 基础重置与排版 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--page-bg);
  color: var(--text-primary);
  line-height: var(--body-lh);
  font-size: 16px;
  transition: background-color 0.3s, color 0.3s;
}
a { color: var(--link-color); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; display: block; }
svg { overflow: hidden; }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding-block: var(--section-y);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}

/* 标题 */
h1, h2, h3, h4 {
  font-weight: var(--title-weight);
  letter-spacing: 0;
  line-height: var(--title-lh);
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.5rem; text-wrap: balance; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 1rem; }
p { margin-bottom: 1rem; max-width: 38em; }

/* 眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--accent-text);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.2em;
  height: 2px;
  background-color: currentColor;
}

/* 高亮词 */
.hl { color: var(--accent-text); }

/* 深色背景下的眉标与高亮词对比度修复 */
.dark-surface .eyebrow,
.dark-surface .hl {
  color: #FFFFFF;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}
.btn-secondary {
  background: transparent;
  border: 2px solid var(--text-primary);
  color: var(--text-primary);
}
.dark-surface .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

/* 卡片 */
.card {
  background-color: var(--page-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.paper-card-in-dark .card {
  background-color: var(--bg-paper);
  border-color: var(--text-main);
  box-shadow: 4px 4px 0 var(--text-main);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
th { font-weight: 600; }
td:first-child { font-weight: 600; }

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  background-color: var(--page-bg);
}
summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
}
details[open] summary::after { content: "-"; }
details p {
  padding: 0 1rem 1rem;
  margin: 0;
}

/* 页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--page-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  transition: background-color 0.3s;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
}
nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-primary);
}
nav a:hover, nav a[aria-current="page"] {
  color: var(--accent-text);
}
footer {
  background-color: var(--page-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: var(--section-y);
  text-align: center;
  color: var(--text-secondary);
}

/* SVG 动效基础 */
.svg-draw path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.animate-draw { animation: drawLine 4s ease-in-out infinite alternate; }
.animate-fade { animation: fadePulse 5s ease-in-out infinite alternate; }
.animate-slide { animation: slideIn 6s ease-in-out infinite alternate; }
.animate-breathe { animation: breathe 4s ease-in-out infinite alternate; }
.animate-float { animation: float 5s ease-in-out infinite alternate; }

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes fadePulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-10px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes breathe {
  from { opacity: 0.5; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes float {
  from { transform: translateY(-4px); }
  to { transform: translateY(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
  .animate-draw, .animate-fade, .animate-slide, .animate-breathe, .animate-float {
    animation: none !important;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  nav ul { gap: 1rem; }
  h1 { font-size: 2rem; }
  section { padding-block: var(--section-y); }
}
