/* === 设计变量与基础重置 === */
:root {
  --color-dark: #140E25;
  --color-paper: #F5F0E5;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 1px solid rgba(25, 21, 35, 0.16);
  --card-shadow: none;
  
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 960px;
  
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::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.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 {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}
.section {
  padding: var(--section-y) 0;
}
.section--dark {
  background: var(--color-dark);
  color: var(--color-paper);
}
.section--dark .hl { color: var(--color-accent); }
.section--paper { background: var(--color-paper); }
.section--paper .hl { color: var(--color-brand); }

/* === 排版 === */
.megamark {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section--paper .megamark { color: var(--color-brand); }
.section--dark .megamark { color: var(--color-accent); }

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
p { margin-bottom: 1rem; max-width: 38em; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* === 页头页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 229, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}
.section--dark ~ .site-header,
.site-header.dark-mode {
  background: rgba(20, 14, 37, 0.92);
  border-bottom-color: rgba(245, 240, 229, 0.1);
}
.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 { display: flex; gap: 1.5rem; align-items: center; }
.nav a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.section--dark .nav a:hover, .section--dark .nav a[aria-current="page"] { color: var(--color-accent); }
.nav a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; width: 0; height: 2px;
  background: currentColor;
  transition: width 0.2s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }

.footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 3rem 0;
  border-top: 1px solid rgba(245, 240, 229, 0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer h4 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--color-accent); }
.footer ul li { margin-bottom: 0.5rem; }
.footer a:hover { text-decoration: underline; }
.copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(245, 240, 229, 0.1);
  font-size: 0.85rem;
  opacity: 0.8;
  text-align: center;
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.25rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: none;
  text-decoration: none;
}
.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 { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(200, 237, 110, 0.3); }
.btn--secondary {
  background: transparent;
  border: 1px solid var(--color-text);
  color: var(--color-text);
}
.section--dark .btn--secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}
.btn--secondary:hover { background: rgba(25, 21, 35, 0.05); transform: translateY(-1px); }
.section--dark .btn--secondary:hover { background: rgba(245, 240, 229, 0.08); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* === 卡片与面板 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.section--dark .card {
  background: rgba(245, 240, 229, 0.05);
  border-color: rgba(245, 240, 229, 0.12);
  color: var(--color-paper);
}
.visual-panel {
  background: var(--color-dark);
  border-radius: 12px;
  padding: 1.5rem;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.visual-panel svg { width: 100%; height: auto; }

/* === 图文交错布局 === */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: center;
}
.split-row.reverse .visual-panel { order: -1; }
@media (max-width: 768px) {
  .split-row { grid-template-columns: 1fr; }
  .split-row.reverse .visual-panel { order: 0; }
}

/* === 表格 === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}
.data-table th { font-weight: 600; width: 40%; }
.section--dark .data-table th, .section--dark .data-table td {
  border-bottom-color: rgba(245, 240, 229, 0.1);
}

/* === 步骤条 === */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.step-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.step-badge {
  width: 36px; height: 36px;
  background: var(--color-accent);
  color: var(--color-dark);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* === 流程条 === */
.flow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
}
.flow-node {
  flex: 1;
  min-width: 140px;
  text-align: center;
  padding: 1rem;
  background: rgba(245, 240, 229, 0.06);
  border-radius: var(--radius-card);
  border: 1px solid rgba(245, 240, 229, 0.1);
}
.flow-arrow {
  width: 32px; height: 32px;
  flex-shrink: 0;
  color: var(--color-accent);
}

/* === 新闻卡片 === */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.news-card article {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.news-card time {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: auto;
  padding-top: 0.75rem;
}

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  background: var(--color-paper);
}
.section--dark .faq-item details {
  background: rgba(245, 240, 229, 0.04);
  border-color: rgba(245, 240, 229, 0.12);
}
.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin-top: 0.75rem; opacity: 0.9; }

/* === SVG 动效基类 === */
.svg-anim-container { width: 100%; height: auto; }
/* 描边绘制：默认 pathLength="1"，stroke-dashoffset: 0，从 1 开始动画 */
.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawPath 3s ease forwards;
}
@keyframes drawPath {
  0% { stroke-dashoffset: 1; }
  100% { stroke-dashoffset: 0; }
}
/* 悬浮呼吸 */
.anim-float {
  animation: floatMove 4s ease-in-out infinite;
}
@keyframes floatMove {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
/* 输入点呼吸 */
.anim-breathe {
  animation: breathCycle 2.4s ease-in-out infinite;
}
@keyframes breathCycle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
/* 几何旋转拼合 */
.anim-rotate {
  animation: spinSlow 10s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* 通知滑入 */
.anim-slide-in {
  animation: slideIn 1.5s ease forwards;
}
@keyframes slideIn {
  0% { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
