/* === 设计变量与基础重置 === */
:root {
  /* 色板 */
  --color-dark: #140E25;
  --color-paper: #FCFCFD;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #6EEDD2;
  
  /* 结构 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  
  /* 排版 Token */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --lead-line: 1.65;
  --heading-lk: -0.02em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lead-line);
  font-size: 16px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section { padding-block: var(--section-y); }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 253, 253, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand img { height: 28px; width: auto; }
.nav-list { display: flex; gap: 24px; }
.nav-link { font-size: 15px; font-weight: 500; opacity: 0.8; transition: opacity 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; color: var(--color-brand); }
.header-actions { display: flex; align-items: center; gap: 16px; }

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding-block: 48px;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { opacity: 0.7; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.footer-copy { opacity: 0.5; margin-top: 16px; }

/* === 按钮组件 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding-inline: 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid transparent;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid currentColor;
}
.dark-bg .btn-secondary { color: var(--color-paper); }
.btn-secondary:hover { background: rgba(0,0,0,0.05); }
.dark-bg .btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* === 文本排版 === */
.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--color-brand);
}
.dark-bg .section-label { color: var(--color-accent); }
h1, h2, h3 { line-height: 1.1; letter-spacing: var(--heading-lk); font-weight: 800; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin-bottom: 24px; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 20px; }
h3 { font-size: 1.25rem; margin-bottom: 12px; }
p { margin-bottom: 16px; max-width: 38em; }
.hl { color: var(--color-brand); }
.dark-bg .hl { color: var(--color-accent); }

/* === 卡片与面板 === */
.panel {
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-card);
  padding: 24px;
  position: relative;
}
.dark-bg .panel { background: rgba(255, 255, 255, 0.06); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--color-paper);
  border: 1px solid rgba(25, 21, 35, 0.08);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-card time { font-size: 13px; color: #6b6b6b; font-weight: 500; }
.news-card h4 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.news-card p { font-size: 15px; color: #4a4a4a; margin: 0; }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.data-table th, .data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
}
.data-table th { font-weight: 600; color: #555; }
.data-table td:first-child { font-weight: 600; }
.data-table a { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; }
.dark-bg .data-table a { color: var(--color-accent); }

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  margin-bottom: 16px;
}
.faq-item summary {
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 32px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding-bottom: 16px; font-size: 15px; color: #3a3a3a; }

/* === 定义列表 === */
.def-list dt { font-weight: 700; margin-bottom: 6px; font-size: 16px; }
.def-list dd { margin-left: 24px; margin-bottom: 24px; font-size: 15px; color: #3a3a3a; }

/* === 步骤编号 === */
.step-list { counter-reset: step; }
.step-item {
  position: relative;
  padding-left: 48px;
  margin-bottom: 24px;
}
.step-item::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* === 杂志排版侧栏 === */
.magazine-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
}
.toc-nav { position: sticky; top: 80px; align-self: start; }
.toc-nav ul { border-left: 2px solid rgba(25, 21, 35, 0.1); padding-left: 16px; }
.toc-nav li { margin-bottom: 12px; }
.toc-nav a { font-size: 14px; color: #555; font-weight: 500; display: block; }
.toc-nav a:hover, .toc-nav a.active { color: var(--color-brand); }
.dark-bg .toc-nav a { color: rgba(252, 253, 253, 0.7); }
.dark-bg .toc-nav a:hover { color: var(--color-accent); }

/* === SVG 动效类 === */
.hero-svg { width: 100%; height: auto; }
.anim-float-1 { animation: float 6s ease-in-out infinite; }
.anim-float-2 { animation: float 7s ease-in-out infinite 1s; }
.anim-float-3 { animation: float 5.5s ease-in-out infinite 0.5s; }
.anim-pop { animation: pop 4s ease-in-out infinite; }
.anim-dot { animation: breathe 2.4s ease-in-out infinite; }
.anim-slide { animation: slideIn 8s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pop {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50% { transform: translateX(6px); opacity: 1; }
}

/* === 响应式与无障碍 === */
@media (max-width: 960px) {
  .magazine-layout { grid-template-columns: 1fr; }
  .toc-nav { display: none; }
  .nav-list { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
