/* === 设计变量 === */
:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #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(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
}

/* === 基础排版 === */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

ul, ol { padding-left: 1.5em; }

/* === 容器 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

/* === 眉标 & 标题 === */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5em;
}

.dark .label { color: var(--color-accent); }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 0; margin-bottom: 0.6em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-top: 0; margin-bottom: 0.4em; }

.hl { color: var(--color-brand); }
.dark .hl { color: var(--color-accent); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 48px;
  padding: 0 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

/* === 卡片 === */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  padding: 1.5em;
  transition: box-shadow 0.3s ease;
}

.card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.4); }

.dark .card {
  background: #2c204a;
  color: var(--color-paper);
}

/* === 网格 === */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* === 表格 === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}

.dark th, .dark td {
  border-bottom-color: rgba(233, 232, 234, 0.15);
}

th { font-weight: 700; }

/* === FAQ === */
details {
  border: 1px solid rgba(25, 21, 35, 0.12);
  border-radius: var(--radius-card);
  margin-bottom: 0.75em;
  overflow: hidden;
}

.dark details {
  border-color: rgba(233, 232, 234, 0.15);
}

summary {
  padding: 1em 1.25em;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5em;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  position: absolute;
  right: 1em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

details > :not(summary) {
  padding: 0 1.25em 1em;
  line-height: 1.7;
}

/* === 页头 === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
  backdrop-filter: blur(8px);
}

.dark-header {
  background: var(--color-dark);
  border-bottom-color: rgba(233, 232, 234, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo img {
  height: 32px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5em;
  margin: 0;
  padding: 0;
}

nav a {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25em 0;
  position: relative;
}

nav a:hover { color: var(--color-brand); }
.dark nav a:hover { color: var(--color-accent); }

nav a[aria-current="page"] { color: var(--color-brand); }
.dark nav a[aria-current="page"] { color: var(--color-accent); }

nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* === 页脚 === */
.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3em 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2em;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li { margin-bottom: 0.5em; }

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 1; }

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* === SVG 动效 === */
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

.draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 4s ease forwards;
}

.breathe {
  animation: breathe 4s ease-in-out infinite;
}

.float {
  animation: float 6s ease-in-out infinite;
}

.slide-in {
  animation: slideIn 1.5s ease forwards;
}

.pulse-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

/* === 减少动画偏好 === */
@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;
  }
}

/* === 响应式 === */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; height: auto; padding: 0.75em 0; }
  nav ul { gap: 1em; font-size: 0.85rem; }
  .hero-grid { grid-template-columns: 1fr !important; }
  .timeline { padding-left: 1.5em !important; }
  .steps-horizontal { flex-direction: column !important; }
}
