/* ================= 设计变量 ================= */
:root {
  --c-dark: #231334;
  --c-paper: #F5F3F7;
  --c-body: #1C1523;
  --c-brand: #7D14EB;
  --c-accent: #EDD26E;
  --r-card: 20px;
  --r-btn: 12px;
  --border-card: 2px solid var(--c-body);
  --shadow-card: 4px 4px 0 var(--c-body);
  --sec-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --max-w: 960px;
  --lh: 1.55;
  --fw-h: 600;
  --lh-h: 1.25;
  --fs-h1: clamp(2rem, 4.6vw, 3.4rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-body: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

/* ================= 基础重置 ================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh);
  color: var(--c-body);
  background: var(--c-paper);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ================= 布局系统 ================= */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px;
  padding: var(--gap);
  border-right: 1px solid var(--c-body);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  background: var(--c-paper);
  z-index: 50;
}
.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap);
}
.section { padding: var(--sec-y) 0; }
.surface-dark { background: var(--c-dark); color: var(--c-paper); }
.surface-light { background: var(--c-paper); color: var(--c-body); }
.surface-dark .hl { color: var(--c-accent); }
.surface-light .hl { color: var(--c-brand); }
.surface-dark .link { color: var(--c-accent); }
.surface-light .link { color: var(--c-brand); }
.surface-dark .btn-primary { background: var(--c-accent); color: var(--c-dark); }
.surface-light .btn-primary { background: var(--c-brand); color: var(--c-paper); }

/* 桌面侧边栏样式 */
.sidebar-header { display: flex; align-items: center; gap: 12px; padding-bottom: var(--gap); border-bottom: 1px solid var(--c-body); }
.sidebar-logo { width: 40px; height: 40px; object-fit: contain; }
.sidebar-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  padding: 10px 12px;
  border-radius: var(--r-btn);
  font-weight: 500;
  transition: background 0.2s;
}
.nav-item:hover, .nav-item[aria-current="page"] { background: rgba(125, 20, 235, 0.08); }
.sidebar-footer { padding-top: var(--gap); border-top: 1px solid var(--c-body); font-size: 0.85rem; opacity: 0.8; }

/* 移动端导航切换 */
.mobile-toggle { display: none; position: fixed; top: 16px; left: 16px; z-index: 60; background: var(--c-paper); border: var(--border-card); border-radius: var(--r-btn); padding: 8px; cursor: pointer; }
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; width: 100%; height: auto;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  .sidebar.open { transform: translateY(0); }
  .sidebar-header { padding: 16px; }
  .sidebar-nav { padding: 16px; }
  .main-content { margin-top: 60px; }
}

/* ================= 排版组件 ================= */
.mega-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; margin-bottom: 12px;
}
.surface-dark .mega-label { color: var(--c-accent); }
.surface-light .mega-label { color: var(--c-brand); }
h1 { font-size: var(--fs-h1); font-weight: var(--fw-h); line-height: var(--lh-h); letter-spacing: -0.02em; margin-bottom: 16px; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-h); line-height: var(--lh-h); margin-bottom: 24px; }
h3 { font-size: 1.25rem; font-weight: var(--fw-h); line-height: var(--lh-h); margin: 24px 0 12px; }
p { margin-bottom: 16px; max-width: 38em; }
.text-muted { opacity: 0.8; font-size: 0.9em; }

/* ================= 按钮系统 ================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px;
  border-radius: var(--r-btn);
  font-weight: 600; font-size: 1rem;
  cursor: pointer; border: none; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--c-brand); color: var(--c-paper); }
.surface-dark .btn-primary { background: var(--c-accent); color: var(--c-dark); }
.btn-secondary { background: transparent; border: 2px solid currentColor; color: currentColor; }
.surface-dark .btn-secondary { border-color: var(--c-paper); color: var(--c-paper); }
.btn-icon { width: 20px; height: 20px; stroke-width: 2; }

/* ================= 卡片与网格 ================= */
.card {
  background: var(--c-paper); color: var(--c-body);
  border: var(--border-card); box-shadow: var(--shadow-card);
  border-radius: var(--r-card); padding: var(--gap);
}
.surface-dark .card { background: var(--c-paper); color: var(--c-body); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* ================= 表格 ================= */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 300px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid currentColor; opacity: 0.9; }
th { font-weight: 700; background: rgba(125, 20, 235, 0.05); }
.surface-dark th { background: rgba(237, 210, 110, 0.1); }
td:first-child { font-weight: 600; white-space: nowrap; }

/* ================= FAQ / Details ================= */
details { border: var(--border-card); border-radius: var(--r-card); margin-bottom: 12px; overflow: hidden; background: var(--c-paper); }
.surface-dark details { background: var(--c-paper); color: var(--c-body); }
summary {
  padding: 16px; 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.2rem; font-weight: 400; }
details[open] summary::after { content: "−"; }
.summary-content { padding: 0 16px 16px; line-height: var(--lh); }

/* ================= 快速开始时间线 ================= */
.timeline { position: relative; padding-left: 24px; border-left: 2px solid currentColor; opacity: 0.9; }
.timeline-item { position: relative; margin-bottom: 32px; padding-left: 20px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: attr(data-step);
  position: absolute; left: -34px; top: 0;
  width: 28px; height: 28px;
  background: var(--c-accent); color: var(--c-dark);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.surface-dark .timeline-item::before { background: var(--c-accent); color: var(--c-dark); }

/* ================= 新闻卡片 ================= */
.news-card { display: flex; flex-direction: column; gap: 12px; }
.news-date { font-size: 0.85rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.news-title { font-weight: 700; line-height: 1.3; }
.news-excerpt { font-size: 0.95rem; opacity: 0.9; }

/* ================= SVG 动效核心 ================= */
svg.anim-svg { width: 100%; height: auto; }
svg.anim-svg path, svg.anim-svg rect, svg.anim-svg circle, svg.anim-svg line, svg.anim-svg polyline, svg.anim-svg polygon {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
@keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes slideRight { 0% { transform: translateX(-16px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }

.anim-draw { animation: drawPath 3.5s ease forwards; }
.anim-draw-delay { animation: drawPath 3.5s ease 0.4s forwards; }
.anim-float { animation: floatY 4s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideRight 0.8s ease-out forwards; }
.anim-flow { animation: flowDash 2s linear infinite; }
.anim-rotate { animation: spin 12s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 减速动效兼容 */
@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;
  }
  .anim-draw, .anim-float, .anim-breathe, .anim-slide, .anim-flow, .anim-rotate {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
