:root {
  /* 色板 */
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  --color-dark-text: #F5F3F7;

  /* 设计 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --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;
  --lh-base: 1.75;
  --tracking-tight: -0.02em;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
}

/* 面与取色变量 */
.bg-paper {
  background: var(--color-paper);
  color: var(--color-text);
}
.bg-paper .hl { color: var(--color-brand); }
.bg-paper a:not(.btn) { color: var(--color-brand); }
.bg-paper .eyebrow { color: var(--color-brand); }

.bg-dark {
  background: var(--color-dark);
  color: var(--color-dark-text);
}
.bg-dark .hl { color: var(--color-accent); }
.bg-dark a:not(.btn) { color: var(--color-accent); }
.bg-dark .eyebrow { color: var(--color-accent); }

/* 卡片在深色面内恢复纸面取色 */
.card-light-on-dark {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border) solid transparent;
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
}
.card-light-on-dark .hl { color: var(--color-brand); }
.card-light-on-dark a:not(.btn) { color: var(--color-brand); }
.card-light-on-dark .eyebrow { color: var(--color-brand); }

/* 布局容器 */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
}

/* 排版 */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  margin-bottom: 0.5em;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.8em;
  line-height: 1.25;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 0.6em;
  line-height: 1.2;
}
p {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  margin-bottom: 1em;
  max-width: 38em;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.6em;
  text-transform: uppercase;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}
.bg-dark .btn-secondary {
  color: var(--color-dark-text);
  border-color: var(--color-dark-text);
}
.btn-secondary:hover { background: rgba(128,128,128,0.1); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }

/* 网格与交错布局 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
  align-items: center;
}
.alt-row:nth-child(even) .grid-2 > * { direction: rtl; }
.alt-row:nth-child(even) .grid-2 > *:first-child { direction: ltr; }

/* 面板与视觉区域 */
.visual-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
}
.bg-dark .visual-panel {
  background: rgba(255,255,255,0.08);
}

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1em;
}
.data-table th, .data-table td {
  padding: 0.75em 1em;
  border-bottom: 1px solid currentColor;
  text-align: left;
}
.data-table th { font-weight: 700; }
.data-table td:last-child { font-weight: 600; }

/* FAQ */
.faq-list details {
  margin-bottom: 1em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1em;
}
.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  padding: 0.5em 0;
  position: relative;
  padding-left: 1.5em;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "+";
  position: absolute;
  left: 0;
  font-weight: 400;
}
.faq-list details[open] summary::before { content: "-"; }
.faq-list details p { margin-top: 0.5em; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  border-radius: 6px;
  margin-right: 0.5em;
  flex-shrink: 0;
}

/* 新闻卡片 */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.news-card {
  background: var(--color-paper);
  color: var(--color-text);
  border-radius: var(--radius-card);
  padding: var(--gap);
  text-decoration: none;
  transition: transform 0.2s ease;
}
.news-card:hover { transform: translateY(-4px); }
.news-card time {
  display: block;
  font-size: 0.85rem;
  color: var(--color-brand);
  margin-bottom: 0.5em;
}

/* SVG 基础与动效类 */
.svg-anim {
  width: 100%;
  height: auto;
  display: block;
}
.svg-anim path, .svg-anim line, .svg-anim rect, .svg-anim circle {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-pulse { opacity: 1; }
.anim-float { transform: translateY(0); }
.anim-slide { transform: translateX(0); opacity: 1; }
.anim-rotate { transform: rotate(0deg); }

@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulse-dots {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes slide-in-right {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes rotate-combine {
  0% { transform: rotate(-15deg); }
  50% { transform: rotate(0deg); }
  100% { transform: rotate(-15deg); }
}

.anim-draw { animation: draw-line 4s ease-in-out infinite alternate; }
.anim-pulse { animation: pulse-dots 3s ease-in-out infinite; }
.anim-float { animation: float-bubble 5s ease-in-out infinite; }
.anim-slide { animation: slide-in-right 6s ease-in-out infinite alternate; }
.anim-rotate {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotate-combine 8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .anim-draw, .anim-pulse, .anim-float, .anim-slide, .anim-rotate {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .btn { transition: none; }
}

/* 导航与页脚 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 21, 35, 0.1);
}
.bg-dark .site-header {
  background: rgba(35, 19, 52, 0.9);
  border-bottom-color: rgba(245, 243, 247, 0.1);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.logo-img {
  height: 32px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 1.5em;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.25em 0;
  border-bottom: 2px solid transparent;
}
.nav-links a.active { border-bottom-color: var(--color-brand); }
.bg-dark .nav-links a.active { border-bottom-color: var(--color-accent); }

.site-footer {
  padding: var(--section-y) 0;
  border-top: 1px solid currentColor;
  margin-top: var(--section-y);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap);
}
.footer-links {
  display: flex;
  gap: 1.5em;
  list-style: none;
}
.footer-links a { text-decoration: none; font-size: 0.9rem; }

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .alt-row:nth-child(even) .grid-2 > * { direction: ltr; }
  .nav-links { display: none; } /* 简化移动端，实际项目可加汉堡菜单，此处保持静态结构 */
  .footer-inner { flex-direction: column; text-align: center; }
}
