/* === 设计变量与基础重置 === */
:root {
  --bg-dark: #17203F;
  --bg-paper: #FCFCFD;
  --text-body: #151823;
  --brand: #1441EB;
  --accent: #6EEDBD;
  --text-on-dark: #FCFCFD;
  --text-on-paper: #151823;
  --accent-on-dark: #6EEDBD;
  --brand-on-paper: #1441EB;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 24, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --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);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
}

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: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}
.section-paper { background: var(--bg-paper); color: var(--text-on-paper); }
.section-dark { background: var(--bg-dark); color: var(--text-on-dark); }

/* 颜色作用域修正 */
.section-dark {
  --ui-text: var(--text-on-dark);
  --ui-accent: var(--accent-on-dark);
  --ui-brand: var(--accent-on-dark);
}
.section-paper {
  --ui-text: var(--text-on-paper);
  --ui-accent: var(--brand-on-paper);
  --ui-brand: var(--brand);
}
/* 深色背景中的浅色卡片恢复纸面取色 */
.card-light {
  background: var(--bg-paper);
  color: var(--text-body);
}
.card-light .eyebrow { color: var(--brand); }
.card-light h3, .card-light p { color: var(--text-body); }
.card-light a { color: var(--brand); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: 0.02em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1.5rem; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.25rem; text-wrap: balance; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; max-width: 38em; }
strong { font-weight: 600; }

.highlight { color: var(--ui-accent); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ui-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 2px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
}
.btn-primary:hover { background: #5ce8ad; box-shadow: 0 4px 12px rgba(110, 237, 189, 0.25); }

.btn-secondary {
  background: transparent;
  color: var(--ui-text);
  border: 1.5px solid currentColor;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }
.section-paper .btn-secondary { color: var(--text-body); border-color: var(--text-body); }
.section-paper .btn-secondary:hover { background: rgba(21,24,35,0.05); }

/* === 卡片 === */
.card {
  background: var(--bg-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(21, 24, 35, 0.35); transform: translateY(-2px); }
.section-dark .card { background: var(--bg-paper); color: var(--text-body); }
.section-dark .card h3, .section-dark .card p { color: var(--text-body); }
.section-dark .card .eyebrow { color: var(--brand); }

.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); }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(21,24,35,0.1);
  text-align: left;
}
.data-table th { font-weight: 600; color: var(--text-body); width: 40%; }
.section-dark .data-table { color: var(--text-on-dark); }
.section-dark .data-table th, .section-dark .data-table td { border-bottom-color: rgba(252,252,253,0.15); }

/* === FAQ === */
details {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(21,24,35,0.1);
  padding-bottom: 1rem;
}
.section-dark details { border-bottom-color: rgba(252,252,253,0.15); }
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
summary::marker, summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--ui-accent);
  border-bottom: 2px solid var(--ui-accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
details[open] summary::before { transform: rotate(135deg); }
details p { margin-top: 0.5rem; color: var(--ui-text); opacity: 0.9; }

/* === 页头页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252,252,253,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21,24,35,0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.logo img { height: 28px; width: auto; }
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-size: 0.95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); }
.nav a[aria-current="page"] { font-weight: 700; }

.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 3rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { opacity: 0.8; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.copyright { font-size: 0.85rem; opacity: 0.6; margin-top: 1rem; }

/* === SVG 动效基础 === */
.svg-anim { width: 100%; height: auto; overflow: visible; }
.svg-anim path, .svg-anim circle, .svg-anim rect, .svg-anim line {
  transition: stroke 0.3s ease;
}
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.pop-element {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 1;
}
.blink-star {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0.7;
}

/* === Keyframes === */
@keyframes line-draw {
  0% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@keyframes pop-in {
  0% { transform: scale(0.8); opacity: 0; }
  20% { transform: scale(1.05); opacity: 1; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes star-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* === 动效类绑定 === */
.anim-draw { animation: line-draw 3s ease-out forwards infinite alternate; }
.anim-pop { animation: pop-in 2.5s ease-out forwards infinite alternate; }
.anim-float { animation: float 4s ease-in-out infinite; }
.anim-blink { animation: star-blink 3s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1rem; }
  .nav { display: none; } /* 简化移动端头部，实际项目可加汉堡菜单，此处按静态要求保留结构 */
  h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim-draw, .anim-pop, .anim-float, .anim-blink, .anim-breathe {
    animation: none !important;
  }
}
