/* === 设计变量与基础重置 === */
:root {
  /* 色板 */
  --c-bg-dark: #1B1231;
  --c-bg-paper: #F4F3F7;
  --c-text-body: #191523;
  --c-brand: #5214EB;
  --c-accent: #9977EE;

  /* 结构参数 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 2px solid var(--c-text-body);
  --card-shadow: 4px 4px 0 var(--c-text-body);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --line-height: 1.65;

  /* 字体 */
  --font-main: "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: var(--line-height);
  background: var(--c-bg-paper);
  color: var(--c-text-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* === 容器与排版 === */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}
.section + .section {
  border-top: 1px solid rgba(0,0,0,0.08);
}
.surface-dark + .surface-light { border-top-color: transparent; }
.surface-light + .surface-dark { border-top-color: transparent; }

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: calc(var(--gap) * 0.75);
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); text-wrap: balance; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); text-wrap: balance; }
p { margin-bottom: 1rem; max-width: 38em; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}
.hl { color: var(--c-brand); }
.surface-dark .hl { color: var(--c-accent); }

/* === 表面层颜色覆盖规则 === */
.surface-dark { background: var(--c-bg-dark); color: var(--c-bg-paper); }
.surface-dark .label, .surface-dark a:not(.btn) { color: var(--c-accent); }
.surface-dark .card { background: var(--c-bg-paper); color: var(--c-text-body); border-color: var(--c-text-body); box-shadow: var(--card-shadow); }

.surface-light { background: var(--c-bg-paper); color: var(--c-text-body); }
.surface-light .label, .surface-light a:not(.btn) { color: var(--c-brand); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 52px;
  padding-inline: 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--c-accent);
  color: var(--c-bg-dark);
  border: 2px solid transparent;
}
.btn-primary:hover { filter: brightness(0.92); }

.btn-outline {
  background: transparent;
  color: var(--c-text-body);
  border: 2px solid var(--c-text-body);
}
.surface-dark .btn-outline { color: var(--c-bg-paper); border-color: var(--c-bg-paper); }
.btn-outline:hover { background: rgba(0,0,0,0.04); }
.surface-dark .btn-outline:hover { background: rgba(255,255,255,0.08); }

/* === 组件：卡片 === */
.card {
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  background: var(--c-bg-paper);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }

/* === 组件：表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.data-table th { font-weight: 700; width: 40%; }
.data-table tr:last-child td { border-bottom: none; }
.surface-dark .data-table th, .surface-dark .data-table td { border-bottom-color: rgba(255,255,255,0.15); }

/* === 组件：步骤与徽标 === */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--c-accent);
  color: var(--c-bg-dark);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin-top: 1.5rem;
}
.step-item { display: flex; gap: 1rem; align-items: flex-start; }

/* === 组件：FAQ === */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
  background: var(--c-bg-paper);
  overflow: hidden;
}
summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
.details-content { padding: 0 1.25rem 1rem; color: var(--c-text-body); }
.surface-dark details { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); }
.surface-dark details .details-content { color: var(--c-bg-paper); }

/* === 组件：新闻卡片 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
  margin-top: 1.5rem;
}
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-card time { font-size: 0.8rem; opacity: 0.7; margin-bottom: 0.5rem; display: block; }
.news-card p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 0; }

/* === 导航与页头 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 243, 247, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-bottom-color: rgba(0,0,0,0.1); background: rgba(244, 243, 247, 0.95); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.1rem; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-weight: 500; font-size: 0.95rem; }
.nav-links a[aria-current="page"] { color: var(--c-brand); font-weight: 700; }
.surface-dark .nav-links a[aria-current="page"] { color: var(--c-accent); }

@media (max-width: 768px) {
  .nav-links { gap: 1rem; }
  .nav-links .hide-mobile { display: none; }
}

/* === 页脚 === */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid rgba(0,0,0,0.1);
  font-size: 0.9rem;
  color: rgba(0,0,0,0.6);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a:hover { color: var(--c-brand); }
.surface-dark .site-footer { border-top-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.surface-dark .footer-links a:hover { color: var(--c-accent); }

/* === SVG 动效系统 === */
.svg-canvas { width: 100%; height: auto; max-width: 600px; margin: 0 auto; }
.orbit-ring { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.bubble { fill: var(--c-accent); opacity: 0.6; }
.line-path { fill: none; stroke: var(--c-brand); stroke-width: 2; stroke-linecap: round; }

@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.06); opacity: 0.65; }
}
@keyframes bubble-rise {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 0.85; }
}
@keyframes dash-flow {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}
@keyframes card-slide-in {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(4px); opacity: 1; }
}

.anim-orbit { animation: orbit-breathe 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-bubble { animation: bubble-rise 4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.anim-dash { animation: dash-flow 5s linear infinite; }
.anim-slide { animation: card-slide-in 7s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
