/* === 设计变量与基础重置 === */
:root {
  /* 色板 */
  --color-deep: #19102D;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #D66EED;

  /* 结构 Token */
  --radius-card: 0;
  --radius-btn: 0;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --line-height-body: 1.55;
  --content-max: 1280px;

  /* 排版 Token */
  --heading-weight: 800;
  --tracking-tight: -0.02em;
  --lh-heading: 1.1;
  --fs-h1: clamp(2.4rem, 6vw, 4.5rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-h3: clamp(1.2rem, 2vw, 1.5rem);
  --fs-body: clamp(1rem, 1.2vw, 1.125rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 var(--gap) 0; max-width: 38em; }

/* === 布局容器 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
section {
  padding: var(--section-y) 0;
  border-bottom: 1px solid var(--color-text);
}
section:last-of-type { border-bottom: none; }

/* === 排版 === */
h1, h2, h3, h4 {
  font-weight: var(--heading-weight);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-heading);
  margin: 0 0 calc(var(--gap) * 1.5) 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
.text-brand { color: var(--color-brand); }
.text-accent { color: var(--color-accent); }
.text-paper { color: var(--color-paper); }
.text-deep { color: var(--color-deep); }

/* === 导航与页头页脚 === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-text);
  padding: 1rem 0;
  backdrop-filter: blur(4px);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-img { width: 32px; height: 32px; object-fit: contain; }
.nav-links { display: flex; gap: var(--gap); align-items: center; }
.nav-links a {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-radius: 0;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
footer {
  background: var(--color-deep);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  border-top: 1px solid var(--color-paper);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-grid h4 { color: var(--color-accent); margin-bottom: 0.5rem; }
.footer-grid a { display: block; padding: 0.25rem 0; opacity: 0.85; transition: opacity 0.2s; }
.footer-grid a:hover { opacity: 1; }
.copyright {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid rgba(244,243,247,0.2);
  text-align: center;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-deep);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-text);
}
.btn-secondary:hover { background: var(--color-text); color: var(--color-paper); }
.btn:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; }
.btn svg { width: 20px; height: 20px; stroke-width: 2; }

/* === 卡片与面板 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  margin-bottom: var(--gap);
}
.panel-dark {
  background: var(--color-deep);
  border: 2px solid var(--color-paper);
  box-shadow: 4px 4px 0 var(--color-paper);
  padding: var(--gap);
}
/* 深色面板内的浅色卡片恢复纸面取色 */
.panel-dark .card {
  background: var(--color-paper);
  border-color: var(--color-text);
  box-shadow: var(--card-shadow);
}
.grid-2 { 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; }

/* === 表格 === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
th, td {
  border: 1px solid var(--color-text);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
  min-width: 0;
  word-break: break-word;
}
th { background: var(--color-deep); color: var(--color-paper); font-weight: 700; }
td strong { display: block; margin-bottom: 0.25rem; }

/* === FAQ === */
details {
  border: var(--card-border);
  padding: var(--gap);
  margin-bottom: var(--gap);
  background: var(--color-paper);
}
summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; line-height: 1; }
details[open] summary::after { content: "-"; }
details p { margin-top: var(--gap); }

/* === 眉标 === */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}
.panel-dark .eyebrow { color: var(--color-accent); }

/* === SVG 动效 === */
svg { width: 100%; height: auto; max-width: 100%; overflow: visible; }
.draw-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawStroke 8s ease-in-out infinite alternate;
}
.anim-float { animation: floatUp 5s ease-in-out infinite; }
.anim-breathe { animation: breathOpacity 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 6s ease forwards; }
.transform-center { transform-box: fill-box; transform-origin: center; }

@keyframes drawStroke {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === 响应式微调 === */
@media (max-width: 768px) {
  .hero-layout { flex-direction: column-reverse; }
  .feature-alternate:nth-child(even) { flex-direction: column; }
  .nav-links { gap: 0.5rem; }
  .nav-links a { padding: 0.5rem; font-size: 0.9rem; }
}
