/* ==================== 设计变量 ==================== */
:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --color-line: rgba(21, 23, 35, 0.12);
  --color-line-dark: rgba(247, 245, 243, 0.15);

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;

  --section-y: clamp(2.5rem, 5vw, 4rem);
  --gap: clamp(0.75rem, 1.5vw, 1.25rem);
  --content-max: 1280px;

  --font-sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --line-height-body: 1.55;
}

/* ==================== 基础重置与排版 ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ==================== 布局容器 ==================== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
.section {
  padding-block: var(--section-y);
}
.section--dark {
  background-color: var(--color-dark);
  color: var(--color-paper);
}
.section--dark .hl { color: var(--color-accent); }
.section--paper { background-color: var(--color-paper); color: var(--color-text); }
.section--paper .hl { color: var(--color-brand); }

.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)); }
.grid--magazine { grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .grid--magazine { grid-template-columns: 1fr 280px; }
}
.flex { display: flex; }
.flex--col { flex-direction: column; }
.flex--wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-gap { gap: var(--gap); }

/* ==================== 排版组件 ==================== */
.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section--paper .label { color: var(--color-brand); }
.section--dark .label { color: var(--color-accent); }
.label::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 0.6rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; max-width: 38em; }
strong { font-weight: 600; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding-inline: 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-dark);
}
.btn--primary:hover { background-color: #5a9de0; }
.btn--secondary {
  background: transparent;
  border: 1px solid currentColor;
}
.section--paper .btn--secondary { color: var(--color-text); border-color: var(--color-text); }
.section--dark .btn--secondary { color: var(--color-paper); border-color: var(--color-paper); }

/* ==================== 卡片与面板 ==================== */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
}
.section--dark .card { background: rgba(247, 245, 243, 0.06); }
.card--light {
  background: var(--color-paper);
  color: var(--color-text);
}
.card--light .label { color: var(--color-brand); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  overflow: hidden;
}
.section--paper .panel { background: var(--color-dark); }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-line);
}
.section--dark th, .section--dark td { border-bottom-color: var(--color-line-dark); }
th { font-weight: 600; }

/* ==================== FAQ ==================== */
.faq details {
  border-bottom: 1px solid var(--color-line);
  padding-block: 16px;
}
.section--dark .faq details { border-bottom-color: var(--color-line-dark); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-weight: 400;
  color: currentColor;
  opacity: 0.6;
}
.faq details[open] summary::before { content: "−"; }
.faq p { margin-top: 8px; font-size: 0.95rem; }

/* ==================== 眉标与高亮 ==================== */
.hl { font-weight: 800; }

/* ==================== SVG 视觉与动效 ==================== */
.svg-visual {
  width: 100%;
  height: auto;
  display: block;
}
.svg-layer { transform-box: fill-box; transform-origin: center; }

@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes floatB {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes slideIn {
  0% { transform: translateX(12px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes drawLine {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.anim-float-a { animation: floatA 6s ease-in-out infinite; }
.anim-float-b { animation: floatB 7.5s ease-in-out infinite; }
.anim-breathe { animation: breathe 3s ease-in-out infinite; }
.anim-slide { animation: slideIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.anim-draw { animation: drawLine 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.anim-pulse { animation: pulseDot 2s ease-in-out infinite; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    animation-name: none !important;
    transition: none !important;
  }
}

/* ==================== 响应式微调 ==================== */
@media (max-width: 768px) {
  .grid--3 { grid-template-columns: 1fr; }
  .flex--row-mobile { flex-direction: column; }
}
/* 防止横向溢出 */
.long-text { overflow-wrap: anywhere; }
.overflow-hidden-parent { overflow: hidden; }
.min-zero { min-width: 0; }
