:root {
  --color-dark: #21163C;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #ED926E;
  --radius-card: 20px;
  --radius-btn: 12px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* 主题上下文变量控制 */
.theme-light { --ctx-text: var(--color-text); --ctx-brand: var(--color-brand); --ctx-accent: var(--color-accent); --ctx-bg: var(--color-paper); }
.theme-dark { --ctx-text: var(--color-paper); --ctx-brand: var(--color-accent); --ctx-accent: var(--color-brand); --ctx-bg: var(--color-dark); }
.card-light { --ctx-text: var(--color-text); --ctx-brand: var(--color-brand); --ctx-accent: var(--color-accent); --ctx-bg: var(--color-paper); }

/* 排版 */
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: var(--gap); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; line-height: 1.25; margin-bottom: var(--gap); color: var(--ctx-text); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.75rem; color: var(--ctx-text); }
p { margin-bottom: 1rem; max-width: 38em; }
.hl { color: var(--ctx-brand); }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; color: var(--ctx-brand); margin-bottom: 0.5rem; }

/* 区块布局 */
section { padding-top: var(--section-y); padding-bottom: var(--section-y); background: var(--ctx-bg); }
.section-inner { display: flex; flex-direction: column; gap: var(--gap); color: var(--ctx-text); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); align-items: center; }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(244, 243, 247, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(25, 21, 35, 0.08); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 64px; }
nav { display: flex; gap: 1.5rem; }
nav a { font-weight: 500; transition: color 0.2s ease; }
nav a:hover, nav a[aria-current="page"] { color: var(--ctx-brand); }
nav a[aria-current="page"] { font-weight: 700; }
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }
.footer-grid a { color: var(--color-accent); display: block; margin-bottom: 0.5rem; transition: opacity 0.2s ease; }
.footer-grid a:hover { opacity: 0.85; }
.footer-col h4 { color: var(--color-paper); margin-bottom: 0.75rem; font-size: 1rem; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.75rem; 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; min-height: 48px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); border: none; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(237, 146, 110, 0.4); }
.btn-secondary { background: transparent; border: 2px solid var(--ctx-text); color: var(--ctx-text); }
.btn-secondary:hover { background: var(--ctx-text); color: var(--ctx-bg); }
.btn:focus-visible { outline: 3px solid var(--ctx-brand); outline-offset: 2px; }

/* 卡片 */
.card { background: var(--ctx-bg); 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(25, 21, 35, 0.35); }
.card.dark-card { background: var(--color-dark); color: var(--color-paper); }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid rgba(25, 21, 35, 0.1); }
th { font-weight: 600; }
td { color: var(--ctx-text); }
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* FAQ */
details { background: var(--ctx-bg); border: 1px solid rgba(25, 21, 35, 0.1); border-radius: var(--radius-card); margin-bottom: 0.75rem; padding: 1rem; }
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.2rem; transition: transform 0.2s ease; }
details[open] summary::after { content: "-"; transform: rotate(90deg); }
details p { margin-top: 0.75rem; color: var(--ctx-text); line-height: 1.7; }

/* SVG 图标基础 */
.svg-icon { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.5; fill: none; transform-box: fill-box; transform-origin: center; }

/* SVG 动效 */
@keyframes drawPath { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes flowDash { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes slideInLeft { 0% { opacity: 0; transform: translateX(-12px); } 100% { opacity: 1; transform: translateX(0); } }

.anim-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: drawPath 4s ease forwards; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; animation: flowDash 8s linear infinite; }
.anim-float { animation: floatY 6s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideInLeft 0.8s ease backwards; }
.anim-slide:nth-child(1) { animation-delay: 0.1s; }
.anim-slide:nth-child(2) { animation-delay: 0.25s; }
.anim-slide:nth-child(3) { animation-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .anim-draw, .anim-flow, .anim-float, .anim-breathe, .anim-slide { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* 响应式微调 */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 0.75rem; }
  nav { flex-wrap: wrap; justify-content: center; }
}
