/* =========================================
   SafeW 全站共享样式
   ========================================= */
:root {
  /* 色板 */
  --bg-dark: #140E25;
  --bg-paper: #FCFCFD;
  --text-body: #191523;
  --brand-color: #5214EB;
  --accent-color: #6EEDD2;
  --text-on-dark: #FCFCFD;
  --text-on-accent: #140E25;
  --border-subtle: rgba(0, 0, 0, 0.06);

  /* 设计 Token */
  --radius-card: 8px;
  --radius-btn: 6px;
  --card-border: 0;
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 960px;
  --header-h: 64px;

  /* 字体栈 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-paper);
  color: var(--text-body);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 基础排版 */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-top: 0; margin-bottom: var(--gap); }
h3 { font-size: 1.125rem; margin-top: calc(var(--gap) * 0.8); margin-bottom: 0.5em; }
p { margin-bottom: 1em; max-width: 38em; }
ul, ol { margin-bottom: 1em; padding-left: 1.25em; }
li { margin-bottom: 0.5em; }

/* 强调与眉标 */
.hl { color: var(--brand-color); }
.dark .hl { color: var(--accent-color); }
.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.badge-brand { color: var(--brand-color); }
.dark .badge-brand { color: var(--accent-color); }

/* 布局容器 */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--gap); }
section { padding-block: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 页头 */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-h);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.125rem; color: var(--text-body);
  text-decoration: none;
}
.logo img { width: 28px; height: 28px; object-fit: contain; }
nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
nav a {
  text-decoration: none; color: var(--text-body); font-weight: 500; font-size: 0.9rem;
  padding: 4px 0; border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
nav a:hover, nav a[aria-current="page"] { color: var(--brand-color); border-color: var(--brand-color); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 24px; height: 50px; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: none; transition: transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-color); color: var(--text-on-accent); }
.btn-secondary { background: transparent; color: var(--text-body); border: 1px solid var(--text-body); }
.dark .btn-secondary { color: var(--text-on-dark); border-color: var(--text-on-dark); }
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* 卡片与面板 */
.card {
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-card);
  padding: 24px;
  border: var(--card-border);
  box-shadow: var(--card-shadow);
}
.dark .card { background: rgba(255, 255, 255, 0.05); }
.visual-panel {
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 24px;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.dark .visual-panel { background: linear-gradient(135deg, #1a1433 0%, #0f0b1c 100%); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-subtle); }
th { font-weight: 600; background: rgba(0,0,0,0.02); }
td a { color: var(--brand-color); text-decoration: underline; text-decoration-thickness: 1px; }
.dark td a { color: var(--accent-color); }

/* FAQ */
details { margin-bottom: 16px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 16px; }
summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.2rem; font-weight: 400; color: var(--brand-color); }
details[open] summary::after { content: "-"; }
details p { margin-top: 12px; color: var(--text-body); line-height: 1.7; }

/* 页脚 */
.site-footer {
  padding: 48px 0; border-top: 1px solid var(--border-subtle);
  background: var(--bg-paper);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.footer-col h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col a { color: var(--text-body); text-decoration: none; font-size: 0.9rem; display: block; margin-bottom: 8px; }
.footer-col a:hover { color: var(--brand-color); }
.copyright { text-align: center; margin-top: 48px; font-size: 0.85rem; color: var(--text-body); opacity: 0.7; }

/* SVG 动效系统 */
svg { width: 100%; height: auto; max-width: 100%; display: block; }
.svg-group { transform-box: fill-box; transform-origin: center; }
.path-draw {
  pathLength: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.anim-line { animation: draw-line 6s ease-in-out infinite; }
.anim-twinkle { animation: twinkle 3.5s ease-in-out infinite; }
.anim-float { animation: float-bubble 5s ease-in-out infinite; }
.anim-breathe { animation: breathe-dots 2.4s ease-in-out infinite; }
.anim-slide-in { animation: slide-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes draw-line {
  0%, 100% { stroke-dashoffset: 1; }
  40%, 60% { stroke-dashoffset: 0; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
@keyframes float-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes breathe-dots {
  0%, 100% { opacity: 0.3; }
  33% { opacity: 1; }
  66% { opacity: 0.3; }
}
@keyframes slide-in {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 减少动态效果 */
@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;
  }
}

/* 焦点与无障碍 */
:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
