/* ============================================================
   base.css — 设计令牌 / 重置 / 通用组件
   ============================================================ */
:root {
  /* 深色主站令牌（了解实验室） */
  --bg-0: #0a0e14;
  --bg-1: #0f141c;
  --bg-2: #151c26;
  --line-dark: rgba(255, 255, 255, .10);
  --line-dark-2: rgba(255, 255, 255, .16);
  --text-0: #eef3f8;
  --text-1: #b8c3cf;
  --text-2: #7d8894;
  --accent-blue: #4d9fff;
  --accent-blue-dim: rgba(77, 159, 255, .25);
  --ok: #3ddc84;
  --warn: #ffb74d;
  --bad: #ff5d5d;

  /* 瑞士网格 · 加入实验室（浅色国际风格） */
  --swiss-bg: #f4f4f2;
  --swiss-ink: #101010;
  --swiss-line: #101010;
  --swiss-blue: #1f5eff;

  /* 杂志风（关于我们） */
  --paper: #f6f1e7;
  --paper-2: #efe7d8;
  --ink: #1b1712;
  --ink-soft: #4c443a;
  --accent-red: #c03b2d;
  --accent-gold: #b8894a;

  /* 登录（CRT / 蓝图HUD） */
  --crt-green: #4dff88;
  --crt-green-dim: rgba(77, 255, 136, .62);
  --crt-bg: #04100a;
  --bp-line: rgba(120, 190, 255, .35);
  --bp-cyan: #7ec9ff;
  --bp-amber: #ffd166;

  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "Consolas", "SFMono-Regular", "JetBrains Mono", monospace;
  --font-serif: "Georgia", "Songti SC", "Noto Serif SC", "STSong", serif;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;

  --shadow-1: 0 2px 12px rgba(0, 0, 0, .35);
  --shadow-2: 0 10px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性必须赢过组件级 display 规则 */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.pre-login, body.logged-in { overflow: clip; position: fixed; inset: 0; width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(77, 159, 255, .35); }

/* ---------- 通用 toast（网页内提醒，非浏览器弹窗） ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 20px);
  z-index: 5000;
  background: rgba(12, 17, 24, .92);
  border: 1px solid var(--line-dark-2);
  color: var(--text-0);
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 14px;
  letter-spacing: .04em;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  max-width: min(88vw, 640px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 93, 93, .55); color: #ffb4b4; }
.toast.ok { border-color: rgba(61, 220, 132, .5); color: #b9f4d2; }

/* ---------- 通用工具 ---------- */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

/* ---------- 焦点可见性 ---------- */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 滚动条（深色区） ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128, 146, 166, .35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 146, 166, .55); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 无障碍减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
