:root {
  --color-dark: #121531;
  --color-paper: #E8E9EA;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #ED7D6E;
  --color-bg-card: #F2F3F4;
  --color-bg-dark-card: #1A1D3A;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* 上下文取色变量 */
.bg-paper { --text-color: var(--color-text); --link-color: var(--color-brand); --accent-color: var(--color-brand); --badge-bg: rgba(20, 44, 235, 0.1); --card-bg: var(--color-bg-card); }
.bg-dark { --text-color: var(--color-paper); --link-color: var(--color-accent); --accent-color: var(--color-accent); --badge-bg: rgba(237, 125, 110, 0.15); --card-bg: var(--color-bg-dark-card); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--color-paper); color: var(--color-text); line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { 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 + .section { border-top: 1px solid rgba(0,0,0,0.08); }
.bg-dark .section + .section { border-top-color: rgba(255,255,255,0.08); }

/* 排版 */
h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: 0; text-wrap: balance; color: var(--text-color); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: var(--gap); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: calc(var(--gap) * 0.75); }
p { margin-bottom: var(--gap); max-width: 38em; }
.hl { color: var(--accent-color); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; padding: 4px 12px; border-radius: 999px; background: var(--badge-bg); color: var(--accent-color); margin-bottom: calc(var(--gap) * 0.5); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 28px; border-radius: var(--radius-btn); font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; border: none; white-space: nowrap; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237, 125, 110, 0.25); }
.btn-secondary { background: transparent; border: 1px solid var(--text-color); color: var(--text-color); }
.btn-secondary:hover { background: rgba(0,0,0,0.04); }
.bg-dark .btn-secondary { border-color: var(--text-color); color: var(--text-color); }
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* 网格与布局 */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.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; }
.col-left { flex: 1 1 480px; }
.col-right { flex: 1 1 480px; }

/* 卡片 */
.card { background: var(--card-bg); border-radius: var(--radius-card); padding: calc(var(--gap) * 1.5); border: var(--card-border); box-shadow: var(--card-shadow); }
.card h3 { margin-top: 0; }
.card ul { padding-left: 1.2em; margin-bottom: 0; }
.card li { margin-bottom: 0.5em; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-bottom: var(--gap); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.bg-dark th, .bg-dark td { border-bottom-color: rgba(255,255,255,0.08); }
th { font-weight: 600; }

/* FAQ */
details { background: var(--card-bg); border-radius: var(--radius-card); padding: 16px 20px; margin-bottom: 12px; border: var(--card-border); }
summary { cursor: pointer; 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.2em; }
details[open] summary::after { content: "-"; }
details p { margin-top: 12px; margin-bottom: 0; }

/* 导航与页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(232, 233, 234, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.bg-dark header { background: rgba(18, 21, 49, 0.92); border-bottom-color: rgba(255,255,255,0.06); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text-color); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text-color); text-decoration: none; }
.logo img { width: 32px; height: 32px; object-fit: contain; }
nav ul { display: flex; gap: 24px; list-style: none; }
nav a { font-weight: 500; transition: color 0.2s; color: var(--color-paper); }
nav a:hover, nav a[aria-current="page"] { color: var(--accent-color); }
.bg-dark .logo span { color: var(--color-paper); }
footer { background: var(--color-dark); color: var(--color-paper); padding: 48px 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: var(--color-accent); }

/* SVG 容器与动效 */
.svg-container { width: 100%; height: auto; overflow: hidden; }
.svg-container svg { width: 100%; height: auto; display: block; }
svg { max-width: 100%; height: auto; display: block; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes draw { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

.anim-float { animation: float 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-draw { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 3s ease forwards; }
.anim-breathe { animation: breathe 4s ease-in-out infinite; }
.anim-slide { animation: slideIn 1.5s 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; }
}

@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .flex-row { flex-direction: column; align-items: stretch; }
  .col-left, .col-right { flex: 1 1 100%; }
}

/* 兜底：裁掉横向溢出 */
body > * {
  overflow-x: clip;
}
