/* === 设计变量与基础重置 === */
:root {
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --color-text-light: #F5F0E5;
  --color-brand-light: #C8ED6E;
  --color-border-subtle: rgba(25, 21, 35, 0.12);
  --color-border-dark: rgba(245, 240, 229, 0.15);

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid;
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  --header-h: 64px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::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: 1.75;
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* === 容器与区块 === */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section-y) 0; position: relative; }
.section-dark { background: var(--color-dark); color: var(--color-text-light); }
.section-paper { background: var(--color-paper); color: var(--color-text); }
.section-inner { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }

/* === 排版 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-paper .badge { color: var(--color-brand); }
.section-dark .badge { color: var(--color-accent); }

h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
p { margin-bottom: 1rem; max-width: 38em; }
.hl { font-weight: 600; }
.section-paper .hl { color: var(--color-brand); }
.section-dark .hl { color: var(--color-accent); }

/* === 页头与页脚 === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
  height: var(--header-h);
  display: flex; align-items: center;
}
.section-dark .site-header { background: rgba(20, 14, 37, 0.95); border-color: var(--color-border-dark); }
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--color-brand); }
.section-dark .nav-links a:hover, .section-dark .nav-links a[aria-current="page"] { color: var(--color-accent); }
.brand-img { height: 32px; width: auto; margin-right: 0.5rem; }

.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border-subtle);
  font-size: 0.9rem;
  text-align: center;
  color: rgba(25, 21, 35, 0.7);
}
.section-dark .site-footer { border-color: var(--color-border-dark); color: rgba(245, 240, 229, 0.6); }

/* === 按钮 === */
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 48px; padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem;
  transition: transform 0.2s, filter 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary { background: var(--color-accent); color: var(--color-dark); }
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary { border: 2px solid var(--color-text); color: var(--color-text); }
.section-dark .btn-secondary { border-color: var(--color-text-light); color: var(--color-text-light); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片与网格 === */
.card-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.card {
  background: var(--color-paper);
  border: var(--card-border) var(--color-text);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  display: flex; flex-direction: column;
}
.section-dark .card { background: rgba(245, 240, 229, 0.08); border-color: var(--color-border-dark); }
.card h3 { margin-top: 0; }
.card ul { margin: 0.75rem 0; padding-left: 1.2rem; list-style-type: disc; }
.card li { margin-bottom: 0.4rem; }
.card-note { font-size: 0.85rem; color: rgba(25, 21, 35, 0.7); margin-top: auto; padding-top: 0.75rem; border-top: 1px dashed var(--color-border-subtle); }
.section-dark .card-note { color: rgba(245, 240, 229, 0.6); border-color: var(--color-border-dark); }

/* === 表格 === */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border-subtle); }
.section-dark .data-table th, .section-dark .data-table td { border-color: var(--color-border-dark); }
.data-table th { font-weight: 600; background: rgba(0,0,0,0.03); }
.section-dark .data-table th { background: rgba(255,255,255,0.05); }
.data-table a { color: var(--color-brand); font-weight: 500; }
.section-dark .data-table a { color: var(--color-accent); }
.data-table a:hover { text-decoration: underline; }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { border: var(--card-border) var(--color-text); border-radius: var(--radius-card); overflow: hidden; }
.section-dark .faq-item { border-color: var(--color-border-dark); }
.faq-item summary {
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; user-select: none;
  list-style: none; position: relative; padding-right: 2.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 1.25rem; top: 50%; transform: translateY(-50%);
  font-weight: 400; transition: transform 0.2s;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 1.25rem 1rem; font-size: 0.95rem; line-height: 1.7; }

/* === 步骤徽标 === */
.step-list { counter-reset: step; }
.step-item { display: flex; gap: 1rem; margin-bottom: 1.25rem; align-items: flex-start; }
.step-badge {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 6px;
  background: var(--color-accent); color: var(--color-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
}
.step-content h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.step-content p { margin: 0; font-size: 0.95rem; }

/* === 资讯卡片 === */
.news-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.news-card {
  background: rgba(245, 240, 229, 0.06); border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-card); padding: 1.25rem;
  display: flex; flex-direction: column;
}
.news-card time { font-size: 0.8rem; color: rgba(245, 240, 229, 0.5); margin-bottom: 0.5rem; display: block; }
.news-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.news-card p { font-size: 0.9rem; color: rgba(245, 240, 229, 0.8); margin: 0; }

/* === SVG 容器 === */
.svg-panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
}
.section-dark .svg-panel { background: rgba(245, 240, 229, 0.05); }
.svg-visual { width: 100%; height: auto; max-width: 100%; }

/* === SVG 动效关键帧 === */
@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes typing-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes line-flow {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
@keyframes slide-in-right {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 动效类应用 */
.anim-orbit { animation: orbit-breathe 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-float { animation: float-gentle 4s ease-in-out infinite; }
.anim-typing { animation: typing-pulse 1.8s ease-in-out infinite; }
.anim-typing:nth-child(2) { animation-delay: 0.3s; }
.anim-typing:nth-child(3) { animation-delay: 0.6s; }
.anim-flow { stroke-dasharray: 1; stroke-dashoffset: 0; animation: line-flow 3s linear infinite; }
.anim-slide { animation: slide-in-right 0.8s ease-out forwards; opacity: 0; }
.anim-slide:nth-child(2) { animation-delay: 0.2s; }
.anim-slide:nth-child(3) { animation-delay: 0.4s; }

/* === 响应式与无障碍 === */
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
  .hero-layout { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .anim-orbit, .anim-float, .anim-typing, .anim-flow, .anim-slide {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
/* Flex/Grid 防溢出 */
.flex-row { display: flex; gap: var(--gap); align-items: center; }
.flex-row > * { flex: 1 1 0; min-width: 0; }
.grid-auto { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
@media (min-width: 769px) {
  .hero-layout { display: flex; align-items: stretch; }
  .hero-text { flex: 1; min-width: 0; }
  .hero-visual { flex: 1; min-width: 0; }
}
