/* ============================================================
   style-gold-chat.css — 聊天核心页黑金主题覆盖层（黑金规范 v1.0）
   加载顺序：style-g.css → style-v3.css → style-gold.css → 本文件
   适用范围：chat.html / group.html / chats.html / messages.html
   原则：全部使用字面色值（不用 --p-* 变量，因为 chat.js 会以
   内联样式写入服务端主题色），浅色模式同样强制黑金。
   ============================================================ */

/* ===== 0. 全局基底与变量 ===== */
:root {
  --bg: #0a0a0c; --surface: #14110d; --surface2: #1c1813;
  --border: rgba(212,175,55,.22); --text: #f3f4f6; --text2: #c9a96a;
  --primary: #d4af37; --primary-hover: #f5d78e; --primary-light: rgba(212,175,55,.15);
  --user-msg: #d4af37; --user-text: #0a0a0c; --ai-msg: #14110d; --ai-border: rgba(212,175,55,.22);
}
/* 浅色模式同样强制黑金变量（修复：style-g.css 的 [data-theme="light"]
   .input-wrap textarea 深色文字压深色输入框、对比度仅 1.1:1 的 bug） */
[data-theme="light"] {
  --bg: #0a0a0c; --surface: #14110d; --surface2: #1c1813;
  --border: rgba(212,175,55,.22); --text: #f3f4f6; --text2: #c9a96a;
  --primary: #d4af37; --primary-hover: #f5d78e; --primary-light: rgba(212,175,55,.15);
  --user-msg: #d4af37; --user-text: #0a0a0c; --ai-msg: #14110d; --ai-border: rgba(212,175,55,.22);
}
[data-theme="light"] .input-wrap textarea,
[data-theme="light"] #msg-input,
[data-theme="light"] #pm-input {
  color: #f3f4f6 !important;
}
[data-theme="light"] .input-wrap textarea::placeholder { color: #a8a29e; }
body {
  background: #0a0a0c;
  color: #f3f4f6;
}
/* 滚动条：黑底 + 金 thumb */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10,10,12,.85); }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,.55); }
::-webkit-scrollbar-corner { background: transparent; }
::selection { background: rgba(212,175,55,.35); color: #0a0a0c; }
:focus-visible { outline: 2px solid rgba(212,175,55,.5); outline-offset: 2px; }

/* ===== 1. 聊天页框架 ===== */
/* 压过 JS 内联 background:var(--p-bg,#171426)，仅改底色不动壁纸图 */
.chat-page,
[data-theme="dark"] #chat-page,
[data-theme="light"] #chat-page {
  background-color: #0a0a0c !important;
}

/* ===== 2. 顶部栏：黑底 + 底部金色渐变线 ===== */
.chat-header-bar,
[data-theme="light"] .chat-header-bar {
  background: rgba(10,10,12,.85) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: none !important;
  box-shadow: none !important;
}
.chat-header-bar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.6), transparent);
  pointer-events: none;
}
.chat-header-bar .char-avatar {
  border: 2px solid rgba(212,175,55,.35);
  box-shadow: 0 0 0 2px rgba(212,175,55,.12), 0 2px 12px rgba(212,175,55,.18);
}
.chat-header-bar .char-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(212,175,55,.4), 0 0 22px rgba(212,175,55,.45);
}
.chat-header-bar .char-name,
[data-theme="light"] .chat-header-bar .char-name { color: #f3f4f6; }
#creator-link { color: #c9a96a !important; }

/* 顶部按钮 */
#btn-menu { color: #c9a96a; }
#btn-menu:hover {
  background: rgba(212,175,55,.14);
  color: #f5d78e;
  border-color: rgba(212,175,55,.35);
}
.header-action-btn { color: #c9a96a; }
.header-action-btn:hover {
  background: rgba(212,175,55,.12);
  color: #f5d78e;
  border-color: rgba(212,175,55,.3);
}
.header-action-btn.active {
  background: linear-gradient(135deg, rgba(212,175,55,.25), rgba(154,123,45,.15));
  border-color: #d4af37;
  color: #f5d78e;
  box-shadow: 0 0 8px rgba(212,175,55,.2);
}

/* 下拉菜单 */
.chat-dropdown,
[data-theme="light"] .chat-dropdown {
  background: rgba(14,12,10,.95) !important;
  border: 1px solid rgba(212,175,55,.25) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 0 24px rgba(212,175,55,.05) !important;
}
.menu-item { color: #f3f4f6; }
.menu-item:hover {
  background: rgba(212,175,55,.14) !important;
  color: #f5d78e;
  transform: translateX(2px);
}

/* 返回按钮 */
.chat-back-btn { color: #c9a96a; }
.chat-back-btn:hover { background: rgba(212,175,55,.12); color: #f5d78e; }

/* ===== 3. 消息区 ===== */
.messages-area::-webkit-scrollbar { width: 3px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: rgba(212,175,55,.35); }

/* 用户消息：金色渐变底 + 纯黑文字 + 右上角金色装饰角 */
.message.user .msg-bubble {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border-radius: 18px 4px 18px 18px;
  border: none;
  box-shadow: 0 6px 24px rgba(212,175,55,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
.message.user .msg-bubble:hover {
  box-shadow: 0 8px 30px rgba(212,175,55,.4);
  transform: translateY(-2px);
}
.message.user .msg-bubble::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 11px; height: 11px;
  border-top: 2px solid rgba(245,215,142,.95);
  border-right: 2px solid rgba(245,215,142,.95);
  border-top-right-radius: 3px;
  filter: drop-shadow(0 0 4px rgba(212,175,55,.55));
  pointer-events: none;
}
.message.user .msg-bubble code {
  background: rgba(10,10,12,.15);
  color: #0a0a0c;
}
.message.user .msg-bubble a { color: #0a0a0c; font-weight: 600; text-decoration: underline; }

/* AI 角色消息：深色卡片底 + 金边 + 淡金文字 */
.message.assistant .msg-bubble,
[data-theme="light"] .message.assistant .msg-bubble {
  background: linear-gradient(160deg, rgba(26,22,16,.85), rgba(14,12,10,.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 4px 18px 18px 18px;
  color: #c9a96a;
  box-shadow: 0 4px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(212,175,55,.06);
}
.message.assistant .msg-bubble:hover {
  border-color: rgba(212,175,55,.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0,0,0,.4), 0 0 18px rgba(212,175,55,.08);
}
.message.assistant .msg-bubble a { color: #e8c56b; }
.message.assistant .msg-bubble code {
  background: rgba(212,175,55,.1);
  color: #f5d78e;
}
.message.assistant .msg-bubble pre {
  background: rgba(10,10,12,.6);
  border: 1px solid rgba(212,175,55,.18);
  border-radius: 10px;
}
.copy-code {
  background: rgba(212,175,55,.12) !important;
  border: 1px solid rgba(212,175,55,.3) !important;
  color: #e8c56b !important;
  border-radius: 6px;
}
.copy-code:hover { background: rgba(212,175,55,.22) !important; color: #f5d78e !important; }

/* 系统提示：透明底 + 金色虚线边（预留） */
.message.system .msg-bubble {
  background: transparent;
  border: 1px dashed rgba(212,175,55,.4);
  color: #c9a96a;
  border-radius: 14px;
}

/* 消息头像 */
.message .msg-avatar { border: 1px solid rgba(212,175,55,.25); }
.message.assistant .msg-avatar {
  box-shadow: 0 0 0 2px rgba(212,175,55,.15), 0 0 14px rgba(212,175,55,.14);
}

/* 消息元信息 / 操作按钮 */
.msg-time { color: #c9a96a; }
.msg-copy-btn { color: #c9a96a; }
.msg-copy-btn:hover {
  color: #f5d78e;
  background: rgba(212,175,55,.14) !important;
  box-shadow: 0 3px 10px rgba(212,175,55,.18);
}

/* 反应徽章 */
.reaction-badge {
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.18);
  color: #e8c56b;
}
.reaction-badge:hover { background: rgba(212,175,55,.2); }
.reaction-badge small { color: #c9a96a; }

/* 日期分隔符：金色渐变线 */
.date-separator::before,
.date-separator::after {
  background: linear-gradient(to right, transparent, rgba(212,175,55,.25), transparent);
}
.date-separator span,
[data-theme="light"] .date-separator span {
  background: rgba(14,12,10,.75);
  border: 1px solid rgba(212,175,55,.2);
  color: #e8c56b;
}

/* 选中态：金色描边 */
.message.msg-selected .msg-bubble {
  box-shadow: 0 0 0 2px #d4af37, 0 0 18px rgba(212,175,55,.2) !important;
}

/* 流式气泡 / 打字指示器（金色圆点） */
#streaming-msg .msg-bubble {
  border: 1px solid rgba(212,175,55,.22);
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}
#streaming-avatar { box-shadow: 0 0 12px rgba(212,175,55,.2); }
.typing-dots span {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  box-shadow: 0 0 8px rgba(212,175,55,.5);
}
.typing-dots span:nth-child(2) { background: linear-gradient(135deg, #d4af37, #9a7b2d); }
.typing-dots span:nth-child(3) { background: linear-gradient(135deg, #9a7b2d, #f5d78e); }
.typing-cursor { color: #f5d78e; }

/* 气泡内状态栏面板 */
.status-panel,
[data-theme="light"] .status-panel {
  background: rgba(10,10,12,.75);
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(212,175,55,.05);
}
.status-panel .status-label { color: #e8c56b; }
.status-panel .status-value { color: #f3f4f6; }
.status-panel .status-fallback-note {
  border-top: 1px dashed rgba(212,175,55,.25);
  color: rgba(232,197,107,.55);
}

/* ===== 4. 输入区 ===== */
.input-bar,
[data-theme="light"] .input-bar {
  background: rgba(10,10,12,.85) !important;
  border-top: 1px solid rgba(212,175,55,.25);
  box-shadow: 0 -8px 32px rgba(0,0,0,.25);
}
.input-bar .input-wrap,
[data-theme="light"] .input-bar .input-wrap {
  background: rgba(10,10,12,.6);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 18px;
}
.input-wrap:focus-within {
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 3px rgba(212,175,55,.15), 0 0 24px rgba(212,175,55,.1) !important;
}
.input-wrap textarea { color: #f3f4f6; }
.input-wrap textarea::placeholder { color: #c9a96a; }

/* 语音按钮 */
.mic-btn { color: #c9a96a; }
.mic-btn:hover { background: rgba(212,175,55,.14); color: #f5d78e; }

/* 发送按钮：金色渐变 + 纯黑文字 + 辉光 + hover 流光扫过 */
.send-btn {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 18px rgba(212,175,55,.35);
}
.send-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
  pointer-events: none;
}
.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(212,175,55,.5);
}
.send-btn:hover::after { left: 130%; }
.send-btn:active { transform: scale(.92); }

/* 工具栏文字 */
#token-display, #status-display, #char-count { color: #c9a96a !important; }

/* ===== 5. AI记忆面板 ===== */
.memory-panel,
[data-theme="light"] .memory-panel {
  background: rgba(14,12,10,.96);
  border-left: 1px solid rgba(212,175,55,.2);
  box-shadow: -4px 0 24px rgba(0,0,0,.4);
}
.memory-header {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid rgba(212,175,55,.18);
}
.memory-header button { color: #c9a96a; }
.memory-item {
  background: rgba(212,175,55,.08);
  border-left: 3px solid #d4af37;
  color: #f3f4f6;
}
.memory-item:hover { background: rgba(212,175,55,.14); }
.memory-key { color: #e8c56b; }
@media (max-width: 600px) {
  .memory-panel { border-top: 1px solid rgba(212,175,55,.2); }
}

/* ===== 6. 状态栏抽屉 / 编辑器 / 摘要 ===== */
.status-summary-bar,
[data-theme="light"] .status-summary-bar {
  background: rgba(14,12,10,.95);
  border-top: 1px solid rgba(212,175,55,.2);
}
.status-summary-bar:hover { background: rgba(24,20,14,.98); }
.status-summary-bar:active { background: rgba(212,175,55,.1); }
.status-summary-chip,
[data-theme="light"] .status-summary-chip {
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.2);
  color: #e8c56b;
}
.status-summary-chip.flash {
  animation: chipFlashGold .6s ease;
}
@keyframes chipFlashGold {
  0%, 100% { background: rgba(212,175,55,.1); border-color: rgba(212,175,55,.2); }
  50% { background: rgba(63,185,122,.25); border-color: rgba(63,185,122,.4); }
}
.status-expand-arrow { color: #c9a96a; }

.status-drawer-panel,
[data-theme="light"] .status-drawer-panel {
  background: rgba(10,10,12,.98);
  border-top: 1px solid rgba(212,175,55,.25);
  box-shadow: 0 -12px 48px rgba(0,0,0,.5);
}
.status-drawer-handle { background: rgba(212,175,55,.35); }
.status-drawer-header {
  background: rgba(10,10,12,.98);
  border-bottom: 1px solid rgba(212,175,55,.15);
}
.status-drawer-header button {
  background: rgba(212,175,55,.14);
  color: #f5d78e;
  border: 1px solid rgba(212,175,55,.25);
}
.status-drawer-header button:hover { background: rgba(212,175,55,.24); }
.status-drawer-header span { color: #f3f4f6; }
.status-drawer-grid .status-field-card,
[data-theme="light"] .status-field-card {
  background: rgba(212,175,55,.06);
  border: 1px solid rgba(212,175,55,.12);
  border-radius: 14px;
}
.status-drawer-grid .status-field-card:hover {
  background: rgba(212,175,55,.12);
  border-color: rgba(212,175,55,.25);
  transform: translateY(-2px);
}
.status-field-card .field-value { color: #f3f4f6; }
.status-field-card .field-progress { background: rgba(255,255,255,.08); }
.status-field-card .field-progress-fill {
  background: linear-gradient(90deg, #f5d78e, #d4af37 50%, #9a7b2d);
  box-shadow: 0 0 8px rgba(212,175,55,.4);
}
.status-field-card .field-level-badge {
  background: rgba(212,175,55,.15);
  color: #f5d78e;
}

/* 状态编辑器 */
.status-editor-panel,
[data-theme="light"] .status-editor-panel {
  background: rgba(10,10,12,.98);
  border-top: 1px solid rgba(212,175,55,.25);
}
.status-editor-header { border-bottom: 1px solid rgba(212,175,55,.15); }
.status-editor-header button {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  color: #0a0a0c;
  box-shadow: 0 4px 14px rgba(212,175,55,.3);
}
.status-editor-header span { color: #f3f4f6; }
.status-editor-item { border-bottom: 1px solid rgba(212,175,55,.08); }
.status-editor-item .ei-label { color: #f3f4f6; }
.status-editor-item .ei-toggle.on { background: #d4af37; box-shadow: 0 0 10px rgba(212,175,55,.4); }
.status-editor-item .ei-toggle.off { background: rgba(255,255,255,.14); }
.status-editor-item .ei-delete { color: #e05b5b; }
.status-editor-add > button {
  border: 1px dashed rgba(212,175,55,.4);
  color: #f5d78e;
  background: transparent;
}
.status-editor-add > button:hover { background: rgba(212,175,55,.08); border-color: #d4af37; }
.status-custom-form input, .status-custom-form select {
  background: rgba(10,10,12,.6);
  border: 1px solid rgba(212,175,55,.2);
  color: #f3f4f6;
}
.status-custom-form input:focus, .status-custom-form select:focus { border-color: #d4af37; }
.status-custom-form button {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  color: #0a0a0c;
}

/* ===== 7. 表情选择器 / 弹窗 / Toast ===== */
.reaction-picker,
[data-theme="light"] .reaction-picker {
  background: rgba(14,12,10,.97);
  border: 1px solid rgba(212,175,55,.3);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.reaction-picker button:hover { background: rgba(212,175,55,.18); transform: scale(1.15); }

.fx-overlay { background: rgba(0,0,0,.6); }
.fx-dialog,
[data-theme="light"] .fx-dialog {
  background: linear-gradient(160deg, rgba(26,22,16,.92), rgba(14,12,10,.97));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212,175,55,.25) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.55), 0 0 40px rgba(212,175,55,.06) !important;
}
.fx-dialog-title { color: #f3f4f6; }
.fx-btn-cancel {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(212,175,55,.25);
  color: #c9a96a;
}
.fx-btn-cancel:hover { background: rgba(212,175,55,.1); }
.fx-btn-close {
  background: transparent;
  border: 1px solid rgba(212,175,55,.3);
  color: #e8c56b;
}
.fx-btn-close:hover { background: rgba(212,175,55,.12); color: #f5d78e; }
.fx-btn-primary, .btn-primary {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%) !important;
  color: #0a0a0c !important;
  box-shadow: 0 4px 18px rgba(212,175,55,.35) !important;
}
.fx-btn-primary:hover, .btn-primary:hover {
  box-shadow: 0 6px 26px rgba(212,175,55,.5) !important;
  transform: translateY(-1px);
}
.fx-option-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212,175,55,.15);
}
.fx-option-card:hover { border-color: rgba(212,175,55,.45); background: rgba(212,175,55,.07); }
.fx-option-card.active {
  border-color: #d4af37;
  background: linear-gradient(160deg, rgba(212,175,55,.18), rgba(154,123,45,.08));
  box-shadow: 0 0 20px rgba(212,175,55,.15), inset 0 1px 0 rgba(255,255,255,.05);
}
.fx-option-name { color: #f3f4f6; }
.fx-option-desc { color: #c9a96a; }

.toast-item {
  border: 1px solid rgba(212,175,55,.25) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.4) !important;
}
/* GM 修复 2026-08-14：toast 类型底色旧紫红黄绿越界 → 黑金状态色 */
.toast-item.toast-success { background: rgba(63,185,122,.16) !important; color: #3fb97a !important; }
.toast-item.toast-error { background: rgba(224,91,91,.16) !important; color: #e05b5b !important; }
.toast-item.toast-info { background: rgba(212,175,55,.14) !important; color: #e8c56b !important; }
.toast-item.toast-warning { background: rgba(212,175,55,.18) !important; color: #f5d78e !important; }

/* ===== 8. 会话列表页（chats.html） ===== */
.g-tab { color: #c9a96a; }
.g-tab.active {
  border-bottom-color: #d4af37;
  color: #f5d78e;
}
.g-tab:not(.active) { color: #8a7a52; }
.g-check.checked {
  background: #d4af37 !important;
  border-color: #d4af37 !important;
  box-shadow: 0 0 10px rgba(212,175,55,.4) !important;
}

/* ===== 9. 群聊页（group.html） ===== */
#grp-loader { background: #0a0a0c; }
#grp-loader .spinner {
  border: 3px solid rgba(212,175,55,.15);
  border-top-color: #d4af37;
}
#grp-app, #grp-create-view { background: #0a0a0c; color: #f3f4f6; }

#grp-header {
  background: rgba(10,10,12,.85);
  border-bottom: 1px solid rgba(212,175,55,.2);
  box-shadow: 0 10px 32px rgba(0,0,0,.25);
}
#grp-back, .grp-header-btn {
  border: 1px solid rgba(212,175,55,.2);
  background: rgba(212,175,55,.06);
  color: #c9a96a;
}
#grp-back:hover, .grp-header-btn:hover {
  background: rgba(212,175,55,.14);
  border-color: rgba(212,175,55,.4);
  color: #f5d78e;
}
#grp-title { color: #f3f4f6; }
#grp-subtitle { color: #c9a96a; }

/* 侧边栏：深黑底 + 金色分割线 */
#grp-sidebar {
  background: rgba(10,10,12,.6);
  border-right: 1px solid rgba(212,175,55,.2);
}
.sb-head { border-bottom: 1px solid rgba(212,175,55,.14); }
.sb-room-name { color: #f3f4f6; }
.sb-room-meta { color: #c9a96a; }
.sb-actions { border-bottom: 1px solid rgba(212,175,55,.1); }
.sb-btn {
  border: 1px solid rgba(212,175,55,.18);
  background: rgba(212,175,55,.05);
  color: #c9a96a;
}
.sb-btn:hover {
  background: rgba(212,175,55,.12);
  color: #f5d78e;
  box-shadow: 0 4px 14px rgba(212,175,55,.2);
}
.sb-btn.primary {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border: none;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}
.sb-btn.primary:hover { box-shadow: 0 6px 22px rgba(212,175,55,.5); }
.sb-banter-row { border-top: 1px dashed rgba(212,175,55,.2); color: #c9a96a; }
.sb-member {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212,175,55,.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sb-member.on {
  box-shadow: inset 3px 0 0 0 rgba(212,175,55,.7), 0 2px 8px rgba(0,0,0,.2);
}
.sb-member:hover {
  border-color: rgba(212,175,55,.45);
  background: rgba(212,175,55,.09);
  transform: translateX(2px);
}
.sb-member.sb-dragging {
  border-color: rgba(212,175,55,.7);
  box-shadow: 0 10px 28px rgba(212,175,55,.3);
}
.sb-handle { color: #c9a96a; }
.sb-member:hover .sb-handle { color: #f5d78e; }
.sb-avatar { background: #14110d; }
.sb-mname { color: #f3f4f6; }
.sb-arrow:hover { color: #f5d78e; }
.sb-switch-slider { background: rgba(255,255,255,.14); }
.sb-switch input:checked + .sb-switch-slider {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  box-shadow: 0 0 8px rgba(212,175,55,.45);
}
.sb-foot { border-top: 1px solid rgba(212,175,55,.14); }

/* 群聊消息 */
#grp-chat .message.user .msg-bubble {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border: none;
  box-shadow: 0 4px 16px rgba(212,175,55,.28), inset 0 1px 0 rgba(255,255,255,.25);
}
#grp-chat .message.user .msg-bubble:hover { box-shadow: 0 8px 24px rgba(212,175,55,.4); }
#grp-chat .message.user .msg-bubble::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 11px; height: 11px;
  border-top: 2px solid rgba(245,215,142,.95);
  border-right: 2px solid rgba(245,215,142,.95);
  border-top-right-radius: 3px;
  filter: drop-shadow(0 0 4px rgba(212,175,55,.55));
  pointer-events: none;
}
#grp-chat .message.assistant .msg-bubble {
  background: linear-gradient(160deg, rgba(26,22,16,.85), rgba(14,12,10,.92));
  border: 1px solid rgba(212,175,55,.22);
  color: #c9a96a;
  box-shadow: 0 4px 24px rgba(0,0,0,.35), inset 0 1px 0 rgba(212,175,55,.06);
}
#grp-chat .message.assistant .msg-bubble:hover {
  border-color: rgba(212,175,55,.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.4), 0 0 18px rgba(212,175,55,.08);
}
#grp-chat .message .msg-avatar {
  border: 2px solid rgba(212,175,55,.35);
  background: linear-gradient(135deg, #f5d78e, #d4af37) border-box, rgba(14,12,10,.6) padding-box;
  box-shadow: 0 2px 10px rgba(212,175,55,.25);
}
.grp-msg-name, [data-theme="light"] .grp-msg-name { color: #e8c56b; }
.grp-msg-time { color: #c9a96a; }
.grp-msg-typing { color: #c9a96a; }
.grp-msg-tokens { color: #c9a96a; }
#grp-chat .grp-msg-name::before {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  box-shadow: 0 0 6px rgba(212,175,55,.6);
}

/* 群聊输入区 */
.grp-input-bar {
  background: rgba(10,10,12,.82);
  border-top: 1px solid rgba(212,175,55,.2);
  box-shadow: 0 -8px 32px rgba(0,0,0,.25);
}
.grp-status { color: #e8c56b; }
.grp-status:not(:empty)::before {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  box-shadow: 0 0 8px rgba(212,175,55,.7);
}
.grp-input-wrap {
  background: rgba(10,10,12,.6);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 18px;
}
.grp-input-wrap:focus-within {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212,175,55,.15), 0 0 30px rgba(212,175,55,.12);
}
#grp-input { color: #f3f4f6; }
#grp-input::placeholder { color: #c9a96a; }
#grp-send-btn {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(212,175,55,.35);
}
#grp-send-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-20deg);
  transition: left .5s ease;
  pointer-events: none;
}
#grp-send-btn:hover { box-shadow: 0 6px 26px rgba(212,175,55,.5); transform: translateY(-1px); }
#grp-send-btn:hover::after { left: 130%; }
#grp-send-btn:active { transform: scale(.92); }

/* 创建房间视图 */
.cv-hero .cv-hero-icon {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  box-shadow: 0 8px 28px rgba(212,175,55,.4);
}
.cv-hero p { color: #c9a96a; }
.cv-card {
  background: linear-gradient(160deg, rgba(26,22,16,.85), rgba(14,12,10,.92));
  border: 1px solid rgba(212,175,55,.22);
  border-radius: 20px;
  backdrop-filter: blur(16px);
}
.cv-card h2 { color: #f3f4f6; }
.cv-input {
  background: rgba(10,10,12,.6);
  border: 1px solid rgba(212,175,55,.2);
  color: #f3f4f6;
}
.cv-input:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}
.gchar-card {
  background: rgba(255,255,255,.03);
  border: 1.5px solid rgba(212,175,55,.14);
}
.gchar-card:hover {
  border-color: rgba(212,175,55,.45);
  background: rgba(212,175,55,.07);
  transform: scale(1.045);
}
.gchar-card img { background: #14110d; }
.gchar-name { color: #f3f4f6; }
.gchar-card.selected {
  border-color: #d4af37;
  background: linear-gradient(160deg, rgba(212,175,55,.18), rgba(154,123,45,.08));
  box-shadow: 0 0 20px rgba(212,175,55,.3), inset 0 0 0 1px rgba(255,255,255,.06);
}
.gchar-check {
  background: linear-gradient(135deg, #f5d78e, #d4af37);
  color: #0a0a0c;
  box-shadow: 0 2px 8px rgba(212,175,55,.5);
}
.cv-selected { color: #c9a96a; }
.cv-create-btn {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  box-shadow: 0 6px 20px rgba(212,175,55,.4);
}
.cv-create-btn:hover { box-shadow: 0 8px 26px rgba(212,175,55,.55); }

/* 房间列表 / 弹层 */
#cv-room-list .room-item, #grp-rooms-list .room-item {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(212,175,55,.14);
}
#cv-room-list .room-item:hover, #grp-rooms-list .room-item:hover {
  border-color: rgba(212,175,55,.4);
  background: rgba(212,175,55,.08);
}
.ri-name { color: #f3f4f6; }
.ri-meta { color: #c9a96a; }
.ri-go { color: #e8c56b; }
#grp-rooms-list .room-item.current { border-color: rgba(212,175,55,.55); }
.grp-add-dialog {
  background: rgba(14,12,10,.96);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 24px;
  box-shadow: 0 -4px 40px rgba(212,175,55,.06), 0 24px 70px rgba(0,0,0,.5);
}
.grp-add-head h3 { color: #f3f4f6; }
.grp-add-close {
  border: 1px solid rgba(212,175,55,.2);
  background: rgba(212,175,55,.06);
  color: #c9a96a;
}
.grp-add-close:hover { background: rgba(212,175,55,.14); color: #f5d78e; }
.rooms-new-btn {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  box-shadow: 0 6px 20px rgba(212,175,55,.35);
}
.rooms-new-btn:hover { box-shadow: 0 8px 26px rgba(212,175,55,.5); }

/* 移动端侧边栏抽屉 */
@media (max-width: 768px) {
  #grp-sidebar {
    background: rgba(10,10,12,.96);
    box-shadow: 0 0 44px rgba(0,0,0,.45), 0 0 60px rgba(212,175,55,.06);
    border-right: 1px solid rgba(212,175,55,.2);
    border-radius: 0 24px 24px 0;
  }
}

/* ===== 10. 私信页（messages.html） ===== */
.tip-quick {
  border: 1px solid rgba(212,175,55,.25);
  background: rgba(212,175,55,.08);
  color: #e8c56b;
}
.tip-quick.active {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
#chat-view .input-wrap label,
#chat-view .input-wrap button {
  background: rgba(212,175,55,.08);
  color: #e8c56b;
}
#chat-view .input-wrap label:hover,
#chat-view .input-wrap button:hover { background: rgba(212,175,55,.16); color: #f5d78e; }
#chat-view .msg-bubble { color: #c9a96a; }

/* 未读数徽章等沿用状态色（success #3fb97a / danger #e05b5b） */

/* ===== 11. 聊天页优化 2026-08-17（按钮布局重构 / 对话设置 / 高峰提示 / 积分余额） ===== */

/* 输入区：作为对话设置面板的定位上下文 */
.input-bar { position: relative; }

/* 输入框左侧常用操作组（⚙️设置 🎤语音 🎨风格 🗑清空） */
.cmc-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cmc-toolbar-actions .mic-btn,
.cmc-toolbar-actions .header-action-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, .2);
  background: rgba(212, 175, 55, .06);
  color: #c9a96a;
  font-size: 16px;
}
.cmc-toolbar-actions .mic-btn:hover,
.cmc-toolbar-actions .header-action-btn:hover {
  background: rgba(212, 175, 55, .14);
  color: #f5d78e;
  border-color: rgba(212, 175, 55, .35);
}
.cmc-toolbar-actions .mic-btn:active,
.cmc-toolbar-actions .header-action-btn:active { transform: scale(.92); }
@media (max-width: 768px) {
  .cmc-toolbar-actions .mic-btn,
  .cmc-toolbar-actions .header-action-btn { width: 36px; height: 36px; font-size: 15px; }
}
@media (max-width: 390px) {
  .cmc-toolbar-actions .mic-btn,
  .cmc-toolbar-actions .header-action-btn { width: 32px; height: 32px; font-size: 14px; }
}

/* 高峰扣费提示条（北京时间9-12、14-18点显示，可关闭当日） */
.peak-hint-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #e8c56b;
  background: linear-gradient(90deg, rgba(212, 175, 55, .14), rgba(154, 123, 45, .08));
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: 10px;
}
.peak-hint-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: #c9a96a;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.peak-hint-close:hover { background: rgba(212, 175, 55, .18); color: #f5d78e; }

/* 对话设置面板（⚙️ 触发，悬浮输入区上方，不破坏聊天主流程） */
.gen-settings-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(320px, calc(100vw - 24px));
  z-index: 40;
  background: linear-gradient(160deg, rgba(26, 22, 16, .97), rgba(14, 12, 10, .98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, .28);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55), 0 0 24px rgba(212, 175, 55, .07);
  padding: 12px 14px;
}
.gsp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gsp-title { font-size: 14px; font-weight: 600; color: #f3f4f6; }
.gsp-close {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(212, 175, 55, .1);
  color: #c9a96a;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gsp-close:hover { background: rgba(212, 175, 55, .2); color: #f5d78e; }
.gsp-row { padding: 8px 0; border-top: 1px solid rgba(212, 175, 55, .1); }
.gsp-row:first-of-type { border-top: none; }
.gsp-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.gsp-label { font-size: 13px; color: #f3f4f6; }
.gsp-val { font-size: 13px; color: #e8c56b; font-weight: 600; }
.gsp-hint { font-size: 11px; color: #8a7a52; line-height: 1.5; margin-top: 6px; }
#temp-range { width: 100%; accent-color: #d4af37; cursor: pointer; }
.gsp-seg { display: flex; gap: 6px; }
.gsp-seg button {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, .2);
  background: rgba(212, 175, 55, .06);
  color: #c9a96a;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.gsp-seg button:hover { border-color: rgba(212, 175, 55, .4); color: #f5d78e; }
.gsp-seg button.active {
  background: linear-gradient(135deg, #f5d78e 0%, #d4af37 45%, #9a7b2d 100%);
  color: #0a0a0c;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(212, 175, 55, .3);
}

/* 积分余额芯片（输入区辅助行） */
.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(212, 175, 55, .1);
  border: 1px solid rgba(212, 175, 55, .22);
  color: #e8c56b;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.credit-chip:hover { background: rgba(212, 175, 55, .18); color: #f5d78e; }
.credit-chip.low { color: #f5d78e; background: rgba(224, 91, 91, .14); border-color: rgba(224, 91, 91, .35); }
.credit-chip b { color: inherit; }

/* 积分不足弹窗：去打卡/去充值（.fx-btn 用于 a 标签时的展示修正） */
.fx-dialog-actions a.fx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* ===== GM 修复 2026-08-13：聊天记录页空状态（纯 CSS :empty，零 JS 改动） ===== */
/* 游客或暂无记录时 history-list 为空，原样是纯黑空页，补黑金空状态提示 */
#history-list:empty::before {
  content: '✦';
  display: block;
  text-align: center;
  font-size: 40px;
  color: #d4af37;
  margin: 64px 0 14px;
  opacity: .75;
  text-shadow: 0 0 18px rgba(212,175,55,.5);
}
#history-list:empty::after {
  content: '还没有聊天记录\A 去首页挑一个喜欢的角色，开始第一场对话吧';
  white-space: pre-line;
  display: block;
  text-align: center;
  color: #c9a96a;
  font-size: 14px;
  line-height: 2;
  padding: 0 16px 70px;
}
