/* === 全局变量与设计 Token === */
:root {
  /* 色板 */
  --color-dark: #13102D;
  --color-paper: #F7F5F3;
  --color-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  
  /* 派生色 */
  --color-body-muted: rgba(23, 21, 35, 0.65);
  --color-border-card: rgba(23, 21, 35, 0.16);
  --color-border-dark: rgba(247, 245, 243, 0.12);
  
  /* 尺寸与节奏 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid;
  --card-shadow: none;
  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1120px;
  
  /* 字体 */
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --text-base: 16px;
  --line-height-base: 1.55;
}

/* === 基础重置与排版 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: var(--text-base); }
body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-body);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  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, textarea { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 区块通用布局 */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
  position: relative;
}
.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.section__inner {
  display: flex;
  flex-direction: column;
  gap: var(--section-y);
}
@media (min-width: 900px) {
  .section__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .section__text { flex: 1; min-width: 0; }
  .section__visual { flex: 1; min-width: 0; }
}

/* 眉标与标题 */
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.paper-theme .eyebrow { color: var(--color-brand); }
.dark-theme .eyebrow { color: var(--color-accent); }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); margin-bottom: 0.5rem; }
.hl { color: var(--color-brand); }
.dark-theme .hl { color: var(--color-accent); }

/* 文本排版 */
p { margin-bottom: 1rem; max-width: 38em; }
.text-muted { color: var(--color-body-muted); }
.dark-theme .text-muted { color: rgba(247, 245, 243, 0.7); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  border: none;
  outline: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(137, 237, 110, 0.6);
  transform: translateY(-1px);
}
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { background-color: #7AD663; transform: translateY(-2px); }
.btn--secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.dark-theme .btn--secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn--secondary:hover { background-color: rgba(23, 21, 35, 0.05); transform: translateY(-1px); }
.dark-theme .btn--secondary:hover { background-color: rgba(247, 245, 243, 0.08); }

/* 卡片 */
.card {
  background-color: var(--color-paper);
  border: var(--card-border) var(--color-border-card);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.dark-theme .card {
  background-color: var(--color-dark);
  border-color: var(--color-border-dark);
}

/* 网格 */
.grid {
  display: grid;
  gap: var(--gap);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: var(--card-border) var(--color-border-card);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}
th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-card);
}
th { font-weight: 600; background-color: rgba(23, 21, 35, 0.03); }
.dark-theme th { background-color: rgba(247, 245, 243, 0.05); }
tr:last-child th, tr:last-child td { border-bottom: none; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--color-border-card);
  padding: 1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq p { margin-top: 0.75rem; font-size: 0.95rem; }

/* 步骤徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* 页头与页脚 */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 245, 243, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-card);
}
.dark-theme .header { background-color: rgba(19, 16, 45, 0.9); border-color: var(--color-border-dark); }
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--color-brand); }
.dark-theme .nav a:hover { color: var(--color-accent); }
.nav a[aria-current="page"] { color: var(--color-brand); font-weight: 600; }
.dark-theme .nav a[aria-current="page"] { color: var(--color-accent); }

.footer {
  background-color: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  border-top: 1px solid var(--color-border-dark);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}
.footer__links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer__links a { color: rgba(247, 245, 243, 0.7); font-size: 0.9rem; }
.footer__links a:hover { color: var(--color-accent); }
.footer__copy { font-size: 0.8rem; color: rgba(247, 245, 243, 0.5); }

/* SVG 动效 Keyframes */
@keyframes flow-path {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-6px); opacity: 1; }
}
@keyframes breathe-dot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes slide-in {
  from { transform: translateX(10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 动效类应用 */
.animate-flow {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: flow-path 4s linear infinite;
}
.animate-float {
  animation: float-bubble 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.animate-float-delayed { animation-delay: 1.5s; }
.animate-breathe {
  animation: breathe-dot 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.animate-slide {
  animation: slide-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 减少动态效果 */
@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;
  }
  .animate-flow, .animate-float, .animate-breathe, .animate-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
