/* === 设计变量与基础重置 === */
:root {
  --color-dark: #1B1231;
  --color-paper: #F4F3F7;
  --color-text: #191523;
  --color-brand: #5214EB;
  --color-accent: #9977EE;
  --radius-card: 24px;
  --radius-btn: 999px;
  --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);
  --content-max: 1280px;
  --line-height: 1.65;
  --font-main: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-paper);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* === 布局容器 === */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}
section { padding-block: var(--section-y); }
section.bg-dark { background: var(--color-dark); }
section.bg-paper { background: var(--color-paper); }

/* === 主题覆盖规则 === */
.bg-dark {
  color: var(--color-paper);
}
.bg-dark a { color: var(--color-accent); }
.bg-dark .hl { color: var(--color-accent); }
.bg-dark .badge { color: var(--color-accent); }

.theme-paper-inside-dark {
  background: var(--color-paper);
  color: var(--color-text);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
}
.theme-paper-inside-dark a { color: var(--color-brand); }
.theme-paper-inside-dark .hl { color: var(--color-brand); }
.theme-paper-inside-dark .badge { color: var(--color-brand); }

/* === 排版系统 === */
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}
p { margin: 0 0 1rem; }
.hl { color: var(--color-brand); }
.bg-dark .hl { color: var(--color-accent); }

/* === 组件：按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.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); filter: brightness(0.95); }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.bg-dark .btn-secondary { color: var(--color-paper); border-color: var(--color-paper); }
.btn-secondary:hover { transform: translateY(-2px); background: rgba(0,0,0,0.05); }
.bg-dark .btn-secondary:hover { background: rgba(255,255,255,0.08); }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* === 组件：卡片 === */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: var(--radius-card);
  padding: var(--gap);
  height: 100%;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }

/* === 组件：表格 === */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}
.data-table th { font-weight: 700; color: var(--color-text); }
.bg-dark .data-table th, .bg-dark .data-table td { border-bottom-color: rgba(255,255,255,0.15); color: var(--color-paper); }
.data-table a { color: var(--color-brand); text-decoration: underline; text-decoration-thickness: 1px; }
.bg-dark .data-table a { color: var(--color-accent); }

/* === 组件：FAQ === */
details {
  border: var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: var(--color-paper);
}
summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
}
details[open] summary::after { content: "-"; }
details p { margin-top: 0.75rem; color: var(--color-text); }
.bg-dark details { background: var(--color-dark); border-color: var(--color-accent); }
.bg-dark details p { color: var(--color-paper); }

/* === 组件：步骤条 === */
.steps { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 0.5rem; }
.step { flex: 1; min-width: 0; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

/* === 页头与页脚 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-paper);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.75rem 0;
}
.bg-dark .site-header { background: var(--color-dark); border-bottom-color: rgba(255,255,255,0.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo-area { display: flex; align-items: center; gap: 0.75rem; }
.logo-img { width: 32px; height: 32px; object-fit: contain; }
.nav-list { display: flex; gap: 1.5rem; }
.nav-link { font-weight: 500; position: relative; padding: 0.25rem 0; }
.nav-link[aria-current="page"] { color: var(--color-brand); font-weight: 700; }
.bg-dark .nav-link[aria-current="page"] { color: var(--color-accent); }
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.site-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 2rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.footer-col h4 { margin: 0 0 0.75rem; color: var(--color-accent); }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col a:hover { text-decoration: underline; }
.copyright { text-align: center; margin-top: 2rem; font-size: 0.85rem; opacity: 0.7; }

/* === SVG 动效系统 === */
.svg-anim { width: 100%; height: auto; }
.anim-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: draw-stroke 5s ease-in-out infinite alternate;
}
.anim-float {
  animation: float-gentle 6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
.anim-breathe {
  animation: breathe-opacity 4s ease-in-out infinite;
}
.anim-slide {
  animation: slide-in 5s ease-in-out infinite alternate;
}
.anim-pulse-dot {
  animation: pulse-dot 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes draw-stroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes breathe-opacity {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes slide-in {
  from { transform: translateX(-8px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .svg-anim { animation: none !important; }
}
