:root {
  /* 色板 */
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-body: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  /* 卡片辅助底色 */
  --bg-card-paper: #EAE9EF;
  --bg-card-dark: #241B3D;

  /* 结构 Token */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 960px;
  --line-height: 1.55;
  --title-weight: 600;
  --title-lh: 1.25;
  --title-ls: 0;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-main);
  line-height: var(--line-height);
  background: var(--color-paper);
  color: var(--color-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 基础排版与取色作用域 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section-paper { background: var(--color-paper); color: var(--color-body); position: relative; }
.section-paper::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: rgba(25,21,35,0.1); }
.section-dark { background: var(--color-dark); color: var(--color-paper); }

.section-paper h1, .section-paper h2, .section-paper h3, .section-paper p, .section-paper li, .section-paper td, .section-paper th { color: var(--color-body); }
.section-paper .hl { color: var(--color-brand); }
.section-paper .eyebrow { color: var(--color-brand); }
.section-paper a:not(.btn) { color: var(--color-brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section-paper a:not(.btn):hover { text-decoration: underline; }

.section-dark h1, .section-dark h2, .section-dark h3, .section-dark p, .section-dark li, .section-dark td, .section-dark th { color: var(--color-paper); }
.section-dark .hl { color: var(--color-accent); }
.section-dark .eyebrow { color: var(--color-accent); }
.section-dark a:not(.btn) { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.section-dark a:not(.btn):hover { text-decoration: underline; }

/* 卡片取色覆盖 */
.card-light { background: var(--color-paper); color: var(--color-body); }
.card-light h2, .card-light h3, .card-light p, .card-light li, .card-light td, .card-light th { color: var(--color-body); }
.card-light .hl { color: var(--color-brand); }
.card-light .eyebrow { color: var(--color-brand); }
.card-light a:not(.btn) { color: var(--color-brand); }

/* 标题系统 */
h1, h2, h3 { font-weight: var(--title-weight); line-height: var(--title-lh); letter-spacing: var(--title-ls); text-wrap: balance; margin: 0 0 calc(var(--gap) * 1.5) 0; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--gap) 0; max-width: 38em; }
ul, ol { padding-left: 1.2em; margin: 0 0 var(--gap) 0; }
li { margin-bottom: 0.5em; }

/* 眉标 */
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.75em; }

/* 高亮词 */
.hl { font-weight: 600; }

/* 按钮系统 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0 1.5em; height: 48px; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius-btn); border: none; cursor: pointer;
  text-decoration: none; transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(0.95); }
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-secondary { background: transparent; border: 1px solid currentColor; }
.section-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }

/* 布局网格 */
.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); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }

/* 组件：卡片 */
.card {
  background: var(--bg-card-paper); border-radius: var(--radius-card);
  padding: calc(var(--gap) * 1.5); border: var(--card-border); box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.section-dark .card { background: var(--bg-card-dark); color: var(--color-paper); }
.card-light { background: var(--color-paper); color: var(--color-body); }

/* 组件：表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--gap) 0; }
table { width: 100%; border-collapse: collapse; min-width: 300px; }
th, td { text-align: left; padding: 0.75em 1em; border-bottom: 1px solid rgba(25,21,35,0.1); }
th { font-weight: 600; }
.section-dark th, .section-dark td { border-bottom-color: rgba(244,243,247,0.1); }

/* 组件：FAQ */
details { margin-bottom: var(--gap); border-bottom: 1px solid rgba(25,21,35,0.1); padding-bottom: var(--gap); }
.summary { cursor: pointer; font-weight: 600; margin: 0; padding: 0.5em 0; list-style: none; display: flex; align-items: center; gap: 0.5em; }
.summary::-webkit-details-marker { display: none; }
.summary::before { content: "+"; display: inline-block; width: 1.5em; text-align: center; font-weight: 400; color: var(--color-brand); }
details[open] .summary::before { content: "-"; }
details p { margin: 0.5em 0 0 2.5em; }
.section-dark details { border-bottom-color: rgba(244,243,247,0.1); }
.section-dark .summary::before { color: var(--color-accent); }

/* 组件：提示框 */
.tip { background: var(--bg-card-paper); border-radius: var(--radius-card); padding: 1em 1.25em; border-left: 4px solid var(--color-brand); margin: var(--gap) 0; }
.section-dark .tip { background: var(--bg-card-dark); border-left-color: var(--color-accent); }

/* 新闻卡片 */
.news-card { display: flex; flex-direction: column; justify-content: space-between; }
.news-card time { font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.5em; display: block; }
.news-card p { font-size: 0.95rem; opacity: 0.9; }

/* 头部与页脚 */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(244,243,247,0.9); 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; }
.logo-img { height: 32px; width: auto; vertical-align: middle; }
.nav { display: flex; gap: 1.5em; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav a:hover { opacity: 0.8; }
.nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.site-footer { background: var(--color-dark); color: var(--color-paper); padding: 2em 0; border-top: 1px solid rgba(244,243,247,0.1); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5em; }
.footer-links a { color: var(--color-paper); text-decoration: none; margin-right: 1em; }
.footer-links a:hover { text-decoration: underline; }

/* SVG 基础 */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero-svg { width: 100%; height: auto; max-width: 480px; display: block; }
.feature-svg { width: 100%; height: auto; max-width: 320px; display: block; margin: 0 auto; }

/* SVG 动效 Keyframes */
@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes floatCardAlt {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes drawLine {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes slideIn {
  0% { transform: translateX(-12px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 动效类应用 */
.anim-float { animation: floatCard 6s ease-in-out infinite; }
.anim-float-alt { animation: floatCardAlt 7s ease-in-out infinite 1s; }
.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawLine 4s ease-in-out infinite alternate; }
.anim-pulse { animation: pulseDot 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-slide { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* 响应式与无障碍 */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: flex-start; }
  .nav { display: none; } /* 移动端简化，实际项目可加汉堡菜单，此处保持静态合规 */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
