/* =========================================================================
   鍔熻兘灞?v4锛氬乏涓婅鑿滃崟 / 蹇嵎閿?/ 鎴浘鍙戦€?/ 鏀惰棌澶?   ========================================================================= */

/* ---------------- 妗岄潰绔細鏀惰捣宸︿晶鍥炬爣鏍忥紝鏀圭敤宸︿笂瑙掕彍鍗?---------------- */
@media (min-width: 861px) {
  .rail { display: none !important; }
  .list-panel { width: 372px; flex: 0 0 372px; }
}
/* 左上角：圆形头像取代"聊天"文字 */
.me-avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  padding: 0; flex: 0 0 auto;
  display: grid; place-items: center;
  position: relative; cursor: pointer;
  transition: transform .16s var(--ease);
}
.me-avatar-btn:hover { transform: scale(1.06); }
.me-avatar-btn .avatar { width: 38px; height: 38px; font-size: 14px; }
.me-avatar-btn .avatar::after { opacity: .85; }
.me-avatar-btn .me-status-dot {
  position: absolute; right: 0; bottom: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--online); border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--hairline-2);
}
.me-avatar-btn .me-pen {
  position: absolute; right: -2px; top: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: grid; place-items: center;
  opacity: 0; transition: opacity .16s;
  border: 1.5px solid var(--panel);
}
.me-avatar-btn:hover .me-pen { opacity: 1; }
.list-mode-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--ink-3); padding: 0 2px 4px;
}
.list-title-row { gap: 8px; }
.list-title-row h2 { display: none; }

/* ---------------- 宸︿笂瑙掕彍鍗曢潰鏉?---------------- */
.app-menu {
  position: fixed; z-index: 145; width: 300px;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 16px; box-shadow: var(--shadow-3);
  padding: 8px; -webkit-app-region: no-drag;
  animation: menuIn .16s var(--ease);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.app-menu .mi {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 9px; border-radius: 10px; cursor: pointer;
  transition: background .14s;
}
.app-menu .mi:hover { background: var(--row-hover); }
.app-menu .mi.danger .t { color: var(--danger); }
.app-menu .mi .ico {
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-grad-soft); color: var(--brand-2);
}
.app-menu .mi.danger .ico { background: rgba(239, 83, 80, .12); color: var(--danger); }
.app-menu .mi .txt { flex: 1; min-width: 0; }
.app-menu .mi .t { font-size: 13.4px; font-weight: 600; letter-spacing: -.1px; }
.app-menu .mi .d { font-size: 11.2px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-menu .mi .kbd {
  font-size: 10.5px; color: var(--ink-3);
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.app-menu .sep { height: 1px; background: var(--hairline); margin: 6px 10px; }

/* ---------------- 鎴浘鍙栨櫙 ---------------- */
.shot-overlay {
  position: fixed; inset: 0; z-index: 165;
  background: rgba(6, 12, 18, .88);
  display: flex; flex-direction: column;
  -webkit-app-region: no-drag;
}
.shot-stage {
  position: relative; flex: 1; margin: 22px 22px 8px;
  display: grid; place-items: center; overflow: hidden;
}
.shot-img { max-width: 100%; max-height: 100%; user-select: none; border-radius: 10px; box-shadow: 0 30px 80px -30px #000; }
.shot-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); cursor: crosshair; }
.shot-mask.hidden, .shot-sel.hidden { display: none; }
.shot-sel {
  position: absolute; border: 1.5px solid var(--brand-1);
  background: rgba(34, 211, 238, .06);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .42);
  pointer-events: none;
}
.shot-sel .shot-size {
  position: absolute; right: -1px; bottom: -22px;
  font-size: 11px; color: #fff; background: rgba(0, 0, 0, .55);
  padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums;
}
.shot-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 8px 24px 20px;
}
.shot-hint { font-size: 12.5px; color: rgba(255, 255, 255, .78); }
.shot-actions { display: flex; gap: 10px; }
.shot-bar .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.shot-bar .btn.ghost:hover { background: rgba(255, 255, 255, .12); }

/* ---------------- 鏀惰棌澶?---------------- */
.fav-item {
  display: flex; gap: 11px; padding: 10px 8px;
  border-bottom: 1px solid var(--hairline); cursor: pointer;
  border-radius: 10px;
}
.fav-item:hover { background: var(--row-hover); }
.fav-item .fi-body { flex: 1; min-width: 0; }
.fav-item .fi-top { display: flex; align-items: baseline; gap: 8px; }
.fav-item .fi-name { font-size: 13px; font-weight: 600; }
.fav-item .fi-time { font-size: 11px; color: var(--ink-3); margin-left: auto; }
.fav-item .fi-text { font-size: 13.2px; color: var(--ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fav-item .fi-del { width: 30px; height: 30px; border-radius: 9px; color: var(--ink-3); align-self: center; }
.fav-item .fi-del:hover { background: rgba(239, 83, 80, .12); color: var(--danger); }

/* ---------------- 蹇嵎閿鏄?---------------- */
.kbd-list { display: grid; gap: 2px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 6px; border-bottom: 1px solid var(--hairline); }
.kbd-row:last-child { border-bottom: 0; }
.kbd-row .kt { font-size: 13.2px; }
.kbd-row .kk { font-size: 11px; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--hairline); border-radius: 7px; padding: 3px 8px; font-variant-numeric: tabular-nums; }

/* 鎵嬫満绔細搴曢儴 Tab 淇濈暀锛岃彍鍗曚篃鑳界敤 */
@media (max-width: 860px) {
  .app-menu { width: calc(100vw - 28px); left: 14px !important; right: 14px; }
  .shot-stage { margin: 12px 12px 4px; }
  .shot-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 8px 14px calc(16px + var(--safe-b)); }
  .shot-actions .btn { flex: 1; }
}


/* ================= v5：引用 / 转发 / 多选 / 设备管理 ================= */

/* ---- 引用条（输入框上方） ---- */
.reply-bar { align-items: center; gap: 10px; padding: 7px 12px; border-left: 3px solid var(--brand-2); border-radius: 8px; background: var(--brand-grad-soft); font-size: 12.5px; color: var(--ink-2); }
.reply-bar .rb-name { font-weight: 700; color: var(--brand-2); margin-bottom: 1px; font-size: 12px; }
.reply-bar .rb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw; }
.reply-bar .rb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reply-bar .x { margin-left: auto; color: var(--ink-3); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.reply-bar .x:hover { background: var(--row-hover); color: var(--ink); }

/* ---- 气泡内的引用块 ---- */
.bubble .quote {
  display: flex; gap: 8px; padding: 5px 9px; margin: 1px 0 5px;
  border-left: 2.5px solid var(--brand-1); border-radius: 6px;
  background: rgba(59, 130, 246, .10); cursor: pointer;
  font-size: 12.5px; line-height: 1.35;
}
[data-theme="dark"] .bubble .quote { background: rgba(34, 211, 238, .10); }
.bubble .quote .q-name { font-weight: 700; color: var(--brand-2); font-size: 11.8px; }
[data-theme="dark"] .bubble .quote .q-name { color: var(--brand-1); }
.bubble .quote .q-text { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.quote-block { min-width: 0; flex: 1; }

/* 转发标记 */
.fwd-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-2); margin-bottom: 3px; font-style: italic; }

/* ---- 多选模式 ---- */
.multi-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--hairline); }
.multi-bar .mb-count { font-size: 12.5px; color: var(--ink-2); flex: 1; }
.multi-bar .mb-actions { display: flex; gap: 6px; }
.multi-bar .mb-btn {
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--hairline); color: var(--ink);
  transition: background .14s, transform .14s;
}
.multi-bar .mb-btn:hover { background: var(--row-hover); transform: translateY(-1px); }
.multi-bar .mb-btn.danger { color: var(--danger); border-color: rgba(239, 83, 80, .35); }
.multi-bar .mb-btn.danger:hover { background: rgba(239, 83, 80, .12); }
.msg-row .pick {
  position: absolute; left: -2px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid var(--hairline-2);
  background: var(--panel); display: grid; place-items: center; z-index: 3;
}
.msg-row .pick.on { background: var(--brand-grad); border-color: transparent; color: #fff; }
.msg-row.selectable { padding-left: 26px; cursor: pointer; }
.msg-row.selectable .msg-col { pointer-events: none; }
.msg-row.picked { background: var(--brand-grad-soft); }
.msg-list.selecting .msg-row { animation: none; }

/* ---- 转发选择器 ---- */
.fwd-list { display: flex; flex-direction: column; gap: 2px; max-height: 54vh; overflow-y: auto; }
.fwd-list .list-item { border-radius: 10px; }

/* ---- 设备管理 ---- */
.dev-item { display: flex; align-items: center; gap: 11px; padding: 11px 6px; border-bottom: 1px solid var(--hairline); }
.dev-item:last-child { border-bottom: 0; }
.dev-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-grad-soft); color: var(--brand-2); flex: 0 0 auto; }
.dev-body { flex: 1; min-width: 0; }
.dev-name { font-size: 13.4px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.dev-tag { font-size: 10px; padding: 1px 6px; border-radius: 20px; background: rgba(23, 160, 106, .14); color: #17a06a; font-weight: 700; }
.dev-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }

/* ---- 群已读统计 ---- */
.read-stats { display: flex; flex-direction: column; gap: 6px; }
.read-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.read-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-2); }
.read-row .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(76, 175, 80, .16); }
.read-row .nm { flex: 1; }
.read-row .tm { color: var(--ink-3); font-size: 11.5px; }

/* ---- 收藏夹媒体 ---- */
.fav-thumbs { display: flex; gap: 6px; margin-top: 6px; }
.fav-thumbs img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; cursor: zoom-in; border: 1px solid var(--hairline); }
.fav-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--brand-2); cursor: pointer; }
.fav-file:hover { text-decoration: underline; }

/* ---- 搜索进度 ---- */
.search-progress { font-size: 11.5px; color: var(--ink-3); padding: 6px 2px; }
