/* ============================================================
   style.css — 全站设计系统（v26）
   员工A 2026-08-19 完整重写：高端 AI 酒馆风
   深色底 + 紫金渐变 accent + 玻璃拟态卡片 + 大圆角 + 细腻阴影 + 精致动效
   契约：其他页面依赖本文件顶部的 CSS 变量与组件类，命名必须精确。
   ============================================================ */

/* ============================================================
   一、CSS 变量契约（全站统一，严禁改名）
   ============================================================ */
:root {
  --bg0: #0b0d12; --bg1: #11141b; --bg2: #1a1f2a; --bg3: #232936;
  --line: rgba(255,255,255,.08);
  --text0: #f2f4f8; --text1: #a7aebc; --text2: #6b7384;
  --gold: #d4af37; --gold2: #f5d78e;
  --grad-gold: linear-gradient(135deg, #f5d78e, #d4af37);
  --grad-main: linear-gradient(135deg, #8b5cf6, #d4af37);
  --danger: #e5484d; --ok: #46a758;
  --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --shadow-card: 0 8px 32px rgba(0,0,0,.35);
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;

  /* ---- 旧版变量兼容（common.js 内联样式 / 老页面 / admin 后台依赖） ---- */
  --bg: #0b0d12; --surface: #14181f; --surface2: #1c2230;
  --border: rgba(255,255,255,.08); --text: #f2f4f8;
  --primary: #8b5cf6; --primary-hover: #7c3aed; --primary-light: rgba(139,92,246,.15);
  --danger2: #e5484d; --warning: #f59e0b; --success: #46a758;
  --user-msg: linear-gradient(135deg, #8b5cf6, #d4af37); --user-text: #fff;
  --ai-msg: #1a1f2a; --ai-border: rgba(255,255,255,.1);
  --radius: 16px; --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.3); --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
  --transition: .25s;
  --gold-text: #e8c56b; --gold-bright: #f5d78e; --gold-deep: #9a7b2d;
  --p-primary: #d4af37; --p-accent: #c9a96a; --p-bg: #0b0d12; --p-surface: #14181f;
  --p-text: #f2f4f8; --p-text2: #a7aebc; --p-card-radius: 16px;
  --p-card-glow: 0 0 20px rgba(212,175,55,.35);
  --p-card-hover: translateY(-4px);
  --p-cols: 4; --p-cols-mobile: 2; --p-font-scale: 1; --p-glass: 1; --p-glow: 1;
  --header-h: 64px;
}

/* ===== 浅色模式（基本可用） ===== */
[data-theme="light"] {
  --bg0: #f4f4f6; --bg1: #ffffff; --bg2: #f0f1f4; --bg3: #e4e6eb;
  --line: rgba(20,24,33,.10);
  --text0: #1a1e27; --text1: #4a5262; --text2: #8a91a0;
  --shadow-card: 0 8px 28px rgba(31,38,55,.10);
  --bg: #f4f4f6; --surface: #ffffff; --surface2: #eceef2;
  --border: rgba(20,24,33,.10); --text: #1a1e27; --text2: #6b7384;
  --primary: #7c3aed; --primary-hover: #6d28d9; --primary-light: #f1eafe;
  --danger2: #d93036; --warning: #b45309; --success: #3d8b4f;
  --user-msg: linear-gradient(135deg, #7c3aed, #c9a227);
  --ai-msg: #ffffff; --ai-border: rgba(20,24,33,.12);
  --shadow: 0 1px 3px rgba(31,38,55,.06);
  --shadow-lg: 0 8px 24px rgba(31,38,55,.10);
  --p-bg: #f4f4f6; --p-surface: #ffffff; --p-text: #1a1e27; --p-text2: #6b7384;
}

/* ============================================================
   二、全局基底
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text0);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold2); }
img { max-width: 100%; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* 全局滚动条（深色主题） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #2e3646; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* 背景主题类（index.js applyTheme 会挂 bg-stars / bg-solid 等到 body） */
.bg-stars { background: var(--bg0); }
.bg-solid { background: var(--bg0); }
.bg-nebula {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139,92,246,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(212,175,55,.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(99,102,241,.08) 0%, transparent 50%),
    var(--bg0);
}
.bg-gradient { background: linear-gradient(135deg, #0b0d12 0%, #12101e 30%, #141018 60%, #0b0d12 100%); }
.bg-aurora, .bg-deepsea, .bg-mist, .bg-crystal, .bg-cloudsea,
.bg-floatdust, .bg-flowlight, .bg-firefly, .bg-nebulaflow, .bg-starriver, .bg-vangogh {
  background: var(--bg0);
}

.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-\[10px\] { font-size: 10px; }
.px-3\.5 { padding-left: 14px; padding-right: 14px; }
.px-1\.5 { padding-left: 6px; padding-right: 6px; }
.py-0\.5 { padding-top: 2px; padding-bottom: 2px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.gap-0\.5 { gap: 2px; }
.gap-1\.5 { gap: 6px; }
.w-2\.5 { width: 10px; } .h-2\.5 { height: 10px; }
.w-8 { width: 32px; } .h-8 { height: 32px; }
.w-11 { width: 44px; } .h-11 { height: 44px; }
.min-w-0 { min-width: 0; }

/* 通用容器 */
.app-container-xl {
  max-width: 1280px;
  margin-left: auto; margin-right: auto;
  padding-left: 16px; padding-right: 16px;
}

/* ============================================================
   三、设计系统组件（契约类名，其他页面依赖）
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
  position: relative; /* 涟漪定位基准 */
  overflow: hidden;   /* 涟漪/扫光不越界 */
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: all .2s ease;
  white-space: nowrap; line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 主按钮：金渐变 + 深色字（酒馆招牌金）+ 流光（背景位移动画） */
.btn-primary {
  background: linear-gradient(135deg, #f5d78e, #d4af37, #f0cf6f, #d4af37, #f5d78e);
  background-size: 220% auto;
  animation: btnFlow 4s linear infinite;
  color: #14100a;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(212,175,55,.55), 0 0 22px rgba(212,175,55,.25);
  transform: translateY(-1px);
  color: #14100a;
}

/* 幽灵按钮：玻璃描边 */
.btn-ghost {
  background: rgba(255,255,255,.05);
  border-color: var(--line);
  color: var(--text0);
}
.btn-ghost:hover { background: rgba(255,255,255,.10); color: var(--gold2); border-color: rgba(212,175,55,.4); }

/* 危险按钮 */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c73b40; color: #fff; }

/* 次要按钮 / 描边 */
.btn-outline {
  border: 1px solid var(--line);
  background: var(--bg1);
  color: var(--text1);
}
.btn-outline:hover { background: var(--bg3); color: var(--text0); border-color: rgba(212,175,55,.35); }

.btn-sm { padding: 5px 13px; font-size: 12.5px; border-radius: 999px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; justify-content: center; }
.btn-gold-glow { background: var(--grad-gold); color: #14100a; }
.btn-purple { background: var(--grad-main); color: #fff; }

/* 图标按钮（主题切换等圆形小按钮） */
.icon-btn {
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn-glass {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--text1);
  transition: all .2s;
  cursor: pointer;
}
.icon-btn-glass:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); background: rgba(212,175,55,.08); }

/* ---------- 输入 ---------- */
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg2);
  color: var(--text0);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text2); }
.input:focus {
  border-color: rgba(212,175,55,.55);
  box-shadow: 0 0 0 3px rgba(212,175,55,.12);
}
.input-glass {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  color: var(--text0);
  transition: border-color .2s, box-shadow .2s;
}
.input-glass::placeholder { color: var(--text2); }
.input-glass:focus { border-color: rgba(212,175,55,.5); box-shadow: 0 0 0 3px rgba(212,175,55,.1); }

/* 表单字段组（label + 控件） */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text1);
  margin-bottom: 6px;
  letter-spacing: .3px;
}

/* ---------- 卡片 ---------- */
.card {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

/* 玻璃面板（侧栏 / 抽屉类容器） */
.panel {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.sidebar {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  overflow-y: auto;
}

/* ---------- 角色卡 ---------- */
.char-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: cardIn .45s cubic-bezier(.16,1,.3,1) backwards; /* 入场 fadeIn+slideUp（animation-delay 由 JS 内联 stagger） */
}
.char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212,175,55,.45);
  box-shadow: 0 0 0 1px rgba(212,175,55,.4), 0 14px 36px rgba(0,0,0,.5), 0 0 30px rgba(212,175,55,.22);
}
/* 头像轻微放大（hover） */
.char-card-avatar {
  transition: transform .45s cubic-bezier(.16,1,.3,1);
  transform-origin: center;
}
.char-card:hover .char-card-avatar { transform: scale(1.05); }
/* 斜向扫光（hover，transform-only 不触发重排） */
.char-card::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 55%; height: 100%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.14), transparent);
  transform: translateX(-170%) skewX(-18deg);
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}
.char-card:hover::after { transform: translateX(340%) skewX(-18deg); }
.char-card-avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  background-color: var(--bg3);
}
.char-card-avatar-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.32), rgba(0,0,0,.05) 35%, transparent 55%);
  pointer-events: none;
}
.char-card-official { position: absolute; top: 10px; left: 10px; z-index: 2; }
.char-card-chat-btn {
  position: absolute; left: 50%; top: 58%; z-index: 2;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  border: none; border-radius: 999px;
  background: var(--grad-gold);
  color: #14100a; font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(212,175,55,.45);
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
}
.char-card:hover .char-card-chat-btn { opacity: 1; pointer-events: auto; top: 50%; }
.char-card-chat-btn:hover { box-shadow: 0 8px 26px rgba(212,175,55,.6); transform: translate(-50%,-50%) translateY(-1px); }
.char-card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 6px;
  flex: 1;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
}
.char-card-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.char-card-name {
  flex: 1; min-width: 0;
  margin: 0;
  font-size: 15px; font-weight: 700;
  color: var(--text0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.char-card-views {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text1);
}
.char-card-desc {
  margin: 0;
  font-size: 12px; color: var(--text1); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.9em;
}
.char-card-tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.char-tag-item {
  font-size: 10.5px; padding: 2px 9px; border-radius: 999px;
  background: rgba(212,175,55,.10);
  border: 1px solid rgba(212,175,55,.22);
  color: #e8c56b;
  white-space: nowrap;
}
.char-tag-item.is-empty { color: var(--text2); background: rgba(255,255,255,.04); border-color: var(--line); }
.char-card-creator {
  margin-top: auto; padding-top: 2px;
  font-size: 10.5px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.char-card-creator:empty { display: none; }

/* 旧角色卡类名兜底（老页面 JS 可能还在输出） */
.card-avatar-area { position: relative; width: 100%; aspect-ratio: 3/4; background-size: cover; background-position: center; }
.card-info-area { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-name-text { margin: 0; font-size: 15px; font-weight: 700; color: var(--text0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc-text { margin: 0; font-size: 12px; color: var(--text1); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags-row { display: flex; gap: 6px; flex-wrap: wrap; }
.card-tag-item { font-size: 10.5px; padding: 2px 9px; border-radius: 999px; background: rgba(212,175,55,.1); border: 1px solid rgba(212,175,55,.22); color: #e8c56b; }
.card-creator-row { font-size: 10.5px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-views { font-size: 11px; color: var(--text1); }
.card-official-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--grad-gold); color: #14100a; }
.card-chat-btn {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%);
  padding: 8px 16px; border: none; border-radius: 999px;
  background: var(--grad-gold); color: #14100a; font-size: 12.5px; font-weight: 700;
  cursor: pointer; opacity: 0; pointer-events: none; transition: all .25s ease; white-space: nowrap;
}
.char-card-new:hover .card-chat-btn, .card-avatar-area:hover .card-chat-btn { opacity: 1; pointer-events: auto; top: 50%; }

/* ---------- 角色网格 ---------- */
.char-grid, .char-grid-container {
  display: grid;
  grid-template-columns: repeat(var(--p-cols-mobile, 2), 1fr);
  gap: 14px;
}
@media (min-width: 769px) and (max-width: 1023px) {
  .char-grid, .char-grid-container { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .char-grid, .char-grid-container { grid-template-columns: repeat(var(--p-cols, 4), 1fr); }
}

/* ---------- Tabs / 分类 ---------- */
.tabs {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-item {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text1);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.tab-item:hover { color: var(--text0); background: rgba(255,255,255,.05); }
.tab-item.active {
  color: #14100a;
  background: var(--grad-gold);
  box-shadow: 0 3px 14px rgba(212,175,55,.35);
}
.tabs-divider { width: 1px; height: 20px; background: var(--line); flex-shrink: 0; margin: 0 2px; }

/* 分类标签（index.js 依赖 .category-tag + .active） */
.category-tag {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text1);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.category-tag:hover { color: var(--text0); background: rgba(255,255,255,.05); }
.category-tag.active {
  color: #14100a;
  background: var(--grad-gold);
  box-shadow: 0 3px 14px rgba(212,175,55,.35);
}

/* ---------- Chip 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text1);
  font-size: 12px;
  cursor: pointer; user-select: none;
  transition: all .2s ease;
  white-space: nowrap;
}
.chip:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); background: rgba(212,175,55,.08); }
.chip.active {
  color: #14100a;
  background: var(--grad-gold);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(212,175,55,.3);
}
.chip:disabled { opacity: .5; cursor: not-allowed; }

/* 标签弹窗里的标签 */
.tag-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text1);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .2s ease;
}
.tag-chip:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); }
.tag-chip.active {
  color: #14100a;
  background: var(--grad-gold);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(212,175,55,.3);
}

/* ---------- 头像 / 徽标 ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg3);
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-xl { width: 84px; height: 84px; border-width: 2px; border-color: rgba(212,175,55,.45); box-shadow: 0 6px 18px rgba(212,175,55,.25); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text1);
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.badge-official {
  background: var(--grad-gold);
  color: #14100a;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(212,175,55,.4);
}
.badge-hot { color: #ff8a8e; border-color: rgba(229,72,77,.4); }
.badge-gold { color: #e8c56b; border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.1); }
.badge-ok { color: #7fd98f; border-color: rgba(70,167,88,.4); }

/* ---------- 空状态 / 加载 ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text1);
  font-size: 14px;
}
.empty .empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty .empty-text { color: var(--text1); }
.empty .empty-sub { color: var(--text2); font-size: 12.5px; margin-top: 4px; }

.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 20px;
  color: var(--text1);
  font-size: 13.5px;
}
.spinner-glow {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(212,175,55,.15);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
.spinner {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  display: inline-block;
}
.spin {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.15);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
  vertical-align: -2px; margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton-card { pointer-events: none; }
.skeleton-card .char-card-avatar { background: var(--bg3); }
.skeleton-bg {
  width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--bg3) 25%, #2a3242 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg3) 25%, #2a3242 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- Hero 主视觉 ---------- */
.hero {
  position: relative;
  margin: 20px auto 0;
  max-width: 1280px;
  padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 48px) clamp(20px, 3vw, 32px);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: center;
  background:
    radial-gradient(1100px 420px at 50% -20%, rgba(139,92,246,.22), transparent 62%),
    radial-gradient(800px 300px at 88% 8%, rgba(212,175,55,.14), transparent 55%),
    radial-gradient(700px 280px at 8% 22%, rgba(139,92,246,.12), transparent 55%),
    linear-gradient(160deg, #12151f 0%, #0d1017 100%);
}
[data-theme="light"] .hero {
  background:
    radial-gradient(1100px 420px at 50% -20%, rgba(139,92,246,.14), transparent 62%),
    radial-gradient(800px 300px at 88% 8%, rgba(212,175,55,.12), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, #f2f0fa 100%);
}
.hero-title {
  margin: 0;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.25;
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 60%, #f5d78e 90%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 22px rgba(212,175,55,.25));
  animation: textFlow 7s linear infinite; /* 渐变文字流动 */
}
/* Hero 动态背景：渐变流动层 + 内容浮层 */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(120deg, rgba(212,175,55,.07), rgba(139,92,246,.12), rgba(212,175,55,.05), rgba(99,102,241,.10), rgba(212,175,55,.07));
  background-size: 300% 300%;
  animation: heroFlow 16s ease infinite;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
/* 漂浮光点（.hero-particle 由 index.html 提供 16 个，纯 CSS 动画） */
.hero-particle {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,215,142,.95), rgba(212,175,55,.3) 60%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  animation: particleFloat var(--pf-dur, 7s) ease-in-out var(--pf-delay, 0s) infinite;
}
.hero-particle:nth-child(odd) {
  background: radial-gradient(circle, rgba(167,139,250,.9), rgba(139,92,246,.25) 60%, transparent 75%);
}
.hero-particle:nth-child(1)  { left: 8%;  top: 22%; width: 6px; --pf-dur: 8s;   --pf-delay: 0s; }
.hero-particle:nth-child(2)  { left: 16%; top: 68%; width: 4px; --pf-dur: 6.5s; --pf-delay: .8s; }
.hero-particle:nth-child(3)  { left: 26%; top: 30%; width: 5px; --pf-dur: 7.5s; --pf-delay: 1.6s; }
.hero-particle:nth-child(4)  { left: 33%; top: 78%; width: 3px; --pf-dur: 9s;   --pf-delay: .4s; }
.hero-particle:nth-child(5)  { left: 44%; top: 18%; width: 4px; --pf-dur: 6s;   --pf-delay: 2s; }
.hero-particle:nth-child(6)  { left: 52%; top: 62%; width: 6px; --pf-dur: 8.5s; --pf-delay: 1.2s; }
.hero-particle:nth-child(7)  { left: 60%; top: 28%; width: 3px; --pf-dur: 7s;   --pf-delay: 2.6s; }
.hero-particle:nth-child(8)  { left: 68%; top: 72%; width: 5px; --pf-dur: 6.8s; --pf-delay: .2s; }
.hero-particle:nth-child(9)  { left: 76%; top: 20%; width: 4px; --pf-dur: 8.2s; --pf-delay: 1.8s; }
.hero-particle:nth-child(10) { left: 84%; top: 58%; width: 6px; --pf-dur: 7.4s; --pf-delay: .6s; }
.hero-particle:nth-child(11) { left: 90%; top: 32%; width: 3px; --pf-dur: 6.4s; --pf-delay: 2.2s; }
.hero-particle:nth-child(12) { left: 12%; top: 48%; width: 5px; --pf-dur: 7.8s; --pf-delay: 1s; }
.hero-particle:nth-child(13) { left: 40%; top: 86%; width: 4px; --pf-dur: 8.8s; --pf-delay: .3s; }
.hero-particle:nth-child(14) { left: 56%; top: 12%; width: 3px; --pf-dur: 6.2s; --pf-delay: 1.4s; }
.hero-particle:nth-child(15) { left: 72%; top: 44%; width: 5px; --pf-dur: 7.2s; --pf-delay: 2.4s; }
.hero-particle:nth-child(16) { left: 92%; top: 78%; width: 4px; --pf-dur: 6.6s; --pf-delay: .9s; }
.hero-sub {
  margin: 12px auto 0;
  max-width: 560px;
  font-size: 14.5px;
  color: var(--text1);
  line-height: 1.8;
}
/* Hero 搜索栏（GM 2026-08-19：位于标题上方，顶栏删除后为唯一搜索入口） */
.hero-search {
  display: flex; align-items: center; gap: 8px;
  max-width: 580px;
  /* GM 2026-08-19：搜索栏置于「hero 框顶 → 标题顶」范围的垂直正中间：上方留白 = 框内边距 + 24px，下方留白取同值 */
  margin: 24px auto clamp(52px, calc(6vw + 24px), 88px);
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.28);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 34px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within {
  border-color: rgba(212,175,55,.6);
  box-shadow: 0 12px 38px rgba(0,0,0,.4), 0 0 0 3px rgba(212,175,55,.12);
}
.hero-search svg { flex-shrink: 0; color: var(--gold); }
.hero-search-input {
  flex: 1; min-width: 0;
  padding: 11px 6px;
  border: none; background: transparent;
  color: var(--text0); font-size: 15px;
  outline: none;
}
.hero-search-input::placeholder { color: var(--text2); }
.hero-search-btn { flex-shrink: 0; border-radius: 999px; padding: 10px 24px; }

/* Hero 推荐角色横滑行 */
.hero-row-head {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 30px;
}
.hero-row-title {
  margin: 0;
  font-size: 15px; font-weight: 700;
  color: var(--text0);
  letter-spacing: .5px;
}
.hero-row-title::before { content: '✨ '; }
.hero-row-more { font-size: 12.5px; color: var(--text2); transition: color .2s; }
.hero-row-more:hover { color: var(--gold2); }
.hero-row {
  display: flex; gap: 16px;
  margin-top: 16px;
  padding: 4px 4px 12px;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.hero-row::-webkit-scrollbar { display: none; }
.hero-char-card {
  flex: 0 0 104px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer;
  transition: transform .25s ease;
}
.hero-char-card:hover { transform: translateY(-4px); }
.hero-char-avatar-wrap {
  position: relative;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #f5d78e, #8b5cf6, #d4af37, #f5d78e);
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
}
.hero-char-avatar {
  display: block;
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg1);
  background: var(--bg3);
}
.hero-char-name {
  max-width: 104px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-char-card:hover .hero-char-name { color: var(--gold2); }

/* ---------- 顶部应用栏（首页吸附顶栏） ---------- */
.app-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(11,13,18,.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
[data-theme="light"] .app-header { background: rgba(255,255,255,.82); }
.app-header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.app-logo {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  font-size: 19px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 50%, #9a7b2d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(212,175,55,.35));
  white-space: nowrap;
  animation: logoBreath 4s ease-in-out infinite; /* 微光呼吸 */
}
.app-logo:hover { opacity: .9; }
.app-logo-emoji { font-size: 22px; -webkit-text-fill-color: initial; }
.nav-search {
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
}
.nav-search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  transition: border-color .2s, box-shadow .2s;
}
.nav-search-box:focus-within {
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}
.nav-search-box svg { flex-shrink: 0; color: var(--text2); }
.nav-search-box:focus-within svg { color: var(--gold); }
.search-input {
  flex: 1; min-width: 0;
  padding: 8px 2px;
  border: none; background: transparent;
  color: var(--text0); font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: var(--text2); }

/* 顶栏导航链接 */
.app-nav {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a {
  position: relative;
  padding: 8px 13px;
  font-size: 14px; font-weight: 600;
  color: var(--text1);
  border-radius: 10px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.app-nav a:hover { color: var(--gold2); background: rgba(255,255,255,.05); }
.app-nav a.active { color: var(--text0); }
/* 下划线渐变展开动画（hover / active 时 scaleX 0→1） */
.app-nav a::after {
  content: '';
  position: absolute; left: 50%; bottom: 2px;
  transform: translateX(-50%) scaleX(0);
  width: 22px; height: 3px;
  border-radius: 3px;
  background: var(--grad-gold);
  box-shadow: 0 0 8px rgba(212,175,55,.6);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
  transform-origin: center;
}
.app-nav a:hover::after,
.app-nav a.active::after { transform: translateX(-50%) scaleX(1); }

/* 顶栏右侧操作区 */
.header-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.header-login { border-radius: 999px; padding: 7px 18px; font-size: 13px; }

/* 响应式：平板/手机两行 */
@media (max-width: 959px) {
  :root { --header-h: 102px; }
  .app-header-inner { align-content: center; gap: 6px 12px; padding: 6px 12px; }
  .app-nav { order: 2; flex: 1; min-width: 0; }
  .app-nav a { padding: 6px 10px; font-size: 13px; }
  .app-logo { font-size: 17px; }
  .nav-search { order: 3; width: 100%; max-width: none; margin: 0; }
}

/* ---------- 游客登录按钮（GM 2026-08-19：顶栏删除后悬浮右上角，已登录由 JS 隐藏） ---------- */
.guest-login-btn {
  position: fixed; top: 14px; right: 14px; z-index: 80;
  padding: 9px 20px; border-radius: 999px;
  background: var(--grad-gold);
  color: #14100a;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
  transition: transform .2s, box-shadow .2s;
}
.guest-login-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(212,175,55,.5); }

/* ---------- 筛选栏（分类 Tab + 标签云） ----------
   GM 2026-08-19：移除吸顶，随页面正常滚动，待在原本位置（与 style-gold-layout.css 的取消吸顶意图对齐） */
.filter-sticky-bar {
  background: rgba(11,13,18,.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
[data-theme="light"] .filter-sticky-bar { background: rgba(255,255,255,.88); }
.filter-inner { display: flex; flex-direction: column; gap: 8px; }
.tag-cloud {
  display: flex; gap: 7px;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 2px;
}
.tag-cloud::-webkit-scrollbar { display: none; }
.tag-cloud-chip { flex-shrink: 0; font-size: 11.5px; padding: 4px 11px; }

/* ---------- 页脚 ---------- */
.footer, .site-footer {
  margin-top: 52px;
  padding: 28px 16px 90px;
  border-top: 1px solid var(--line);
  background: rgba(17,20,27,.55);
  text-align: center;
}
[data-theme="light"] .footer, [data-theme="light"] .site-footer { background: rgba(255,255,255,.6); }
.site-footer-inner { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.site-footer-brand { font-size: 14.5px; font-weight: 700; color: var(--text0); letter-spacing: .3px; }
.site-footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.site-footer-links a { font-size: 12.5px; color: var(--text1); transition: color .2s; }
.site-footer-links a:hover { color: var(--gold2); }
.site-footer-copy { font-size: 11.5px; color: var(--text2); }

/* ---------- Toast 提示 ---------- */
.toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  max-width: 86vw;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  text-align: center;
  background: rgba(17,20,27,.94);
  border: 1px solid var(--line);
  color: var(--text0);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  animation: toastIn .25s ease;
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(.96); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.toast.success { border-color: rgba(70,167,88,.5); color: #8ee6a0; }
.toast.error { border-color: rgba(229,72,77,.55); color: #ff9a9d; }
.toast.info { border-color: rgba(212,175,55,.4); color: #e8c56b; }

/* ---------- 消息气泡 ---------- */
.bubble-user {
  align-self: flex-end;
  max-width: 76%;
  padding: 10px 15px;
  border-radius: 18px 18px 4px 18px;
  background: var(--grad-main);
  color: #fff;
  font-size: 14px; line-height: 1.7;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(139,92,246,.25);
}
.bubble-ai {
  align-self: flex-start;
  max-width: 76%;
  padding: 10px 15px;
  border-radius: 18px 18px 18px 4px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text0);
  font-size: 14px; line-height: 1.7;
  word-break: break-word;
}
.msg-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  opacity: 0;
  transition: opacity .2s;
}
.msg-row:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-actions button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--text2);
  font-size: 11.5px;
  cursor: pointer;
  transition: all .2s;
}
.msg-actions button:hover { color: var(--gold2); border-color: rgba(212,175,55,.4); }

/* 打字机光标动画 */
.stream-cursor {
  display: inline-block;
  width: 8px; height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 2px;
  background: var(--gold2);
  box-shadow: 0 0 8px rgba(245,215,142,.7);
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---------- 分割线 / 标题 ---------- */
.divider {
  height: 1px;
  border: none;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0;
  font-size: 19px; font-weight: 700;
  color: var(--text0);
  letter-spacing: .3px;
}
.section-title::before {
  content: '';
  width: 4px; height: 18px;
  border-radius: 3px;
  background: var(--grad-gold);
  box-shadow: 0 0 10px rgba(212,175,55,.55);
}

/* ============================================================
   四、首页布局细节
   ============================================================ */
.char-grid-head { margin-top: 30px; }
.char-grid-head .section-title { margin-bottom: 16px; }

.grid-end-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 30px 0 10px;
  color: var(--text2);
  font-size: 12.5px;
}

/* 公告横幅 */
.announce-banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #d4af37, #b8932f);
  color: #14100a;
  text-align: center;
  padding: 9px 40px;
  font-size: 13px;
  z-index: 55;
}
.announce-content { max-width: 1000px; margin: 0 auto; line-height: 1.6; }
.announce-close {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.12);
  color: #14100a;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
}
.announce-close:hover { background: rgba(0,0,0,.22); }

/* 多AI群聊入口卡（老类名保留） */
.group-entry-card {
  display: flex; align-items: center; gap: 12px;
  border-radius: 18px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(212,175,55,.10), rgba(154,123,45,.06));
  border: 1px solid rgba(212,175,55,.3);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s;
}
.group-entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 8px 32px rgba(212,175,55,.28);
}

/* 回到顶部按钮 hover（按钮本体为 inline 样式） */
#scroll-top-btn:hover { background: rgba(212,175,55,.24) !important; color: #f5d78e !important; transform: translateY(-2px); }
#scroll-top-btn:active { transform: translateY(0) scale(.94); }

/* 消息中心面板 / 标签面板 / 通用浮层 */
.fx-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fxFadeIn .2s ease;
}
@keyframes fxFadeIn { from { opacity: 0; } to { opacity: 1; } }
.fx-dialog {
  width: 100%; max-width: 440px;
  max-height: 86vh; overflow-y: auto;
  background: linear-gradient(165deg, var(--bg1), var(--bg0));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card), 0 0 40px rgba(212,175,55,.07);
  animation: fxDialogIn .3s cubic-bezier(.16,1,.3,1);
}
@keyframes fxDialogIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fx-dialog-title { font-size: 18px; font-weight: 700; color: var(--text0); margin-bottom: 6px; }
.fx-dialog-sub { font-size: 13px; color: var(--text1); margin-bottom: 14px; }
.fx-dialog-text { font-size: 13px; color: var(--text1); line-height: 1.8; }
.fx-dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.fx-btn-cancel {
  flex: 1; padding: 11px 0;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  color: var(--text1); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.fx-btn-cancel:hover { background: rgba(255,255,255,.09); color: var(--text0); }
.fx-btn-danger {
  background: linear-gradient(135deg, rgba(229,72,77,.12), rgba(229,72,77,.2));
  color: #ff8a8e;
}
.fx-btn-danger:hover { background: linear-gradient(135deg, rgba(229,72,77,.2), rgba(229,72,77,.3)); }
.fx-option-desc { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* 消息中心（右滑抽屉） */
.changelog-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.changelog-panel {
  position: fixed; top: 0; right: 0; z-index: 410;
  width: min(92vw, 400px);
  height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg1);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0,0,0,.4);
  animation: fxDialogIn .3s cubic-bezier(.16,1,.3,1);
}

/* 标签选择弹窗 */
.tag-panel-dialog {
  width: 100%; max-width: 560px;
  max-height: 76vh; overflow-y: auto;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  animation: fxDialogIn .3s cubic-bezier(.16,1,.3,1);
}
.tag-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 14px; }

/* 创建角色弹窗 */
.modal-overlay-glass {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-glass {
  width: 100%;
  max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  background: linear-gradient(165deg, var(--bg1), var(--bg0));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card), 0 0 40px rgba(212,175,55,.06);
}

/* 旧玻璃顶栏类（其他页面还在用） */
.navbar-glass {
  background: rgba(11,13,18,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] .navbar-glass { background: rgba(255,255,255,.82); }

/* 旧搜索框类 */
.search-box-glass {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box-glass:focus-within { border-color: rgba(212,175,55,.5); box-shadow: 0 0 0 3px rgba(212,175,55,.1); }

/* ============================================================
   五、角色档案弹窗（cd-*，index.js openCharDetail 输出）
   ============================================================ */
.cd-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 16px);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: cdFadeIn .25s ease;
}
@keyframes cdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.cd-dialog {
  width: 92%; max-width: 480px; max-height: 86vh;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(17,20,27,.97), rgba(11,13,18,.97));
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 40px rgba(212,175,55,.10), 0 20px 60px rgba(0,0,0,.5);
  animation: cdSlideUp .4s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
  position: relative;
}
@keyframes cdSlideUp {
  from { opacity: 0; transform: translateY(48px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (min-width: 640px) {
  .cd-overlay { align-items: center; padding-bottom: 0; }
  .cd-dialog { border-radius: 28px; max-height: 88vh; }
}
.cd-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 22px 20px calc(env(safe-area-inset-bottom,0px) + 20px); }
.cd-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(212,175,55,.3);
  background: rgba(10,10,12,.5);
  color: #e8c56b; font-size: 15px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.cd-close:hover { background: rgba(212,175,55,.15); color: #f5d78e; transform: rotate(90deg); }
.cd-header { text-align: center; padding: 4px 0 18px; }
.cd-avatar-wrap { position: relative; width: 92px; height: 92px; margin: 0 auto 12px; }
.cd-avatar {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover;
  border: 3px solid rgba(212,175,55,.35);
  background: var(--bg3);
  box-shadow: 0 8px 24px rgba(212,175,55,.3);
}
.cd-name { font-size: 22px; font-weight: 800; color: var(--text0); margin: 0; letter-spacing: .5px; }
.cd-official {
  display: inline-block; vertical-align: middle; margin-left: 4px;
  font-size: 10px; font-weight: 600; color: #14100a;
  background: var(--grad-gold);
  padding: 2px 8px; border-radius: 999px;
}
.cd-sub { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 8px; }
.cd-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: rgba(212,175,55,.1); border: 1px solid rgba(212,175,55,.25);
  color: #e8c56b;
}
.cd-desc { font-size: 13px; color: #c9a96a; line-height: 1.7; margin: 12px auto 0; max-width: 400px; }
.cd-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cd-tag {
  font-size: 10px; padding: 3px 10px; border-radius: 999px;
  background: rgba(212,175,55,.12); border: 1px solid rgba(212,175,55,.25);
  color: #e8c56b;
}
.cd-cards { display: flex; flex-direction: column; gap: 10px; }
.cd-card {
  background: rgba(10,10,12,.4);
  border: 1px solid rgba(212,175,55,.14);
  border-radius: 16px;
  padding: 12px 14px;
  transition: border-color .2s, background .2s;
}
.cd-card:hover { border-color: rgba(212,175,55,.35); background: rgba(212,175,55,.06); }
.cd-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.cd-card-icon {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.cd-card-title { font-size: 12px; font-weight: 700; color: #f5d78e; letter-spacing: .5px; }
.cd-card-body { font-size: 13.5px; color: #e8dcc0; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.cd-empty { color: #8a7a55 !important; font-style: italic; }
.cd-opening { margin-top: 10px; }
.cd-bubble {
  position: relative;
  background: linear-gradient(135deg, rgba(212,175,55,.14), rgba(154,123,45,.10));
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px; line-height: 1.8; color: #f5edd0;
}
.cd-bubble::before {
  content: ''; position: absolute; top: -8px; left: 24px;
  border: 8px solid transparent; border-bottom-color: rgba(212,175,55,.35);
}
.cd-foot { display: flex; gap: 10px; margin-top: 16px; }
.cd-btn-ghost {
  flex: 1; padding: 12px 0; border-radius: 14px;
  border: 1px solid rgba(212,175,55,.35);
  background: rgba(10,10,12,.5);
  color: #c9a96a; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.cd-btn-ghost:hover { background: rgba(212,175,55,.1); }
.cd-btn-chat {
  flex: 1.6; padding: 12px 0; border-radius: 14px; border: none;
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 6px 20px rgba(212,175,55,.4);
  transition: all .2s;
}
.cd-btn-chat:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(212,175,55,.55); }
.cd-btn-chat:active { transform: translateY(0) scale(.98); }
.cd-scroll::-webkit-scrollbar { width: 5px; }
.cd-scroll::-webkit-scrollbar-thumb { background: rgba(212,175,55,.35); border-radius: 99px; }
.cd-scroll::-webkit-scrollbar-track { background: transparent; }
[data-theme="light"] .cd-dialog {
  background: linear-gradient(160deg, rgba(255,255,255,.97), rgba(250,246,238,.97));
  border-color: rgba(212,175,55,.3);
  box-shadow: 0 -4px 40px rgba(212,175,55,.08), 0 20px 60px rgba(0,0,0,.15);
}
[data-theme="light"] .cd-name { color: #2b2417; }
[data-theme="light"] .cd-close { border-color: rgba(176,141,47,.4); background: rgba(0,0,0,.04); color: #7a6b4d; }
[data-theme="light"] .cd-close:hover { background: rgba(212,175,55,.12); color: #000; }
[data-theme="light"] .cd-badge { background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.25); color: #9a7b2d; }
[data-theme="light"] .cd-desc { color: #7a6b4d; }
[data-theme="light"] .cd-tag { background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.25); color: #9a7b2d; }
[data-theme="light"] .cd-card { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.06); }
[data-theme="light"] .cd-card:hover { border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.05); }
[data-theme="light"] .cd-card-title { color: #3d361f; }
[data-theme="light"] .cd-card-body { color: #4b4433; }
[data-theme="light"] .cd-empty { color: #9d9378 !important; }
[data-theme="light"] .cd-bubble { color: #6b5216; }
[data-theme="light"] .cd-btn-ghost { border-color: rgba(176,141,47,.35); background: rgba(0,0,0,.04); color: #7a6b4d; }
[data-theme="light"] .cd-btn-ghost:hover { background: rgba(212,175,55,.1); }

/* ============================================================
   六、旧页面类名保留（升级视觉）—— 登录页
   ============================================================ */
/* 契约类：登录容器 / 登录卡片 / 表单组 / 通栏按钮 */
.login-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(212,175,55,.12), transparent 65%),
    radial-gradient(ellipse 60% 45% at 95% 110%, rgba(154,123,45,.10), transparent 65%),
    var(--bg0);
}
.login-box {
  width: 100%; max-width: 420px;
  background: linear-gradient(165deg, var(--bg1), var(--bg0));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px 28px 26px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(212,175,55,.06);
  animation: loginCardIn .45s cubic-bezier(.16,1,.3,1);
}
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 实际登录页类（login.html 结构） */
.login-stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .8;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(232,197,107,.45), transparent),
    radial-gradient(1px 1px at 25% 45%, rgba(232,197,107,.35), transparent),
    radial-gradient(1.5px 1.5px at 40% 15%, rgba(245,215,142,.55), transparent),
    radial-gradient(1px 1px at 55% 60%, rgba(232,197,107,.35), transparent),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(245,215,142,.45), transparent),
    radial-gradient(1px 1px at 85% 50%, rgba(232,197,107,.35), transparent),
    radial-gradient(1px 1px at 15% 75%, rgba(232,197,107,.45), transparent),
    radial-gradient(1.5px 1.5px at 60% 80%, rgba(245,215,142,.55), transparent);
}
.form-page {
  position: relative; z-index: 1;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 40px 16px 64px;
  min-height: calc(100vh - 96px);
}
.form-container {
  width: 100%; max-width: 400px;
  background: linear-gradient(165deg, var(--bg1), var(--bg0));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-card), 0 0 60px rgba(212,175,55,.06);
  animation: loginCardIn .45s cubic-bezier(.16,1,.3,1);
}
.form-error {
  background: rgba(229,72,77,.10);
  border: 1px solid rgba(229,72,77,.32);
  color: #ff8a8e;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.form-error.hidden { display: none; }
.login-split-wrap { gap: 48px; }
.login-split { display: flex; gap: 56px; align-items: center; justify-content: center; width: 100%; max-width: 900px; }
.login-brand { flex: 1; max-width: 400px; }
.login-brand-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.4);
  background: rgba(212,175,55,.1);
  color: #e8c56b;
  font-size: 12px; letter-spacing: 1px;
  margin-bottom: 14px;
}
.login-brand-title {
  margin: 0 0 10px;
  font-size: 34px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 50%, #9a7b2d 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(212,175,55,.25));
}
.login-brand-sub { margin: 0 0 20px; font-size: 14.5px; color: var(--text1); line-height: 1.8; }
.login-brand-points { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.login-brand-points li { font-size: 13.5px; color: var(--text0); display: flex; align-items: center; gap: 8px; }
.login-brand-points li::before {
  content: '✦';
  color: var(--gold);
  text-shadow: 0 0 8px rgba(212,175,55,.6);
}
.login-brand-note { margin: 0; font-size: 12px; color: var(--text2); line-height: 1.8; }
.login-form-wrap { flex: 1; max-width: 420px; }
.login-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(212,175,55,.35);
  background: rgba(10,10,12,.5);
  color: #e8c56b;
  font-size: 13px; text-decoration: none;
  transition: all .2s;
}
.login-back-btn:hover { background: rgba(212,175,55,.12); color: #f5d78e; border-color: rgba(212,175,55,.6); box-shadow: 0 3px 14px rgba(212,175,55,.2); }
.login-back-btn:active { transform: scale(.96); }
@media (max-width: 768px) {
  .login-back-btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .login-back-label { display: none; }
  .login-brand { display: none; }
  .login-split { gap: 0; }
}
.age-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.age-option {
  display: flex; align-items: center; gap: 8px;
  padding: 12px;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.age-option .age-icon { font-size: 16px; }
.age-option .age-text { font-size: 13px; color: var(--text0); }
.age-option .age-check {
  margin-left: auto; font-size: 14px; font-weight: 700;
  color: transparent;
  transition: all .2s;
}
.age-option:hover { border-color: rgba(212,175,55,.45); background: rgba(212,175,55,.08); }
.age-option.selected {
  border-color: rgba(212,175,55,.7);
  background: rgba(212,175,55,.14);
  box-shadow: 0 0 14px rgba(212,175,55,.15);
}
.age-option.selected .age-check { color: var(--gold); }
.age-modal-card {
  position: relative;
  width: 100%; max-width: 320px;
  background: linear-gradient(165deg, var(--bg1), var(--bg0));
  border: 1px solid rgba(229,72,77,.35);
  border-radius: var(--r-lg);
  padding: 28px 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-card), 0 0 50px rgba(229,72,77,.10);
  animation: loginCardIn .35s cubic-bezier(.16,1,.3,1);
}
.age-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(212,175,55,.3);
  background: rgba(10,10,12,.5);
  color: #e8c56b;
  font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.age-modal-close:hover { background: rgba(212,175,55,.15); color: #f5d78e; transform: rotate(90deg); }
.age-modal-title { font-size: 17px; font-weight: 700; color: #ff8a8e; margin-bottom: 10px; }
.age-modal-text { font-size: 13px; line-height: 1.8; color: var(--text1); margin-bottom: 20px; }
.age-modal-btn {
  width: 100%; padding: 11px;
  background: var(--grad-gold);
  color: #14100a; border: none; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .25s ease;
}
.age-modal-btn:hover { box-shadow: 0 6px 20px rgba(212,175,55,.5); }

/* ============================================================
   七、旧页面类名保留（升级视觉）—— 后台 / 表格 / 通用
   ============================================================ */
/* 通用表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg3); color: var(--text1); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table tr:hover { background: rgba(255,255,255,.03); }

/* 表单组（登录页/后台通用） */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text1); margin-bottom: 6px; letter-spacing: .3px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  background: var(--bg2);
  color: var(--text0);
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(212,175,55,.55);
  box-shadow: 0 0 0 3px rgba(212,175,55,.12);
}
.form-group input::placeholder { color: var(--text2); }

/* 后台布局（admin/index.html 仅加载 style.css + admin.css） */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
  background: rgba(11,13,18,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
[data-theme="light"] .navbar { background: rgba(255,255,255,.82); }
.navbar .logo { font-size: 20px; font-weight: 700; white-space: nowrap; }
.navbar .logo a { color: var(--text0); text-decoration: none; text-shadow: 0 0 18px rgba(212,175,55,.45); }
.navbar .nav-right { display: flex; align-items: center; gap: 8px; }

.admin-layout { display: flex; min-height: calc(100vh - 56px); background: var(--bg0); }
.admin-sidebar {
  width: 220px; min-width: 220px;
  background: var(--bg1);
  border-right: 1px solid var(--line);
  padding: 12px 8px;
  overflow-y: auto;
}
.admin-sidebar a {
  display: block;
  padding: 10px 14px;
  margin: 2px 4px;
  border-radius: 10px;
  color: var(--text1);
  font-size: 14px;
  border: 1px solid transparent;
  transition: all .2s;
}
.admin-sidebar a:hover { background: rgba(139,92,246,.12); color: var(--text0); transform: translateX(2px); }
.admin-sidebar a.active {
  background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(212,175,55,.10));
  border-color: rgba(212,175,55,.3);
  color: var(--text0);
  font-weight: 600;
}
.admin-content { flex: 1; padding: 24px; overflow-y: auto; }
.admin-content h2 {
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(135deg, #f5d78e, #d4af37, #9a7b2d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-top: 0;
}
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.admin-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.admin-card:hover { transform: translateY(-3px); border-color: rgba(212,175,55,.4); box-shadow: var(--shadow-card); }
.admin-card .stat-value { font-size: 26px; font-weight: 700; color: var(--gold); }
.admin-card .stat-label { font-size: 13px; color: var(--text2); margin-top: 4px; }
.admin-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--bg3); font-weight: 600; font-size: 13px; color: var(--text1); white-space: nowrap; }
.admin-table tr:hover { background: rgba(255,255,255,.03); }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* 后台弹窗 / 审核卡（admin.html 内联样式之外的兜底） */
.adm-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.adm-modal {
  width: 100%; max-width: 560px; max-height: 84vh; overflow-y: auto;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.rv-card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.rv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rv-check { width: 16px; height: 16px; accent-color: var(--gold); flex-shrink: 0; cursor: pointer; }
.rv-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(212,175,55,.5); flex-shrink: 0; }
.rv-avatar-empty { display: flex; align-items: center; justify-content: center; background: var(--bg3); font-size: 22px; }
.rv-info { flex: 1; min-width: 200px; }
.rv-name { font-size: 16px; font-weight: 700; color: var(--text0); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-id { font-size: 11px; color: var(--text2); font-weight: 400; }
.rv-meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.rv-desc { font-size: 12px; color: var(--text2); margin-top: 6px; line-height: 1.6; }
.rv-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rv-btn {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text1); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.rv-btn:hover { color: var(--text0); }
.rv-btn-ok { background: var(--grad-gold); color: #14100a; border-color: transparent; }
.rv-btn-no { background: rgba(229,72,77,.14); color: #ff8a8e; border-color: rgba(229,72,77,.4); }
.rv-batch-bar { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.rv-badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.rv-approved { color: #7fd98f; background: rgba(70,167,88,.12); }
.rv-pending { color: #e8c56b; background: rgba(212,175,55,.1); }
.rv-pinned { color: #ff9a9d; background: rgba(229,72,77,.1); }
.rv-rejected { color: #ff8a8e; background: rgba(229,72,77,.1); }
.rv-approved-status, .rv-pending-status, .rv-rejected-status { font-size: 11px; padding: 2px 9px; border-radius: 999px; }
.rv-approved-status { color: #7fd98f; background: rgba(70,167,88,.12); }
.rv-pending-status { color: #e8c56b; background: rgba(212,175,55,.1); }
.rv-rejected-status { color: #ff8a8e; background: rgba(229,72,77,.1); }

/* 后台分类标签 */
.category-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
/* index.html 首页分类 Tab：与 .category-tag（index.js 逻辑选择器）并存，.category-tab 施加 v26 新设计系统样式。
   注意：style-g.css 的 [class*="tab"] 通配规则（specificity 0-4-0）会压过单类选择器，故用 #category-tabs 前缀（1-1-0） */
#category-tabs .category-tab {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text1);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: all .2s;
}
#category-tabs .category-tab:hover { color: var(--text0); background: rgba(255,255,255,.05); border-color: rgba(212,175,55,.4); }
#category-tabs .category-tab.active {
  color: #14100a;
  background: var(--grad-gold);
  border-color: transparent;
  box-shadow: 0 3px 14px rgba(212,175,55,.35);
}
.tag-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text1);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.tag-tab:hover { background: rgba(139,92,246,.12); color: var(--text0); }
.tag-tab.active { background: var(--grad-gold); color: #14100a; border-color: transparent; }

/* ============================================================
   八、旧页面类名保留（升级视觉）—— mom / wallet / grp / prof
   ============================================================ */
/* ---- 动态页 ---- */
.mom-feed { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 90px; }
.mom-publish {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.mom-feed-status {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.mom-feed-status:hover { border-color: rgba(212,175,55,.3); transform: translateY(-2px); }
.mom-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mom-thumbs img { border-radius: var(--r-md); max-height: 220px; object-fit: cover; }
.mom-video-prev { border-radius: var(--r-md); overflow: hidden; margin-top: 10px; }
.mom-guest-bar { text-align: center; padding: 14px; color: var(--text1); font-size: 13px; }

/* ---- 钱包页 ---- */
.wallet-page { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.wallet-hero {
  background: linear-gradient(135deg, rgba(139,92,246,.14), rgba(212,175,55,.10));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.wallet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.wallet-card-title { font-size: 15px; font-weight: 700; color: var(--text0); margin-bottom: 10px; }
.wallet-modules { display: grid; gap: 12px; margin-top: 16px; }
.wallet-tip { font-size: 12px; color: var(--text2); }
.wallet-login-guide { text-align: center; padding: 40px 20px; color: var(--text1); }
.wallet-log-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.wallet-bottom { padding-bottom: 90px; }
.wallet-wide { width: 100%; }
.wallet-btn-primary {
  background: var(--grad-gold);
  color: #14100a;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}
.wallet-balance-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; }

/* ---- 群聊页 ---- */
.grp-app { height: calc(100vh - 64px); display: flex; gap: 12px; padding: 12px; max-width: 1400px; margin: 0 auto; }
.grp-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}
.grp-main {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.grp-chat { display: flex; flex-direction: column; height: 100%; }
.grp-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.grp-title { font-size: 16px; font-weight: 700; color: var(--text0); }
.grp-subtitle { font-size: 12px; color: var(--text2); }
.grp-msg-list { flex: 1; overflow-y: auto; padding: 16px; }
.grp-input-bar { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.grp-input {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg2);
  color: var(--text0);
  font-size: 14px;
  outline: none;
}
.grp-input:focus { border-color: rgba(212,175,55,.5); }
.grp-send-btn {
  padding: 10px 22px;
  border: none; border-radius: var(--r-md);
  background: var(--grad-gold);
  color: #14100a; font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.grp-send-btn:hover { box-shadow: 0 6px 20px rgba(212,175,55,.45); }
.grp-rooms-modal, .grp-add-modal, .grp-del-modal {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.grp-rooms-list { display: flex; flex-direction: column; gap: 10px; }
.grp-rooms-new {
  padding: 11px 0;
  border: 1px dashed rgba(212,175,55,.4);
  border-radius: var(--r-md);
  background: rgba(212,175,55,.05);
  color: #e8c56b;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.grp-rooms-new:hover { background: rgba(212,175,55,.12); }
.grp-members-panel { padding: 12px; }
.grp-mobile-menu, .grp-toggle-panel { display: none; }
@media (max-width: 768px) {
  .grp-app { height: calc(100vh - 102px); padding: 8px; }
  .grp-sidebar { display: none; }
  .grp-toggle-panel { display: inline-flex; }
}

/* ---- 个人页 ---- */
.lp-profile-page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 90px; }
.lp-profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .lp-profile-grid { grid-template-columns: 1fr; } }
.lp-hero-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.lp-hero-avatar-wrap { margin-bottom: 12px; }
.lp-hero-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.lp-hero-stats { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.lp-stat { text-align: center; }
.lp-stat-val { font-size: 18px; font-weight: 800; color: var(--gold); }
.lp-stat-lbl { font-size: 11px; color: var(--text2); }
.lp-profile-tabs {
  display: flex; gap: 8px; margin: 16px 0;
  overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.lp-profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text1);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.profile-tab.active { background: var(--grad-gold); color: #14100a; border-color: transparent; box-shadow: 0 3px 14px rgba(212,175,55,.3); }
.gold-divider { height: 1px; border: none; margin: 16px 0; background: linear-gradient(90deg, transparent, rgba(212,175,55,.35), transparent); }

/* 通用个人页类（prof-*） */
.prof-header { display: flex; align-items: center; gap: 16px; padding: 20px; }
.prof-card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-card); }
.prof-name { font-size: 20px; font-weight: 800; color: var(--text0); }
.prof-stats { display: flex; gap: 16px; color: var(--text1); font-size: 13px; }

/* ============================================================
   九、移动端底部导航（旧类名保留，升级视觉）
   ============================================================ */
.bottom-nav-glass {
  background: rgba(11,13,18,.9);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
}
[data-theme="light"] .bottom-nav-glass { background: rgba(255,255,255,.92); }
.bottom-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: none;
  background: none;
  color: var(--text2);
  cursor: pointer;
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:active { transform: scale(.94); }
.nav-item.is-active { color: var(--gold); }
.nav-ico { width: 23px; height: 23px; }
.nav-label { font-size: 10px; font-weight: 600; }
.nav-create-badge { position: relative; display: inline-flex; }
.nav-create-badge::before {
  content: '';
  position: absolute; inset: -5px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,175,55,.35), rgba(139,92,246,.35));
  filter: blur(6px);
  z-index: -1;
}
.pm-badge-top {
  position: absolute; top: 0; right: 0;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  display: none;
  align-items: center; justify-content: center;
  padding: 0 4px;
  transform: translate(30%, -30%);
}

/* ============================================================
   十、下拉刷新指示器（index.js 下拉手势控制）
   ============================================================ */
#pull-refresh { position: fixed; top: 0; left: 0; right: 0; z-index: 120; display: none; justify-content: center; pointer-events: none; }
.pull-refresh-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(17,20,27,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 999px;
  padding: 7px 14px;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  transition: transform .25s cubic-bezier(.16,1,.3,1), opacity .2s;
}
.pull-refresh-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(212,175,55,.25);
  border-top-color: #d4af37;
  border-radius: 50%;
  transition: transform .08s linear, border-color .2s;
  flex-shrink: 0;
}
.pull-refresh-spinner.pull-ready { border-top-color: #3fb97a; }
.pull-refresh-spinner.pull-spinning { animation: pullSpin .8s linear infinite; }
.pull-refresh-text { color: #d1d5db; font-size: 12px; white-space: nowrap; }
@keyframes pullSpin { to { transform: rotate(360deg); } }

/* ============================================================
   十一、动效与可访问性
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   v26 首页高级动效（总经理追加 2026-08-19）：入场 / Hero粒子 / 流光 / 涟漪
   原则：只用 transform/opacity（box-shadow 仅短暂发光），无外部库，
   时长 0.25-0.6s（环境循环动画例外），prefers-reduced-motion 全禁用
   ════════════════════════════════════════════════════════════════════ */

/* ---- 通用入场（JS IntersectionObserver 滚动进入视口时加 .is-visible） ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- 滚动渐显工具类（供其他页面复用：加载即播） ---- */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp .5s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 渐变文字流动工具类（标题复用） ---- */
.gradient-text {
  background: linear-gradient(135deg, #f5d78e, #d4af37, #9a7b2d, #f5d78e);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: textFlow 6s linear infinite;
}

/* ---- 按钮点击涟漪（index.js 事件委托生成 span.ripple） ---- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5), rgba(255,255,255,.16) 55%, transparent 72%);
  transform: scale(0);
  animation: rippleIn .55s cubic-bezier(.16,1,.3,1) forwards;
  pointer-events: none;
  z-index: 2;
}
@keyframes rippleIn {
  from { transform: scale(0); opacity: .8; }
  to   { transform: scale(1); opacity: 0; }
}

/* ---- 关键帧集合 ---- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes btnFlow { to { background-position: -220% center; } }
@keyframes textFlow { to { background-position: -220% center; } }
@keyframes heroFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes logoBreath {
  0%, 100% { filter: drop-shadow(0 2px 10px rgba(212,175,55,.30)); }
  50%      { filter: drop-shadow(0 2px 20px rgba(212,175,55,.62)); }
}
@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); opacity: .15; }
  50%      { transform: translateY(-30px) translateX(8px); opacity: .9; }
}

/* ════════════════════════════════════════════════════════════════════
   v26 动效加码（总经理追加 2026-08-19）：入场/流光/呼吸/弹跳/闪烁
   原则：只动 transform/opacity（box-shadow 仅短暂动画），prefers-reduced-motion 全禁用
   ════════════════════════════════════════════════════════════════════ */

/* 1. 消息气泡入场：用户 slideIn / AI 落定（流式完成时新消息插入同样触发） */
.message { animation:msgSlideIn .3s ease-out both; }
.message.assistant { animation:msgSettleIn .38s ease-out both; }
@keyframes msgSlideIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes msgSettleIn {
  0% { opacity:0; transform:translateY(12px) scale(.985); }
  60% { opacity:1; transform:translateY(0) scale(1.003); }
  100% { opacity:1; transform:translateY(0) scale(1); }
}

/* 2. 流式增量轻微淡入 + 金色呼吸光标（scale/opacity 脉动） */
#streaming-bubble.fade-in { animation:streamFade .14s ease-out; }
@keyframes streamFade { from { opacity:.5; } to { opacity:1; } }
.stream-cursor {
  display:inline-block; width:2px; height:1.05em; background:var(--gold2); border-radius:1px;
  margin-left:2px; vertical-align:text-bottom; box-shadow:0 0 6px rgba(245,215,142,.85);
  animation:streamPulse 1s ease-in-out infinite;
}
@keyframes streamPulse {
  0%,100% { opacity:.25; transform:scaleY(.55); }
  50% { opacity:1; transform:scaleY(1.05); }
}

/* 3. 输入框：聚焦金色发光+上浮；发送按钮流光+ripple */
.input-wrap { transform:translateY(0); transition:border-color .15s, box-shadow .15s, transform .2s ease; }
.input-wrap:focus-within {
  transform:translateY(-2px);
  border-color:rgba(212,175,55,.65);
  box-shadow:0 4px 18px rgba(212,175,55,.16), 0 0 0 3px rgba(212,175,55,.10);
}
.send-btn { position:relative; overflow:hidden; }
.send-btn::after {
  content:''; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(120deg, transparent 25%, rgba(255,255,255,.5) 50%, transparent 75%);
  transform:translateX(-130%);
}
.send-btn:hover::after { animation:btnShine .85s ease forwards; }
@keyframes btnShine { from { transform:translateX(-130%); } to { transform:translateX(130%); } }
.send-btn::before {
  content:''; position:absolute; left:50%; top:50%; width:0; height:0; border-radius:50%;
  background:rgba(255,255,255,.45); transform:translate(-50%,-50%); opacity:0; pointer-events:none;
}
.send-btn:active::before { animation:btnRipple .45s ease-out; }
@keyframes btnRipple { from { width:6px; height:6px; opacity:.5; } to { width:84px; height:84px; opacity:0; } }

/* 4. 左右栏：折叠按钮旋转；滚动条 hover 亮起（滑入滑出过渡已在响应式段定义 0.25s） */
.panel-collapse { transition:transform .25s ease, color .15s, background .15s; }
.panel-collapse:hover { transform:rotate(180deg); }
.chat-app ::-webkit-scrollbar-thumb { transition:background .2s; }
.chat-app ::-webkit-scrollbar-thumb:hover { background:rgba(139,92,246,.55); }

/* 5. AI 头像微呼吸 + 情绪 emoji 弹跳（updateCharExpression 每次更新重触发） */
.message.assistant .msg-avatar { animation:avatarBreath 3.2s ease-in-out infinite; }
@keyframes avatarBreath { 0%,100% { transform:scale(1); } 50% { transform:scale(1.05); } }
.emoji-bounce { display:inline-block; animation:emojiBounce .4s ease; }
@keyframes emojiBounce {
  0% { transform:scale(.4) translateY(4px); opacity:.3; }
  60% { transform:scale(1.25) translateY(-3px); opacity:1; }
  100% { transform:scale(1) translateY(0); opacity:1; }
}

/* 6. 朗读中金边呼吸（伪元素 opacity 脉动，不重绘气泡内容层） */
.message.tts-speaking .msg-bubble { box-shadow:0 0 0 1.5px rgba(212,175,55,.55); }
.message.tts-speaking .msg-bubble::after {
  content:''; position:absolute; inset:-1px; border-radius:inherit; pointer-events:none;
  border:1.5px solid var(--gold); opacity:.4;
  animation:ttsBreath 1.6s ease-in-out infinite;
}
@keyframes ttsBreath { 0%,100% { opacity:.28; } 50% { opacity:.95; } }

/* 7. 搜索命中：3 次闪黄淡出（伪元素层动画，原 box-shadow 方案移除） */
.msg-search-hit .msg-bubble { animation:none; box-shadow:none; position:relative; }
.msg-search-hit .msg-bubble::after {
  content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:rgba(212,175,55,.24);
  animation:searchFlash3 1.8s ease 3;
}
@keyframes searchFlash3 { 0%,100% { opacity:0; } 50% { opacity:1; } }

/* 8. 空状态：渐变呼吸提示 + 头像漂浮（chat.js renderEmptyPlaceholder 生成 .chat-empty） */
.chat-empty { text-align:center; padding:60px 20px; color:var(--text2); animation:emptyBreath 3s ease-in-out infinite; }
.chat-empty .chat-empty-icon {
  display:inline-block; font-size:48px; line-height:1;
  filter:drop-shadow(0 6px 16px rgba(212,175,55,.25));
  animation:emptyFloat 4s ease-in-out infinite;
}
.chat-empty p { margin-top:14px; font-size:14px; }
@keyframes emptyFloat { 0%,100% { transform:translateY(0) rotate(-2deg); } 50% { transform:translateY(-10px) rotate(2deg); } }
@keyframes emptyBreath { 0%,100% { opacity:.72; } 50% { opacity:1; } }

/* 9. 动效总开关：用户偏好减少动效时全部禁用 */
@media (prefers-reduced-motion: reduce) {
  .message, .message.assistant, #streaming-bubble.fade-in, .stream-cursor,
  .input-wrap, .send-btn::after, .send-btn::before,
  .panel-collapse, .message.assistant .msg-avatar, .emoji-bounce,
  .message.tts-speaking .msg-bubble::after, .msg-search-hit .msg-bubble::after,
  .chat-empty, .chat-empty .chat-icon, .chat-empty .chat-empty-icon,
  .sidebar, .panel,
  .reveal, .fade-in-up, .ripple, .hero-particle, .char-card,
  .btn-primary, .hero-title, .hero::before, .app-logo, .app-nav a::after,
  .gradient-text { animation:none !important; transition:none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
/* ════════════════════════════════════════════════════════════════════
   v26 聊天页三栏布局段（员工B 2026-08-19）
   员工A 重写 style.css 后补充：chat.html / chat.js / status-bar.js 专属样式
   （契约变量与通用组件类沿用员工A 版本，本段只补聊天页所需）
   ════════════════════════════════════════════════════════════════════ */

/* ---------- 0. 页面基底 ---------- */
body.chat-page-body {
  background: var(--bg0);
  color: var(--text0);
  overflow: hidden;
  height: 100dvh;
  margin: 0;
  user-select: text;
}

/* ---------- 1. 三栏骨架 ---------- */
.chat-app {
  display: flex;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg0);
}
.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  position: relative;
}

/* ---------- 2. 左栏：会话历史（260px 可折叠） ---------- */
.sidebar#chat-left-col {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease, opacity .25s ease, transform .25s ease;
}
.sidebar#chat-left-col.collapsed {
  width: 0; min-width: 0; max-width: 0;
  padding: 0; border: 0; overflow: hidden; opacity: 0;
}
.sidebar-head { display: flex; }
.btn-new { width: 100%; }
.sidebar-search { position: sticky; top: 0; }
.sidebar-search .input { width: 100%; }
.sidebar-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; }
.foot-row { display: flex; gap: 8px; }
.foot-row .btn { flex: 1; text-align: center; }
.history-empty {
  text-align: center;
  color: var(--text2);
  font-size: 13px;
  padding: 24px 8px;
}
.history-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
}
.history-item:hover { background: rgba(139,92,246,.10); }
.history-item.active { background: rgba(212,175,55,.12); box-shadow: inset 2px 0 0 var(--gold); }
.history-item-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.history-item-info { flex: 1; min-width: 0; }
.history-item-name {
  font-size: 13px;
  color: var(--text0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-preview {
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.history-item-time { font-size: 10px; color: var(--text2); flex-shrink: 0; }
.history-item-del {
  position: absolute;
  right: 4px; top: 4px;
  width: 18px; height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(229,72,77,.15);
  color: var(--danger);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.history-item:hover .history-item-del { opacity: 1; }
.history-item-del:hover { background: rgba(229,72,77,.35); }

/* ---------- 3. 顶栏角色条 ---------- */
.chat-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  min-height: 58px;
}
.chat-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: var(--text1);
  transition: background .15s, color .15s;
}
.chat-back-btn:hover { background: rgba(255,255,255,.06); color: var(--text0); }
.char-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .15s;
}
.char-bar:hover { background: rgba(255,255,255,.05); }
.char-bar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212,175,55,.5);
  box-shadow: 0 0 10px rgba(212,175,55,.25);
  flex-shrink: 0;
  background: var(--bg3);
}
.char-bar-info { display: flex; flex-direction: column; min-width: 0; }
.char-bar-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.char-bar-sub {
  font-size: 11.5px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-dot-char {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px rgba(70,167,88,.8);
  margin-left: 6px;
  vertical-align: middle;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100% { opacity:.55; } 50% { opacity:1; } }
.topbar-actions { display: flex; align-items: center; gap: 4px; position: relative; }
.chat-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 170px;
  padding: 6px;
  background: rgba(17,20,27,.97);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text0);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.menu-item:hover { background: rgba(212,175,55,.12); }

/* ---------- 4. 会话内搜索条 ---------- */
.in-chat-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--bg1);
}
.in-chat-search input {
  flex: 1;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--text0);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.in-chat-search input:focus { border-color: rgba(212,175,55,.55); }
.ics-count { font-size: 11px; color: var(--text2); white-space: nowrap; }
.ics-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text1);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}
.ics-btn:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); }

/* ---------- 5. 消息区 ---------- */
.messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
#msg-list {
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.message { display: flex; gap: 10px; align-items: flex-start; }
/* 用户消息 DOM 顺序为 [气泡, 头像]：row 方向气泡在左、头像在右；justify-content:flex-end 让整条消息右对齐，头像贴屏幕最右边缘 */
.message.user { flex-direction: row; justify-content: flex-end; }
.msg-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
  margin-top: 2px;
}
.message > div { max-width: 76%; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.message.user > div { align-items: flex-end; }
.msg-bubble {
  position: relative;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
}
.message.user .msg-bubble {
  background: var(--grad-main);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(139,92,246,.28);
}
.message.assistant .msg-bubble {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text0);
  border-bottom-left-radius: 6px;
}
.msg-bubble p { margin: 4px 0; }
.msg-bubble pre {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 12.5px;
}
.msg-bubble pre code { background: transparent; padding: 0; }
.msg-bubble code { font-family: Consolas, "Courier New", monospace; }
.msg-bubble table { border-collapse: collapse; margin: 6px 0; }
.msg-bubble th, .msg-bubble td { border: 1px solid var(--line); padding: 5px 10px; font-size: 12.5px; }
.copy-code {
  position: absolute;
  top: 6px; right: 6px;
  padding: 3px 8px;
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.06);
  color: var(--text1);
  cursor: pointer;
}
.copy-code:hover { color: var(--gold2); border-color: rgba(212,175,55,.4); }
.msg-meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.message:hover .msg-meta, .msg-meta:focus-within { opacity: 1; }
.msg-time { font-size: 10.5px; color: var(--text2); align-self: center; }
.msg-copy-btn {
  padding: 2px 6px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text2);
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.msg-copy-btn:hover { background: rgba(212,175,55,.12); color: var(--gold2); }
.msg-selected .msg-bubble {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 14px rgba(212,175,55,.35);
}
.msg-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.reaction-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg3);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s;
}
.reaction-badge:hover { border-color: rgba(212,175,55,.45); }
.date-separator {
  text-align: center;
  font-size: 11px;
  color: var(--text2);
  position: sticky;
  top: 0;
  z-index: 5;
}
.date-separator span {
  background: var(--bg3);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
}
#session-stats { text-align: center; font-size: 11.5px; color: var(--text2); padding: 10px 0 2px; }

/* typing dots（流式前占位） */
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text2);
  animation: dotTyping 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dotTyping { 0%,100% { opacity:.3; transform:translateY(0); } 50% { opacity:1; transform:translateY(-4px); } }

/* ---------- 6. 输入区 ---------- */
.input-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: var(--bg1);
  padding: 8px 14px 10px;
  position: relative;
}
.peak-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--warning, #f59e0b);
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--r-sm);
}
.peak-hint-close {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}
.gen-settings-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 14px; right: 14px;
  z-index: 40;
  max-width: 560px;
  margin: 0 auto;
  background: rgba(17,20,27,.97);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 14px;
}
.gsp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gsp-title { font-size: 13.5px; font-weight: 700; }
.gsp-close {
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}
.gsp-body { display: flex; flex-direction: column; gap: 14px; }
.gsp-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.gsp-label { font-size: 12.5px; color: var(--text1); }
.gsp-val { font-size: 12.5px; color: var(--gold2); font-weight: 600; }
.gsp-row input[type="range"], .settings-row { width: 100%; accent-color: #d4af37; cursor: pointer; }
.gsp-hint, .settings-hint { font-size: 11px; color: var(--text2); margin-top: 5px; line-height: 1.6; }
.gsp-seg, .settings-seg { display: flex; gap: 6px; }
.gsp-seg button, .settings-seg button {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text1);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.gsp-seg button.active, .settings-seg button.active,
.gsp-seg button:hover, .settings-seg button:hover {
  border-color: rgba(212,175,55,.55);
  background: rgba(212,175,55,.12);
  color: var(--gold2);
}
.cmc-toolbar { max-width: 820px; margin: 0 auto; }
.cmc-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.header-action-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text1);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  line-height: 1;
}
.header-action-btn:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); background: rgba(212,175,55,.08); }
.input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 10px;
}
#msg-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text0);
  font-size: 14.5px;
  line-height: 1.6;
  resize: none;
  max-height: 160px;
  font-family: var(--font);
}
#msg-input::placeholder { color: var(--text2); }
.send-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--grad-gold);
  color: #14100a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  box-shadow: 0 3px 10px rgba(212,175,55,.35);
}
.send-btn:hover { box-shadow: 0 5px 16px rgba(212,175,55,.5); transform: translateY(-1px); }
.stop-btn {
  display: none; /* 初始隐藏，流式生成时由 JS 显示 */
  flex-shrink: 0;
  width: 36px; height: 36px;
  border: 1px solid rgba(229,72,77,.5);
  border-radius: 50%;
  background: rgba(229,72,77,.12);
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.stop-btn:hover { background: rgba(229,72,77,.25); }
.cmc-toolbar-sub {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text2);
  flex-wrap: wrap;
}
.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 999px;
  background: rgba(212,175,55,.08);
  color: var(--gold2);
  font-size: 11.5px;
  cursor: pointer;
  transition: all .15s;
}
.credit-chip:hover { border-color: rgba(212,175,55,.6); background: rgba(212,175,55,.14); }

/* ---------- 7. 右栏：角色面板（300px 可折叠） ---------- */
.panel#chat-right-col {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  border: none;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  transition: width .25s ease, opacity .25s ease, transform .25s ease;
}
.panel#chat-right-col.collapsed {
  width: 0; min-width: 0; max-width: 0;
  padding: 0; border: 0; overflow: hidden; opacity: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
}
.panel-title { font-size: 14px; font-weight: 700; }
.panel-collapse {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text1);
  font-size: 14px;
  cursor: pointer;
}
.panel-collapse:hover { color: var(--gold2); border-color: rgba(212,175,55,.45); }
.panel#chat-right-col.collapsed .panel-collapse { transform: rotate(180deg); }
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); }
.panel-tab {
  flex: 1;
  padding: 9px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text1);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.panel-tab:hover { color: var(--text0); }
.panel-tab.active { color: var(--gold2); border-bottom-color: var(--gold); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.panel-tab-pane { display: none; }
.panel-tab-pane.active { display: block; }

/* 角色卡 Tab */
.char-card-avatar#char-avatar-large {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg3);
}
.char-card-name { font-size: 17px; font-weight: 700; margin-top: 10px; }
.char-card-badge { margin-top: 6px; }
.char-card-desc {
  font-size: 13px;
  color: var(--text1);
  margin-top: 8px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.char-field {
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  margin-top: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12.5px;
}
.char-field-label { color: var(--gold2); flex-shrink: 0; font-weight: 600; }
.char-field-value { color: var(--text1); word-break: break-word; }
.char-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.char-card-actions .btn { flex: 1; text-align: center; }

/* 状态栏 Tab（status-bar.js 渲染类） */
.status-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s;
}
.status-summary-bar:hover { border-color: rgba(212,175,55,.4); }
.status-summary-fields { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.status-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.25);
  font-size: 11.5px;
  color: var(--text1);
}
.chip-icon { font-size: 12px; }
.chip-val { color: var(--text0); font-weight: 600; }
.status-expand-arrow { color: var(--text2); font-size: 14px; flex-shrink: 0; }
.status-hint { font-size: 12px; color: var(--text2); margin-top: 10px; line-height: 1.7; }
.status-panel {
  margin-top: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px;
}
.status-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.status-field-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.status-field-card.wide { grid-column: 1 / -1; }
.field-header { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text1); }
.field-icon { font-size: 13px; }
.field-label { font-weight: 600; }
.field-value { font-size: 13.5px; color: var(--text0); word-break: break-word; }
.field-level-badge { font-size: 12.5px; color: var(--gold2); font-weight: 600; }
.field-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--bg3);
  overflow: hidden;
}
.field-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #d4af37);
  border-radius: 3px;
  transition: width .4s ease;
}
.status-drawer-foot { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.status-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.status-drawer-head-actions { display: flex; gap: 8px; }
.status-editor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-top: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.ei-icon { font-size: 15px; flex-shrink: 0; }
.ei-info { flex: 1; min-width: 0; }
.ei-label { font-size: 13px; color: var(--text0); }
.ei-type { font-size: 11px; color: var(--text2); }
.ei-toggle {
  width: 36px; height: 20px;
  border: none;
  border-radius: 999px;
  background: var(--bg3);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}
.ei-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text2);
  transition: transform .2s, background .2s;
}
.ei-toggle.on { background: rgba(212,175,55,.35); }
.ei-toggle.on::after { transform: translateX(16px); background: var(--gold2); }
.ei-delete {
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}
.ei-delete:hover { color: var(--danger); }
.status-custom-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: var(--bg2);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}
.status-custom-form input, .status-custom-form select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg1);
  color: var(--text0);
  font-size: 12.5px;
  outline: none;
}
.status-custom-form input:focus { border-color: rgba(212,175,55,.5); }

/* 记忆 Tab（memory-panel 内嵌化） */
.memory-panel#memory-panel {
  position: static;
  width: auto;
  height: auto;
  max-height: none;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
#memory-panel.hidden { display: none !important; }
.memory-header { font-size: 13px; color: var(--text1); font-weight: 600; margin-bottom: 8px; }
.memory-body { display: flex; flex-direction: column; gap: 6px; }
.memory-item {
  padding: 6px 8px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.15);
  border-radius: var(--r-sm);
}
.memory-key { font-size: 12.5px; color: var(--text0); }
.memory-new-row { display: flex; gap: 6px; margin-top: 10px; }
.memory-new-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text0);
  font-size: 12.5px;
  outline: none;
}
.memory-new-row input:focus { border-color: rgba(212,175,55,.5); }
.memory-new-row button {
  padding: 8px 14px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--grad-gold);
  color: #14100a;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* 设置 Tab */
.settings-group { margin-bottom: 16px; }
.settings-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text1);
  margin-bottom: 6px;
}
.settings-val { color: var(--gold2); font-weight: 600; }
.settings-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text0);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ---------- 8. Toast（#toast-container 内 .toast-item，chat.js 用） ---------- */
.toast-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(17,20,27,.95);
  border: 1px solid var(--line);
  color: var(--text0);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastItemIn .25s ease;
  max-width: 80vw;
}
@keyframes toastItemIn {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-item.toast-success { border-color: rgba(70,167,88,.5); }
.toast-item.toast-error { border-color: rgba(229,72,77,.55); }
.toast-item.toast-info { border-color: rgba(212,175,55,.4); }
.toast-icon { font-size: 14px; }
.toast-text { font-size: 13px; }

/* ---------- 9. 表情反应选择器 ---------- */
.reaction-picker {
  position: fixed;
  z-index: 120;
  display: grid;
  grid-template-columns: repeat(4, 36px);
  gap: 4px;
  padding: 6px;
  background: rgba(17,20,27,.97);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.reaction-picker button {
  width: 36px; height: 36px;
  font-size: 18px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
  transition: background .15s;
}
.reaction-picker button:hover { background: rgba(212,175,55,.15); }

/* ---------- 10. 抽屉遮罩（状态栏抽屉 / 编辑器） ---------- */
.sidebar-overlay, .panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sidebar-overlay.show, .panel-overlay.show { opacity: 1; pointer-events: auto; }
.fx-overlay.status-drawer-overlay, .fx-overlay.status-editor-overlay { z-index: 200; }

/* ---------- 11. 移动端断点 ---------- */
@media (max-width: 900px) {
  body.chat-page-body { overflow: hidden; }
  .sidebar#chat-left-col,
  .sidebar#chat-left-col.collapsed {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    border-right: 1px solid var(--line);
    border-radius: 0;
    padding: 12px;
    transform: translateX(-105%);
    opacity: 1;
  }
  .sidebar#chat-left-col.open { transform: translateX(0); }
  .panel#chat-right-col,
  .panel#chat-right-col.collapsed {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 50;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 0;
    transform: translateX(105%);
    opacity: 1;
  }
  .panel#chat-right-col.open { transform: translateX(0); }
}
@media (max-width: 640px) {
  #msg-list { padding: 12px 10px 18px; }
  .message > div { max-width: 86%; }
  .char-bar-name { font-size: 14px; }
  .char-bar-avatar { width: 34px; height: 34px; }
  .cmc-toolbar-actions { gap: 4px; }
  .header-action-btn { width: 28px; height: 28px; font-size: 12.5px; }
  .status-drawer-grid { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .msg-meta { opacity: 1; }
  .history-item-del { opacity: .6; }
  /* 触屏热区加大（375px 移动端适配，2026-08-20）：只影响触屏设备，桌面 hover 不变 */
  .msg-copy-btn {
    padding: 9px 12px;
    font-size: 12px;
    min-height: 36px;
  }
  .history-item-del {
    width: 30px; height: 30px;
    font-size: 13px;
  }
  .ics-btn {
    width: 36px; height: 36px;
    font-size: 14px;
  }
  .header-action-btn {
    width: 32px; height: 32px;
    font-size: 13px;
  }
}

/* ---------- fx-* 弹窗子类补全（chat.html 引用，员工B 2026-08-19） ---------- */
.fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  color: var(--text1);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.fx-btn:hover { background: rgba(255,255,255,.09); color: var(--text0); }
.fx-btn-primary {
  flex: 1;
  padding: 11px 0;
  border: none;
  border-radius: var(--r-md);
  background: var(--grad-gold);
  color: #14100a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fx-btn-primary:hover { box-shadow: 0 4px 16px rgba(212,175,55,.4); transform: translateY(-1px); color: #14100a; }
.fx-btn-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text1);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .2s;
}
.fx-btn-close:hover { color: var(--gold2); border-color: rgba(212,175,55,.4); }
.fx-dialog-icon { font-size: 40px; text-align: center; margin-bottom: 10px; }
.fx-icon-danger { filter: drop-shadow(0 0 12px rgba(229,72,77,.4)); }
.fx-dialog-warn { font-size: 12.5px; color: var(--warning, #f59e0b); margin-top: 8px; }
.fx-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.fx-option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.fx-option-card:hover { border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.06); }
.fx-option-card.active { border-color: rgba(212,175,55,.6); background: rgba(212,175,55,.1); }
.fx-option-icon { font-size: 22px; flex-shrink: 0; }
.fx-option-info { display: flex; flex-direction: column; gap: 2px; }
.fx-option-name { font-size: 13.5px; font-weight: 600; color: var(--text0); }

/* ============================================================
   首页角色卡「海报式」改版（GM 2026-08-19）
   整卡即大照片：全幅背景图 + 底部磨砂玻璃信息层（名称/简介/标签）。
   聊天页复用的 .char-card-name/.char-card-desc 全局定义不受影响，
   新增样式全部限定 #char-grid 作用域。
   ============================================================ */
/* 整卡定比海报：移动 2:3，桌面 3:4。
   GM 2026-08-19：用 padding-bottom 百分比技法而非 aspect-ratio——
   aspect-ratio 老版本 iOS Safari/微信 WebView 不支持，会导致卡片高度塌陷为 0、页面无内容可滚；
   padding-bottom 百分比全版本兼容。 */
#char-grid .char-card { display: block; height: 0; padding-bottom: 150%; }
@media (min-width: 769px) { #char-grid .char-card { padding-bottom: 133.33%; } }

/* 全幅照片背景（懒加载 [data-bg] 填充 background-image；hover 轻微放大） */
#char-grid .char-card-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--bg3);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
#char-grid .char-card:hover .char-card-bg { transform: scale(1.05); }

/* 上轻下重的通透遮罩：官方角标可读、与玻璃层衔接自然（GM 2026-08-19：收窄渐变，少遮照片） */
#char-grid .char-card-tint {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.14), transparent 30%, rgba(8,8,14,.20) 75%);
  pointer-events: none;
}

/* 底部玻璃信息层（GM 2026-08-19：压缩为迷你条，仅占照片底部一小条）
   ⚠️ 不用 backdrop-filter 模糊：几百张卡片同时渲染模糊层会让 iOS Safari/微信 WebView
   合成卡死、页面无法滚动（苹果用户滑动不了屏幕的根因）。半透明渐变同样有玻璃质感。 */
#char-grid .char-card-glass {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 12px 10px;
  background: linear-gradient(to top, rgba(10,10,16,.72), rgba(10,10,16,.42));
  border-top: 1px solid rgba(255,255,255,.08);
}

/* 玻璃层内文字（暗色模式：白字系） */
#char-grid .char-card-name {
  flex: 1; min-width: 0;
  margin: 0;
  font-size: 14px; font-weight: 700;
  color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#char-grid .char-card-views { font-size: 10.5px; color: rgba(255,255,255,.68); }
#char-grid .char-card-desc {
  margin: 0;
  font-size: 11.5px; color: rgba(255,255,255,.82); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 0;
  white-space: normal; word-break: break-word;
}
#char-grid .char-card-tags {
  gap: 4px;
  flex-wrap: nowrap; overflow: hidden;
  min-height: 0;
}
#char-grid .char-tag-item {
  font-size: 9.5px; padding: 1px 7px;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.26);
  color: #f5d78e;
}
#char-grid .char-tag-item.is-empty {
  color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.16);
}
#char-grid .char-card-creator { font-size: 9.5px; color: rgba(255,255,255,.55); }

/* 浅色模式玻璃层（同比例减淡） */
[data-theme="light"] #char-grid .char-card-glass {
  background: linear-gradient(to top, rgba(255,255,255,.72), rgba(255,255,255,.45));
  border-top-color: rgba(0,0,0,.08);
}
[data-theme="light"] #char-grid .char-card-name { color: #1c1a14; }
[data-theme="light"] #char-grid .char-card-views { color: rgba(0,0,0,.6); }
[data-theme="light"] #char-grid .char-card-desc { color: rgba(0,0,0,.75); }
[data-theme="light"] #char-grid .char-tag-item {
  background: rgba(0,0,0,.06);
  border-color: rgba(0,0,0,.22);
  color: #8a6d1d;
}
[data-theme="light"] #char-grid .char-tag-item.is-empty {
  color: rgba(0,0,0,.45);
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.12);
}
[data-theme="light"] #char-grid .char-card-creator { color: rgba(0,0,0,.55); }

/* ============================================================
   ---------- 刘海屏/打孔屏/全面屏 安全区适配（GM 2026-08-20） ----------
   全机型统一：iPhone 灵动岛/刘海 + Android 打孔屏 + 底部手势横条。
   前提：各页面 <meta viewport> 均已带 viewport-fit=cover（本次已补齐）。
   @supports 兜底：不支持 env() 的旧浏览器自动跳过。
   ============================================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  /* 功能页吸顶顶栏（钱包/我的/创造/动态/会话/指南）：header 整体拔高 + inner 保持原高，安全区作 padding-top */
  .app-header {
    height: calc(var(--header-h, 58px) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }
  .app-header-inner { height: var(--header-h, 58px); }

  /* 首页 Hero 大卡：渐变背景向上延伸，内容避开刘海（Hero 是页面首元素，无吸顶栏） */
  .hero { padding-top: calc(clamp(28px, 6vw, 64px) + env(safe-area-inset-top, 0px)); }

  /* 聊天页：顶栏避刘海 */
  .chat-topbar {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    min-height: calc(58px + env(safe-area-inset-top, 0px));
  }
  /* 聊天页：输入栏底部避手势横条（iPhone home 条 / Android 手势条） */
  .input-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

  /* 移动端底部导航：safe-area 由 .bottom-nav-row 的 env 计算处理（勿重复添加，避免双重留白） */
}
