
/* ========== 站内 IM ========== */
.im-page-header { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.im-page-actions { display:flex; gap:8px; }
.im-conv-card { padding:0; overflow:hidden; }
.im-conv-list { display:flex; flex-direction:column; }
.im-conv-row {
  display:flex; gap:12px; align-items:center;
  padding:14px 16px; text-decoration:none; color:inherit;
  border-bottom:1px solid #f0f0f0;
}
.im-conv-row:last-child { border-bottom:none; }
.im-conv-row:active, .im-conv-row:hover { background:#fafafa; }
.im-conv-avatar {
  width:44px; height:44px; border-radius:10px; flex-shrink:0;
  background:linear-gradient(145deg,#1677ff,#69b1ff);
  color:#fff; font-weight:700; font-size:18px;
  display:flex; align-items:center; justify-content:center;
}
.im-conv-main { flex:1; min-width:0; }
.im-conv-top, .im-conv-bottom { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.im-conv-title { font-weight:600; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.im-conv-time { font-size:12px; color:#999; flex-shrink:0; }
.im-conv-preview { font-size:13px; color:#8c8c8c; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.im-unread {
  min-width:18px; height:18px; padding:0 5px; border-radius:9px;
  background:#ff4d4f; color:#fff; font-size:11px; line-height:18px; text-align:center; flex-shrink:0;
}
.im-tag {
  display:inline-block; margin-right:4px; padding:0 4px; border-radius:3px;
  background:#e6f4ff; color:#1677ff; font-size:11px; font-weight:600; vertical-align:middle;
}

.im-modal[hidden] { display:none !important; }
.im-modal { position:fixed; inset:0; z-index:2000; display:flex; align-items:flex-end; justify-content:center; }
.im-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.45); }
.im-modal-panel {
  position:relative; width:100%; max-width:560px; max-height:80vh;
  background:#fff; border-radius:12px 12px 0 0; padding:14px 16px 20px;
  display:flex; flex-direction:column; gap:10px; box-shadow:0 -4px 24px rgba(0,0,0,.12);
}
.im-modal-head { display:flex; justify-content:space-between; align-items:center; }
.im-pick-list { overflow:auto; flex:1; min-height:180px; max-height:50vh; }
.im-pick-row {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  width:100%; padding:10px 4px; border:0; border-bottom:1px solid #f5f5f5;
  background:transparent; text-align:left; cursor:pointer;
}
.im-pick-name { font-weight:600; }
.im-pick-meta { color:#999; font-size:12px; }
.im-pick-empty { padding:24px; text-align:center; color:#999; }
.im-modal-foot { display:flex; gap:8px; flex-wrap:wrap; }

.im-room-page {
  display:flex; flex-direction:column;
  height:calc(100vh - 120px); min-height:420px;
  margin:-8px -12px 0; background:#f5f6f8;
}
.im-room-head {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:10px 12px; background:#fff; border-bottom:1px solid #eee; flex-shrink:0;
}
.im-room-title-wrap { display:flex; align-items:center; gap:6px; min-width:0; }
.im-room-title-wrap h1 {
  margin:0; font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.im-at-badge {
  display:inline-block; margin-right:4px; padding:0 4px; border-radius:3px;
  background:#fff1f0; color:#cf1322; font-size:11px; font-weight:600;
}
.im-room-search {
  flex-shrink:0; padding:6px 10px; background:#fff; border-bottom:1px solid #f0f0f0;
}
.im-room-search .form-control { font-size:13px; }
.im-bubble-meta {
  display:flex; flex-wrap:wrap; align-items:center; gap:6px;
  margin-top:4px; justify-content:flex-end;
}
.im-bubble-row:not(.is-mine) .im-bubble-meta { justify-content:flex-start; }
.im-read-state { font-size:11px; color:rgba(0,0,0,.35); }
.im-read-state.is-read { color:#1677ff; }
.im-read-state.is-partial { color:#fa8c16; }
.im-read-state.is-pending { color:#999; }
.im-revoke-btn, .im-retry-btn {
  border:0; background:transparent; color:#1677ff; font-size:11px; padding:0; cursor:pointer;
}
.im-retry-btn { color:#cf1322; font-weight:600; }
.im-bubble-row.is-pending .im-bubble { opacity:.75; }
.im-bubble-row.is-failed .im-bubble { outline:1px solid #ffccc7; }
.im-mention { color:#1677ff; font-weight:600; }
.im-mention-chips { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:4px; }
.im-chip {
  display:inline-flex; align-items:center; gap:4px;
  background:#e6f4ff; color:#1677ff; border-radius:12px; padding:2px 8px; font-size:12px;
}
.im-chip button { border:0; background:transparent; color:#1677ff; cursor:pointer; padding:0 2px; }
.im-voice-btn {
  border:0; background:transparent; color:inherit; font-size:14px;
  display:inline-flex; align-items:center; gap:6px; cursor:pointer; padding:4px 0;
  min-width:88px;
}
.im-voice-icon { color:#1677ff; font-weight:700; }
.im-bubble-row.is-mine .im-voice-icon { color:#389e0d; }
.im-voice-tip {
  background:#fff1f0; color:#cf1322; text-align:center;
  font-size:13px; padding:6px; border-radius:6px; margin-bottom:6px;
}
.im-room-msgs { flex:1; overflow:auto; padding:12px; -webkit-overflow-scrolling:touch; min-height:0; }
.im-sys {
  text-align:center; color:#999; font-size:12px; margin:10px 0;
}
.im-bubble-row { display:flex; margin:8px 0; }
.im-bubble-row.is-mine { justify-content:flex-end; }
.im-bubble {
  max-width:78%; background:#fff; border-radius:10px; padding:8px 10px;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.im-bubble-row.is-mine .im-bubble { background:#95ec69; }
.im-bubble-name { font-size:12px; color:#1677ff; margin-bottom:4px; }
.im-bubble-text { font-size:15px; line-height:1.45; white-space:pre-wrap; word-break:break-word; }
.im-bubble-time { font-size:11px; color:rgba(0,0,0,.35); margin-top:4px; text-align:right; }
.im-img { max-width:200px; max-height:240px; border-radius:6px; display:block; }
.im-img-btn {
  position: relative;
  display:block; padding:0; margin:0; border:0; background:transparent; cursor:zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.im-img-btn:active { opacity: .92; }
.im-video-btn {
  position: relative; display: block; padding: 0; margin: 0;
  border: 0; background: transparent; cursor: zoom-in;
  max-width: 220px; -webkit-tap-highlight-color: transparent;
}
.im-video-btn:active { opacity: .92; }
.im-video {
  width: 100%; max-height: 280px; border-radius: 6px; display: block;
  background: #000; pointer-events: none;
}
.im-video-play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 22px;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; padding-left: 3px; pointer-events: none;
}
.im-video-tip {
  position: absolute; left: 0; right: 0; bottom: 6px;
  text-align: center; font-size: 11px; color: rgba(255,255,255,.85);
  text-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none;
}

.im-lightbox[hidden] { display:none !important; }
.im-lightbox {
  position:fixed; inset:0; z-index:3000;
  display:flex; align-items:center; justify-content:center;
  padding:12px;
}
.im-lightbox-backdrop {
  position:absolute; inset:0; background:rgba(0,0,0,.88);
}
.im-lightbox-img {
  position:relative; z-index:1;
  max-width:100%; max-height:100%;
  object-fit:contain;
  border-radius:4px;
  box-shadow:0 4px 24px rgba(0,0,0,.4);
  cursor:zoom-out;
  -webkit-tap-highlight-color: transparent;
}
.im-lightbox-video {
  position:relative; z-index:1;
  width:100%; max-width:720px; max-height:82vh;
  background:#000; border-radius:4px;
  box-shadow:0 4px 24px rgba(0,0,0,.4);
}
.im-lightbox-img[hidden],
.im-lightbox-video[hidden] { display: none !important; }
.im-lightbox-backdrop { cursor:zoom-out; }
.im-lightbox-bar {
  position:absolute; top:0; left:0; right:0; z-index:2;
  display:flex; justify-content:flex-end; align-items:center; gap:8px;
  padding:12px;
  background:linear-gradient(to bottom, rgba(0,0,0,.45), transparent);
  pointer-events:none;
}
.im-lightbox-bar > * { pointer-events:auto; }
.im-lightbox-save {
  border:0; border-radius:18px; padding:8px 14px;
  background:rgba(255,255,255,.92); color:#1677ff;
  font-size:14px; font-weight:600; cursor:pointer;
}
.im-lightbox-hint {
  position:absolute; bottom:18px; left:0; right:0; z-index:2;
  text-align:center; color:rgba(255,255,255,.75); font-size:13px;
  pointer-events:none;
}
.im-lightbox-close {
  width:40px; height:40px; border:0; border-radius:20px;
  background:rgba(255,255,255,.18); color:#fff; font-size:28px; line-height:40px;
  cursor:pointer;
}
.im-loc-card {
  display:block; text-decoration:none; color:inherit;
  min-width:160px; max-width:220px;
}
.im-loc-title { font-weight:700; color:#cf1322; margin-bottom:4px; }
.im-loc-addr { font-size:13px; line-height:1.4; }
.im-loc-tip { font-size:11px; color:#1677ff; margin-top:6px; }

.im-room-composer {
  flex-shrink:0; background:#fff; border-top:1px solid #eee; padding:8px 10px 12px;
}
.im-room-tools { display:flex; gap:8px; margin-bottom:6px; }
.im-tool-btn {
  border:1px solid #d9d9d9; background:#fafafa; border-radius:6px;
  padding:4px 10px; font-size:13px; cursor:pointer; color:#333;
}
.im-room-input-row { display:flex; gap:8px; align-items:flex-end; }
.im-text {
  flex:1; min-height:38px; max-height:100px; resize:none;
  border-radius:8px; padding:8px 10px;
}
.im-room-status { font-size:12px; color:#999; min-height:16px; margin-top:4px; }
.im-room-status.is-busy {
  color: #1677ff;
  font-weight: 600;
  background: #e6f4ff;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  min-height: 0;
}
.im-media-progress {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,.48);
  border-radius: 6px;
  pointer-events: none;
}
.im-media-progress-track {
  width: 72%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.28);
  overflow: hidden;
}
.im-media-progress-bar {
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 3px;
  transition: width .12s linear;
}
.im-media-progress-txt {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

@media (min-width: 768px) {
  .im-modal { align-items:center; }
  .im-modal-panel { border-radius:12px; max-height:70vh; }
  .im-room-page { margin:0; border-radius:8px; overflow:hidden; height:calc(100vh - 160px); }
}
