/* ==================== 设计变量与基础重置 ==================== */
:root {
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-text: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  font-size: 16px;
  background-color: var(--color-paper);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ==================== 上下文取色覆盖 ==================== */
.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
  --c-head: var(--color-paper);
  --c-body: rgba(var(--rgb-paper), 0.85);
  --c-link: var(--color-accent);
  --c-accent: var(--color-accent);
  --c-brand: var(--color-accent);
}
.bg-paper {
  background-color: var(--color-paper);
  color: var(--color-text);
  --c-head: var(--color-text);
  --c-body: var(--color-text);
  --c-link: var(--color-brand);
  --c-accent: var(--color-accent);
  --c-brand: var(--color-brand);
}
:root { --rgb-paper: 247, 245, 243; }

/* ==================== 布局与排版 ==================== */
.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);
}
.section + .section { margin-top: 0; }
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 0.5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); text-wrap: balance; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin-bottom: 1em; max-width: 38em; }
.text-center { text-align: center; }
.highlight { color: var(--c-accent); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-brand);
  margin-bottom: 0.75em;
}

/* ==================== 组件：按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  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;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--c-head);
  border: 1px solid currentColor;
}
.btn-icon { width: 20px; height: 20px; stroke-width: 2; }

/* ==================== 组件：卡片与面板 ==================== */
.card {
  background-color: var(--color-paper);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: box-shadow 0.3s ease;
}
.bg-dark .card {
  background-color: #1C1A38;
  color: var(--color-paper);
}
.card:hover { box-shadow: 0 12px 32px -12px rgba(23, 21, 35, 0.4); }
.panel {
  background-color: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.bg-paper .panel { background-color: #EDEDF0; }

/* ==================== 组件：表格 ==================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
th { font-weight: 600; }
td a { color: var(--c-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* ==================== 组件：FAQ ==================== */
details {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  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.2em;
  transition: transform 0.2s;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { padding: 0 20px 16px; font-size: 0.95rem; line-height: 1.7; color: var(--c-body); }

/* ==================== 组件：步骤条 ==================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  counter-reset: step-counter;
}
.step-item {
  position: relative;
  padding-left: 48px;
  counter-increment: step-counter;
}
.step-item::before {
  content: counter(step-counter);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
  display: grid; place-items: center;
}

/* ==================== 组件：新闻卡片 ==================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.news-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.news-date {
  font-size: 0.8rem;
  color: var(--c-body);
  margin-bottom: 8px;
  display: block;
}
.news-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.news-excerpt { font-size: 0.9rem; color: var(--c-body); line-height: 1.6; }

/* ==================== SVG 动效系统 ==================== */
.svg-wrapper { width: 100%; height: auto; }
.flow-path {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 4s linear infinite;
}
.flow-path-reverse {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dashFlow 5s linear infinite reverse;
}
.anim-float { animation: floatY 4s ease-in-out infinite; }
.anim-float-delay { animation: floatY 4.5s ease-in-out infinite 1.2s; }
.anim-pulse { animation: pulseOpacity 3s ease-in-out infinite; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes dashFlow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulseOpacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-path, .flow-path-reverse, .anim-float, .anim-float-delay, .anim-pulse {
    animation: none !important;
  }
}
.transform-box-center { transform-box: fill-box; transform-origin: center; }

/* ==================== 响应式微调 ==================== */
@media (max-width: 768px) {
  .alt-layout { flex-direction: column-reverse !important; }
  .steps-grid { grid-template-columns: 1fr; }
}
.alt-layout { display: flex; gap: var(--gap); align-items: center; }
.alt-layout > div:first-child { flex: 1; }
.alt-layout > div:last-child { flex: 1; max-width: 100%; }
@media (min-width: 769px) {
  .alt-layout.reverse { flex-direction: row-reverse; }
}
