/* === 设计变量与基础重置 === */
:root {
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;
  --color-white: #FFFFFF;

  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 2px solid var(--color-text);
  --card-shadow: 4px 4px 0 var(--color-text);

  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --line-height-body: 1.65;

  --content-max: 960px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-text);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* === 容器与排版 === */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

section {
  padding: var(--section-y) 0;
}

h1, h2, h3, h4 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  margin-bottom: var(--gap);
  line-height: 1.1;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--gap);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  max-width: 38em;
  margin-bottom: var(--gap);
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--color-brand);
}

.dark-bg .eyebrow {
  color: var(--color-accent);
}

.hl {
  color: var(--color-brand);
}

.dark-bg .hl {
  color: var(--color-accent);
}

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 52px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(0.95);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
}

.dark-bg .btn-secondary {
  border-color: var(--color-paper);
  color: var(--color-paper);
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* === 卡片与面板 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  position: relative;
}

.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.dark-bg .card {
  background: var(--color-paper);
  border-color: var(--color-text);
  box-shadow: var(--card-shadow);
}

/* === 表格 === */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--gap);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(21, 23, 35, 0.12);
}

th {
  font-weight: 600;
  background: rgba(20, 44, 235, 0.06);
}

td:first-child {
  font-weight: 600;
  width: 35%;
}

/* === FAQ === */
details {
  margin-bottom: var(--gap);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  background: var(--color-paper);
}

summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

details p {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--color-text);
}

/* === 布局工具 === */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--gap);
}

.flex-row {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.magazine-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
}

.toc {
  position: sticky;
  top: 6rem;
  padding: 1rem;
  background: rgba(247, 245, 243, 0.9);
  border: 1px solid rgba(21, 23, 35, 0.1);
  border-radius: var(--radius-card);
}

.toc ul {
  list-style: none;
  border-left: 2px solid var(--color-brand);
  padding-left: 1rem;
}

.toc li {
  margin-bottom: 0.6rem;
}

.toc a {
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.85rem;
  line-height: 1.4;
}

.toc a:hover, .toc a.active {
  color: var(--color-brand);
  font-weight: 600;
}

.step-list {
  counter-reset: step;
  list-style: none;
}

.step-list li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: var(--gap);
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.feature-block {
  margin-bottom: var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid rgba(21, 23, 35, 0.1);
}

.feature-block:last-child {
  border-bottom: none;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
}

.news-card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card time {
  font-size: 0.8rem;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.news-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  flex-grow: 1;
}

/* === 页头与页脚 === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(21, 23, 35, 0.1);
  padding: 0.75rem 0;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--color-brand);
}

footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: var(--section-y) 0;
  margin-top: var(--section-y);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.footer-col h4 {
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--color-paper);
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* === SVG 响应式与动效 === */
.svg-responsive {
  width: 100%;
  height: auto;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes orbitPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 0.4; }
}

.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: drawLine 6s ease-in-out infinite alternate;
}

.anim-float {
  animation: float 5s ease-in-out infinite;
}

.anim-breathe {
  animation: breathe 4s ease-in-out infinite;
}

.anim-slide {
  animation: slideIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
}

.anim-orbit {
  animation: orbitPulse 7s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* === 减少动态效果 === */
@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-slide {
    opacity: 1;
    transform: none;
  }
}

/* 兜底：裁掉横向溢出 */
div.magazine-layout {
  overflow-x: clip;
}
