/* ==================== 设计变量与基础重置 ==================== */
:root {
  /* 色板 */
  --color-dark: #231334;
  --color-paper: #F5F3F7;
  --color-text: #1C1523;
  --color-brand: #7D14EB;
  --color-accent: #EDD26E;
  
  /* 结构 Token */
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1280px;
  
  /* 字体与排版 */
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --lh-tight: 1.15;
  --lh-body: 1.75;
  --fs-h1: clamp(2.6rem, 6.4vw, 5rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.4rem);
  --fs-body: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-main);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; background: none; border: none; }

/* ==================== 布局与容器 ==================== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.grid-2 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.grid-3 {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

/* ==================== 色彩上下文类 ==================== */
.bg-dark {
  --c-bg: var(--color-dark);
  --c-fg: var(--color-paper);
  --c-accent: var(--color-accent);
  background-color: var(--c-bg);
  color: var(--c-fg);
}
.bg-dark .hl { color: var(--c-accent); }
.bg-dark a { color: var(--c-accent); }
.bg-dark a:hover { color: #fff; }

.card-light {
  --c-bg: var(--color-paper);
  --c-fg: var(--color-text);
  --c-accent: var(--color-brand);
  background-color: var(--c-bg);
  color: var(--c-fg);
  border-radius: var(--radius-card);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
}

/* ==================== 排版组件 ==================== */
.overline {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}
.bg-dark .overline { color: var(--color-accent); }

h1, h2, h3 {
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-h1); margin-bottom: 1rem; }
h2 { font-size: var(--fs-h2); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; max-width: 38em; }
p:last-child { margin-bottom: 0; }

.hl {
  font-weight: 600;
  color: var(--color-brand);
}
.bg-dark .hl { color: var(--color-accent); }

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding-inline: 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.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); background-color: #e5c85a; }
.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}
.bg-dark .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.bg-dark .btn-secondary:hover { background-color: rgba(255,255,255,0.1); }

/* ==================== 表格 ==================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid rgba(0,0,0,0.08);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
th { font-weight: 700; background: rgba(0,0,0,0.02); }
td { white-space: normal; }
tr:last-child td { border-bottom: none; }

/* ==================== FAQ ==================== */
.faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-block: 1rem;
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.05);
  font-size: 0.9rem;
}
.faq-item[open] summary::before { content: "-"; }
.faq-item p { margin-top: 0.75rem; font-size: 0.95rem; color: #444; }

/* ==================== 页头与页脚 ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 243, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--color-brand); }
.nav-links a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }

.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding-block: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
}
.footer-col h4 { color: var(--color-accent); margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

/* ==================== SVG 动效 ==================== */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes float-fast {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes breath {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes dash-flow {
  to { stroke-dashoffset: -20; }
}

.hero-svg .card-1 { animation: float-slow 6s ease-in-out infinite; }
.hero-svg .card-2 { animation: float-fast 5s ease-in-out infinite 1s; }
.hero-svg .bubble { animation: fade-in-up 0.8s ease-out forwards; opacity: 0; }
.hero-svg .bubble:nth-child(1) { animation-delay: 0.2s; }
.hero-svg .bubble:nth-child(2) { animation-delay: 0.5s; }
.hero-svg .bubble:nth-child(3) { animation-delay: 0.8s; }
.hero-svg .input-dot { animation: breath 1.5s ease-in-out infinite; }
.hero-svg .input-dot:nth-child(2) { animation-delay: 0.3s; }
.hero-svg .input-dot:nth-child(3) { animation-delay: 0.6s; }
.hero-svg .conn-line {
  stroke-dasharray: 10 5;
  animation: dash-flow 2s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-svg .bubble { opacity: 1; transform: none; }
}

/* ==================== 响应式微调 ==================== */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .header-cta { display: none; }
}
