:root {
  --color-dark: #141838;
  --color-paper: #FCFCFD;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --color-border-light: rgba(21, 23, 35, 0.08);
  --color-bg-alt: rgba(21, 23, 35, 0.03);
  --color-bg-dark-alt: rgba(255, 255, 255, 0.06);

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --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, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
  width: 100%;
}

/* 响应式网格基础 */
.grid-auto { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

/* 页头与品牌栏 */
.site-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.brand-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--color-dark);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-paper);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand-logo img { width: 32px; height: 32px; object-fit: contain; }

.nav-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-list a {
  text-decoration: none;
  color: #a0a8c8;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  transition: color 0.2s, background 0.2s;
  font-size: 0.95rem;
}
.nav-list a:hover, .nav-list a[aria-current="page"] {
  color: var(--color-paper);
  background: var(--color-bg-dark-alt);
}

.main-content {
  padding-top: 0;
  overflow-x: hidden;
}

/* 移动端回退为顶部导航 */
@media (max-width: 768px) {
  .site-layout { grid-template-columns: 1fr; }
  .brand-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    height: 64px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
  }
  .main-content { padding-top: 64px; }
  .nav-list { flex-direction: row; gap: 0.25rem; }
  .nav-list a { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
}

/* 区块背景变体 */
.section-dark {
  background: var(--color-dark);
  --text-primary: var(--color-paper);
  --text-secondary: #a0a8c8;
  --brand-color: var(--color-accent);
  --accent-color: var(--color-accent);
}
.section-paper {
  background: var(--color-paper);
  --text-primary: var(--color-text);
  --text-secondary: #4a5068;
  --brand-color: var(--color-brand);
  --accent-color: var(--color-accent);
}

/* 排版 */
.h-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-color);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 2rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-top: 1.5rem; }
p { margin-bottom: 1.25rem; color: var(--text-secondary); max-width: 38em; }
.hl { color: var(--brand-color); font-weight: 600; }
.section-dark .hl { color: var(--accent-color); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 52px;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-color);
  color: var(--color-dark);
  border-color: var(--accent-color);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.section-dark .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.btn-secondary:hover { background: var(--text-primary); color: var(--color-paper); }
.section-dark .btn-secondary:hover { background: var(--color-paper); color: var(--color-dark); }

/* 面板与卡片 */
.panel {
  background: var(--color-bg-alt);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}
.section-dark .panel { background: var(--color-bg-dark-alt); }
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.section-dark .card { background: var(--color-bg-dark-alt); color: var(--color-paper); }
.card h4 { margin: 0; font-size: 1.1rem; }
.card p { font-size: 0.95rem; margin: 0; color: var(--text-secondary); }
.card time { font-size: 0.85rem; opacity: 0.8; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border-light); }
.section-dark th, .section-dark td { border-bottom-color: rgba(255,255,255,0.1); }
th { font-weight: 600; color: var(--text-primary); }
td { color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }

/* 定义列表 */
.dl-grid { display: grid; gap: 1.5rem; }
.dl-item dt { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
.dl-item dd { margin: 0; color: var(--text-secondary); }

/* 步骤与列表 */
.step-list { counter-reset: step; list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.step-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: var(--color-dark);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.step-content strong { display: block; color: var(--text-primary); margin-bottom: 0.25rem; }
.step-content span { color: var(--text-secondary); font-size: 0.95rem; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--color-border-light); padding: 1rem 0; }
.section-dark .faq-item { border-bottom-color: rgba(255,255,255,0.1); }
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; color: var(--brand-color); font-weight: 400; }
details[open] summary::before { content: "−"; }
details p { margin-top: 0.75rem; color: var(--text-secondary); }

/* 杂志排版侧栏 */
.magazine-layout { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; }
@media (max-width: 900px) { .magazine-layout { grid-template-columns: 1fr; } }
.toc-nav { position: sticky; top: 80px; height: fit-content; }
.toc-nav ul { list-style: none; border-left: 2px solid var(--color-border-light); padding-left: 1rem; }
.section-dark .toc-nav ul { border-left-color: rgba(255,255,255,0.15); }
.toc-nav a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.toc-nav a:hover, .toc-nav a.active { color: var(--brand-color); }
.section-dark .toc-nav a { color: #a0a8c8; }
.section-dark .toc-nav a:hover, .section-dark .toc-nav a.active { color: var(--accent-color); }

/* 场景对照 */
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
@media (max-width: 768px) { .scene-grid { grid-template-columns: 1fr; } }
.scene-card { padding: 1.5rem; border-radius: var(--radius-card); background: var(--color-bg-alt); }
.section-dark .scene-card { background: var(--color-bg-dark-alt); }
.scene-card h4 { color: var(--text-primary); margin-bottom: 0.5rem; }
.scene-card ul { padding-left: 1.25rem; color: var(--text-secondary); }
.scene-card li { margin-bottom: 0.5rem; }

/* SVG 基础 */
.svg-container { width: 100%; height: auto; max-width: 100%; display: block; }
.hero-svg { width: 100%; height: auto; max-width: 100%; }

/* SVG 动效关键帧 */
@keyframes rotate-align {
  0%, 100% { transform: rotate(0deg) translate(0, 0); }
  50% { transform: rotate(180deg) translate(6px, 6px); }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-8px); opacity: 1; }
}
@keyframes breathe-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slide-in-notif {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(4px); opacity: 1; }
}
@keyframes flow-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}
@keyframes draw-path {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 1; }
}

/* 动效类 */
.anim-rotate { animation: rotate-align 8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: float-bubble 6s ease-in-out infinite; }
.anim-breathe { animation: breathe-dots 3s ease-in-out infinite; }
.anim-slide { animation: slide-in-notif 5s ease-in-out infinite; }
.anim-flow { animation: flow-line 4s linear infinite; }
.anim-draw { animation: draw-path 6s ease-in-out infinite; }

/* 减少动态效果 */
@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-rotate, .anim-float, .anim-breathe, .anim-slide, .anim-flow, .anim-draw {
    animation: none !important;
  }
}
