/* === 设计变量 === */
:root {
  --bg-dark: #2D1438;
  --bg-paper: #F6F3F7;
  --text-main: #1F1523;
  --brand: #9E13DD;
  --accent: #6EEDA8;
  
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(31, 21, 35, 0.3);
  
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  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);
}

/* === 排版 === */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); text-wrap: balance; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) / 2); }
p { margin-bottom: var(--gap); max-width: 38em; }
.text-muted { color: rgba(31, 21, 35, 0.7); }
.text-accent { color: var(--accent); }
.text-brand { color: var(--brand); }
.text-paper { color: var(--bg-paper); }

.hl { color: var(--brand); }
.dark-surface .hl { color: var(--accent); }
.dark-surface .text-muted { color: rgba(246, 243, 247, 0.7); }

/* 眉标 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  padding: 4px 12px;
  border-radius: 99px;
}
.paper-badge { background: rgba(158, 19, 221, 0.1); color: var(--brand); }
.dark-badge { background: rgba(110, 237, 168, 0.15); color: var(--accent); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
  box-shadow: 0 4px 12px rgba(110, 237, 168, 0.25);
}
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  border: 2px solid var(--text-main);
  color: var(--text-main);
}
.dark-surface .btn-secondary {
  border-color: var(--bg-paper);
  color: var(--bg-paper);
}

/* === 页头 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31, 21, 35, 0.08);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.2rem; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav { display: flex; gap: 24px; align-items: center; }
nav a { font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
@media (max-width: 768px) {
  nav { display: none; }
}

/* === 区块 === */
.section { padding-block: var(--section-y); }
.dark-section { background-color: var(--bg-dark); color: var(--bg-paper); }
.paper-section { background-color: var(--bg-paper); color: var(--text-main); }

/* === 卡片 === */
.card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(31, 21, 35, 0.35); }
.dark-card { background: rgba(246, 243, 247, 0.08); border: 1px solid rgba(246, 243, 247, 0.1); }
.dark-card:hover { background: rgba(246, 243, 247, 0.12); }

/* === 网格布局 === */
.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); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }

/* === 时间轴 === */
.timeline { position: relative; padding-left: 32px; border-left: 2px solid rgba(31, 21, 35, 0.1); }
.dark-section .timeline { border-color: rgba(246, 243, 247, 0.2); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -39px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); border: 2px solid var(--bg-paper);
}
.dark-section .timeline-item::before { background: var(--accent); border-color: var(--bg-dark); }
.timeline-time { font-weight: 800; font-size: 0.9rem; margin-bottom: 4px; color: var(--brand); }
.dark-section .timeline-time { color: var(--accent); }

/* === 步骤条 === */
.steps { display: flex; gap: 16px; counter-reset: step; }
.step { flex: 1; position: relative; counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  width: 40px; height: 40px;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 800;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
@media (max-width: 640px) { .steps { flex-direction: column; } }

/* === 表格 === */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-card); border: 1px solid rgba(31, 21, 35, 0.1); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 16px; text-align: left; border-bottom: 1px solid rgba(31, 21, 35, 0.08); }
th { background: rgba(158, 19, 221, 0.05); font-weight: 700; }
.dark-section .table-wrapper { border-color: rgba(246, 243, 247, 0.15); }
.dark-section th { background: rgba(246, 243, 247, 0.08); }
.dark-section td, .dark-section th { border-color: rgba(246, 243, 247, 0.1); }

/* === FAQ === */
.faq details {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dark-section .faq details { background: rgba(246, 243, 247, 0.06); }
.faq summary {
  padding: 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.5rem; font-weight: 400; opacity: 0.5; }
.faq details[open] summary::after { content: '−'; }
.faq .answer { padding: 0 20px 20px; line-height: 1.6; }

/* === SVG 通用 === */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: visible;
}
svg { overflow: visible; }

/* === SVG 动效 Keyframes === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes flowDash {
  to { stroke-dashoffset: -1; }
}
@keyframes gridPulse {
  0%, 100% { opacity: 0.2; r: 3; }
  50% { opacity: 1; r: 5; fill: var(--accent); }
}

.anim-float { animation: float 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-flow { animation: flowDash 2s linear infinite; }
.anim-grid-node { animation: gridPulse 3s ease-in-out infinite; }

/* 节点延迟控制 */
.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 0.4s; }
.node-3 { animation-delay: 0.8s; }
.node-4 { animation-delay: 1.2s; }
.node-5 { animation-delay: 1.6s; }
.node-6 { animation-delay: 2.0s; }
.node-7 { animation-delay: 2.4s; }
.node-8 { animation-delay: 2.8s; }

/* 变换中心 */
.transform-center { transform-box: fill-box; transform-origin: center; }

/* === 减少动态效果 === */
@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;
  }
  .anim-float, .anim-breathe, .anim-slide, .anim-flow, .anim-grid-node {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
