:root {
  /* 配色层 */
  --color-bg-dark: #13102D;
  --color-bg-paper: #F7F5F3;
  --color-text-body: #171523;
  --color-brand: #2714EB;
  --color-accent: #89ED6E;
  /* 圆角 */
  --radius-card: 24px;
  --radius-btn: 999px;
  /* 阴影与边框 */
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(23, 21, 35, 0.3);
  /* 间距 */
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  /* 宽度 */
  --content-max: 1280px;
  /* 字体 */
  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --lh-tight: 1.1;
  --lh-body: 1.65;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-body);
  color: var(--color-text-body);
  background-color: var(--color-bg-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 主题取色变量覆写 */
.theme-dark { background-color: var(--color-bg-dark); color: var(--color-bg-paper); }
.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark p, .theme-dark li, .theme-dark span, .theme-dark td, .theme-dark th { color: var(--color-bg-paper); }
.theme-dark .hl { color: var(--color-accent); }
.theme-dark .badge { color: var(--color-accent); }
.theme-dark .link { color: var(--color-accent); }
.theme-dark .btn-secondary { color: var(--color-bg-paper); border-color: var(--color-bg-paper); }
.theme-dark .btn-secondary:hover { background-color: rgba(247, 245, 243, 0.1); }

.theme-light { background-color: var(--color-bg-paper); color: var(--color-text-body); }
.theme-light h1, .theme-light h2, .theme-light h3, .theme-light p, .theme-light li, .theme-light span, .theme-light td, .theme-light th { color: var(--color-text-body); }
.theme-light .hl { color: var(--color-brand); }
.theme-light .badge { color: var(--color-brand); }
.theme-light .link { color: var(--color-brand); }
.theme-light .btn-secondary { color: var(--color-text-body); border-color: var(--color-text-body); }
.theme-light .btn-secondary:hover { background-color: rgba(23, 21, 35, 0.05); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }

/* 排版 */
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-tight); margin-bottom: var(--gap); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: var(--lh-tight); margin-bottom: calc(var(--gap) * 0.75); text-wrap: balance; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 800; letter-spacing: -0.01em; line-height: var(--lh-tight); margin-bottom: calc(var(--gap) * 0.5); }
p { margin-bottom: var(--gap); max-width: 38em; }
ul, ol { margin-bottom: var(--gap); padding-inline-start: 1.2em; }
li { margin-bottom: 0.5em; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: calc(var(--gap) * 0.5); }
.hl { font-weight: 800; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; padding: 0 24px; border-radius: var(--radius-btn);
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; border: none; transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-primary { background-color: var(--color-accent); color: var(--color-bg-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(137, 237, 110, 0.4); }
.btn-secondary { background: transparent; border: 1.5px solid currentColor; }
.btn-secondary:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.icon-svg { width: 20px; height: 20px; stroke-width: 1.5; fill: none; stroke: currentColor; flex-shrink: 0; }

/* 卡片与网格 */
.card {
  background: var(--color-bg-paper); border: var(--card-border); border-radius: var(--radius-card);
  box-shadow: var(--card-shadow); padding: var(--gap); transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 14px 32px -12px rgba(23, 21, 35, 0.4); }
.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); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(128,128,128,0.2); }
th { font-weight: 700; white-space: nowrap; }
td { vertical-align: middle; }

/* FAQ */
details { margin-bottom: var(--gap); border: 1px solid rgba(128,128,128,0.2); border-radius: var(--radius-card); padding: var(--gap); }
summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }
summary::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E"); transition: transform 0.2s; display: inline-block; width: 20px; height: 20px; }
details[open] summary::before { transform: rotate(90deg); }
details p { margin-top: var(--gap); }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(247, 245, 243, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.05); }
.theme-dark header { background: rgba(19, 16, 45, 0.92); border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.2rem; color: inherit; }
.logo img { height: 32px; width: auto; display: block; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { text-decoration: none; color: inherit; font-weight: 500; transition: color 0.2s; }
nav a:hover, nav a[aria-current="page"] { color: var(--color-brand); }
.theme-dark nav a:hover, .theme-dark nav a[aria-current="page"] { color: var(--color-accent); }
footer { padding: var(--section-y) 0; border-top: 1px solid rgba(128,128,128,0.2); margin-top: var(--section-y); }

/* SVG 动效系统 */
svg { width: 100%; height: auto; display: block; }
.draw { animation: draw-line 5s ease forwards; stroke-dasharray: 1; stroke-dashoffset: 0; }
.orbit { animation: breathe-orbit 8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.float { animation: float-bubble 6s ease-in-out infinite; }
.slide-in {
  width: 100%;
  animation: slide-in-right 5s ease forwards;
  overflow: hidden;
}
.delay-1 { animation-delay: 0.6s; }
.delay-2 { animation-delay: 1.4s; }
.delay-3 { animation-delay: 2.2s; }

@keyframes draw-line {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes breathe-orbit {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes slide-in-right {
  0% { transform: translateX(30px); opacity: 0; }
  100% { 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; scroll-behavior: auto !important; }
}

/* 兜底：裁掉横向溢出 */
div.container.grid-2 {
  overflow-x: clip;
}
