/* 鲸聊 · 仿 QQ/微信 皮肤 */
:root {
  --brand: #0099ff;
  --brand-d: #0084e0;
  --brand-soft: #e9f3fe;
  --bg: #f2f4f7;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --rail: #eef1f4;
  --line: #e5e8ec;
  --text: #16181c;
  --text-2: #8a9099;
  --text-3: #b6bcc4;
  --bubble-me: #0099ff;
  --bubble-me-text: #ffffff;
  --bubble-other: #ffffff;
  --danger: #fa5151;
  --ok: #34c759;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}

html[data-theme="dark"] {
  --brand: #3aa0ff;
  --brand-d: #2b8ee6;
  --brand-soft: #17324d;
  --bg: #0f1216;
  --panel: #171b21;
  --panel-2: #1d222a;
  --rail: #14181e;
  --line: #262c35;
  --text: #e8eaee;
  --text-2: #8c95a1;
  --text-3: #5f6672;
  --bubble-me: #2b7fd4;
  --bubble-me-text: #ffffff;
  --bubble-other: #222831;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  font-size: 15px;
}
.hidden { display: none !important; }
button { font-family: inherit; }

/* ─────────── 配对页 ─────────── */
.pair {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #e8f4ff 0%, #f7fbff 60%, #eef6ff 100%);
  padding: 24px; z-index: 50;
}
.pair-card {
  width: 100%; max-width: 340px; background: var(--panel); border-radius: 20px;
  padding: 34px 26px 26px; text-align: center; box-shadow: 0 20px 60px rgba(20, 90, 150, .14);
}
.pair-logo img { width: 78px; height: 78px; border-radius: 22px; }
.pair-card h1 { font-size: 21px; margin: 14px 0 4px; letter-spacing: .5px; }
.pair-sub { color: var(--text-2); font-size: 13px; margin: 0 0 22px; }
.pair-card input {
  width: 100%; padding: 12px 14px; font-size: 14px; border: 1.5px solid var(--line);
  border-radius: 11px; outline: none; background: var(--panel-2); color: var(--text); margin-bottom: 10px;
}
.pair-card input:focus { border-color: var(--brand); background: var(--panel); }
.pair-card button {
  width: 100%; margin-top: 4px; padding: 12px; font-size: 15px; font-weight: 600;
  color: #fff; background: var(--brand); border: 0; border-radius: 11px; cursor: pointer;
}
.pair-card button:active { background: var(--brand-d); }
.pair-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin: 10px 0 0; }
.pair-tip { color: var(--text-3); font-size: 11.5px; margin: 12px 0 0; line-height: 1.6; }
.pair-tip code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* ─────────── 主框架 ─────────── */
.app { display: grid; grid-template-columns: 62px 280px 1fr; height: 100%; }

/* 左窄栏 */
.rail {
  background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0 10px; gap: 4px;
}
.rail-avatar { position: relative; margin-bottom: 12px; }
.rail-avatar img { width: 38px; height: 38px; border-radius: 50%; display: block; }
.rail-avatar .dot {
  position: absolute; right: -1px; bottom: 0; width: 10px; height: 10px;
  background: var(--ok); border: 2px solid var(--rail); border-radius: 50%;
}
.rail-btn {
  position: relative; width: 44px; height: 44px; border: 0; border-radius: 11px;
  background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.rail-btn svg { width: 21px; height: 21px; fill: currentColor; }
.rail-btn:hover { background: rgba(0, 0, 0, .05); }
.rail-btn.active { background: var(--brand-soft); color: var(--brand); }
.rail-spacer { flex: 1; }
.badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600; border-radius: 8px;
  display: none; place-items: center;
}

/* 会话列表 */
.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.list-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; }
.list-head .me img { width: 32px; height: 32px; border-radius: 50%; display: block; }
.search {
  flex: 1; min-width: 0; padding: 7px 12px; font-size: 12.5px; border: 0; border-radius: 9px;
  background: var(--panel-2); color: var(--text); outline: none;
}
.search::placeholder { color: var(--text-3); }
.conv { display: flex; gap: 11px; padding: 12px 14px; cursor: pointer; align-items: center; }
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--brand-soft); }
.conv-ava { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-name { font-size: 14.5px; font-weight: 500; }
.conv-time { font-size: 11px; color: var(--text-3); flex: 0 0 auto; }
.conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.conv-last { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-badge {
  min-width: 17px; height: 17px; padding: 0 5px; background: var(--danger); color: #fff;
  font-size: 10.5px; border-radius: 9px; display: grid; place-items: center; font-weight: 600;
}
.conv-tip { padding: 26px 20px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.8; }
.conv-tip b { display: block; font-size: 13.5px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }

/* 聊天区 */
.chat { display: flex; flex-direction: column; background: var(--bg); min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.chat-head {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.back { display: none; border: 0; background: transparent; padding: 4px; cursor: pointer; color: var(--text); }
.back svg { width: 22px; height: 22px; }
.chat-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; flex: 1; min-width: 0; }
.chat-title .sub { font-size: 11.5px; color: var(--text-3); font-weight: 400; margin-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; flex: 0 0 7px; }
.online.off { background: var(--text-3); }
.chat-actions { display: flex; gap: 2px; }
.chat-actions button { border: 0; background: transparent; padding: 7px; cursor: pointer; color: var(--text-2); border-radius: 8px; }
.chat-actions button:hover { background: var(--panel-2); }
.chat-actions svg { width: 19px; height: 19px; fill: currentColor; }

.msgs {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 10px; display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth; overscroll-behavior: contain;
}
.msgs::-webkit-scrollbar { width: 8px; }
.msgs::-webkit-scrollbar-thumb { background: rgba(140, 150, 160, .35); border-radius: 4px; }

.day { align-self: center; font-size: 11px; color: var(--text-3); background: rgba(140, 150, 160, .14); padding: 3px 10px; border-radius: 10px; margin: 6px 0 2px; }

.msg { display: flex; gap: 9px; max-width: 100%; align-items: flex-start; min-width: 0; }
.msg.me { align-self: flex-end; justify-content: flex-end; }
.msg.me .msg-ava { order: 2; }
.msg.me .bubble-wrap { order: 1; align-items: flex-end; }
.msg-ava { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px; margin-top: 2px; background: var(--brand); }
.bubble-wrap { display: flex; flex-direction: column; min-width: 0; max-width: calc(100% - 43px); gap: 3px; }
.bubble {
  padding: 9px 13px; border-radius: var(--radius); font-size: 14.5px; line-height: 1.55;
  background: var(--bubble-other); box-shadow: var(--shadow); color: var(--text);
  word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap; position: relative;
  min-width: 0; max-width: 100%;
  -webkit-touch-callout: none;
  transition: transform .06s ease;
}
/* 气泡小角，像 QQ/微信那样 */
.bubble::after {
  content: ''; position: absolute; top: 13px; width: 0; height: 0;
  border: 5px solid transparent;
}
.msg:not(.me) .bubble::after { left: -9px; border-right-color: var(--bubble-other); }
.msg.me .bubble::after { right: -9px; border-left-color: var(--bubble-me); }
.msg.revoked .bubble::after { display: none; }
.msg.me .bubble { background: var(--bubble-me); color: var(--bubble-me-text); }
.bubble a { color: #0b74c4; text-decoration: underline; word-break: break-all; }
.msg.me .bubble a { color: #dff0ff; }
.bubble img.media { max-width: 220px; max-height: 280px; border-radius: 8px; display: block; cursor: zoom-in; }
.bubble video { max-width: 240px; border-radius: 8px; display: block; }
.msg-time { font-size: 10.5px; color: var(--text-3); padding: 0 4px; }
.msg.revoked .bubble { background: transparent; box-shadow: none; color: var(--text-3); font-size: 12.5px; padding: 2px 4px; font-style: italic; }

/* 引用块 */
.quote {
  border-left: 3px solid rgba(0, 0, 0, .12); padding: 4px 8px; margin-bottom: 6px;
  font-size: 12.5px; color: var(--text-2); background: rgba(0, 0, 0, .03);
  border-radius: 5px; max-height: 54px; overflow: hidden;
}
.msg.me .quote { border-left-color: rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); }

/* 语音条 */
.voice {
  display: flex; align-items: center; gap: 8px; min-width: 84px; cursor: pointer; user-select: none;
}
.voice .wave { display: flex; align-items: center; gap: 2px; height: 18px; }
.voice .wave i { width: 2.5px; border-radius: 2px; background: currentColor; opacity: .55; }
.voice .dur { font-size: 12px; opacity: .8; min-width: 22px; text-align: right; }
.msg.me .voice { color: var(--bubble-me-text); }

/* 文件卡 */
.file-card { display: flex; align-items: center; gap: 10px; min-width: 190px; text-decoration: none; color: inherit; }
.file-ico {
  width: 36px; height: 36px; border-radius: 9px; background: rgba(0, 153, 255, .1); color: var(--brand);
  display: grid; place-items: center; font-size: 16px; flex: 0 0 36px;
}
.msg.me .file-ico { background: rgba(255, 255, 255, .22); color: #fff; }
.file-meta { min-width: 0; }
.file-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; display: block; }
.file-size { font-size: 11px; opacity: .6; }

/* 输入区 */
.composer { flex: 0 0 auto; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 14px 12px; position: relative; }
.tools { display: flex; gap: 3px; align-items: center; padding-bottom: 5px; }
.tools button {
  width: 34px; height: 32px; border: 0; background: transparent; border-radius: 8px;
  cursor: pointer; font-size: 18px; color: var(--text-2); display: grid; place-items: center;
  transition: background .15s;
}
.tools button svg { width: 19px; height: 19px; }
.tools button:hover { background: var(--panel-2); }
.tools button.on { background: var(--brand-soft); color: var(--brand); }
.input-row { display: flex; align-items: flex-end; gap: 9px; }
#input {
  flex: 1; resize: none; max-height: 128px; min-height: 42px; padding: 10px 13px;
  font-size: 14.5px; line-height: 1.45; font-family: inherit; border: 1px solid var(--line);
  border-radius: 11px; outline: none; background: var(--panel-2); color: var(--text);
  transition: border-color .15s, background .15s;
}
#input:focus { border-color: var(--brand); background: var(--panel); }
#input::placeholder { color: var(--text-3); }
.send {
  padding: 11px 20px; font-size: 14px; font-weight: 500; color: #fff; background: var(--brand);
  border: 0; border-radius: 10px; cursor: pointer; flex: 0 0 auto;
}
.send:disabled { background: var(--text-3); cursor: default; }
.send:active:not(:disabled) { background: var(--brand-d); }

/* 引用提示条 */
.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 6px;
  background: var(--panel-2); border-radius: 8px; font-size: 12.5px; color: var(--text-2);
  border-left: 3px solid var(--brand);
}
.reply-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar button { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 16px; padding: 0 4px; }

/* 面板 */
/* 面板：放在输入区里走文档流（微信那样），不悬浮、不盖工具栏 */
.emoji-panel {
  margin-top: 8px; max-height: 208px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 1px;
}
.emoji-panel span { font-size: 21px; text-align: center; padding: 4px; cursor: pointer; border-radius: 7px; line-height: 1.2; }
.emoji-panel span:hover { background: var(--panel-2); }

.plus-panel {
  margin-top: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.plus-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-size: 11.5px;
}
.plus-item i {
  width: 52px; height: 52px; border-radius: 14px; background: var(--panel-2);
  display: grid; place-items: center; font-size: 22px;
}
.plus-item:active i { background: var(--brand-soft); }

.rec-panel { display: flex; align-items: center; gap: 12px; padding: 6px 2px 2px; }
.rec-panel button {
  padding: 11px 22px; border-radius: 10px; border: 0; background: var(--brand-soft); color: var(--brand);
  font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background .15s;
}
.rec-panel button.recording { background: rgba(250, 81, 81, .14); color: var(--danger); }
#recTip { font-size: 12px; color: var(--text-2); }

/* 长按菜单 */
.ctx {
  position: fixed; z-index: 80; background: var(--panel); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2); border: 1px solid var(--line); min-width: 132px;
  display: flex; flex-direction: column; gap: 1px;
}
.ctx button {
  border: 0; background: transparent; text-align: left; padding: 9px 12px; font-size: 14px;
  color: var(--text); border-radius: 8px; cursor: pointer;
}
.ctx button:hover { background: var(--panel-2); }
.ctx button.danger { color: var(--danger); }

/* 图片预览 */
.lightbox {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center;
  z-index: 90; padding: 18px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 6px; }

/* 抽屉 */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .38); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 86vw); background: var(--panel);
  z-index: 61; box-shadow: -14px 0 40px rgba(0, 0, 0, .16); display: flex; flex-direction: column;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { padding: 22px 20px 16px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.drawer-head img { width: 48px; height: 48px; border-radius: 50%; }
.drawer-head .n { font-size: 16px; font-weight: 600; }
.drawer-head .d { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; font-size: 14.5px; cursor: pointer;
}
.row:hover { background: var(--panel-2); }
.row .v { color: var(--text-2); font-size: 13px; }
.row.danger { color: var(--danger); }
.switch {
  width: 44px; height: 26px; border-radius: 13px; background: var(--text-3); position: relative;
  transition: background .18s; flex: 0 0 44px;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s;
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(18px); }
.drawer-foot { padding: 14px 20px 22px; border-top: 1px solid var(--line); }
.drawer-foot button {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 14px; cursor: pointer;
}

/* 搜索结果 */
.search-panel {
  position: absolute; inset: 56px 0 0 0; background: var(--bg); z-index: 30;
  display: flex; flex-direction: column;
}
.search-bar { display: flex; gap: 8px; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.search-bar input {
  flex: 1; padding: 9px 13px; font-size: 14px; border: 1px solid var(--line); border-radius: 9px;
  outline: none; background: var(--panel-2); color: var(--text);
}
.search-bar button { border: 0; background: transparent; color: var(--text-2); font-size: 14px; cursor: pointer; padding: 0 6px; }
.search-hits { flex: 1; overflow-y: auto; padding: 8px 0; }
.hit { padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.hit:hover { background: var(--panel); }
.hit .t { font-size: 14px; margin-bottom: 3px; }
.hit .d { font-size: 11.5px; color: var(--text-3); }
.hit mark { background: rgba(0, 153, 255, .2); color: inherit; border-radius: 3px; }
.hit-empty { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 新版本提示条 */
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); top: 8px; z-index: 70;
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 520px);
  background: rgba(20, 24, 28, .92); color: #fff; padding: 9px 14px; border-radius: 11px;
  font-size: 12.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); animation: fadeIn .2s ease;
}
.update-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.update-bar button {
  border: 0; background: var(--brand); color: #fff; padding: 6px 13px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; cursor: pointer; flex: 0 0 auto;
}

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: rgba(20, 24, 28, .86); color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; z-index: 95; pointer-events: none; animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ─────────── 手机 ─────────── */
/* ─────────── 打磨层 ─────────── */

/* 顶栏毛玻璃 */
.chat-head {
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.list-head { background: color-mix(in srgb, var(--panel) 82%, transparent); backdrop-filter: blur(10px); }

/* 聊天区极淡的水波底纹 */
.chat {
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0, 153, 255, .05), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(0, 153, 255, .045), transparent 46%);
  background-size: cover;
}
html[data-theme="dark"] .chat {
  background-image:
    radial-gradient(circle at 18% 12%, rgba(58, 160, 255, .07), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(58, 160, 255, .05), transparent 46%);
}

/* 头像：品牌色底 + 图标居中 */
.msg-ava, .conv-ava, .rail-avatar img, .list-head .me img, .drawer-head img, .pair-logo img {
  background: linear-gradient(140deg, #4fc3ff, #0d7fd4);
  object-fit: cover;
}

/* 图片消息：给小图一个下限，避免缩成一条 */
.bubble img.media { min-width: 84px; min-height: 60px; object-fit: cover; background: rgba(0, 0, 0, .04); }
.bubble img.media.broken {
  display: flex; align-items: center; justify-content: center; min-width: 120px; min-height: 88px;
  background: rgba(0, 0, 0, .06); color: var(--text-2); font-size: 12px; cursor: pointer;
}
.img-broken {
  display: flex; align-items: center; justify-content: center; min-width: 130px; min-height: 88px;
  border-radius: 8px; background: rgba(0, 0, 0, .06); color: var(--text-2);
  font-size: 12px; cursor: pointer; padding: 10px; text-align: center;
}
.msg.me .img-broken { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .8); }
/* 桌面端别让一条消息拉满整行 */
@media (min-width: 761px) {
  .msg { max-width: 74%; }
  .msg .bubble-wrap { max-width: calc(100% - 43px); }
}

/* 空状态 */
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; pointer-events: none;
  color: var(--text-3); font-size: 13px; text-align: center; padding: 0 40px;
}
.empty img { width: 64px; height: 64px; opacity: .35; filter: grayscale(0.2); }
.empty b { font-size: 14px; color: var(--text-2); font-weight: 500; }

/* 加载更多 */
.load-more {
  align-self: center; font-size: 12px; color: var(--text-2); cursor: pointer;
  padding: 6px 14px; border-radius: 12px; background: rgba(140, 150, 160, .12);
}
.load-more:hover { background: rgba(140, 150, 160, .2); }

/* 发送中 / 失败 */
.msg.pending .bubble { opacity: .62; }
.msg.failed .bubble { box-shadow: 0 0 0 1.5px var(--danger); }
.retry {
  font-size: 11.5px; color: var(--danger); cursor: pointer; padding: 1px 4px; align-self: flex-end;
}

/* 语音播放态 */
.voice.playing .wave i { animation: wavePulse .9s ease-in-out infinite; }
@keyframes wavePulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* 输入区更贴手 */
#input { transition: border-color .15s, background .15s, box-shadow .15s; }
#input:focus { box-shadow: 0 0 0 3px rgba(0, 153, 255, .12); }
.send { transition: transform .08s ease, background .15s; }
.send:active:not(:disabled) { transform: scale(.97); }

/* 长按菜单出现动画 */
.ctx { animation: ctxIn .12s ease; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

/* 滚动条更细 */
.msgs::-webkit-scrollbar { width: 6px; }
.msgs::-webkit-scrollbar-thumb { background: rgba(140, 150, 160, .28); }
.msgs::-webkit-scrollbar-thumb:hover { background: rgba(140, 150, 160, .45); }

/* 抽屉里的小字行 */
.row .v.arrow { color: var(--text-3); }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .rail { display: none; }
  .list { width: 100%; border-right: 0; }
  .chat { position: fixed; inset: 0; z-index: 20; transform: translateX(100%); transition: transform .22s ease; }
  body.in-chat .chat { transform: translateX(0); }
  body:not(.in-chat) .chat { transform: translateX(100%); }
  body.in-chat .list { display: none; }
  .back { display: block; }
  .msg { max-width: calc(100% - 40px); }
  .msgs { padding: 12px 12px 6px; gap: 11px; }
  .composer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chat-head { padding-left: 6px; }
  .bubble img.media { max-width: 190px; }
  .list-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .chat-head { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); flex-basis: calc(56px + env(safe-area-inset-top)); }
  .search-panel { inset: calc(56px + env(safe-area-inset-top)) 0 0 0; }
  .chat-actions button { padding: 9px; }
}
