/* ================= 设计 Token 与色板 ================= */
:root {
  --c-dark: #21163C;
  --c-paper: #F4F3F7;
  --c-text: #191523;
  --c-brand: #5214EB;
  --c-accent: #ED926E;
  --c-white: #FFFFFF;

  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);

  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ================= 主题上下文变量 ================= */
.theme-paper {
  --bg-page: var(--c-paper);
  --text-main: #191523;
  --text-heading: #191523;
  --text-link: var(--c-brand);
  --text-accent: var(--c-accent);
  --border-subtle: rgba(25, 21, 35, 0.08);
  --bg-card: var(--c-white);
}

.theme-dark {
  --bg-page: var(--c-dark);
  --text-main: var(--c-paper);
  --text-heading: var(--c-paper);
  --text-link: var(--c-accent);
  --text-accent: var(--c-accent);
  --border-subtle: rgba(244, 243, 247, 0.1);
  --bg-card: var(--c-paper);
}

.card-light {
  --bg-page: var(--c-paper);
  --text-main: var(--c-text);
  --text-heading: var(--c-text);
  --text-link: var(--c-brand);
  --text-accent: var(--c-accent);
  --border-subtle: rgba(25, 21, 35, 0.1);
  --bg-card: var(--c-white);
}

/* ================= 基础重置与排版 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  line-height: var(--line-height-body, 1.75);
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--text-link); text-decoration: underline; text-underline-offset: 3px; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }
:focus-visible { outline: 2px solid var(--text-link); outline-offset: 2px; border-radius: 4px; }

/* ================= 布局容器 ================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  border-bottom: 1px solid var(--border-subtle);
}
.section:last-child { border-bottom: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: start; overflow-wrap: anywhere; word-break: break-word; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); overflow-wrap: anywhere; word-break: break-word; }

/* ================= 标题与眉标 ================= */
.breadcrumb {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-link);
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.2rem;
}
.breadcrumb::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background-color: var(--text-link);
  border-radius: 50%;
}
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-heading);
  margin-bottom: 1rem;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.25; margin-top: 2rem; }
h3 { font-size: 1.25rem; line-height: 1.3; margin-top: 1.5rem; }
.text-hl { color: var(--text-link); font-weight: 700; }
p { margin-bottom: 1rem; max-width: 38em; }
ul, ol { margin-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* ================= 按钮组件 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background-color: var(--c-accent);
  color: var(--c-dark);
  border-color: var(--c-accent);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(237, 146, 110, 0.35); opacity: 1; }
.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border-color: currentColor;
}
.btn-secondary:hover { background-color: var(--border-subtle); opacity: 1; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ================= 卡片与面板 ================= */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35); }
.panel-dark {
  background-color: var(--c-dark);
  border-radius: var(--radius-card);
  padding: 2rem;
  color: var(--c-paper);
}

/* ================= 表格与列表 ================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
th { font-weight: 700; color: var(--text-heading); }
td:first-child { font-weight: 600; width: 35%; }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
dt { font-weight: 700; color: var(--text-heading); margin-bottom: 0.25rem; }
dd { margin-left: 0; color: var(--text-main); }

/* ================= 步骤与时间轴 ================= */
.steps-row { display: flex; flex-wrap: wrap; gap: var(--gap); counter-reset: step; }
.step-item {
  flex: 1 1 220px;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-card);
  position: relative;
  counter-increment: step;
}
.step-item::before {
  content: "0" counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--c-accent);
  color: var(--c-dark);
  font-weight: 800;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.timeline { position: relative; padding-left: 2rem; margin-bottom: 1.5rem; }
.timeline::before {
  content: "";
  position: absolute; left: 0.75rem; top: 0; bottom: 0;
  width: 2px; background: var(--border-subtle);
}
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
  content: "";
  position: absolute; left: -1.65rem; top: 0.4rem;
  width: 12px; height: 12px;
  background: var(--text-link);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-page);
}
.timeline-time { font-weight: 700; color: var(--text-link); margin-bottom: 0.25rem; font-size: 0.9rem; }

/* ================= FAQ ================= */
details {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
summary {
  padding: 1rem 1.5rem;
  font-weight: 600;
  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.25rem;
  font-weight: 400;
  transition: transform 0.2s;
}
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 1.5rem 1.25rem; color: var(--text-main); line-height: 1.7; }

/* ================= 新闻卡片 ================= */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-date { font-size: 0.8rem; color: var(--text-link); margin-bottom: 0.5rem; font-weight: 600; }
.news-title { font-weight: 700; margin-bottom: 0.5rem; line-height: 1.35; }
.news-excerpt { flex-grow: 1; font-size: 0.95rem; color: var(--text-main); }

/* ================= SVG 动效系统 ================= */
.svg-container { width: 100%; height: auto; max-width: 600px; }
.draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 0.1s; }
.anim-draw { animation: drawLoop 4s ease-in-out infinite alternate; }
.anim-breathe { animation: breathe 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: floatUp 6s ease-in-out infinite; }
.anim-slide { animation: slideIn 5s ease-in-out infinite; }
.anim-pulse { animation: pulseDot 2s ease-in-out infinite; }

@keyframes drawLoop {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-6px); opacity: 0.92; }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* ================= 响应式与无障碍 ================= */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 7vw, 3.2rem); }
  .steps-row { flex-direction: column; }
}
@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;
  }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
