/* =========================================================
   局域网聊天室 — 界面样式
   默认浅色，[data-theme="dark"] 切换暗色；两套共用同一组变量
   ========================================================= */

:root {
  --bg: #eef1f7;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f5fb;
  --line: #e3e8f2;
  --line-strong: #d3dbe9;
  --text: #171a22;
  --text-dim: #6d7688;
  --text-faint: #98a1b3;
  --brand: #4f7cff;
  --brand-2: #8b5cf6;
  --brand-soft: rgba(79, 124, 255, .1);
  --accent: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .14);
  --bubble-other: #ffffff;
  --bubble-mine: linear-gradient(135deg, #4f7cff, #7c5cff);
}

html[data-theme="dark"] {
  --bg: #0c0f15;
  --bg-soft: #12161f;
  --panel: #171c27;
  --panel-2: #1f2532;
  --line: #262d3b;
  --line-strong: #333c4d;
  --text: #e8ecf6;
  --text-dim: #98a3b8;
  --text-faint: #6d7789;
  --brand: #6b8dff;
  --brand-2: #a78bfa;
  --brand-soft: rgba(107, 141, 255, .16);
  --accent: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .38);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, .55);
  --bubble-other: #1f2532;
  --bubble-mine: linear-gradient(135deg, #4f6fe0, #7b57e8);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

body { transition: background .25s ease, color .25s ease; }

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

/* ---------------- 登录 / 注册 ---------------- */

.auth-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(760px 460px at 14% 4%, rgba(79, 124, 255, .20), transparent 62%),
    radial-gradient(680px 500px at 88% 96%, rgba(139, 92, 246, .20), transparent 62%),
    radial-gradient(520px 380px at 78% 8%, rgba(16, 185, 129, .10), transparent 60%),
    var(--bg);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 412px;
  background: var(--panel);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 28px 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px) saturate(1.2);
}

.brand { text-align: center; margin-bottom: 24px; }

.brand-logo {
  width: 60px; height: 60px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 27px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 28px rgba(79, 124, 255, .36);
  letter-spacing: 1px;
}

.brand h1 { margin: 0; font-size: 22px; letter-spacing: .3px; }
.brand-sub { margin: 7px 0 0; font-size: 13px; color: var(--text-dim); }

.tabs {
  display: flex;
  background: var(--panel-2);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  padding: 10px;
  border-radius: 11px;
  font-size: 14px;
  transition: .18s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.auth-form { display: flex; flex-direction: column; gap: 15px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-family: inherit;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.btn-primary {
  border: 0;
  border-radius: 13px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(79, 124, 255, .28);
  transition: transform .12s, filter .16s, box-shadow .16s;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 12px 28px rgba(79, 124, 255, .34); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

.form-msg { min-height: 17px; font-size: 12.5px; color: var(--danger); }
.form-msg.ok { color: var(--accent); }

.auth-tip {
  margin: 18px 0 0;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.65;
}

/* 头像选择器 */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; }

.avatar-opt {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background: var(--panel-2);
  overflow: hidden;
  transition: .16s;
  position: relative;
}
.avatar-opt img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-opt:hover { transform: translateY(-2px); }
.avatar-opt.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------------- 聊天布局 ---------------- */

.chat-screen {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 10px;
  overflow: hidden;
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 4px; }
.side-title { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.sidebar-head .icon-btn { display: none; }

.me-card {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  flex: 0 0 auto;
}
.avatar-lg { width: 42px; height: 42px; }
.avatar-xl { width: 68px; height: 68px; }
.avatar-sm { width: 34px; height: 34px; }

.me-info { min-width: 0; }
.me-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub {
  font-size: 11.5px;
  color: var(--accent);
  margin-top: 3px;
  display: flex; align-items: center; gap: 5px;
}
.me-sub::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.side-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  transition: .15s;
}
.side-item:hover { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.side-item.logout { margin-top: auto; color: var(--danger); }
.side-item.logout:hover { background: var(--panel); background: color-mix(in srgb, var(--danger) 10%, transparent); }

.side-section-title {
  font-size: 12px;
  color: var(--text-faint);
  padding: 8px 6px 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .4px;
}
.side-section-title .count {
  background: var(--panel-2);
  color: var(--text-dim);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
}

.user-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 11px;
  position: relative;
  transition: background .15s;
}
.user-row:hover { background: var(--panel); }
.user-row .u-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .u-tag { font-size: 10px; color: var(--warn); margin-left: 4px; }
.user-row .dot {
  position: absolute;
  left: 34px;
  bottom: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  border: 2px solid var(--bg-soft);
}
.user-row .dot.on { background: var(--accent); }

/* ---------------- 主聊天区 ---------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 80% -12%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 62%),
    var(--bg);
}

.chat-header {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  background: color-mix(in srgb, var(--bg-soft) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  z-index: 5;
}
.chat-title { font-size: 15.5px; font-weight: 700; letter-spacing: .2px; }
.chat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 11px;
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  width: 34px; height: 34px;
  border-radius: 10px;
  font-size: 15px;
  display: grid; place-items: center;
  transition: .15s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.icon-btn.round {
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 17px;
  width: 38px; height: 38px;
  box-shadow: var(--shadow-sm);
}
.icon-btn.round:hover { border-color: var(--brand); }
.only-mobile { display: none; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
/* 大屏把消息收成一条阅读列，避免一行拉得太长 */
@media (min-width: 900px) {
  .messages > * { width: 100%; max-width: 880px; margin-left: auto; margin-right: auto; }
}

.empty-state { margin: auto; text-align: center; color: var(--text-faint); }
.empty-emoji { font-size: 48px; margin-bottom: 12px; opacity: .8; }

.msg { display: flex; gap: 11px; max-width: 100%; align-items: flex-start; }
.msg .msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--panel-2);
  box-shadow: var(--shadow-sm);
}
.msg-body { min-width: 0; max-width: min(620px, 78%); }

.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; padding: 0 3px; }
.msg-name { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.msg-time { font-size: 10.5px; color: var(--text-faint); }
.msg-admin {
  font-size: 10px;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
  padding: 1px 7px;
  border-radius: 20px;
}

.bubble {
  background: var(--bubble-other);
  border: 1px solid var(--line);
  border-radius: 5px 18px 18px 18px;
  padding: 10px 14px;
  font-size: 14.5px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}

.bubble img {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 12px;
  margin-top: 7px;
  cursor: zoom-in;
  object-fit: cover;
}
.bubble .text + img { margin-top: 9px; }

.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-meta { justify-content: flex-end; }
.msg.mine .bubble {
  background: var(--bubble-mine);
  border-color: transparent;
  color: #fff;
  border-radius: 18px 5px 18px 18px;
  box-shadow: 0 8px 20px rgba(79, 124, 255, .26);
}

.msg-del {
  border: 0; background: transparent; color: var(--text-faint);
  font-size: 11px; padding: 0 4px; opacity: 0; transition: .15s;
}
.msg:hover .msg-del { opacity: 1; }
.msg-del:hover { color: var(--danger); }

/* 输入区 */
.composer {
  flex: 0 0 auto;
  padding: 10px 20px 18px;
  background: transparent;
}

.pending-image {
  position: relative;
  width: fit-content;
  margin-bottom: 10px;
}
.pending-image img {
  max-height: 110px;
  max-width: 180px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  box-shadow: var(--shadow-md);
}
.remove-img {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 9px 8px 10px;
  box-shadow: var(--shadow-md);
  transition: border-color .16s, box-shadow .16s;
  max-width: 880px;
  margin: 0 auto;
}
.composer-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-md);
}
.composer textarea {
  resize: none;
  max-height: 130px;
  line-height: 1.5;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  font-size: 14.5px;
  box-shadow: none;
}
.composer textarea:focus { box-shadow: none; background: transparent; }

.btn-send {
  border: 0;
  border-radius: 14px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  transition: .15s;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(79, 124, 255, .3);
}
.btn-send:hover { filter: brightness(1.06); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(10, 14, 22, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(6px);
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.modal-card.wide { max-width: 720px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head h2 { margin: 0; font-size: 16px; }

.modal-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }

.setting-block { display: flex; flex-direction: column; gap: 10px; }
.setting-label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }

.avatar-row { display: flex; align-items: center; gap: 14px; }

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 13px;
  transition: .15s;
  flex: 0 0 auto;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; }

.hint { font-size: 11.5px; color: var(--text-faint); min-height: 15px; }
.hint.err { color: var(--danger); }
.hint.ok { color: var(--accent); }

/* 管理后台 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--brand); }
.stat-label { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

.admin-section-title { font-size: 13px; font-weight: 600; color: var(--text-dim); }

.admin-users { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
}
.admin-user-row .au-info { flex: 1; min-width: 0; }
.admin-user-row .au-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-user-row .au-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.pill { font-size: 10px; padding: 1px 8px; border-radius: 20px; }
.pill.online { background: var(--panel-2); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill.offline { background: var(--panel-2); color: var(--text-faint); }
.pill.banned { background: var(--panel-2); background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.pill.muted { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.admin { background: var(--panel-2); background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand); }

.mini-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 11.5px;
  transition: .15s;
}
.mini-btn:hover { color: var(--text); border-color: var(--brand); }
.mini-btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.admin-messages { display: flex; flex-direction: column; gap: 7px; }
.admin-msg-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
}
.admin-msg-row .am-main { flex: 1; min-width: 0; }
.admin-msg-row .am-name { font-size: 12px; color: var(--brand); }
.admin-msg-row .am-text { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 图片查看 */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(6, 8, 14, .92);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 13px;
  font-size: 13.5px;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease;
}
.toast.err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-faint) 35%, transparent);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-faint) 55%, transparent); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 移动端 ---------------- */
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    width: 80%;
    max-width: 300px;
    box-shadow: 24px 0 60px rgba(0, 0, 0, .28);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-head .icon-btn { display: grid; }
  .only-mobile { display: grid; }

  .mobile-mask {
    position: fixed; inset: 0;
    background: rgba(8, 11, 18, .45);
    z-index: 55;
    display: none;
    backdrop-filter: blur(2px);
  }
  .mobile-mask.show { display: block; }

  .msg-body { max-width: 82%; }
  .bubble { font-size: 14.5px; }
  .bubble img { max-width: 200px; max-height: 200px; }
  .auth-card { padding: 26px 20px 20px; border-radius: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .composer { padding: 8px 12px 14px; }
  .composer-row { border-radius: 18px; padding: 7px 8px; }
  .messages { padding: 14px 12px 6px; gap: 14px; }
  .chat-header { padding: 0 12px; height: 58px; flex: 0 0 58px; }
  .chat-sub { padding: 3px 9px; font-size: 11.5px; }
  .btn-send { padding: 9px 16px; }
}

/* =========================================================
   v4 新增：会话列表（公共 / 好友 / 群聊）、选择器、后台分页
   ========================================================= */

/* 侧边栏变成纵向滚动容器，三块列表各自限高 */
.sidebar { overflow-y: auto; gap: 6px; }
.sidebar::-webkit-scrollbar { width: 6px; }

.side-item { flex: 0 0 auto; }
.side-item.logout { margin-top: 6px; }

.side-section-first { padding-top: 2px; }

.side-section-title .mini-add {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: .15s;
}
.side-section-title .mini-add:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
}

.user-list { flex: 0 0 auto; max-height: 208px; overflow-y: auto; }

.side-empty {
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 8px 10px;
  line-height: 1.6;
}

/* 会话行：整行可点，选中用品牌渐变 */
.room-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13.5px;
  text-align: left;
  transition: .15s;
}
.room-item:hover { background: var(--panel); box-shadow: var(--shadow-sm); }
.room-item.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 30%, transparent);
}
.room-item.active .u-count { background: rgba(255, 255, 255, .24); color: #fff; }
.room-item.active .group-badge { background: rgba(255, 255, 255, .22); color: #fff; }
.room-item .room-ico { font-size: 14px; }
.room-item .u-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .u-count {
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--panel-2);
  border-radius: 20px;
  padding: 1px 7px;
}
.room-item .dot {
  position: static;
  left: auto;
  bottom: auto;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border: 0;
}

.group-badge {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
}

/* 选择器列表（加好友、建群、群成员） */
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 13.5px;
}
.picker-row .picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row .picker-tag { font-size: 10.5px; color: var(--text-faint); }
.picker-check { cursor: pointer; }
.picker-check input { width: 16px; height: 16px; accent-color: var(--brand); flex: 0 0 auto; }
.mini-btn.primary { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.mini-btn:disabled { opacity: .55; cursor: default; }

/* 后台分段切换 */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  align-self: flex-start;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 9px;
  transition: .15s;
}
.seg-btn.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

.admin-users { display: flex; flex-direction: column; gap: 8px; max-height: 450px; overflow-y: auto; }
.admin-user-row .au-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 58%; }
.stat-card .stat-num { font-size: 20px; }

.admin-groups { display: flex; flex-direction: column; gap: 8px; max-height: 430px; overflow-y: auto; }
.admin-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  transition: .15s;
}
.admin-group-row:hover { border-color: var(--brand); }
.admin-group-row .au-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-group-row .au-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-group-row .au-sub { font-size: 11px; color: var(--text-dim); }

.admin-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-group-name { font-size: 13.5px; font-weight: 600; }
.admin-group-view .admin-messages { max-height: 430px; overflow-y: auto; }
.admin-msg-row { align-items: flex-start; }
.admin-msg-row .am-text { white-space: normal; word-break: break-word; }

/* =========================================================
   v5 新增：@艾特 与 引用
   ========================================================= */

.composer { position: relative; }

/* 输入 @ 时弹出的候选面板 */
.mention-menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% - 2px);
  width: min(320px, calc(100% - 40px));
  max-height: 262px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 13.5px;
  text-align: left;
}
.mention-item.active, .mention-item:hover { background: var(--brand-soft); }
.mention-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 正文里的 @名字 */
.bubble .mention {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-radius: 6px;
  padding: 0 3px;
  font-weight: 600;
}
.msg.mine .bubble .mention { color: #fff; background: rgba(255, 255, 255, .22); }

/* 引用块 */
.quoted {
  display: block;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 8px;
  padding: 5px 9px;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  max-width: 100%;
  transition: .15s;
}
.quoted:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.quoted-name { display: block; font-size: 11.5px; font-weight: 600; color: var(--brand); margin-bottom: 1px; }
.quoted-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.mine .quoted {
  border-left-color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .92);
}
.msg.mine .quoted-name { color: #fff; }

/* 消息上的「引用」按钮 */
.msg-act {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 11px;
  padding: 0 4px;
  line-height: 1.2;
  align-self: center;
  opacity: 0;
  transition: .15s;
}
.msg:hover .msg-act { opacity: 1; }
.msg-act:hover { color: var(--brand); }
.msg-del { align-self: center; line-height: 1.2; }

/* 「@了我」的标记 */
.at-badge {
  font-size: 10px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
  padding: 1px 7px;
  border-radius: 20px;
  align-self: center;
}
.msg.at-me .bubble { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }

/* 点击引用后原消息闪一下 */
.msg.flash .bubble {
  animation: bubbleFlash 1.1s ease;
}
@keyframes bubbleFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  40% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 0%, transparent); }
  100% { box-shadow: var(--shadow-sm); }
}

/* 输入区上方的引用条 */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto 8px;
  padding: 8px 10px 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.reply-bar-main { flex: 1; min-width: 0; }
.reply-bar-name { font-size: 11.5px; font-weight: 600; color: var(--brand); }
.reply-bar-text {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ==================== v6：积分 / 红包 / 转账 / 接龙 / 公告 / 备注 ==================== */

/* 侧边栏积分 */
.me-points {
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: 20px;
  padding: 2px 9px;
  display: inline-block;
}

/* 顶部公告条 */
.announce-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 18px 8px;
  padding: 7px 10px 7px 12px;
  background: color-mix(in srgb, var(--warn) 9%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.announce-tag {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--warn);
  border-radius: 6px;
  padding: 1px 6px;
}
.announce-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announce-more {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
}
.announce-more:hover { background: var(--brand-soft); }
.announce-view {
  font-size: 13.5px;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  white-space: pre-wrap;
  line-height: 1.65;
}
.announce-view:empty { display: none; }
.announce-body { margin-bottom: 6px; }

/* 卡片型气泡：去掉外层气泡背景，交给卡片自己画 */
.msg .bubble.bubble-card {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  color: var(--text);
  white-space: normal;
}

/* 红包卡片 */
.rp-card {
  width: 250px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #ff7a59, #f0482f 62%, #d63a24);
  color: #fff;
  box-shadow: 0 8px 22px rgba(214, 58, 36, .28);
}
.rp-head { display: flex; gap: 10px; padding: 12px 13px 10px; align-items: flex-start; }
.rp-ico { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); }
.rp-info { min-width: 0; }
.rp-note {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-word;
}
.rp-sub { font-size: 11.5px; opacity: .88; }
.rp-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px 12px;
}
.rp-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #d63a24;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.rp-btn:hover { background: #fff4f1; }
.rp-btn:disabled { opacity: .7; }
.rp-state {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .16);
  border-radius: 20px;
  padding: 4px 12px;
}
.rp-state.ok { background: rgba(255, 255, 255, .26); }

/* 转账卡片 */
.transfer-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 230px;
  padding: 12px 13px;
  border-radius: 14px;
  background: linear-gradient(140deg, #ffb03a, #f59300);
  color: #fff;
  box-shadow: 0 8px 20px rgba(245, 147, 0, .26);
}
.transfer-ico {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  font-size: 19px;
}
.transfer-main { min-width: 0; }
.transfer-amount { font-size: 16px; font-weight: 700; }
.transfer-sub { font-size: 11.5px; opacity: .9; }

/* 接龙卡片 */
.chain-card {
  width: 260px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 11px 12px 12px;
  box-shadow: var(--shadow-sm);
}
.chain-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  word-break: break-word;
}
.chain-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  max-height: 168px;
  overflow-y: auto;
  font-size: 12.5px;
  color: var(--text);
}
.chain-list li {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}
.chain-list li:last-child { border-bottom: 0; }
.chain-idx { color: var(--brand); font-weight: 700; min-width: 18px; }
.chain-empty { color: var(--text-faint); border-bottom: 0 !important; }
.chain-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
}
.chain-btn:hover { filter: brightness(1.06); }
.chain-btn:disabled { opacity: .65; }
.chain-joined {
  text-align: center;
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 10px;
  padding: 7px 0;
  font-weight: 600;
}

@media (max-width: 720px) {
  .rp-card, .transfer-card, .chain-card { width: min(250px, 62vw); }
  .announce-bar { margin: 0 10px 8px; }
}

/* ==================== v8：微信风格 UI + 「＋」功能面板 ==================== */

/* 浅色：微信配色 */
:root {
  --bg: #ededed;
  --bg-soft: #f7f7f7;
  --panel: #ffffff;
  --line: #e5e5e5;
  --line-strong: #d8d8d8;
  --text: #191919;
  --text-dim: #7a7a7a;
  --text-faint: #a3a3a3;
  --brand: #07c160;
  --brand-soft: rgba(7, 193, 96, .1);
  --accent: #07c160;
  --bubble-other: #ffffff;
  --bubble-mine: #95ec69;
  --radius: 8px;
  --shadow-sm: none;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .06);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .12);
}

/* 暗色：微信夜间 */
html[data-theme="dark"] {
  --bg: #111214;
  --bg-soft: #17181b;
  --panel: #1b1c1f;
  --line: #2a2c30;
  --line-strong: #36383d;
  --text: #e6e6e6;
  --text-dim: #9a9a9a;
  --text-faint: #6f6f6f;
  --brand: #3ecf8e;
  --brand-soft: rgba(62, 207, 142, .14);
  --bubble-other: #26272b;
  --bubble-mine: #2f7a50;
}

/* 顶栏 / 侧边栏 / 聊天区 */
.chat-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.chat-title { font-size: 15px; font-weight: 600; }
.chat-sub { color: var(--text-faint); font-size: 11.5px; }
.sidebar { background: var(--bg-soft); border-right: 1px solid var(--line); }
.main { background: var(--bg); }
.messages { background: var(--bg); padding: 18px 20px 12px; }

/* 气泡：无边框、无阴影、小圆角 */
.bubble {
  background: var(--bubble-other);
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  box-shadow: none;
  color: var(--text);
  font-size: 14.5px;
}
.msg.mine .bubble {
  background: var(--bubble-mine);
  color: #191919;
  border-radius: 6px;
  box-shadow: none;
}
html[data-theme="dark"] .msg.mine .bubble { color: #eaf7ef; }

/* 头像：微信是小圆角方块 */
.msg .msg-avatar {
  width: 38px; height: 38px;
  border-radius: 6px;
  box-shadow: none;
}

/* 名字与时间更淡 */
.msg-meta { margin-bottom: 4px; }
.msg-name { color: var(--text-faint); font-weight: 500; }
.msg-time { color: var(--text-faint); opacity: .8; }

/* 引用块与 @ 在绿色气泡里换配色 */
.msg.mine .quoted {
  background: rgba(0, 0, 0, .06);
  border-left-color: rgba(0, 0, 0, .18);
  color: #3d3d3d;
}
.msg.mine .quoted-name { color: #2b7a4b; }
html[data-theme="dark"] .msg.mine .quoted {
  background: rgba(255, 255, 255, .14);
  border-left-color: rgba(255, 255, 255, .4);
  color: rgba(255, 255, 255, .9);
}
html[data-theme="dark"] .msg.mine .quoted-name { color: #fff; }
.msg.mine .bubble .mention {
  color: #0a7a3d;
  background: rgba(0, 0, 0, .08);
}
html[data-theme="dark"] .msg.mine .bubble .mention {
  color: #eafff3;
  background: rgba(255, 255, 255, .2);
}

/* 输入区：整条白色，像微信 */
.composer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 9px 16px 14px;
}
.composer-row {
  max-width: 100%;
  gap: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
#msgInput {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 4px;
  font-size: 14.5px;
}
#msgInput:focus { outline: none; box-shadow: none; border: 0; }
.btn-send {
  background: #07c160;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: none;
}
.btn-send:hover { background: #06ad56; }
.btn-send:disabled { background: #b9e6cc; color: #fff; }
.icon-btn.round {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 19px;
  color: var(--text-dim);
}
.icon-btn.round:hover { background: var(--bg); box-shadow: none; }
#plusBtn { font-size: 22px; line-height: 1; }
#plusBtn.active { background: var(--bg); }

/* 「＋」面板 */
.plus-panel {
  max-width: 100%;
  margin-top: 10px;
  padding: 14px 6px 10px;
  background: var(--bg-soft);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 2px;
  animation: plusIn .16s ease;
}
@keyframes plusIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.plus-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  border-radius: 8px;
}
.plus-item:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.plus-ico {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.plus-label { font-size: 11.5px; color: var(--text-dim); }
.plus-tip {
  grid-column: 1 / -1;
  padding: 6px 10px 0;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* 群公告条、积分、卡片保持原样，只微调圆角 */
.announce-bar { border-radius: 6px; }
.rp-card, .transfer-card, .chain-card { border-radius: 8px; }

/* ==================== v9：顶栏文字按钮 + 公共聊天室红包 ==================== */

.hdr-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-dim);
  border-radius: 5px;
  font-size: 12.5px;
  line-height: 28px;
  transition: .15s;
}
.hdr-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
#leaveGroupBtn:hover { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* 弹窗里的「转给谁」下拉 */
#transferTo {
  width: 100%;
  margin-bottom: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
}

/* 选中会话：微信式浅灰底，不用紫色渐变 */
.room-item.active {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
}
.room-item.active .u-count { background: rgba(0, 0, 0, .08); color: var(--text-dim); }
.room-item.active .group-badge { background: var(--brand); color: #fff; }
html[data-theme="dark"] .room-item.active { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .room-item.active .u-count { background: rgba(255, 255, 255, .14); color: var(--text-dim); }

/* 侧边「全部用户」入口 */
#openUsers {
  display: flex;
  align-items: center;
  gap: 7px;
}
#openUsers .count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
  background: color-mix(in srgb, var(--text) 7%, transparent);
  border-radius: 20px;
  padding: 1px 8px;
}
#allUserList .picker-name { display: flex; align-items: center; gap: 6px; }
#allUserList .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
#allUserList .dot.on { background: #07c160; }

/* v14 管理后台群聊提示 */
.admin-hint {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 2px 8px;
  line-height: 1.6;
}

/* ============ v15 微信式引用 + 气泡菜单 ============ */
.quoted {
  border-left: 0;
  background: rgba(0, 0, 0, .055);
  border-radius: 4px;
  padding: 4px 8px 5px;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: #7f7f7f;
  line-height: 1.45;
  max-width: 100%;
}
.quoted:hover { background: rgba(0, 0, 0, .09); }
.quoted-name { display: inline; font-size: 12.5px; font-weight: 400; color: #7f7f7f; margin: 0; }
.quoted-name::after { content: "："; }
.quoted-text { display: inline; color: #9a9a9a; }
.msg.mine .quoted { background: rgba(0, 0, 0, .06); color: #6f6f6f; }
.msg.mine .quoted-name { color: #6f6f6f; }
.msg.mine .quoted-text { color: #8d8d8d; }
[data-theme="dark"] .quoted { background: rgba(255, 255, 255, .09); }
[data-theme="dark"] .quoted-name,
[data-theme="dark"] .quoted-text { color: #b6b6b6; }
.msg.mine .bubble .quoted { background: rgba(0, 0, 0, .07); }

/* 气泡操作菜单 */
.msg-menu {
  position: fixed;
  z-index: 80;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  padding: 4px;
  min-width: 104px;
  display: flex;
  flex-direction: column;
}
.msg-menu.hidden { display: none; }
.msg-menu-item {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.msg-menu-item:hover { background: rgba(0, 0, 0, .06); }
[data-theme="dark"] .msg-menu-item:hover { background: rgba(255, 255, 255, .1); }
.msg-menu-item.danger { color: #e64340; }
.msg-menu-item.danger:hover { background: rgba(230, 67, 64, .1); }

/* 输入框上方的引用条（微信绿边灰底） */
.reply-bar {
  border-left: 3px solid var(--brand);
  background: rgba(0, 0, 0, .04);
  border-radius: 4px;
}
[data-theme="dark"] .reply-bar { background: rgba(255, 255, 255, .07); }
.quoted { white-space: normal; }

/* v15.1 引用块收紧成一行（微信样式） */
.quoted {
  display: flex;
  align-items: baseline;
  gap: 0;
  white-space: normal;
  max-width: 100%;
}
.quoted-name {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quoted-text {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg.mine .quoted { background: rgba(0, 0, 0, .07); }
.msg.mine .quoted-name { color: #5d6b57; }
.msg.mine .quoted-text { color: #6f7d69; }
.msg.mine .msg-name { display: none; }

/* ============ v17 管理员隐身查看群聊 ============ */
.shadow-bar {
  padding: 8px 16px;
  font-size: 12.5px;
  color: #8a6d3b;
  background: #fff8e6;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  line-height: 1.4;
}
[data-theme="dark"] .shadow-bar { background: rgba(255, 200, 80, .12); color: #e2c27c; }
.admin-group-head { display: flex; align-items: center; gap: 8px; }
.admin-group-head .admin-group-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.mini-btn.primary:hover { filter: brightness(.95); }
#msgInput:disabled { background: #f5f5f5; color: #9a9a9a; cursor: not-allowed; }
[data-theme="dark"] #msgInput:disabled { background: rgba(255, 255, 255, .05); }
.ghost-disabled { opacity: .55; cursor: not-allowed; }
