:root {
  --color-dark: #140E25;
  --color-paper: #F7F5F3;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #C8ED6E;
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: 0 10px 28px -14px rgba(25, 21, 35, 0.3);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1280px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-paper);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 排版基础 */
h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: var(--gap);
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  max-width: 38em;
}

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 区块背景与取色规则 */
.dark-bg {
  background-color: var(--color-dark);
  color: var(--color-paper);
}

.dark-bg h1, .dark-bg h2, .dark-bg h3, .dark-bg p, .dark-bg li {
  color: var(--color-paper);
}

.dark-bg a:not(.btn) {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.dark-bg .hl {
  color: var(--color-accent);
}

.paper-bg {
  background-color: var(--color-paper);
  color: var(--color-text);
}

.paper-bg a:not(.btn) {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.paper-bg .hl {
  color: var(--color-brand);
}

/* 眉标 */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

.paper-bg .section-label {
  color: var(--color-brand);
  background: rgba(82, 20, 235, 0.08);
}

.dark-bg .section-label {
  color: var(--color-accent);
  background: rgba(200, 237, 110, 0.12);
}

/* 按钮系统 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 237, 110, 0.25);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
}

.dark-bg .btn-secondary {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(25, 21, 35, 0.05);
}

.dark-bg .btn-secondary:hover {
  background-color: rgba(247, 245, 243, 0.08);
}

.btn:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 3px;
}

/* 头部导航 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(247, 245, 243, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(25, 21, 35, 0.08);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
}

.logo img {
  height: 32px;
  width: auto;
  display: block;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover, nav a[aria-current="page"] {
  color: var(--color-brand);
}

/* 卡片与网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  background-color: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px -12px rgba(25, 21, 35, 0.35);
}

.dark-bg .card {
  background-color: #1A1530;
  border-color: #2D2645;
}

.dark-bg .card:hover {
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.4);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(25, 21, 35, 0.1);
  text-align: left;
}

th {
  font-weight: 700;
  color: var(--color-text);
}

.dark-bg th {
  color: var(--color-paper);
  border-bottom-color: rgba(247, 245, 243, 0.15);
}

td {
  vertical-align: top;
}

/* 流程条 */
.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
  margin: 2rem 0;
}

.flow-node {
  flex: 1;
  min-width: 200px;
  background: var(--color-paper);
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  position: relative;
}

.dark-bg .flow-node {
  background: #1A1530;
  border-color: #2D2645;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--color-brand);
  flex-shrink: 0;
}

.dark-bg .flow-arrow {
  color: var(--color-accent);
}

/* 编号徽标 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: var(--color-accent);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* FAQ */
details {
  margin-bottom: 1rem;
  border: 1px solid rgba(25, 21, 35, 0.1);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  background: var(--color-paper);
}

.dark-bg details {
  background: #1A1530;
  border-color: #2D2645;
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.6;
}

details[open] summary {
  margin-bottom: 0.75rem;
}

/* 资讯卡片 */
.news-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.news-date {
  font-size: 0.85rem;
  color: var(--color-text);
  opacity: 0.7;
  font-weight: 500;
}

.dark-bg .news-date {
  color: var(--color-paper);
}

/* SVG 容器 */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

/* SVG 动效关键帧 */
@keyframes drawLine {
  0%, 100% { stroke-dashoffset: 0; }
  50% { stroke-dashoffset: 1; }
}

@keyframes floatBubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

.conn-line {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s ease-in-out infinite;
}

.msg-bubble {
  animation: floatBubble 8s ease-in-out infinite;
}

.msg-bubble:nth-of-type(odd) {
  animation-delay: -2.5s;
}

.star {
  animation: twinkle 4s ease-in-out infinite;
}

.star:nth-child(even) {
  animation-delay: -1.5s;
}

.notif-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulseDot 3s ease-in-out infinite;
}

/* 减少动态效果支持 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 1rem;
  }

  nav ul {
    gap: 1.25rem;
  }

  .flow-steps {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
    height: 48px;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
