/* 设计变量与基础设定 */
:root {
  /* 色板 */
  --color-dark: #271231;
  --color-paper: #F5F0E5;
  --color-text: #1F1523;
  --color-brand: #9B12D8;
  --color-accent: #ED6EC0;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 排版 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lh-body: 1.65;
}

/* 重置与全局 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 容器 */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* 眉标 */
.micro-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
}
.bg-paper .micro-label { color: var(--color-brand); }
.bg-dark .micro-label { color: var(--color-accent); }

/* 标题 */
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5em;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75em;
  line-height: 1.3;
}
p { margin-bottom: 1em; max-width: 38em; }

/* 高亮词 */
.hl { font-weight: 700; }
.bg-paper .hl { color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding-inline: 1.25em;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}
.bg-paper .btn-secondary { color: var(--color-text); border-color: var(--color-text); }
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn:hover { transform: translateY(-2px); opacity: 0.9; }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; }

/* 卡片与面板 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5em;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(31, 21, 35, 0.35); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2em;
  position: relative;
  overflow: hidden;
}

/* 表格 */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th, td {
  padding: 0.75em 1em;
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
}
th { font-weight: 700; }
.bg-dark th, .bg-dark td { border-bottom-color: rgba(245, 240, 229, 0.15); }

/* FAQ */
details {
  border-bottom: 1px solid rgba(31, 21, 35, 0.1);
  padding: 1em 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 2em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
}
details[open] summary::after { content: "-"; }
details p { margin-top: 0.5em; font-size: 0.95rem; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-btn);
  margin-right: 0.5em;
}

/* 页头页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
}
.bg-dark .site-header { background: rgba(39, 18, 49, 0.95); border-bottom-color: rgba(245, 240, 229, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links { display: flex; gap: 1.5em; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.bg-dark .nav-links a:hover, .bg-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }
.site-footer {
  padding: 3em 0;
  border-top: 1px solid rgba(31, 21, 35, 0.1);
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
}
.footer-links { display: flex; gap: 1.5em; }

/* SVG 动效基础 */
.svg-anim-container { width: 100%; max-width: 600px; margin: 0 auto; }
.svg-anim-container svg { width: 100%; height: auto; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-path 4s linear infinite;
}
.bubble-float { animation: float-bubble 5s ease-in-out infinite; }
.bubble-float-delayed { animation: float-bubble 5s ease-in-out infinite 1.5s; }
.dots-breathe::after {
  content: "...";
  animation: breathe-dots 2s steps(3) infinite;
}
.slide-in { animation: slide-up 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe-dots {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}

/* 焦点样式 */
:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
}
.bg-dark :focus-visible { outline-color: var(--color-accent); }

/* 响应式网格 */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 768px) {
  .grid-2-md { grid-template-columns: 1fr 1fr; }
  .grid-3-md { grid-template-columns: repeat(3, 1fr); }
}
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { flex-direction: column; }
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 2em; }
