:root {
  /* 色板 */
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-paper-alt: #EAE9F0;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;

  /* 结构变量 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25,21,35,0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  /* 默认取色（纸面） */
  --text-main: var(--color-body);
  --text-muted: rgba(25,21,35,0.7);
  --icon-color: var(--color-brand);
  --link-color: var(--color-brand);
  --bg-surface: var(--color-paper);
  --bg-surface-alt: var(--color-paper-alt);

  /* 排版 */
  --font-title: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 面系统覆盖 */
.face-dark {
  --text-main: var(--color-paper);
  --text-muted: rgba(244,243,247,0.75);
  --icon-color: var(--color-accent);
  --link-color: var(--color-accent);
  --bg-surface: var(--color-dark);
  --bg-surface-alt: #2A1D4A;
}
.face-card-light {
  --text-main: var(--color-body);
  --text-muted: rgba(25,21,35,0.7);
  --icon-color: var(--color-brand);
  --link-color: var(--color-brand);
  --bg-surface: var(--color-paper);
  --bg-surface-alt: var(--color-paper-alt);
}

*, *::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.75;
  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; }
a:hover { opacity: 0.85; }
:focus-visible { outline: 2px solid var(--link-color); outline-offset: 2px; border-radius: 2px; }

/* 布局容器 */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }

/* 排版 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  color: var(--icon-color);
}
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 0.8rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.6rem; }
p { margin-bottom: 1rem; color: var(--text-muted); max-width: 38em; }
.hl { color: var(--icon-color); font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; padding: 0 1.2rem;
  font-size: 1rem; font-weight: 600; line-height: 1;
  border-radius: var(--radius-btn); border: none; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}
.btn-primary {
  background: var(--color-accent); color: var(--color-dark);
  box-shadow: 0 4px 12px rgba(237,146,110,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237,146,110,0.35); }
.btn-secondary {
  background: transparent; color: var(--text-main); border: 1px solid var(--text-main);
}
.btn-secondary:hover { background: rgba(25,21,35,0.05); }
.face-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.face-dark .btn-secondary:hover { background: rgba(244,243,247,0.1); }

/* 卡片与面板 */
.card {
  background: var(--bg-surface);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25,21,35,0.35); }
.panel {
  background: var(--bg-surface-alt);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.face-dark .panel { background: #2B1E4D; }
.face-card-light .panel { background: var(--color-paper-alt); }

/* 网格与图文交错 */
.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); }
.row-alternate { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.row-alternate > * { flex: 1 1 0; min-width: 0; }
.row-alternate.reverse > *:nth-child(1) { order: 2; }
.row-alternate.reverse > *:nth-child(2) { order: 1; }
@media (min-width: 768px) {
  .row-alternate > * { flex: 1 1 45%; }
}

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--text-muted); }
th { font-weight: 600; color: var(--text-main); }
td { color: var(--text-muted); }
tr:last-child td { border-bottom: none; }

/* 列表 */
ul.check-list { list-style: none; padding-left: 0; }
ul.check-list li {
  position: relative; padding-left: 1.6rem; margin-bottom: 0.6rem; color: var(--text-muted);
}
ul.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45rem;
  width: 8px; height: 8px; border-radius: 2px; background: var(--icon-color);
}

/* 步骤徽标 */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--color-accent); color: var(--color-dark);
  font-weight: 700; font-size: 0.9rem; margin-right: 0.6rem; flex-shrink: 0;
}

/* FAQ */
details {
  border-bottom: 1px solid var(--text-muted); padding: 1rem 0;
  transition: background 0.2s;
}
summary {
  cursor: pointer; font-weight: 600; color: var(--text-main); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; color: var(--icon-color); }
details[open] summary::after { content: "−"; }
details p { margin-top: 0.6rem; font-size: 0.95rem; }

/* 页头页脚 */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244,243,247,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25,21,35,0.08);
}
.face-dark .site-header { background: rgba(33,22,60,0.9); border-color: rgba(244,243,247,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo img { height: 32px; width: auto; margin-right: 0.5rem; }
.nav { display: flex; gap: 1.2rem; align-items: center; }
.nav a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text-main); }
.site-footer {
  padding: var(--section-y) 0; border-top: 1px solid var(--text-muted); margin-top: var(--section-y);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.8rem; color: var(--text-main); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.copyright { text-align: center; margin-top: var(--gap); color: var(--text-muted); font-size: 0.85rem; }

/* SVG 动效基础 */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-panel { width: 100%; height: auto; max-width: 100%; }
svg path, svg circle, svg rect, svg line, svg polyline, svg polygon { vector-effect: non-scaling-stroke; }

/* 关键帧 */
@keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes floatYSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pulseOp { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(-12px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes dashFlow { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 3s ease forwards; }
.anim-float-1 { animation: floatY 6s ease-in-out infinite; }
.anim-float-2 { animation: floatYSlow 7.5s ease-in-out infinite 1s; }
.anim-pulse { animation: pulseOp 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s ease forwards; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; animation: dashFlow 2.5s linear infinite; }

/* 减少动态效果 */
@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-float-1, .anim-float-2, .anim-pulse, .anim-slide, .anim-flow {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
