/* ============================================================
   Verity Mod — 公共 UI 增强层
   设计系统：Retro-Futurism 游戏风格 + 霓虹紫
   依据 ui-ux-pro-max skill 全站 UI 审计（P0/P1 项）创建
   加载顺序：本文件由各页面在 <head> 末尾（内联 <style> 之后）引用
   ============================================================ */

/* ---------- 1. 无障碍 · 键盘焦点可见 (P0-3) ---------- */
:focus-visible {
  outline: 2px solid var(--accent, #a78bfa);
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------- 2. 无障碍 · 减少动态效果 (P0-1) ----------
   全站动画均为 CSS keyframes，此处统一降级，无需改动页面 JS */
@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;
  }
}

/* ---------- 3. 对比度修正 (P0-2) ----------
   原 --text-muted:#64748b 在卡片(#111118)上仅约 4.0:1，低于 WCAG AA 4.5:1
   :root:root 特异性(0,2,0) > 页面内联 :root(0,1,0)，保证覆盖 */
:root:root {
  --text-muted: #7d8aa5;
}

/* ---------- 4. SVG 图标基类 (P0-4) ---------- */
.icon {
  display: inline-block;
  flex: none;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-lg { width: 1.6em; height: 1.6em; }
.cross-link-icon .icon { width: 20px; height: 20px; }
.fear-factor-icon .icon { width: 22px; height: 22px; }
.notice-icon .icon { width: 18px; height: 18px; }
.quick-nav-item .icon { vertical-align: -0.15em; margin-right: 2px; }

/* ---------- 5. 触控目标优化 (P1-9) ---------- */
.footer-link,
.footer-legal a,
.quick-nav-item {
  min-height: 36px;
}
/* 保持现有视觉，同时扩大可点击区域 */
.footer-link,
.footer-legal a {
  align-items: center;
}

/* ---------- 6. 按钮按压反馈 (P1-11) ---------- */
button,
.btn,
.send-btn,
.nav-cta,
#enterGameBtn {
  -webkit-tap-highlight-color: transparent;
}
button:active,
.btn:active,
.send-btn:active,
.nav-cta:active,
#enterGameBtn:active {
  transform: scale(0.97);
}

/* ---------- 7. 导航统一 (P1-8) ----------
   兼容各页面历史类名（nav-cta / back-link / nav-right），
   保证右侧导航元素视觉一致 */
.back-link,
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  border: 1px solid var(--card-border, #1e1e2e);
  border-radius: var(--radius-sm, 8px);
  padding: 6px 14px;
  transition: all 0.2s;
  min-height: 34px;
}
.back-link:hover,
.nav-back:hover {
  color: var(--text, #f1f5f9);
  border-color: var(--accent-dim, #7c3aed);
  transform: translateY(-1px);
}

/* ---------- 8. TOC 目录组件 (P1-10，由 verity-common.js 注入) ---------- */
.toc {
  margin: 0 0 28px;
  padding: 18px 22px;
  background: var(--card, #111118);
  border: 1px solid var(--card-border, #1e1e2e);
  border-radius: var(--radius, 16px);
}
.toc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text, #f1f5f9);
}
.toc-title .icon { color: var(--accent, #a78bfa); }
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toc-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-secondary, #94a3b8);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.55;
  transition: color 0.2s;
}
.toc-list a::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  align-self: center;
  border-radius: 50%;
  background: var(--accent-dim, #7c3aed);
}
.toc-list a:hover,
.toc-list a:focus-visible {
  color: var(--accent-light, #c4b5fd);
}
.toc-list .toc-h3 { padding-left: 16px; font-size: 12px; }
.toc-list .toc-h3::before { background: var(--card-border, #1e1e2e); }

/* ---------- 9. 横向溢出防护 (P2-15，零风险基础设施) ---------- */
pre,
table,
.code-block,
.step-box {
  max-width: 100%;
  overflow-x: auto;
}
img,
video,
iframe {
  max-width: 100%;
}

/* ---------- 10. 内容可读性 (P1-10 辅助) ---------- */
article h2,
.seo-content h2 {
  scroll-margin-top: 84px; /* 固定导航遮挡锚点修正 */
}
article h2:first-of-type,
.seo-content h2:first-of-type {
  scroll-margin-top: 84px;
}
