:root {
  /* 基础色板 */
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;

  /* 设计 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;

  /* 排版变量 */
  --h1-size: clamp(2.4rem, 6vw, 4.5rem);
  --h2-size: clamp(1.6rem, 3vw, 2.4rem);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* 面型变量覆盖 */
.bg-paper {
  --bg: var(--color-paper);
  --fg-text: var(--color-text);
  --fg-brand: var(--color-brand);
  --fg-accent: var(--color-accent);
  --fg-sub: rgba(21, 23, 35, 0.7);
}
.bg-dark {
  --bg: var(--color-dark);
  --fg-text: #F7F5F3;
  --fg-brand: #6EAFED;
  --fg-accent: #6EAFED;
  --fg-sub: rgba(247, 245, 243, 0.75);
}

/* 全局重置与基础 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 容器与布局 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding-block: var(--section-y);
  position: relative;
}
.section-divider {
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  margin-inline: calc(var(--gap) * -1);
  padding-inline: var(--gap);
  width: calc(100% + var(--gap) * 2);
  box-sizing: content-box;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap);
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* 排版组件 */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: var(--fg-brand);
}
.section-title {
  font-size: var(--h2-size);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--fg-text);
}
.section-title .hl {
  color: var(--fg-brand);
}
.hero-h1 {
  font-size: var(--h1-size);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--fg-text);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.intro-text {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.7;
  color: var(--fg-sub);
  max-width: 38em;
  margin-bottom: 2rem;
}
.card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  background: var(--bg);
  padding: 24px;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--fg-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--fg-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--fg-text);
  color: var(--fg-text);
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); transform: translateY(-2px); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* 头部与导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
  padding: 16px 0;
}
.site-header.scrolled {
  border-bottom-color: rgba(128,128,128,0.2);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg-sub);
  transition: color 0.2s;
  position: relative;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--fg-brand); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--fg-brand);
  border-radius: 1px;
}
.mobile-menu-btn { display: none; background: none; border: none; color: var(--fg-text); cursor: pointer; }
@media (max-width: 768px) {
  .nav-list { display: none; }
  .mobile-menu-btn { display: block; }
}

/* 页脚 */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(128,128,128,0.2);
  text-align: center;
  color: var(--fg-sub);
  font-size: 0.9rem;
}
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
.footer-links a { color: var(--fg-sub); transition: color 0.2s; }
.footer-links a:hover { color: var(--fg-brand); }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(128,128,128,0.2);
  text-align: left;
}
.data-table th { font-weight: 700; color: var(--fg-text); }
.data-table td { color: var(--fg-sub); }
.data-table tr:last-child td { border-bottom: none; }

/* FAQ */
.faq-item {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
  background: var(--bg);
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg-text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--fg-brand);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-answer {
  padding: 0 20px 16px;
  color: var(--fg-sub);
  line-height: 1.7;
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}
.news-card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  background: var(--bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.news-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--fg-text);
}
.news-card p {
  font-size: 0.95rem;
  color: var(--fg-sub);
  line-height: 1.6;
  margin-bottom: 16px;
}
.news-date {
  font-size: 0.8rem;
  color: var(--fg-brand);
  font-weight: 600;
}

/* 专题长文侧栏布局 */
.magazine-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
}
.toc-nav {
  position: sticky;
  top: 100px;
  padding-right: 24px;
  border-right: 1px solid rgba(128,128,128,0.2);
}
.toc-nav ul { display: flex; flex-direction: column; gap: 12px; }
.toc-nav li a {
  font-size: 0.9rem;
  color: var(--fg-sub);
  font-weight: 500;
  display: block;
  padding: 4px 0;
  transition: color 0.2s;
}
.toc-nav li a:hover, .toc-nav li a.active { color: var(--fg-brand); }
@media (max-width: 900px) {
  .magazine-layout { grid-template-columns: 1fr; }
  .toc-nav { position: static; border-right: none; border-bottom: 1px solid rgba(128,128,128,0.2); padding: 0 0 24px 0; margin-bottom: 24px; }
}

/* 定义列表风格 */
.def-list { display: flex; flex-direction: column; gap: 24px; }
.def-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}
.def-term {
  font-weight: 700;
  color: var(--fg-text);
  padding-top: 4px;
}
.def-desc {
  color: var(--fg-sub);
  line-height: 1.7;
}
@media (max-width: 600px) {
  .def-item { grid-template-columns: 1fr; }
}

/* SVG 动效基础 */
.svg-container {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.star-dot {
  transform-box: fill-box;
  transform-origin: center;
}
.connect-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes pulseStar {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}
@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes breatheDots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.anim-draw { animation: drawLine 3s ease infinite alternate; }
.anim-star { animation: pulseStar 4s ease-in-out infinite; }
.anim-float { animation: floatBubble 5s ease-in-out infinite; }
.anim-breathe { animation: breatheDots 2.5s 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;
  }
}

/* 兜底：裁掉横向溢出 */
main,
article.article-main {
  overflow-x: clip;
}
