/* === 设计变量与全局设置 === */
:root {
  /* 色板 */
  --c-dark: #21163C;
  --c-paper: #F4F3F7;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED926E;

  /* 组件 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 辅助色（用于边框和次要元素，保持对比度） */
  --border-subtle: rgba(25, 21, 35, 0.08);
  
  /* 排版 */
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 深色面覆盖 */
.dark-surface {
  background-color: var(--c-dark);
  color: var(--c-paper);
}
.dark-surface .hl {
  color: var(--c-accent);
}
.dark-surface a:not(.btn) {
  color: var(--c-accent);
  text-decoration: underline;
}

/* 浅色卡片覆盖（当在深色面上时） */
.light-card {
  background-color: var(--c-paper);
  color: var(--c-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}
.light-card .hl {
  color: var(--c-brand);
}
.light-card a:not(.btn) {
  color: var(--c-brand);
}

/* === 基础重置 === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--c-paper);
  color: var(--c-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  padding-left: 0;
  list-style: none;
}

/* === 布局容器 === */
.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);
}

/* === 排版 === */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: calc(var(--gap) * 1.5);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
  margin-bottom: 1em;
  max-width: 38em;
}

.text-hl {
  display: inline-block;
}

.hl {
  color: var(--c-brand);
  position: relative;
}

/* 眉标 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--c-brand);
}

.dark-surface .section-label {
  color: var(--c-accent);
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--c-text);
  color: var(--c-text);
}

.dark-surface .btn-secondary {
  border-color: var(--c-paper);
  color: var(--c-paper);
}

.btn-secondary:hover {
  background-color: rgba(25, 21, 35, 0.05);
}

.dark-surface .btn-secondary:hover {
  background-color: rgba(244, 243, 247, 0.1);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* === 卡片 === */
.card {
  background-color: var(--c-paper);
  color: var(--c-text);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

/* === 表格 === */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  font-weight: 700;
  background-color: rgba(25, 21, 35, 0.03);
}

.dark-surface th {
  background-color: rgba(244, 243, 247, 0.05);
}

tr:last-child td {
  border-bottom: none;
}

/* === 步骤列表 === */
.steps-list {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

.steps-list li {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 1.5rem;
}

.steps-list li::before {
  counter-increment: step-counter;
  content: "0" counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--c-accent);
  color: var(--c-dark);
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === FAQ === */
details {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 300;
  margin-left: 1rem;
}

details[open] summary::after {
  content: "-";
}

details p {
  margin-top: 0.5rem;
  margin-bottom: 0;
  color: var(--c-text);
  opacity: 0.9;
}

.dark-surface details p {
  color: var(--c-paper);
}

/* === 时间轴 === */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid var(--c-brand);
}

.dark-surface .timeline {
  border-left-color: var(--c-accent);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.55rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background-color: var(--c-accent);
  border-radius: 50%;
  border: 2px solid var(--c-paper);
}

.dark-surface .timeline-item::before {
  border-color: var(--c-dark);
}

.timeline-time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-brand);
  margin-bottom: 0.25rem;
  display: block;
}

.dark-surface .timeline-time {
  color: var(--c-accent);
}

/* === SVG 动效样式 === */
svg {
  overflow: visible;
}

.anim-flow {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash-flow 4s linear infinite;
}

.anim-breathe {
  animation: breathe 3s ease-in-out infinite alternate;
}

.anim-float {
  animation: float 5s ease-in-out infinite alternate;
}

.anim-slide-in {
  animation: slide-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes dash-flow {
  to { stroke-dashoffset: 0; }
}

@keyframes breathe {
  from { opacity: 0.6; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* SVG 容器溢出修复 */
.svg-container {
  overflow-x: hidden;
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

/* 兜底：裁掉横向溢出 */
div {
  overflow-x: clip;
}
