/* === 设计变量与基础配置 === */
:root {
  --color-dark: #21163C;
  --color-paper: #E9E8EA;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --color-paper-light: #F7F6F8;

  --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: 1120px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --line-height-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--color-paper);
  -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 {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}

/* === 主题配色覆盖 === */
.theme-dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.theme-dark .eyebrow,
.theme-dark a:not(.btn-primary):not(.btn-secondary) {
  color: var(--color-accent);
}
.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark p, .theme-dark li {
  color: var(--color-paper);
}
.theme-dark .hl { color: var(--color-accent); }

.theme-paper {
  background: var(--color-paper);
  color: var(--color-text);
}
.theme-paper .eyebrow,
.theme-paper a:not(.btn-primary):not(.btn-secondary) {
  color: var(--color-brand);
}
.theme-paper .hl { color: var(--color-brand); }

/* === 排版组件 === */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 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: 1.5rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 600; }

/* === 按钮系统 === */
.btn-group { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding-inline: 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { background: #D97A54; }
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-text);
  color: var(--color-text);
}
.theme-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* === 卡片与面板 === */
.card {
  background: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  border: var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.theme-dark .card { background: var(--color-paper-light); }

/* === 表格 === */
.table-wrap { overflow-x: auto; margin-top: 1rem; border-radius: var(--radius-card); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-paper-light);
  min-width: 500px;
}
th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
th { font-weight: 600; background: rgba(82, 20, 235, 0.05); }
td { vertical-align: top; }
tr:last-child td { border-bottom: none; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
details {
  background: var(--color-paper-light);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  transition: background 0.2s ease;
}
details[open] { background: rgba(82, 20, 235, 0.04); }
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
details[open] summary::before { transform: rotate(45deg); }
details p { margin-top: 0.75rem; font-size: 0.95rem; line-height: 1.6; }

/* === 步骤条 === */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
  counter-reset: step;
}
.step-item {
  position: relative;
  padding-left: 3.5rem;
}
.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-title { font-weight: 600; margin-bottom: 0.25rem; }

/* === 时间轴 === */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(237, 146, 110, 0.3);
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--color-dark);
}
.time-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
  display: block;
}

/* === 新闻网格 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}
.news-card article {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.news-card time {
  font-size: 0.8rem;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.theme-dark .news-card time { color: var(--color-accent); }

/* === SVG 动效 === */
.grid-node {
  fill: var(--color-accent);
  opacity: 0.15;
  transform-origin: center;
  transform-box: fill-box;
  animation: node-pulse 6s infinite ease-in-out;
}
.node-1 { animation-delay: 0.0s; }
.node-2 { animation-delay: 0.5s; }
.node-3 { animation-delay: 1.0s; }
.node-4 { animation-delay: 1.5s; }
.node-5 { animation-delay: 2.0s; }
.node-6 { animation-delay: 2.5s; }
.node-7 { animation-delay: 3.0s; }
.node-8 { animation-delay: 3.5s; }
.node-9 { animation-delay: 4.0s; }
.node-10 { animation-delay: 4.5s; }
.node-11 { animation-delay: 5.0s; }
.node-12 { animation-delay: 5.5s; }

@keyframes node-pulse {
  0%, 100% { opacity: 0.1; transform: scale(0.9); }
  50% { opacity: 0.85; transform: scale(1.15); }
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
  .steps-grid { grid-template-columns: 1fr; }
}

@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;
  }
  .grid-node { opacity: 0.3; transform: none; animation: none; }
}
