@charset "UTF-8";
/* 51dianzi chat compact layout + unified unread badge (2026-11-24). Shared by MallNav and ChatPage. */

/* 1) Unified unread badge: 16px, 10px/600, #D93A3A; floating badges get a 1.5px white ring. */
span[role="status"].rounded-full.tabular-nums.bg-\[\#E5484D\] {
  box-sizing: border-box; height: 16px; min-width: 16px; padding: 0 4px;
  background: #D93A3A; font-size: 10px; font-weight: 600; line-height: 16px;
}
span[role="status"].rounded-full.tabular-nums.bg-\[\#E5484D\]:not(.ring-0) { box-shadow: 0 0 0 1.5px #fff; }
.mall-nav .mn-message > .mn-message-badge.mn-message-badge,
.mall-nav .mn-cart > .mn-cart-num.mn-cart-num {
  position: absolute; top: -4px; right: -6px; left: auto; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 16px; min-width: 16px; padding: 0 4px; border-radius: 999px;
  background: #D93A3A; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px #fff; pointer-events: none;
}
@media (max-width: 900px) {
  .mall-nav .mn-message > .mn-message-badge.mn-message-badge,
  .mall-nav .mn-cart > .mn-cart-num.mn-cart-num { top: 2px; right: 0; }
}

/* 2) Pane fold buttons (sit inside existing rows; no extra height) */
.d51-chat-fold {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: #8a97a6; cursor: pointer;
}
.d51-chat-fold:hover { background: #eef3f9; color: #185FA5; }
.d51-chat-fold:focus-visible { outline: 2px solid #185FA5; outline-offset: 1px; }
.d51-chat-fold.d51-chat-fold-side { margin-left: auto; flex-basis: 22px; width: 22px; height: 22px; opacity: .75; }
[data-testid="chat-sidebar-all"]:hover .d51-chat-fold-side { opacity: 1; }
.d51-chat-group-abbr { display: none; }
.d51-chat-list-rail { display: none; }

/* Filter row with the current-group chip */
.d51-chat-chips { align-items: center; flex-wrap: nowrap; min-width: 0; }
.d51-chat-chips > span { flex: 0 0 auto; white-space: nowrap; }
.d51-chat-chips > .d51-chat-group-chip {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 1 auto; min-width: 0; max-width: 140px;
  height: 22px; padding: 0 2px 0 7px; border: 1px solid #c9dbee; border-radius: 999px;
  background: #eef4fb; color: #185FA5; font-size: 11px;
}
.d51-chat-group-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.d51-chat-group-chip-count { flex: 0 0 auto; color: #7d94ad; }
.d51-chat-group-chip > button {
  flex: 0 0 18px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #5c7896; font-size: 13px; line-height: 18px; cursor: pointer;
}
.d51-chat-group-chip > button:hover { background: #d9e7f5; }

/* 4) Conversation "···" only on hover/focus (pointer devices) */
@media (hover: hover) {
  .d51-chat-list [draggable="true"] button[title="更多操作"] { opacity: 0; transition: opacity .12s; }
  .d51-chat-list [draggable="true"]:hover button[title="更多操作"],
  .d51-chat-list [draggable="true"]:focus-within button[title="更多操作"] { opacity: 1; }
}

/* Empty state quick entry */
.d51-chat-empty-unread {
  margin-top: 6px; padding: 5px 14px; border: 1px solid #c9dbee; border-radius: 999px;
  background: #fff; color: #185FA5; font-size: 12px; cursor: pointer;
}
.d51-chat-empty-unread:hover { background: #eef4fb; }

/* 3a) Sidebar collapsed -> 56px icon rail; list widens 240 -> 280 (sidebar only exists >= lg) */
@media (min-width: 1024px) {
  .d51-chat-side { transition: width .18s ease, min-width .18s ease; }
  .d51-chat-side.d51-chat-side-collapsed { width: 56px; min-width: 56px; overflow-x: hidden; }
  .d51-chat-side-collapsed [data-testid^="chat-sidebar-"],
  .d51-chat-side-collapsed [data-testid="chat-group-item"],
  .d51-chat-side-collapsed .d51-chat-new-group { position: relative; justify-content: center; padding-left: 0; padding-right: 0; }
  .d51-chat-side-collapsed .d51-chat-side-label,
  .d51-chat-side-collapsed .d51-chat-group-count,
  .d51-chat-side-collapsed [data-testid="chat-group-menu-btn"],
  .d51-chat-side-collapsed [data-testid="chat-group-item"] > svg,
  .d51-chat-side-collapsed [data-testid="chat-empty-groups-toggle"],
  .d51-chat-side.d51-chat-side-collapsed > button { display: none; }
  .d51-chat-side-collapsed [data-testid^="chat-sidebar-"] > span[role="status"],
  .d51-chat-side-collapsed [data-testid="chat-group-item"] > span[role="status"] { position: absolute; top: 2px; right: 8px; margin: 0; }
  .d51-chat-side-collapsed .d51-chat-group-abbr {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border-radius: 7px; background: #f1f4f8; color: #4c5d70; font-size: 11px; font-weight: 600; letter-spacing: -.2px;
  }
  .d51-chat-side-collapsed [data-testid="chat-group-item"].bg-\[\#e8f0fe\] .d51-chat-group-abbr { background: #d6e6f8; color: #185FA5; }
  .d51-chat-side-collapsed .d51-chat-group-label { height: 1px; margin: 6px 10px 0; padding: 0; border-top: 1px solid #eef1f4; font-size: 0; overflow: hidden; }
  .d51-chat-side-collapsed [data-testid="chat-sidebar-all"] { flex-direction: column; gap: 4px; padding-top: 4px; }
  .d51-chat-side-collapsed .d51-chat-fold-side { order: -1; margin: 0; opacity: 1; }
  .d51-chat-list.d51-chat-list-wide { width: 280px; min-width: 280px; }
}

/* 3b) Conversation list collapsed -> 44px rail with expand + unread total (>= md) */
@media (min-width: 768px) {
  .d51-chat-list.d51-chat-list-collapsed { width: 44px; min-width: 44px; }
  .d51-chat-list.d51-chat-list-collapsed > :not(.d51-chat-list-rail) { display: none; }
  .d51-chat-list.d51-chat-list-collapsed > .d51-chat-list-rail {
    display: flex; flex-direction: column; align-items: center; gap: 10px; width: 44px; padding-top: 10px;
  }
  .d51-chat-rail-unread {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: #f1f6fc; color: #185FA5; cursor: pointer;
  }
  .d51-chat-rail-unread > span[role="status"] { top: -4px; right: -6px; }
}
@media (max-width: 767px) {
  .d51-chat-fold.d51-chat-fold-list { display: none; }
}
