/* ============================================================
   base.css · 联机文游 设计系统（F49 赛博朋克霓虹风）
   气质：近黑底 + 霓虹专色（青 / 品红 / 紫）+ 辉光阴影 + 玻璃拟态 + 光污染背景。
   规则：6~14px 圆角、1px 霓虹描边、多层辉光 box-shadow、hover 辉光增强、
        :active 轻微缩放、普通 ease 过渡、现代无衬线字体。
   主题（theme-fantasy 品红主色 / theme-dark 血红主色）只覆盖 CSS 变量，
   在 room.html 中按世界书类型切换；custom 沿用 :root 默认青色主色。
   兼容：F38 时代的变量名（--paper-2 / --paper-3 / --ink-shadow / --dot-ink / --scan-ink / --blob-1 等）
        全部保留、只改值，未重写的旧规则自动降级不破版。
   ============================================================ */

:root {
  /* ---------- 套色：底 / 表面 / 专色 ---------- */
  --paper: #0b0d14;          /* 页面底（近黑蓝） */
  --paper-2: #131726;        /* 卡片表面 */
  --paper-3: #1b2033;        /* 凹槽 / 输入框 */
  --accent: #19e6ff;         /* 霓虹青（主操作） */
  --accent-2: #ff2bd6;       /* 霓虹品红（专色强调） */
  --accent-3: #8b5cf6;       /* 霓虹紫（辅助） */
  --accent-rgb: 25, 230, 255;
  --accent-2-rgb: 255, 43, 214;
  --accent-3-rgb: 139, 92, 246;
  --accent-grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-3) 55%, var(--accent-2) 100%);
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --bg-1: var(--paper);
  --bg-2: var(--paper-2);
  --text-1: #e8f1ff;         /* 正文（冷白） */
  --text-2: #9fb0cc;
  --text-3: #66738f;
  --card-bg: rgba(19, 23, 38, 0.66);
  --card-border: rgba(var(--accent-rgb), 0.35);

  /* ---------- 圆角 ---------- */
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* ---------- 霓虹辉光阴影（多层叠加） ---------- */
  --ink-shadow: rgba(0, 0, 0, 0.6);      /* 旧名保留：现作底部压暗层 */
  --glow-color: rgba(var(--accent-rgb), 0.45);
  --glow-color-2: rgba(var(--accent-2-rgb), 0.35);
  --shadow:
    0 0 12px rgba(var(--accent-rgb), 0.28),
    0 0 32px rgba(var(--accent-rgb), 0.12),
    0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-sm:
    0 0 8px rgba(var(--accent-rgb), 0.3),
    0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg:
    0 0 18px rgba(var(--accent-rgb), 0.4),
    0 0 48px rgba(var(--accent-rgb), 0.16),
    0 18px 50px rgba(0, 0, 0, 0.65);
  --shadow-glow:
    0 0 6px rgba(var(--accent-rgb), 0.9),
    0 0 18px rgba(var(--accent-rgb), 0.55),
    0 0 42px rgba(var(--accent-rgb), 0.28);
  --shadow-glow-2:
    0 0 6px rgba(var(--accent-2-rgb), 0.9),
    0 0 18px rgba(var(--accent-2-rgb), 0.55),
    0 0 42px rgba(var(--accent-2-rgb), 0.28);
  --ring: 0 0 0 2px rgba(var(--accent-rgb), 0.55), 0 0 14px rgba(var(--accent-rgb), 0.5);
  --text-glow: 0 0 8px rgba(var(--accent-rgb), 0.7), 0 0 22px rgba(var(--accent-rgb), 0.35);
  --text-glow-2: 0 0 8px rgba(var(--accent-2-rgb), 0.7), 0 0 22px rgba(var(--accent-2-rgb), 0.35);

  /* ---------- 字体：现代无衬线（本地栈，不引外部请求） ---------- */
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  /* 装饰标题：科技感字体存在则用，否则退到系统无衬线 */
  --font-pixel: "Orbitron", "Rajdhani", "Bahnschrift", "Segoe UI Variable Display", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;
  --font-gm: var(--font);

  /* ---------- 状态色 ---------- */
  --success: #22e58a;
  --success-ink: #5cf2ab;
  --success-soft: rgba(34, 229, 138, 0.16);
  --danger: #ff3b5c;
  --error: #ff6b7f;
  --danger-soft: rgba(255, 59, 92, 0.16);
  --warning: #ffc233;
  --warning-soft: rgba(255, 194, 51, 0.14);
  --warning-border: rgba(255, 194, 51, 0.55);
  --on-accent: #06080f;

  /* ---------- 表面 / 覆盖 / 输入 / 边框 ---------- */
  --bg-glass: rgba(19, 23, 38, 0.62);
  --border: rgba(var(--accent-rgb), 0.22);
  --border-strong: rgba(var(--accent-rgb), 0.6);
  --surface-strong: rgba(27, 32, 51, 0.92);
  --overlay: rgba(4, 6, 14, 0.62);
  --overlay-strong: rgba(4, 6, 14, 0.82);
  --input-bg: rgba(11, 13, 20, 0.72);
  --input-bg-focus: rgba(15, 19, 32, 0.95);
  --input-border: rgba(var(--accent-rgb), 0.32);
  --topbar-bg: rgba(11, 13, 20, 0.72);
  --composer-bg: rgba(13, 16, 27, 0.82);
  --sidebar-bg: rgba(13, 16, 27, 0.7);
  --modal-bg: rgba(15, 19, 32, 0.9);
  --toast-bg: rgba(15, 19, 32, 0.95);
  --toast-error-bg: rgba(120, 18, 40, 0.95);
  --muted-surface: rgba(232, 241, 255, 0.05);
  --muted-surface-strong: rgba(232, 241, 255, 0.1);
  --hover-surface: rgba(var(--accent-rgb), 0.1);
  --scroll-thumb: rgba(var(--accent-rgb), 0.35);
  --scroll-thumb-hover: rgba(var(--accent-rgb), 0.7);

  /* ---------- 背景纹理（旧名保留）：扫描线 ---------- */
  --dot-ink: rgba(var(--accent-rgb), 0.05);
  --scan-ink: rgba(255, 255, 255, 0.025);

  /* ---------- 真实毛玻璃刻度 ---------- */
  --blur-sm: 6px;
  --blur-md: 12px;
  --blur-lg: 18px;
  --blur-xl: 24px;
  --blur-2xl: 36px;
  --blur-topbar: 16px;
  --glass-blur: 14px;

  /* 光污染背景色晕 */
  --blob-1: var(--accent);
  --blob-2: var(--accent-2);
  --blob-3: var(--accent-3);
  --blob-op-1: 0.22;
  --blob-op-2: 0.18;
  --blob-op-3: 0.16;

  /* 触摸目标下限（移动端） */
  --tap: 42px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg-1);
  /* 光污染：青 / 品红 / 紫 三团色晕 + 细扫描线，低对比不干扰阅读 */
  background-image:
    radial-gradient(ellipse 60% 50% at 8% 0%, rgba(var(--accent-rgb), 0.16), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(var(--accent-2-rgb), 0.14), transparent 60%),
    radial-gradient(ellipse 40% 35% at 60% 45%, rgba(var(--accent-3-rgb), 0.1), transparent 60%),
    repeating-linear-gradient(180deg, var(--scan-ink) 0 1px, transparent 1px 3px);
  background-attachment: fixed, fixed, fixed, scroll;
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease, text-shadow 0.18s ease;
}
a:hover {
  text-decoration: none;
  border-bottom-color: var(--accent);
  text-shadow: var(--text-glow);
}

button {
  font-family: var(--font-pixel);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- 输入控件：暗底 + 霓虹描边，聚焦辉光 ---------- */
input,
textarea,
select {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 0 0 rgba(var(--accent-rgb), 0);
  transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
input:focus,
textarea:focus,
select:focus {
  background: var(--input-bg-focus);
  border-color: var(--accent);
  box-shadow: var(--ring);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}
select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  /* 霓虹 V 形箭头 */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right 14px center, right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select option {
  background: #131726;
  color: var(--text-1);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  box-shadow: none;
}
input[type="file"] {
  box-shadow: none;
}

/* ---------- 背景：霓虹光污染色晕 ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient .blob {
  position: absolute;
  border-radius: 50%;
  opacity: var(--blob-op-1);
  background: radial-gradient(circle at center, currentColor 0%, transparent 70%);
  filter: blur(var(--blur-2xl));
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}
.ambient .blob.b1 {
  width: 560px;
  height: 560px;
  top: -160px;
  left: -140px;
  color: var(--blob-1);
}
.ambient .blob.b2 {
  width: 520px;
  height: 520px;
  bottom: -160px;
  right: -120px;
  color: var(--blob-2);
  opacity: var(--blob-op-2);
  animation-delay: -9s;
}
.ambient .blob.b3 {
  width: 360px;
  height: 360px;
  top: 40%;
  left: 54%;
  color: var(--blob-3);
  opacity: var(--blob-op-3);
  animation-delay: -16s;
}

/* 交互光尘层（js/pixelfx.js 注入的 canvas）：点击/移动的霓虹光尘
   与 .ambient 同层置底，pointer-events:none 绝不吃点击 */
.pixelfx-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ---------- 卡片：玻璃拟态（半透明底 + 背景模糊 + 霓虹细边 + 辉光） ---------- */
.glass {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
}

/* ---------- 按钮：霓虹描边，hover 辉光增强，按下轻微缩放 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-pixel);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  user-select: none;
  white-space: nowrap;
  color: var(--text-1);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease,
    color 0.18s ease, border-color 0.18s ease;
}
.btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.35);
}
.btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--on-accent);
  text-shadow: none;
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: saturate(0.5);
}
.btn-secondary {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.5);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
  box-shadow: none;
  padding: 8px 12px;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--hover-surface);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.3);
}
.btn-ghost:active {
  transform: scale(0.97);
}
.btn-danger {
  background: rgba(255, 59, 92, 0.14);
  color: var(--danger);
  border-color: rgba(255, 59, 92, 0.6);
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.28), 0 4px 14px rgba(0, 0, 0, 0.5);
}
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.22);
}
.btn-sm:active {
  transform: scale(0.96);
}
.btn-block {
  width: 100%;
}
@media (hover: hover) {
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.08);
  }
  .btn-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.16);
    box-shadow: var(--shadow-glow);
  }
  .btn-danger:hover {
    transform: translateY(-1px);
    border-color: var(--danger);
    background: rgba(255, 59, 92, 0.24);
    box-shadow: 0 0 6px rgba(255, 59, 92, 0.9), 0 0 18px rgba(255, 59, 92, 0.5), 0 0 42px rgba(255, 59, 92, 0.25);
  }
  .btn-sm:hover {
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45);
  }
}

/* ---------- 徽章 / 标签：霓虹胶囊 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  background: var(--muted-surface);
  color: var(--text-1);
}
.badge-type-dnd {
  background: rgba(255, 194, 51, 0.16);
  color: #ffd76a;
  border-color: rgba(255, 194, 51, 0.55);
  box-shadow: 0 0 8px rgba(255, 194, 51, 0.3);
}
.badge-type-coc {
  background: rgba(255, 59, 92, 0.16);
  color: #ff8a9c;
  border-color: rgba(255, 59, 92, 0.55);
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.3);
}
.badge-type-custom {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}
.badge-online {
  background: rgba(34, 229, 138, 0.16);
  color: var(--success-ink);
  border-color: rgba(34, 229, 138, 0.55);
  box-shadow: 0 0 8px rgba(34, 229, 138, 0.3);
}
.badge-offline {
  background: var(--muted-surface);
  color: var(--text-3);
  border-color: rgba(232, 241, 255, 0.12);
}

/* ---------- 顶栏：玻璃条 + 底部霓虹线 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(var(--blur-topbar)) saturate(1.3);
  backdrop-filter: blur(var(--blur-topbar)) saturate(1.3);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(var(--accent-rgb), 0.18), 0 8px 30px rgba(0, 0, 0, 0.45);
}
.topbar .logo {
  font-family: var(--font-pixel);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  border-bottom: none;
  flex-shrink: 0;
  padding: 2px 4px;
  border: none;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.55));
  transition: filter 0.18s ease;
}
.topbar .logo:hover {
  filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.9)) drop-shadow(0 0 22px rgba(var(--accent-2-rgb), 0.45));
}
.topbar .sub {
  font-family: var(--font-pixel);
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.topbar-title #room-name {
  font-family: var(--font-pixel);
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  font-family: var(--font-pixel);
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-2);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.nav-link:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: var(--hover-surface);
  text-shadow: var(--text-glow);
}
.nav-link.active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.35), inset 0 0 12px rgba(var(--accent-rgb), 0.08);
  text-shadow: var(--text-glow);
}

/* ---------- 用户胶囊 ---------- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--muted-surface);
  font-family: var(--font-pixel);
  font-size: 12px;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.16);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  background: var(--accent-grad);
  color: var(--on-accent);
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.45);
}
/* F29 头像 <img> 填充：object-fit: cover 防拉伸 */
.avatar-img {
  overflow: hidden;
  padding: 0;
}
.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-width: 1px;
}

/* ---------- 通用布局与工具 ---------- */
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}
.page-wide {
  max-width: 1440px;
}
.spacer {
  flex: 1;
  min-width: 0;
}
.hidden {
  display: none;
}
/* 小节标题：霓虹标签 */
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: var(--text-glow);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: var(--shadow-glow-2);
  flex-shrink: 0;
}
.sub {
  font-size: 12.5px;
  color: var(--text-2);
}

/* ---------- 开关：霓虹滑钮 ---------- */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-3);
  transition: left 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.toggle input {
  display: none;
}
.toggle input:checked + .switch {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}
.toggle input:checked + .switch::after {
  left: 20px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.9);
}

/* ---------- 弹窗：玻璃窗体 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--overlay);
  -webkit-backdrop-filter: blur(var(--blur-sm));
  backdrop-filter: blur(var(--blur-sm));
  padding: 18px;
}
.modal-mask.open {
  display: flex;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px;
  background: var(--modal-bg);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(1.3);
  backdrop-filter: blur(var(--blur-lg)) saturate(1.3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-lg);
  animation: fade 0.22s ease;
}
.modal h3 {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 0.06em;
  margin: -20px -20px 16px;
  padding: 11px 16px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-2-rgb), 0.08));
  color: var(--accent);
  text-shadow: var(--text-glow);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal .sub {
  font-size: 12px;
  line-height: 1.6;
  margin: -6px 0 14px;
}
.modal .field {
  margin-bottom: 12px;
}
.modal .field label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}
.modal .field input,
.modal .field select,
.modal .field textarea {
  width: 100%;
}
.modal .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.modal .dialog-msg {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal .dialog-msg.error {
  color: var(--error);
}

/* 轻量提示（toast）：底部霓虹条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 200;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  max-width: min(88vw, 460px);
  padding: 9px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  border-radius: var(--radius-md);
  background: var(--toast-bg);
  -webkit-backdrop-filter: blur(var(--blur-md));
  backdrop-filter: blur(var(--blur-md));
  color: var(--text-1);
  font-family: var(--font-pixel);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: var(--toast-error-bg);
  border-color: rgba(255, 59, 92, 0.65);
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.4), 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* ---------- 滚动条：霓虹细条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  color: var(--text-3);
  padding: 32px 14px;
  font-family: var(--font-pixel);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

/* ---------- 移动端：顶栏折行 + 触摸目标 ---------- */
@media (max-width: 900px) {
  body {
    line-height: 1.62;
  }
  .topbar {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .topbar .logo {
    font-size: 14px;
    letter-spacing: 0.08em;
    padding: 2px 4px;
  }
  .topbar .sub {
    font-size: 11px;
  }
  .topbar .user-chip {
    order: 5;
  }
  .topbar .nav {
    order: 10;
    width: 100%;
    justify-content: space-between;
    gap: 4px;
    padding: 2px 0 0;
    border-top: 1px solid var(--border);
    margin-top: 2px;
  }
  .nav-link {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 11.5px;
    letter-spacing: 0.02em;
  }
  .page {
    padding: 18px 12px 72px;
  }
  /* 移动端手指友好：小按钮也保证可点面积 */
  .btn {
    min-height: 38px;
  }
  .btn-sm {
    min-height: 34px;
  }
  .btn-ghost {
    min-height: 34px;
  }
  .modal {
    padding: 16px;
    max-height: 90vh;
  }
  .modal h3 {
    margin: -16px -16px 14px;
    font-size: 14px;
  }
  .modal .actions .btn {
    flex: 1 1 auto;
  }
  /* iOS 防聚焦缩放：输入字号 ≥16px */
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* ---------- 共享动画 ---------- */
@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(36px, -28px) scale(1.08);
  }
}
@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
/* 霓虹呼吸（供各页装饰复用） */
@keyframes neon-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
