/* === 设计变量与基础设置 === */
:root {
  /* 色板 */
  --bg-dark: #231334;
  --bg-paper: #E9E8EA;
  --text-body: #1C1523;
  --brand: #7D14EB;
  --accent: #EDD26E;
  
  /* 卡片区分用同色系微调 */
  --card-dark: #1a0f28;
  --card-light: #dfe0e2;

  /* 结构令牌 */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;

  /* 排版 */
  --font-main: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, 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-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-body);
  background: var(--bg-paper);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
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;
}

.divider {
  height: 1px;
  background: rgba(28, 21, 35, 0.12);
  margin-block: 0;
}

/* 面上下文取色覆盖 */
.dark-surface {
  background: var(--bg-dark);
  color: var(--bg-paper);
}
.dark-surface a { color: var(--accent); }
.dark-surface .hl { color: var(--accent); }
.dark-surface .badge { color: var(--accent); }

.paper-surface {
  background: var(--bg-paper);
  color: var(--text-body);
}
.paper-surface a { color: var(--brand); }
.paper-surface .hl { color: var(--brand); }
.paper-surface .badge { color: var(--brand); }

/* 浅色卡片在深色面上恢复纸面取色 */
.dark-surface .card-light {
  background: var(--card-light);
  color: var(--text-body);
}
.dark-surface .card-light a { color: var(--brand); }
.dark-surface .card-light .hl { color: var(--brand); }

/* === 标题与眉标 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.badge::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

p { margin-bottom: 1rem; max-width: 38em; }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding-inline: 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}
.btn-primary:hover { transform: translateY(-2px); background: #e5c85a; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-body);
  color: var(--text-body);
}
.dark-surface .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }

/* === 头部与导航 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(233, 232, 234, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.08);
}
.dark-surface .site-header { background: rgba(35, 19, 52, 0.9); border-bottom-color: rgba(233, 232, 234, 0.1); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 24px; align-items: center; }
nav a { font-size: 0.95rem; font-weight: 500; position: relative; }
nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.dark-surface nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 768px) {
  nav ul { gap: 16px; }
}

/* === 页脚 === */
.site-footer {
  background: var(--bg-dark);
  color: var(--bg-paper);
  padding-block: 48px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
}
.footer-col h4 { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 12px; color: var(--accent); }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a:hover { text-decoration: underline; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(233, 232, 234, 0.15);
  text-align: center;
  color: rgba(233, 232, 234, 0.6);
}

/* === 组件：卡片、表格、FAQ === */
.card {
  background: var(--card-light);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.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); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(28, 21, 35, 0.1); }
th { font-weight: 600; }
tr:last-child th, tr:last-child td { border-bottom: none; }

details {
  background: var(--card-light);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
}
summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: transform 0.2s;
}
details[open] summary::after { content: "−"; }
details p { padding: 0 20px 16px; font-size: 0.95rem; line-height: 1.7; }

/* === 图文交错布局 === */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
@media (max-width: 768px) {
  .split-row { grid-template-columns: 1fr; }
  .split-row.reverse .visual-panel { order: -1; }
}

.visual-panel {
  background: var(--bg-dark);
  border-radius: var(--radius-card);
  padding: 24px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  max-width: 100%;
}
.dark-surface .visual-panel { background: var(--card-dark); }
.visual-panel svg { width: 100%; height: auto; min-width: 0; }

/* === SVG 动效核心规则 === */
svg { width: 100%; height: auto; }
svg path, svg circle, svg rect, svg polygon { transform-box: fill-box; transform-origin: center; }

/* 描边绘制 */
.draw-stroke {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

/* 几何旋转拼合 */
.geo-spin {
  animation: spin-slow 12s linear infinite;
}
@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.geo-pulse {
  animation: pulse-rotate 8s ease-in-out infinite alternate;
}
@keyframes pulse-rotate {
  0% { transform: scale(0.95) rotate(0deg); }
  100% { transform: scale(1.05) rotate(15deg); }
}

/* 浮动与呼吸 */
.float-layer {
  animation: float-y 5s ease-in-out infinite;
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.breathe-dot {
  animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
.slide-in {
  animation: slide-up 4s ease-in-out infinite;
}
@keyframes slide-up {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); 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-stroke, .geo-spin, .geo-pulse, .float-layer, .breathe-dot, .slide-in {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* === 工具类 === */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.hint { font-size: 0.85rem; color: rgba(28, 21, 35, 0.7); margin-top: 0.5rem; }
.dark-surface .hint { color: rgba(233, 232, 234, 0.7); }
.step-list { counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin-bottom: 16px;
}
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dark-surface .step-list li::before { background: var(--accent); color: var(--bg-dark); }
scenario-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(125, 20, 235, 0.1);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  margin-bottom: 8px;
}
.dark-surface scenario-tag { background: rgba(237, 210, 110, 0.15); color: var(--accent); }

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
