/* === 设计变量与基础重置 === */
:root {
  /* 颜色系统 */
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-body: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-lighter-paper: #EDE8DC;

  /* 圆角与阴影 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 35, 0.3);
  --shadow-hover: 0 14px 32px -12px rgba(21, 21, 35, 0.4);

  /* 间距与布局 */
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --header-h: 64px;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --fs-h1: clamp(2rem, 4.6vw, 3.4rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-body: 1rem;
  --lh-body: 1.75;
  --lh-title: 1.25;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-body);
  background-color: var(--color-paper);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* === 容器与网格 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.grid-auto {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

/* === 页面区块通用 === */
.section-paper { background-color: var(--color-paper); color: var(--color-body); }
.section-dark { background-color: var(--color-dark); color: var(--color-paper); }

.section-paper .hl { color: var(--color-brand); }
.section-paper .badge { color: var(--color-brand); }
.section-paper a.link { color: var(--color-brand); font-weight: 600; }
.section-paper .icon { stroke: var(--color-brand); }

.section-dark .hl { color: var(--color-accent); }
.section-dark .badge { color: var(--color-accent); }
.section-dark a.link { color: var(--color-accent); font-weight: 600; }
.section-dark .icon { stroke: var(--color-accent); }

/* 深色面内的浅色卡片回退为纸面取色 */
.card-light-in-dark {
  background-color: var(--color-paper);
  color: var(--color-body);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: box-shadow 0.2s ease;
}
.card-light-in-dark:hover { box-shadow: var(--shadow-hover); }
.card-light-in-dark .hl { color: var(--color-brand); }
.card-light-in-dark .badge { color: var(--color-brand); }
.card-light-in-dark a.link { color: var(--color-brand); font-weight: 600; }
.card-light-in-dark .icon { stroke: var(--color-brand); }

/* === 排版组件 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
  text-transform: uppercase;
}
h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
  margin-bottom: 0.8em;
}
h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: var(--lh-title);
  margin-bottom: 1.2em;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6em;
}
p { margin-bottom: 1em; max-width: 38em; }
p:last-child { margin-bottom: 0; }

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 229, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 21, 35, 0.08);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.section-dark .site-header {
  background-color: rgba(16, 17, 45, 0.9);
  border-bottom-color: rgba(245, 240, 229, 0.1);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { opacity: 0.8; }
.nav-links a[aria-current="page"] { font-weight: 700; }

.site-footer {
  padding: var(--gap) 0;
  border-top: 1px solid rgba(21, 21, 35, 0.08);
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}
.section-dark .site-footer { border-top-color: rgba(245, 240, 229, 0.1); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--color-body);
  color: var(--color-body);
}
.section-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片与面板 === */
.panel {
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease;
}
.panel:hover { box-shadow: var(--shadow-hover); }
.panel-dark { background-color: var(--color-dark); color: var(--color-paper); }
.panel-paper { background-color: var(--color-paper); color: var(--color-body); }

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.8em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
}
.section-dark .data-table th,
.section-dark .data-table td { border-bottom-color: rgba(245, 240, 229, 0.1); }
.data-table th { font-weight: 600; opacity: 0.8; }

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid rgba(21, 21, 35, 0.1);
  padding: 1em 0;
}
.section-dark .faq-item { border-bottom-color: rgba(245, 240, 229, 0.1); }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5em 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  font-weight: 700;
  color: var(--color-accent);
  display: inline-block;
  width: 1.2em;
  text-align: center;
}
.faq-item[open] summary::before { content: "-"; }
.faq-item p { margin-top: 0.6em; font-size: 0.95rem; opacity: 0.9; }

/* === 新闻卡片 === */
.news-card {
  background: var(--color-paper);
  border: 1px solid rgba(21, 21, 35, 0.08);
  border-radius: var(--radius-card);
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}
.section-dark .news-card {
  background: var(--color-dark);
  border-color: rgba(245, 240, 229, 0.1);
  color: var(--color-paper);
}
.news-meta { font-size: 0.8rem; opacity: 0.7; display: flex; gap: 1em; }

/* === 时间线 === */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: currentColor;
  opacity: 0.15;
}
.step-item { position: relative; margin-bottom: 2rem; }
.step-num {
  position: absolute;
  left: -2.8rem;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

/* === SVG 动效核心规则 === */
.svg-anim { width: 100%; height: auto; }
.anim-star { animation: starTwinkle 6s ease-in-out infinite; }
.anim-line { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: lineDraw 8s ease-in-out infinite alternate; }
.anim-bubble { animation: bubbleFloat 5s ease-in-out infinite; }
.anim-input { animation: inputBreathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 7s ease-in-out infinite alternate; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes lineDraw {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes inputBreathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0% { opacity: 0.6; transform: translateX(-15px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* 旋转/缩放子元素中心修正 */
.anim-star, .anim-bubble, .anim-input {
  transform-box: fill-box;
  transform-origin: center;
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .grid-auto { grid-template-columns: 1fr; }
  .nav-links { gap: 1rem; }
  .hero-layout { flex-direction: column-reverse; }
}
@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;
  }
}
/* factory-contrast-width */
@media (max-width: 390px) {
  [data-fc-390="paper"] {
    color: #f5f0e5 !important;
    -webkit-text-fill-color: #f5f0e5 !important;
  }
}
