/* 在线沟通面板（卖家 ↔ 回收商）。样式参照 QCT.Buyer 的 _ChatPanel.cshtml，配色换成本站绿色。 */

.pc-chat { display: none; position: fixed; inset: 0; z-index: 80; }
.pc-chat.is-open { display: block; }
.pc-chat-mask { position: absolute; inset: 0; background: rgba(15, 48, 31, .42); }
.pc-chat-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100%;
  display: flex; flex-direction: column; background: #fff;
  box-shadow: -8px 0 24px rgba(15, 48, 31, .16);
}
@media (max-width: 640px) { .pc-chat-panel { width: 100%; } }

.pc-chat-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--line); background: #f8faf6;
}
.pc-chat-who { flex: 1; min-width: 0; }
.pc-chat-who h3 {
  margin: 0; font-size: 15px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-chat-sub {
  margin: 4px 0 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-chat-state { margin: 4px 0 0; font-size: 12px; color: #94a3b8; }
.pc-chat-state.is-off { color: #b45309; }
.pc-chat-close {
  flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: #eef3ea; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.pc-chat-close:hover { background: #e3ecdd; color: var(--ink); }

.pc-chat-body {
  flex: 1; overflow-y: auto; padding: 14px 16px; background: #f6f9f3;
  -webkit-overflow-scrolling: touch;
}
.pc-chat-more {
  display: none; width: 100%; margin-bottom: 10px; padding: 6px 0;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--muted); font-size: 12px; cursor: pointer;
}
.pc-chat-more:hover { color: var(--green); border-color: #b4d3ab; }
.pc-chat-more.is-busy { color: #94a3b8; cursor: default; }

.pc-chat-day { margin: 10px 0; text-align: center; font-size: 12px; color: #94a3b8; }
.pc-chat-row { display: flex; margin-bottom: 10px; }
.pc-chat-row.is-mine { justify-content: flex-end; }
/* 宽度上限放在气泡外那层：中文最小内容宽度是一个字，写在气泡上会被压成一列 */
.pc-chat-msg { flex: 0 0 auto; max-width: 78%; }
.pc-chat-bubble {
  padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.pc-chat-row.is-peer .pc-chat-bubble {
  background: #fff; border: 1px solid var(--line); color: var(--ink); border-top-left-radius: 4px;
}
.pc-chat-row.is-mine .pc-chat-bubble {
  background: var(--green); color: #fff; border-top-right-radius: 4px;
}
.pc-chat-bubble img { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; }
.pc-chat-time { margin: 4px 2px 0; font-size: 11px; color: #94a3b8; }
.pc-chat-row.is-mine .pc-chat-time { text-align: right; }
.pc-chat-row.is-pending .pc-chat-bubble { opacity: .65; }
.pc-chat-row.is-failed .pc-chat-bubble { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; }
.pc-chat-empty { padding: 32px 0; text-align: center; font-size: 13px; color: #94a3b8; }

.pc-chat-foot { border-top: 1px solid var(--line); padding: 12px 16px 14px; }
.pc-chat-input {
  width: 100%; resize: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px; color: var(--ink); outline: none;
}
.pc-chat-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147, 197, 253, .3); }
.pc-chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.pc-chat-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--red); }
.pc-chat-actions .btn[disabled] { opacity: .6; cursor: default; }

/* 导航未读红点：卖家顶栏用 span，回收商侧栏复用 .side-nav em */
.chat-nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
/* 回收商侧栏复用 .side-nav em；聊天未读用红色，和待报价的柠檬绿区分开 */
.side-nav em[data-chat-nav-badge] { background: #ef4444; color: #fff; }

/* 整行按钮（订单详情右侧主操作） */
.btn-block { width: 100%; }

/* ---------- 消息中心会话列表 ---------- */
.chat-thread-list { display: flex; flex-direction: column; }
.chat-thread-item { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.chat-thread-item:last-child { border-bottom: 0; }
.chat-thread-avatar {
  flex: none; width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--line); background: #fff;
}
.chat-thread-avatar-text {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 17px;
}
.chat-thread-last {
  margin-top: 4px; font-size: 13px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

