/* === 设计变量 === */
:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-highlight: var(--color-brand);
  --color-muted: #6B6880;
  
  --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: 1120px;
  
  --font-sans: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
}

/* === 面覆盖 === */
.face-dark {
  --color-bg: var(--color-dark);
  --color-fg: var(--color-paper);
  --color-highlight: var(--color-accent);
  --color-muted: #A8A3C2;
  --card-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.5);
}
.card-light {
  --color-bg: var(--color-paper);
  --color-fg: var(--color-text);
  --color-highlight: var(--color-brand);
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
}

/* === 基础排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--color-fg);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-highlight); text-decoration: none; transition: color 0.2s; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 700; }

/* 修复响应式下 flex/grid 子元素及文本的横向溢出 */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  overflow-x: hidden;
  width: 100%;
}
.container > *, .btn-group, .platform-list, .alternating-layout, .steps, .checklist-grid, .news-grid, .related-links, .platform-item span {
  min-width: 0;
  overflow-wrap: break-word;
}

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-block: var(--section-y);
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}
.section:last-of-type { border-bottom: none; }

/* === 标题与眉标 === */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-highlight);
  margin-bottom: 16px;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 32px;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.text-body {
  max-width: 38em;
  margin-bottom: 1.5em;
}
.hl { color: var(--color-highlight); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-primary:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 3px; }
.btn-secondary {
  background: transparent;
  color: var(--color-fg);
  border: 1px solid currentColor;
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.btn-secondary:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 3px; }

/* === 组件：卡片 === */
.card {
  background: var(--color-bg);
  color: var(--color-fg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: calc(var(--card-shadow) * 1.3); }

/* === 组件：表格 === */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}
th, td { padding: 12px 16px; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; }
td:first-child { font-weight: 600; color: var(--color-highlight); }

/* === 组件：FAQ === */
details {
  background: var(--color-bg);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(128,128,128,0.15);
}
summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-highlight);
  border-bottom: 2px solid var(--color-highlight);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
details[open] summary::before { transform: rotate(45deg); }
.details-content { padding: 0 20px 20px; line-height: 1.7; }

/* === 组件：时间轴 === */
.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--color-highlight); }
.timeline-item { position: relative; margin-bottom: 32px; padding-left: 24px; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -29px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-highlight);
  border: 3px solid var(--color-bg);
}
.timeline-time { font-size: 0.85rem; font-weight: 700; color: var(--color-highlight); margin-bottom: 4px; letter-spacing: 0.05em; }

/* === 组件：步骤条 === */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-num {
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* === 组件：新闻卡片 === */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.news-card h4 { font-size: 1.05rem; margin-bottom: 8px; }
.news-card time { font-size: 0.8rem; color: var(--color-muted); display: block; margin-bottom: 8px; }
.news-card p { font-size: 0.95rem; color: var(--color-fg); opacity: 0.9; }

/* === SVG 基础 === */
.svg-panel {
  width: 100%;
  height: auto;
  max-width: 100%;
  overflow: hidden;
}
svg { width: 100%; height: auto; }

/* === SVG 动效关键帧 === */
@keyframes drawStroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes pulseOpacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes gridLight {
  0%, 100% { fill-opacity: 0.15; transform: scale(0.95); }
  50% { fill-opacity: 1; transform: scale(1.15); }
}
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes breatheDots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* === SVG 动效类 === */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.anim-pulse {
  animation: pulseOpacity 5s ease-in-out infinite;
}
.anim-float {
  animation: floatY 6s ease-in-out infinite;
}
.anim-grid {
  transform-box: fill-box;
  transform-origin: center;
  animation: gridLight 8s ease-in-out infinite;
}
.anim-slide {
  animation: slideInRight 7s cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate;
}
.anim-breathe {
  animation: breatheDots 3s ease-in-out infinite;
}
.stagger-1 { animation-delay: 0.5s; }
.stagger-2 { animation-delay: 1.2s; }
.stagger-3 { animation-delay: 2.0s; }
.stagger-4 { animation-delay: 2.8s; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .alternating-layout { display: flex; flex-direction: column; }
  .alternating-layout .visual-panel { order: 2; margin-top: 24px; }
  .steps { 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;
    animation-delay: 0ms !important;
  }
  .anim-grid, .anim-float, .anim-pulse, .anim-draw, .anim-slide, .anim-breathe {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
