*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: 1.75;
  color: var(--text-main);
  background-color: var(--bg-paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root {
  --bg-dark: #13102D;
  --bg-paper: #D6D4ED;
  --bg-paper-light: #EAE8F7;
  --text-main: #171523;
  --text-on-dark: #D6D4ED;
  --brand: #2714EB;
  --accent: #89ED6E;
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(23, 21, 35, 0.16);
  --card-shadow: none;
  --section-y: clamp(5rem, 10vw, 9rem);
  --gap: clamp(1.5rem, 3vw, 2.5rem);
  --content-max: 1120px;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* 版面节奏与分节 */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.section-paper {
  background-color: var(--bg-paper);
  color: var(--text-main);
}

.section-alt {
  background-color: var(--bg-paper-light);
  color: var(--text-main);
}

/* 排版工具类 */
.label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.section-dark .label { color: var(--accent); }
.section-paper .label { color: var(--brand); }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  margin-bottom: 1rem;
}

p {
  max-width: 38em;
  margin-bottom: 1.5rem;
}

.hl {
  font-weight: 600;
}

.section-dark .hl { color: var(--accent); }
.section-paper .hl { color: var(--brand); }

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border-radius: var(--radius-btn);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--text-main);
  color: var(--text-main);
}

.section-dark .btn-secondary {
  border-color: var(--text-on-dark);
  color: var(--text-on-dark);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* 卡片与网格 */
.card {
  background-color: inherit;
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}

.section-dark .card {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-top: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--card-border);
}

th {
  font-weight: 600;
  background-color: rgba(0, 0, 0, 0.03);
}

td { vertical-align: top; }

/* 导航与页头页脚 */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(214, 212, 237, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

nav { display: flex; align-items: center; }

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover { color: var(--brand); }
nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

footer {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--card-border);
  text-align: center;
  color: var(--text-main);
  font-size: 0.9rem;
}

footer nav { justify-content: center; margin-bottom: 1.5rem; }
footer nav a { margin: 0 1rem; }

/* FAQ */
details {
  border: var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 1rem;
  overflow: hidden;
  background-color: inherit;
}

summary {
  padding: 1.2rem;
  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.4rem;
  font-weight: 300;
  transition: transform 0.2s ease;
}

details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 1.2rem 1.2rem; margin: 0; line-height: 1.7; }

/* SVG 基础与动效 */
.svg-visual {
  width: 100%;
  height: auto;
  max-width: 500px;
  display: block;
}

.anim-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-line 6s ease-in-out infinite alternate;
}

.anim-bubble {
  animation: float-up 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-dot {
  animation: breathe 4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.anim-star {
  animation: twinkle 6s ease-in-out infinite;
}

@keyframes draw-line {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim-draw, .anim-bubble, .anim-dot, .anim-star {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 响应式微调 */
@media (max-width: 768px) {
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav-container { flex-wrap: wrap; height: auto; padding: 1rem 0; }
  nav { margin-top: 0.5rem; }
  nav a { margin-left: 0.8rem; font-size: 0.9rem; }
}
