/* ============================================================
   消息（微信式 IM 触达端）
   皮肤 = 晨光蓝设计系统（CSS 变量、毛玻璃、Noto Sans SC）；
   交互与信息密度 = 微信（密集列表行、气泡、按住说话）。
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand: #2563b0;
  --brand-deep: #1a3a6b;
  --brand-mid: #4a8fd4;
  --brand-light: #d4e8f8;
  --bg-mist: #f0f5fa;
  --text: #1a3a6b;
  --text-soft: #4a5a7a;
  --text-muted: #6b7a95;
  --accent-amber: #b8700f;
  --accent-green: #0f7b5f;
  --accent-purple: #7c5cbf;
  --accent-red: #c0392b;
  --border-subtle: rgba(37, 99, 176, 0.08);
  --border-default: rgba(37, 99, 176, 0.12);
  --border-emphasis: rgba(37, 99, 176, 0.3);
  --shadow-card: 0 6px 32px rgba(37,99,176,0.08), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-emphasis: 0 10px 40px rgba(37,99,176,0.15), 0 2px 6px rgba(0,0,0,0.04);
  --row-h: 64px;
}

html, body {
  height: 100%;
  background: var(--bg-mist);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ---- 整体布局：≥900px 双栏，<900px 单栏滑转 ---- */
.app {
  display: flex;
  height: 100dvh;
  max-width: 1280px;
  margin: 0 auto;
  background: linear-gradient(135deg, #e4eef8 0%, #eef3f9 55%, #e8edf6 100%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* ================= 左栏 ================= */
.side {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}
.side-head {
  padding: calc(12px + env(safe-area-inset-top)) 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.side-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 2px 10px;
}
.side-brand .name {
  font-size: 17px;
  font-weight: 900;
  color: var(--brand-deep);
  letter-spacing: -0.3px;
}
.side-brand .kicker {
  font-family: 'Playfair Display', serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--brand);
  text-transform: uppercase;
  opacity: 0.8;
}
.tabs { display: flex; }
.tab {
  flex: 1;
  padding: 9px 0 11px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.tab.on { color: var(--brand-deep); font-weight: 700; }
.tab.on::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-mid) 100%);
}
.tab .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-red);
  margin-left: 4px;
  vertical-align: 8px;
}

.search-row { padding: 10px 12px 8px; }
.search-row input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}
.search-row input:focus { outline: 0; border-color: var(--brand-mid); }
.search-row input::placeholder { color: var(--text-muted); }

.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ---- 会话行（微信式密集行）---- */
.conv-row {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--row-h);
  padding: 0 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}
.conv-row:hover { background: rgba(37, 99, 176, 0.05); }
.conv-row.on { background: rgba(37, 99, 176, 0.1); }
.conv-row.pinned { background: rgba(37, 99, 176, 0.04); }
.avatar {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  position: relative;
  user-select: none;
}
.avatar .badge-unread {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.9);
}
.conv-main { flex: 1; min-width: 0; }
.conv-line1 { display: flex; align-items: baseline; gap: 8px; }
.conv-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-time {
  flex: 0 0 auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
}
.conv-preview {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 改动三：会话列表行同步「对方正在输入/讲话…」 */
.conv-preview.typing { color: var(--accent-green); }

/* ---- 通讯录 ---- */
.group-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand);
  background: rgba(232, 240, 249, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-subtle);
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 0 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}
.contact-row:hover { background: rgba(37, 99, 176, 0.05); }
.contact-row .avatar { flex: 0 0 36px; width: 36px; height: 36px; font-size: 15px; border-radius: 9px; }
.contact-main { flex: 1; min-width: 0; }
.contact-name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--brand-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.contact-flag {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}
.flag-gold { background: rgba(184, 112, 15, 0.1); color: var(--accent-amber); }
.flag-green { background: rgba(15, 123, 95, 0.1); color: var(--accent-green); }
.flag-amber { background: rgba(184, 112, 15, 0.12); color: var(--accent-amber); }
.flag-muted { background: rgba(107, 122, 149, 0.1); color: var(--text-muted); }

/* ================= 右栏 · 聊天窗 ================= */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: transparent;
}
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}
.chat-empty .logo { font-size: 42px; opacity: 0.5; }
.chat-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.back-btn {
  display: none;
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--brand);
  cursor: pointer;
  padding: 2px 8px 2px 0;
  line-height: 1;
}
.chat-title-wrap { flex: 1; min-width: 0; }
.chat-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sub .voice-label { color: var(--accent-green); }
/* 改动三：「对方正在输入/讲话…」状态（头部名字下方） */
.chat-sub.status { color: var(--accent-green); font-weight: 500; }
/* 改动一：自动朗读开关（头部小胶囊） */
.auto-speak {
  flex: 0 0 auto;
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-green);
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
}
.auto-speak:hover { background: rgba(37, 99, 176, 0.08); }
.auto-speak.off { color: var(--text-muted); opacity: 0.75; }
.icon-btn {
  flex: 0 0 auto;
  border: 0;
  background: none;
  font-size: 19px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.12s ease;
}
.icon-btn:hover { background: rgba(37, 99, 176, 0.08); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

/* 免责/边界提示条（名人卡顶部常驻） */
.notice {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--accent-amber);
  background: rgba(184, 112, 15, 0.07);
  border-bottom: 1px dashed rgba(184, 112, 15, 0.3);
}

/* ---- 消息区 ---- */
.msgs {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 10px;
}
.load-more {
  display: block;
  margin: 0 auto 12px;
  padding: 4px 14px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0;
  animation: msg-in 0.18s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.msg-row .avatar { flex: 0 0 36px; width: 36px; height: 36px; font-size: 15px; border-radius: 9px; }
.msg-row.me { flex-direction: row-reverse; }
.bubble-wrap { max-width: 72%; min-width: 0; display: flex; flex-direction: column; }
.msg-row.me .bubble-wrap { align-items: flex-end; }
.bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(37,99,176,0.06);
}
.msg-row.them .bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
  color: var(--text);
}
.msg-row.me .bubble {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  border-top-right-radius: 4px;
}
.bubble.thinking { color: var(--text-muted); font-style: italic; }
.msg-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.play-btn {
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 1px 7px;
  cursor: pointer;
  color: var(--brand);
}
.play-btn:disabled { opacity: 0.5; }
.msg-sys {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 10px 0;
}
.msg-time {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  margin: 14px 0 4px;
}

/* 语音条（阶段2） */
.voice-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 64px;
}
.voice-bubble .wave { font-size: 15px; }
.voice-bubble.playing .wave { animation: wave-pulse 1s infinite; }
@keyframes wave-pulse { 50% { opacity: 0.35; } }
.voice-dur { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.voice-transcript {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 100%;
  cursor: pointer;
}
.voice-transcript .t-body { display: none; padding-top: 2px; white-space: pre-wrap; }
.voice-transcript.open .t-body { display: block; }

/* 图片/文件消息（P3） */
.bubble.media-bubble {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.img-thumb {
  display: block;
  max-width: min(240px, 100%);
  max-height: 280px;
  min-width: 48px;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(37,99,176,0.08);
  cursor: zoom-in;
  background: rgba(255, 255, 255, 0.6);
}
.bubble.file-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 180px;
  max-width: 100%;
}
.msg-row.me .bubble.file-bubble {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-subtle);
  color: var(--text);
}
.file-icon { font-size: 26px; flex: 0 0 auto; }
.file-info { min-width: 0; }
.file-name {
  font-size: 13.5px;
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.media-hint {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
}
.msg-row.me .media-hint { text-align: right; }
/* 拖拽文件进聊天窗的落点提示 */
.chat-pane.droppable .msgs {
  outline: 2px dashed var(--brand-mid);
  outline-offset: -8px;
  border-radius: 12px;
}

/* ---- 输入栏 ---- */
.input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.input-bar input {
  flex: 1;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}
.input-bar input:focus { outline: 0; border-color: var(--brand-mid); }
.send-btn {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(37, 99, 176, 0.25);
}
.send-btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

/* 按住说话（阶段2）：切换后替换文本框 */
.hold-talk {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--brand-deep);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.hold-talk.rec {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
}
.hold-talk.cancel { background: var(--accent-red); border-color: transparent; color: #fff; }

/* ---- 弹层（边界阻断，皮肤同 plaza） ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(37, 99, 176, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.overlay.on { display: flex; }
.modal {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: var(--shadow-emphasis);
  max-width: 440px;
  width: 100%;
  padding: 28px 26px 22px;
}
.modal h3 { font-size: 19px; font-weight: 900; color: var(--brand-deep); margin-bottom: 10px; }
.modal p { font-size: 13.5px; color: var(--text-soft); line-height: 1.8; }
.modal .warn {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(184, 112, 15, 0.08);
  border: 1px solid rgba(184, 112, 15, 0.25);
  color: var(--accent-amber);
  font-size: 12.5px;
  line-height: 1.7;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
}
.btn-secondary {
  background: rgba(37, 99, 176, 0.08);
  color: var(--brand-deep);
  border: 1px solid rgba(37, 99, 176, 0.2);
}
.btn-amber {
  background: rgba(184, 112, 15, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(184, 112, 15, 0.35);
}

/* ---- 通话面板（阶段4） ---- */
.call-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(48px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #1a3a6b 0%, #2563b0 60%, #4a8fd4 100%);
  color: #fff;
}
.call-panel.on { display: flex; }
.call-top { text-align: center; }
.call-avatar {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.call-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.call-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  margin-top: 8px;
  opacity: 0.85;
}
.call-status {
  font-size: 13.5px;
  margin-top: 14px;
  min-height: 40px;
  opacity: 0.9;
  text-align: center;
  max-width: 520px;
  line-height: 1.7;
}
.call-status .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #7ef0c0;
  margin-right: 6px;
  vertical-align: middle;
  animation: wave-pulse 1.1s infinite;
}
.call-actions { display: flex; gap: 36px; align-items: center; }
.call-btn {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.call-btn:active { transform: scale(0.94); }
.call-btn.mute { background: rgba(255, 255, 255, 0.18); color: #fff; }
.call-btn.mute.on { background: rgba(255, 255, 255, 0.85); color: var(--brand-deep); }
.call-btn.hangup { background: var(--accent-red); color: #fff; box-shadow: 0 8px 24px rgba(192,57,43,0.4); }
.call-btn-label {
  display: block;
  text-align: center;
  font-size: 11.5px;
  margin-top: 8px;
  opacity: 0.8;
}

/* ================= 响应式：<900px 单栏滑转 ================= */
@media (max-width: 899px) {
  .app { max-width: none; }
  .side { flex: 1 1 auto; width: 100%; border-right: 0; }
  .chat {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: linear-gradient(135deg, #e4eef8 0%, #eef3f9 55%, #e8edf6 100%);
    transform: translateX(100%);
    transition: transform 0.22s ease;
  }
  .app.show-chat .chat { transform: none; }
  .back-btn { display: block; }
  .bubble-wrap { max-width: 80%; }
}

/* ================================================================
   测试清零 + 日志导出 + 访客身份 + 管理员控制台
   ================================================================ */

/* ---- 左栏工具区（访客标签 / 全部清零 / 导出日志） ---- */
.side-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.4);
}
.visitor-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}
.tools-spacer { flex: 1; }
.tool-btn {
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-deep);
  font-size: 12px;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.tool-btn:hover { background: rgba(37, 99, 176, 0.08); }
.tool-btn.danger { color: var(--accent-red); border-color: rgba(192, 57, 43, 0.3); }
.tool-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- 聊天窗 ⋯ 菜单 ---- */
.chat-head { position: relative; }
.chat-menu {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: var(--shadow-emphasis);
  padding: 6px;
  min-width: 160px;
}
.chat-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
}
.chat-menu-item:hover { background: rgba(37, 99, 176, 0.08); }

/* ---- 起昵称弹层输入框 ---- */
.nick-input {
  width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
}
.nick-input:focus { border-color: var(--border-emphasis); }

/* ---- 通讯录锁徽标（🔒对外 / 🔓内部）与访客标注 ---- */
.contact-flag.flag-lock { color: var(--text-muted); background: rgba(107, 122, 149, 0.12); }
.contact-flag.flag-unlock { color: var(--accent-amber); background: rgba(184, 112, 15, 0.12); }
.conv-visitor {
  font-size: 11px;
  color: var(--accent-purple);
  background: rgba(124, 92, 191, 0.1);
  border-radius: 6px;
  padding: 0 6px;
  margin-left: 6px;
  white-space: nowrap;
}

/* ---- 管理员控制台浮窗（右下角，可收起；普通访客完全不渲染） ---- */
.admin-console {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 250px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-emphasis);
  border-radius: 12px;
  box-shadow: var(--shadow-emphasis);
  overflow: hidden;
  font-size: 12.5px;
}
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: linear-gradient(135deg, #1a3a6b, #2563b0);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
}
.admin-console.collapsed .admin-body { display: none; }
.admin-body { padding: 10px 12px; }
.admin-row { margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-row:last-child { margin-bottom: 0; }
.admin-id { color: var(--text-muted); }
.admin-switch { cursor: pointer; color: var(--text-soft); gap: 6px; flex-wrap: nowrap; }
.admin-switch input { accent-color: var(--brand); }
.admin-locks {
  display: block;
  border-top: 1px dashed var(--border-default);
  padding-top: 8px;
  color: var(--text-soft);
  line-height: 1.9;
}
.admin-locks .lock-line { display: flex; justify-content: space-between; gap: 8px; }
.admin-locks .lock-state { color: var(--text-muted); white-space: nowrap; }

@media (max-width: 900px) {
  .admin-console { right: 10px; bottom: 76px; width: 230px; }
}
