/* 官机控制台 —— 全站样式（自己的实现，不依赖原版资源） */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #185fa5;
  --brand-weak: #e6f1fb;
  --ok: #0f7b4f;
  --warn: #9a6b0f;
  --danger: #b3371f;
  --radius: 10px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}
button { font: inherit; cursor: pointer; }

/* ------------------------------ 通用 ------------------------------ */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #c6ccd6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #14588f; border-color: #14588f; }
.btn-ghost { background: transparent; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }

/* ------------------------------ 登录页 ------------------------------ */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(180deg, #eef4fa 0%, var(--bg) 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head h1 { font-size: 20px; font-weight: 600; }
.login-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fbfcfe;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); background: #fff; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row input { flex: 1; }
.field-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; }
.field-check .field-row { gap: 8px; padding: 9px 0; }
.field-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-hint { font-size: 12px; color: var(--muted); }
.mode-switch { flex-wrap: wrap; gap: 6px; }
.radio-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; cursor: pointer; background: #fbfcfe; }
.radio-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }
.radio-chip input { accent-color: var(--brand); }
.webhook-tip {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0dca8;
  color: #7a5b12;
  font-size: 12px;
  line-height: 1.7;
  word-break: break-all;
}
.webhook-tip[hidden] { display: none; }
.login-hint { font-size: 12px; color: var(--muted); min-height: 18px; margin: 10px 0 4px; text-align: center; }
.login-hint.is-error { color: var(--danger); }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.qr-panel { text-align: center; margin-top: 14px; }
.qr-panel img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-panel img.is-loading { visibility: hidden; }
.qr-tip { font-size: 12px; color: var(--muted); margin: 8px 0; }

/* ------------------------------ 聊天页 ------------------------------ */
.chat-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.side {
  width: 280px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; }
.bot-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.bot-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 16px;
  overflow: hidden;
}
.bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-name { font-weight: 600; font-size: 13px; }
.bot-status { font-size: 12px; }
.status-online { color: var(--ok); }
.status-connecting, .status-reconnecting { color: var(--warn); }
.status-offline { color: var(--muted); }
/* 会话搜索框 */
.side-search {
  position: relative;
  padding: 8px 10px 4px;
}
.side-search input {
  width: 100%;
  padding: 7px 26px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 12.5px;
  outline: none;
}
.side-search input:focus { border-color: var(--brand); background: var(--surface); }
.search-clear {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  border: none; background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}
.search-clear:hover { color: var(--text); }
.session-list { flex: 1; overflow-y: auto; padding: 6px; }
.session-group-title {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  padding: 9px 10px 5px;
  border: none; background: transparent;
  font-size: 11px; font-weight: 600;
  letter-spacing: .5px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.session-group-title:hover { color: var(--text); }
.group-caret { flex: none; width: 10px; font-size: 10px; }
.group-name { flex: 1; }
.group-count {
  font-weight: 400;
  color: var(--muted);
}
.group-unread {
  flex: none;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: #e24b4a; color: #fff;
  font-size: 10px; font-weight: 600;
  display: grid; place-items: center;
}
.session-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px;
  border: none; background: transparent;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
}
.session-item:hover { background: var(--bg); }
.session-item.is-active { background: var(--brand-weak); }
.session-item.is-pinned { background: rgba(47,128,237,.06); }
/* 会话真实头像：固定 34px，避免被图片原始宽度撑成横条 */
.session-icon-img {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
  position: relative;
}
.session-icon-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* 会话三点菜单按钮 */
.session-more {
  flex: none;
  border: none; background: transparent;
  color: var(--muted);
  font-size: 16px; line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  opacity: 0;
}
.session-item:hover .session-more, .session-item.is-active .session-more { opacity: 1; }
.session-more:hover { color: var(--brand); }
/* 弹出菜单 */
.session-menu {
  position: fixed;
  z-index: 50;
  min-width: 150px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.session-menu[hidden] { display: none; }
.session-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none; background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
}
.session-menu button:hover { background: var(--bg); }
.session-menu button.menu-danger { color: #e24b4a; }
/* 右键头像 @ 菜单 */
.at-menu {
  position: fixed;
  z-index: 50;
  min-width: 110px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.at-menu[hidden] { display: none; }
.at-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none; background: transparent;
  color: var(--brand);
  font-size: 13px;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
}
.at-menu button:hover { background: var(--brand-weak); }
.at-menu-title {
  max-width: 180px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.at-menu .menu-sep { height: 1px; margin: 3px 4px; background: var(--line); }
.at-menu button.menu-danger { color: #e24b4a; }
.at-menu button.menu-danger:hover { background: rgba(226, 75, 74, .08); }
/* 会话内系统提示条（禁言/踢人结果） */
.msg-system {
  align-self: center;
  margin: 6px auto;
  padding: 4px 12px;
  max-width: 80%;
  border-radius: 999px;
  background: var(--bg-soft, #eef1f5);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.msg-system.is-danger { color: #e24b4a; background: rgba(226, 75, 74, .08); }
.msg-avatar-at { cursor: pointer; }
.session-icon {
  flex: none;
  min-width: 34px;
  padding: 0 6px; height: 34px;
  border-radius: 8px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  display: grid; place-items: center;
}
.session-main { flex: 1; min-width: 0; }
.session-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-unread {
  flex: none;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e24b4a;
  color: #fff;
  font-size: 11px;
  display: grid; place-items: center;
}
.side-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.chat-head-main { flex: 1; min-width: 0; }
.chat-title {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-sub {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 手机端返回按钮：桌面隐藏 */
.m-back {
  display: none;
  flex: none;
  width: 32px; height: 32px;
  margin-left: -6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brand);
  font-size: 26px;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.m-back:active { background: var(--brand-weak); }
.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.empty-state {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}
.msg { max-width: 78%; display: flex; gap: 8px; align-items: flex-start; }
.msg-self { align-self: flex-end; flex-direction: row-reverse; }
.msg-other { align-self: flex-start; }
.msg-avatar {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f5;
}
.msg-avatar-ph {
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.msg-body { min-width: 0; max-width: 100%; }
.msg-self .msg-meta, .msg-self .msg-bubble { text-align: right; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.role-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 500;
  vertical-align: 1px;
}
.role-owner { color: #fff; background: #d98a00; }
.role-admin { color: #185fa5; background: var(--brand-weak); }
.role-full { color: #fff; background: #2f80ed; }
.role-tag.role-member { display: none; }
/* CMD 蓝字指令标签（本地预览） */
.msg-cmd {
  display: inline-block;
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.msg-self .msg-cmd { color: #fff; background: rgba(255,255,255,.2); }
/* 消息内引用块 */
.msg-quote {
  margin: -2px 0 6px;
  padding: 5px 8px;
  border-left: 3px solid var(--brand);
  background: rgba(127,127,127,.12);
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  text-align: left;
}
.msg-self .msg-quote { background: rgba(255,255,255,.18); color: rgba(255,255,255,.9); }
.quote-name { font-weight: 600; }
/* 引用回复按钮 */
.msg-quote-btn {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  border: none; background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.msg-quote-btn:hover { color: var(--brand); text-decoration: underline; }
.msg-self .msg-quote-btn { text-align: right; display: block; margin-left: auto; }
/* 撤回按钮与已撤回态 */
.msg-recall-btn {
  display: inline-block;
  margin-top: 3px; margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #e24b4a;
  background: transparent;
  color: #e24b4a;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
}
.msg-recall-btn:hover { background: #e24b4a; color: #fff; }
.msg-self .msg-recall-btn { text-align: right; }
.recalled-tag { color: #e24b4a; font-weight: 600; }
.msg-bubble.is-recalled {
  opacity: .5;
  filter: grayscale(1);
  text-decoration: line-through;
}
.msg-bubble {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}
.msg-other .msg-bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg-self .msg-bubble { background: var(--brand); color: #fff; border-top-right-radius: 4px; }

/* 官方消息内容渲染：表情 / @ / 图片 / 文件 / 链接 */
.msg-face { font-size: 1.35em; line-height: 1; vertical-align: -0.12em; }
.msg-at {
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 500;
}
.msg-self .msg-at { color: #fff; background: rgba(255,255,255,.22); }
.msg-bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.msg-image { margin: 4px 0; }
.msg-image img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f0f2f5;
}
.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 3px 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: rgba(127,127,127,.06);
}
.msg-file:hover { text-decoration: underline; }

/* ------------------------------ 发送区 ------------------------------ */
.composer-wrap {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 16px 12px;
}
.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.tool-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.tool-btn:hover { background: var(--bg); border-color: var(--line); color: var(--text); }
.tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.composer-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.composer-select {
  flex: none;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  font: inherit;
  font-size: 13px;
  max-width: 130px;
}
.composer-select:focus { outline: none; border-color: var(--brand); }
.composer-text, .url-input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fbfcfe;
}
.composer-text:focus, .url-input-wrap input:focus { outline: none; border-color: var(--brand); background: #fff; }
.url-input-wrap { flex: 1; min-width: 0; display: flex; }
.url-input-wrap[hidden] { display: none; }
.config-hint {
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--brand-weak);
  color: var(--brand);
  font-size: 12px;
}
.config-hint[hidden] { display: none; }

/* 引用回复条 */
.reply-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 4px;
  padding: 6px 10px;
  background: var(--brand-weak);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  font-size: 12px;
}
.reply-bar[hidden] { display: none; }
.reply-label { color: var(--brand); font-weight: 600; flex: none; }
.reply-text {
  flex: 1; min-width: 0;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-cancel {
  flex: none;
  border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.reply-cancel:hover { color: var(--text); }

/* 表情弹层 */
.popover {
  position: absolute;
  bottom: 100%;
  left: 16px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  padding: 8px;
}
.popover[hidden] { display: none; }
.face-panel {
  width: 360px;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.face-item {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 5px 0;
  font-size: 19px;
  line-height: 1;
}
.face-item:hover { background: var(--brand-weak); }
.face-panel-tip {
  grid-column: 1 / -1;
  padding: 4px 8px 8px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* 配置弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  display: grid;
  place-items: center;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(460px, 92%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600;
}
.modal-close { border: none; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; }
.modal-body { padding: 14px 16px; max-height: 60vh; overflow-y: auto; }
.cfg-field { display: block; margin-bottom: 12px; }
.cfg-field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.cfg-field input, .cfg-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fbfcfe; resize: vertical;
}
.cfg-field input:focus, .cfg-field textarea:focus { outline: none; border-color: var(--brand); background: #fff; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.btn-danger { color: #e24b4a; border-color: #e24b4a; margin-right: auto; }
.btn-danger:hover { background: #e24b4a; color: #fff; }

/* CMD 蓝字标签 */
.cmd-tag-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px 2px;
}
.cmd-tag-bar[hidden] { display: none; }
.cmd-tag {
  border: 1px solid var(--brand);
  background: var(--brand-weak);
  color: var(--brand);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  line-height: 1.4;
}
.cmd-tag:hover { background: var(--brand); color: #fff; }
.cmd-tag-fill { border-style: dashed; }
/* 模式二选一控件 */
.seg-ctrl { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-btn {
  border: none; background: var(--surface);
  color: var(--muted);
  font-size: 12px; padding: 6px 12px;
  cursor: pointer;
}
.seg-btn.is-on { background: var(--brand); color: #fff; }
.seg-btn:disabled { opacity: .4; cursor: not-allowed; }
/* Markdown 语法快捷栏 */
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.md-tool {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.md-tool:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------ 手机端布局（App / 窄屏共用） ------------------------------ */
@media (max-width: 720px) {
  .field-grid { grid-template-columns: 1fr; }
  .chat-body { height: 100dvh; }

  /* 默认显示会话列表页，聊天页隐藏 */
  .side {
    width: 100%;
    min-width: 0;
    border-right: none;
  }
  .chat-main { display: none; flex-direction: column; }

  /* 选中会话后切成聊天页；返回则回到列表页 */
  body.m-view-chat .side { display: none; }
  body.m-view-chat .chat-main { display: flex; }
  .m-back { display: inline-flex; }

  .side-head { padding: 12px 14px; }
  .bot-card { padding: 10px 14px; }
  .side-search { margin: 8px 12px; }
  .session-item { padding: 10px 12px; }
  .session-group-title { padding: 8px 12px; }
  .side-foot { padding: 8px 14px; }

  /* 聊天区 */
  .chat-head { padding: 10px 12px; }
  .message-list { padding: 12px 12px; gap: 10px; }
  .msg { max-width: 92%; }
  .msg-avatar { width: 30px; height: 30px; }
  .msg-meta { font-size: 10px; }
  .msg-recall-btn, .msg-quote-btn { font-size: 11px; }

  /* 输入区：类型/模式/发送一行，输入框独占一行，避免挤成一团 */
  .composer-wrap { padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .composer-tools { gap: 2px; margin-bottom: 6px; }
  .tool-btn { padding: 6px 7px; font-size: 12px; }
  .tool-sep { display: none; }
  .composer-row { flex-wrap: wrap; gap: 6px; }
  .composer-select {
    flex: 1 1 0; min-width: 0; max-width: none;
    padding: 8px 4px; font-size: 12px;
  }
  #btnSend { flex: 0 0 auto; order: 3; padding: 9px 14px; }
  .composer-text { flex: 1 1 100%; order: 4; font-size: 16px; }
  .url-input-wrap { flex: 1 1 100%; order: 4; }
  .config-hint { font-size: 11px; }

  /* 浮层铺满可用宽度 */
  .popover { left: 8px; right: 8px; width: auto; }
  .face-panel { width: auto; max-height: 38vh; grid-template-columns: repeat(6, 1fr); }
  .reply-bar, .reply-text { min-width: 0; }
}
