/* === 基础变量与设计 Token === */
:root {
  --color-dark: #10112D;
  --color-paper: #F5F0E5;
  --color-text: #151523;
  --color-brand: #1416EB;
  --color-accent: #89ED6E;
  --color-white: #F5F0E5;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(21, 21, 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, "Noto Sans SC", "PingFang SC", sans-serif;
}

/* === 面取色覆盖 === */
.face-dark { background: var(--color-dark); color: var(--color-white); }
.face-dark .hl, .face-dark .accent-text { color: var(--color-accent); }
.face-dark .brand-text { color: var(--color-accent); }
.face-dark .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.face-dark .btn-secondary { border-color: var(--color-white); color: var(--color-white); }

.face-paper { background: var(--color-paper); color: var(--color-text); }
.face-paper .hl, .face-paper .accent-text { color: var(--color-brand); }
.face-paper .brand-text { color: var(--color-brand); }
.face-paper .btn-primary { background: var(--color-accent); color: var(--color-dark); }
.face-paper .btn-secondary { border-color: var(--color-text); color: var(--color-text); }

/* === 重置与全局 === */
*, *::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: 16px;
  line-height: 1.75;
  background: var(--color-paper);
  color: var(--color-text);
  overflow-x: hidden;
}
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 + .section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: currentColor; opacity: 0.12; z-index: 1; pointer-events: none;
}
.face-dark .section + .section::before { display: none; }

h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}
p { margin-bottom: 1.25rem; max-width: 38em; }
mark, .hl { font-weight: 700; }
.epigraph {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}
.face-paper .epigraph { color: var(--color-brand); }
.face-dark .epigraph { color: var(--color-accent); }

/* === 按钮 === */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 52px; padding: 0 2rem;
  font-size: 1rem; font-weight: 600; border-radius: var(--radius-btn);
  cursor: pointer; border: 2px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* === 卡片与面板 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  transition: box-shadow 0.3s ease;
}
.face-dark .card { background: rgba(245, 240, 229, 0.08); backdrop-filter: blur(6px); }
.card:hover { box-shadow: 0 14px 32px -12px rgba(21, 21, 35, 0.35); }

.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.panel svg { width: 100%; height: 100%; }

/* === 网格与布局 === */
.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); }
@media (min-width: 768px) {
  .grid-2-auto { grid-template-columns: 1fr 1fr; }
  .grid-3-auto { grid-template-columns: repeat(3, 1fr); }
}
.flex-row { display: flex; gap: var(--gap); align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: var(--gap); }
.text-center { text-align: center; }
.mt-sm { margin-top: 1rem; }
.mb-lg { margin-bottom: 2rem; }

/* === 列表与标记 === */
.list-mark li { position: relative; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.list-mark li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.6;
}
.face-paper .list-mark li::before { background: var(--color-brand); }
.face-dark .list-mark li::before { background: var(--color-accent); }

/* === 表格 === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid currentColor; opacity: 0.9; }
th { font-weight: 700; opacity: 1; }
td:first-child { font-weight: 600; }

/* === FAQ === */
details { margin-bottom: 1rem; border-bottom: 1px solid currentColor; opacity: 0.9; }
summary {
  cursor: pointer; padding: 1rem 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; transition: transform 0.2s; }
details[open] summary::after { transform: rotate(45deg); }
.details-body { padding-bottom: 1rem; line-height: 1.7; }

/* === 页头与页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid currentColor; opacity: 0.95;
  backdrop-filter: blur(8px);
}
.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 { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { font-weight: 500; font-size: 0.95rem; opacity: 0.85; transition: opacity 0.2s; }
.nav-link:hover, .nav-link[aria-current="page"] { opacity: 1; }
.site-footer { padding: 3rem 0; border-top: 1px solid currentColor; opacity: 0.9; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; opacity: 0.8; }
.footer-col a { display: block; padding: 0.25rem 0; font-size: 0.9rem; opacity: 0.7; transition: opacity 0.2s; }
.footer-col a:hover { opacity: 1; }
.copyright { margin-top: 2rem; font-size: 0.85rem; opacity: 0.6; text-align: center; }

/* === SVG 动效 === */
.svg-panel { width: 100%; height: auto; }
.anim-float { animation: float-cycle 6s ease-in-out infinite; }
.anim-float-delay { animation-delay: 2.5s; }
.anim-pulse { animation: pulse-opacity 4s ease-in-out infinite; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-cycle 8s ease-in-out infinite; }
@keyframes float-cycle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
@keyframes draw-cycle {
  0%, 100% { stroke-dashoffset: 0; }
  15%, 85% { stroke-dashoffset: 1; }
}

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 0.75rem 0; }
  .nav-list { order: 3; width: 100%; justify-content: center; margin-top: 0.5rem; }
  .flex-row { flex-direction: column; }
  .panel { aspect-ratio: 16/10; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* 焦点可见性增强 */
:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.face-dark :focus-visible { outline-color: var(--color-accent); }
