/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #141838;
  --color-paper: #F7F5F3;
  --color-text: #151723;
  --color-brand: #142CEB;
  --color-accent: #6EAFED;

  /* 结构 Token */
  --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: 1120px;

  /* 排版 Token */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-height-base: 1.55;
  --h1-size: clamp(2rem, 4.6vw, 3.4rem);
  --h2-size: clamp(1.4rem, 2.5vw, 2rem);
  --h3-size: 1.125rem;

  /* 上下文变量（默认纸面） */
  --bg-page: var(--color-paper);
  --text-main: var(--color-text);
  --text-muted: rgba(21, 23, 35, 0.65);
  --accent-color: var(--color-brand);
  --brand-color: var(--color-brand);
}

/* 深色面上下文 */
.dark-bg {
  --bg-page: var(--color-dark);
  --text-main: var(--color-paper);
  --text-muted: rgba(247, 245, 243, 0.7);
  --accent-color: var(--color-accent);
  --brand-color: var(--color-accent);
}

/* 浅色卡片上下文（置于深色面上时恢复纸面取色） */
.light-card {
  --bg-page: var(--color-paper);
  --text-main: var(--color-text);
  --text-muted: rgba(21, 23, 35, 0.65);
  --accent-color: var(--color-brand);
  --brand-color: var(--color-brand);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gap);
}

section {
  padding-block: var(--section-y);
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}
section:last-of-type {
  border-bottom: none;
}

/* 排版 */
h1, h2, h3, h4 {
  margin: 0 0 16px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}
h1 { font-size: var(--h1-size); letter-spacing: -0.01em; }
h2 { font-size: var(--h2-size); }
h3 { font-size: var(--h3-size); }

p {
  margin: 0 0 16px;
  max-width: 38em;
}

.hl {
  color: var(--brand-color);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-color);
  margin-bottom: 8px;
}

/* 链接 */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.85; }
a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
  border-radius: 2px;
}

/* 按钮 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 600;
  font-size: 1rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.btn-primary:focus-visible {
  outline: 3px solid var(--color-paper);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  border: 1px solid currentColor;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(128, 128, 128, 0.08);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* 卡片与面板 */
.card {
  background: rgba(128, 128, 128, 0.05);
  border-radius: var(--radius-card);
  padding: var(--gap);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.panel-dark {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
th {
  font-weight: 600;
  color: var(--text-muted);
}
td:last-child {
  text-align: right;
}

/* FAQ */
details {
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  padding-bottom: 12px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding: 4px 0;
  position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 4px;
  font-weight: 400;
  color: var(--text-muted);
}
details[open] summary::after { content: "-"; }
details p {
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--text-muted);
}

/* 导航与页头 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg-page-rgb, 247, 245, 243), 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}
.logo img { height: 28px; width: auto; }
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--text-main);
}
@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* 页脚 */
.site-footer {
  padding-block: 48px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}
.footer-links a { color: var(--accent-color); }

/* =========================================
   SVG 动效系统
   ========================================= */
.svg-wrapper {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.svg-wrapper svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 浮动 */
.svg-float {
  animation: svgFloat 6s ease-in-out infinite;
}
@keyframes svgFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 描边绘制 */
.svg-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: svgDraw 4s ease-in-out infinite;
}
@keyframes svgDraw {
  0%, 100% { stroke-dashoffset: 1; }
  50% { stroke-dashoffset: 0; }
}

/* 呼吸 */
.svg-breathe {
  animation: svgBreathe 3s ease-in-out infinite;
}
@keyframes svgBreathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* 滑入位移 */
.svg-slide {
  animation: svgSlide 5s ease-in-out infinite;
}
@keyframes svgSlide {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-10px); opacity: 0.85; }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
