:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-main: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-paper);
  line-height: 1.65;
  font-size: 16px;
}

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }

/* 面色上下文变量覆盖 */
.dark-surface { background: var(--color-dark); color: var(--color-paper); }
.dark-surface .eyebrow, .dark-surface .hl { color: var(--color-accent); }
.dark-surface a:not(.btn) { color: var(--color-accent); }
.dark-surface .btn-secondary { border-color: var(--color-paper); color: var(--color-paper); }
.paper-surface { background: var(--color-paper); color: var(--color-text); }
.paper-surface .eyebrow, .paper-surface .hl { color: var(--color-brand); }
.paper-surface a { color: var(--color-brand); }

/* 排版 */
h1, h2, h3, h4 { font-weight: 500; line-height: 1.15; margin-top: 0; margin-bottom: var(--gap); text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
p { margin-bottom: var(--gap); max-width: 38em; }
.eyebrow { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.5em; }
.hl { font-weight: 700; }

/* 组件：按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0 1.5em; height: 52px; border-radius: var(--radius-btn);
  font-weight: 600; text-decoration: none; transition: transform 0.2s ease, filter 0.2s ease;
  cursor: pointer; border: none; font-size: 1rem;
}
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-secondary { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 组件：卡片 */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: var(--gap);
  position: relative;
}
.dark-surface .card { background: var(--color-dark); border-color: rgba(255,255,255,0.12); box-shadow: none; }

/* 布局网格 */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; gap: var(--gap); align-items: stretch; flex-wrap: wrap; }
.flex-row > * { flex: 1 1 0; min-width: 0; }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: var(--gap); }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 0.75em 1em; border-bottom: 1px solid var(--color-text); text-align: left; vertical-align: top; }
th { font-weight: 700; white-space: nowrap; }
td:first-child { font-weight: 600; }

/* FAQ */
details { border: var(--card-border); border-radius: var(--radius-card); padding: var(--gap); margin-bottom: var(--gap); background: var(--color-paper); }
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.5em; font-weight: 400; line-height: 1; }
details[open] summary::after { content: "-"; }
details p { margin-top: 0.5em; margin-bottom: 0; }

/* 步骤条 */
.steps { display: flex; gap: var(--gap); counter-reset: step; }
.step { flex: 1; counter-increment: step; position: relative; padding-top: 2.5em; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0;
  width: 2em; height: 2em; background: var(--color-accent); color: var(--color-dark);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; font-size: 0.9rem;
}

/* 资讯卡片 */
.news-card { display: flex; flex-direction: column; }
.news-card time { font-size: 0.85rem; color: var(--color-text); opacity: 0.7; margin-bottom: 0.5em; display: block; }
.dark-surface .news-card time { color: var(--color-paper); }
.news-card h3 { font-size: 1.1rem; margin-bottom: 0.5em; }
.news-card p { font-size: 0.95rem; margin-bottom: 0; line-height: 1.6; }

/* 页头页脚 */
header { position: sticky; top: 0; z-index: 100; background: rgba(244,243,247,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(0,0,0,0.06); }
.nav-wrap { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo img { height: 32px; width: auto; vertical-align: middle; margin-right: 0.5em; }
nav a { margin-left: 1.5em; text-decoration: none; color: inherit; font-weight: 500; }
nav a[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
footer { background: var(--color-dark); color: var(--color-paper); padding: var(--section-y) 0; }
footer a { color: var(--color-accent); text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.footer-col h4 { color: var(--color-paper); margin-bottom: 0.5em; font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.4em; }
.footer-col a { color: rgba(255,255,255,0.8); }
.footer-copy { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--gap); font-size: 0.9rem; opacity: 0.8; }

/* SVG 响应式与基础 */
.svg-panel { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-panel svg { width: 100%; height: auto; display: block; }

/* SVG 动效 Keyframes */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes breathe { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes flowStroke { to { stroke-dashoffset: 0; } }
@keyframes rotateSlow { to { transform: rotate(360deg); } }

.anim-float { animation: float 5s ease-in-out infinite; }
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }
.anim-flow {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: flowStroke 4s linear infinite;
}
.anim-rotate {
  animation: rotateSlow 12s linear infinite;
  transform-box: fill-box; transform-origin: center;
}

/* 无障碍：减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 焦点可见 */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* 窄屏适配 */
@media (max-width: 768px) {
  .flex-row { flex-direction: column; }
  .steps { flex-direction: column; }
  h1 { font-size: clamp(2.2rem, 8vw, 3.5rem); }
}
