﻿/* ==========================================================================
   Hengxin Cloud · Team messaging
   A WeChat-style conversation list, bubbles and composer in black/cobalt.
   ========================================================================== */

.chat-shell {
  height: calc(100vh - var(--topbar-h) - 83px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e0e8f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .05);
}

/* --------------------------------------------------------------------------
   Conversation rail
   -------------------------------------------------------------------------- */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #f7f9fd;
  border-right: 1px solid #e5ecf5;
}
.chat-sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 14px;
}
.chat-kicker {
  margin-bottom: 5px;
  color: #2563eb;
  font-family: var(--font-num);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .16em;
}
.chat-sidebar-head h1 {
  color: #000;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.04em;
}
.chat-sidebar-head-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.chat-my-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid #dbe7f7;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .04);
  transition: border-color .16s, transform .16s;
}
.chat-my-avatar:hover { border-color: #b8d0ea; transform: translateY(-1px); }
.chat-my-avatar .avatar { width: 100%; height: 100%; display: grid; border-radius: 0; }
.chat-new-btn {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #dbe7f7;
  border-radius: 9px;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(15, 23, 42, .04);
  transition: background .16s, border-color .16s, transform .16s;
}
.chat-new-btn:hover { background: #eef5ff; border-color: #bcd3ef; transform: translateY(-1px); }
.chat-new-btn .icon { width: 14px; height: 14px; }
.chat-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin: 0 16px 12px;
  padding: 0 10px;
  border: 1px solid #e1e9f4;
  border-radius: 9px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
.chat-search:focus-within { border-color: #a9c4e8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .06); }
.chat-search > .icon { width: 13px; height: 13px; color: #7f93ab; }
.chat-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #000;
  font-family: var(--font);
  font-size: 10px;
}
.chat-search input::placeholder { color: #93a4b9; }
.chat-list { flex: 1; overflow-y: auto; padding: 0 9px 10px; scrollbar-width: thin; }
.chat-conversation {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.chat-conversation:hover { background: #fff; }
.chat-conversation.active {
  background: linear-gradient(135deg, #2f7cf6 0%, #1d4ed8 100%);
  border-color: #2563eb;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .24);
}
.chat-conversation.active .chat-conv-top strong { color: #fff; }
.chat-conversation.active .chat-conv-time { color: rgba(255, 255, 255, .68); }
.chat-conversation.active .chat-last { color: rgba(255, 255, 255, .82); }
.chat-conversation.active .chat-avatar {
  border: 1px solid rgba(255, 255, 255, .48);
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
.chat-conversation.active .chat-avatar.group {
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
.chat-conversation.active .chat-avatar img {
  border-radius: 9px;
}
.chat-conversation.active .chat-unread {
  background: #fff;
  color: #1d4ed8;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--chat-avatar, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.chat-avatar.group {
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px rgba(37, 99, 235, .16);
}
.chat-avatar.group .icon { width: 18px; height: 18px; }
.chat-avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; }
.chat-avatar.header-avatar { width: 36px; height: 36px; border-radius: 9px; font-size: 12px; }
.chat-avatar.header-avatar .icon { width: 17px; height: 17px; }
.chat-conv-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.chat-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-conv-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  font-size: 10.5px;
  font-weight: 600;
}
.chat-conv-time { flex: 0 0 auto; color: #95a5b8; font-family: var(--font-num); font-size: 7.5px; }
.chat-conv-bottom { display: flex; align-items: center; gap: 7px; min-width: 0; }
.chat-last {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #75879c;
  font-size: 8.5px;
}
.chat-conversation.active .chat-last { color: rgba(255, 255, 255, .82); }
.chat-unread {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-family: var(--font-num);
  font-size: 7px;
  font-weight: 600;
}
.chat-list-empty { padding: 38px 16px; text-align: center; color: #8b9cb2; }
.chat-list-empty span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #edf3fb; color: #7390b0; }
.chat-list-empty span .icon { width: 14px; height: 14px; }
.chat-list-empty p { margin-top: 8px; font-size: 9px; }
.chat-sidebar-foot {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 17px;
  border-top: 1px solid #e5ecf5;
  color: #7c8fa6;
  font-size: 8px;
  letter-spacing: .02em;
}
.chat-online-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.chat-total { margin-left: auto; color: #2563eb; font-family: var(--font-num); font-size: 7.5px; }

/* --------------------------------------------------------------------------
   Conversation
   -------------------------------------------------------------------------- */
.chat-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 1px 1px, rgba(37, 99, 235, .045) 1px, transparent 0) 0 0 / 22px 22px,
    #f5f8fd;
}
.chat-header {
  height: 67px;
  flex: 0 0 67px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid #e5ecf5;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px);
}
.chat-back {
  display: none;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #526983;
  cursor: pointer;
}
.chat-back:hover { background: #eef4fc; }
.chat-back .icon { width: 14px; height: 14px; }
.chat-header-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-header-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  font-size: 12.5px;
  font-weight: 600;
}
.chat-header-main span { color: #7f91a6; font-size: 8px; }
.chat-header-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: #7388a1;
  font-family: var(--font-num);
  font-size: 7.5px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.chat-header-status i { width: 4px; height: 4px; border-radius: 50%; background: #2563eb; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.chat-messages { width: min(820px, 100%); margin: 0 auto; padding: 16px 24px 8px; }
.chat-time-sep {
  margin: 13px 0 10px;
  color: #8b9caf;
  font-family: var(--font-num);
  font-size: 7px;
  letter-spacing: .04em;
  text-align: center;
}
.chat-message { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; }
.chat-message.own { flex-direction: row-reverse; }
.chat-msg-body { max-width: min(70%, 590px); min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.chat-message.own .chat-msg-body { align-items: flex-end; }
.chat-sender-name { color: #70859e; font-size: 7.5px; padding-left: 2px; }
.chat-bubble {
  padding: 9px 12px;
  border: 1px solid #e3e7ee;
  border-radius: 3px 12px 12px 12px;
  background: #f5f6f8;
  color: #111827;
  font-size: 11px;
  line-height: 1.7;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .035);
}
.chat-message.own .chat-bubble {
  border-color: transparent;
  border-radius: 12px 3px 12px 12px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .18);
}
.chat-welcome {
  width: min(420px, 100%);
  margin: 0 auto;
  padding-top: 16vh;
  text-align: center;
}
.chat-welcome-icon,
.chat-empty-icon {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce8f6;
  border-radius: 13px;
  background: #fff;
  color: #2563eb;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .07);
}
.chat-welcome-icon .icon,
.chat-empty-icon .icon { width: 21px; height: 21px; }
.chat-welcome h3 { margin-top: 12px; color: #000; font-size: 13px; font-weight: 600; }
.chat-welcome p { margin-top: 5px; color: #7a8da3; font-size: 9px; }
.chat-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.chat-empty h2 { margin-top: 14px; color: #000; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.chat-empty p { margin-top: 5px; color: #7a8da3; font-size: 9.5px; }
.chat-empty .btn { margin-top: 17px; }
.chat-main-loading { height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; color: #7b8fa7; font-size: 10px; }

/* --------------------------------------------------------------------------
   Composer
   -------------------------------------------------------------------------- */
.chat-composer {
  flex: 0 0 auto;
  padding: 11px 20px 13px;
  border-top: 1px solid #e5ecf5;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(16px);
}
.chat-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border: 1px solid #dce6f3;
  border-radius: 11px;
  background: #fbfdff;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.chat-input-shell:focus-within {
  border-color: #a9c4e8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .06);
}
.chat-input-shell textarea {
  min-height: 27px;
  max-height: 104px;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #000;
  font-family: var(--font);
  font-size: 10.5px;
  line-height: 1.7;
  padding: 3px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.chat-input-shell textarea::placeholder { color: #8fa1b5; }
.chat-send {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
  transition: opacity .16s, transform .16s;
}
.chat-send:hover:not(:disabled) { transform: translateY(-1px); }
.chat-send:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.chat-send .icon { width: 14px; height: 14px; }
.chat-composer-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; color: #8496ab; font-size: 7px; }

/* --------------------------------------------------------------------------
   New conversation
   -------------------------------------------------------------------------- */
.chat-contact-list { display: flex; flex-direction: column; gap: 5px; max-height: 430px; overflow-y: auto; }
.chat-contact {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid #e7eef7;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.chat-contact:hover { border-color: #c4d8ef; background: #fbfdff; }
.chat-contact:disabled { opacity: .55; }
.chat-contact-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--chat-avatar, #2563eb);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
}
.chat-contact-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.chat-contact-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-contact-copy strong { color: #000; font-size: 10.5px; font-weight: 500; }
.chat-contact-copy small { color: #8092a8; font-size: 8px; }
.chat-contact > .icon { width: 13px; height: 13px; color: #8fa2b8; }

/* --------------------------------------------------------------------------
   Attachments and group chat
   -------------------------------------------------------------------------- */
.chat-attach {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #eef5ff;
  color: #52749c;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.chat-attach:hover:not(:disabled) { background: #e3efff; color: #1d4ed8; }
.chat-attach:disabled { opacity: .38; cursor: not-allowed; }
.chat-attach .icon { width: 14px; height: 14px; }
.chat-upload-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 2px 0;
  color: #2563eb;
  font-size: 8px;
}
.chat-upload-status .spinner { width: 11px; height: 11px; border-width: 2px; }

.chat-bubble.chat-bubble-attachment,
.chat-message.own .chat-bubble.chat-bubble-attachment {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.chat-attachment-caption {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #e3e7ee;
  border-radius: 10px;
  background: #f5f6f8;
  color: #000;
  font-size: 10.5px;
  line-height: 1.65;
}
.chat-image-frame,
.chat-video-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #e1e9f3;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(135deg, #f2f7fd, #e9f0f9);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .05);
}
.chat-image-frame { width: min(270px, 44vw); min-height: 130px; max-width: 300px; }
.chat-video-frame { width: min(330px, 54vw); min-height: 170px; background: #0b1220; }
.chat-image {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  opacity: 0;
  transition: opacity .2s;
}
.chat-image-frame.is-loaded .chat-image { opacity: 1; }
.chat-image-frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.55) 48%, transparent 72%);
  animation: chatAttachmentShimmer 1.3s infinite;
}
.chat-image-frame.is-error { min-height: 120px; }
.chat-image-frame.is-error::after {
  content: "图片加载失败";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #7b8fa6;
  font-size: 8px;
}
@keyframes chatAttachmentShimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.chat-video { display: block; width: 100%; max-height: 340px; background: #0b1220; }
.chat-attachment-foot {
  width: min(270px, 44vw);
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #e1e9f3;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  background: #fff;
  color: #8193a8;
  font-size: 7.5px;
}
.chat-video-frame + .chat-attachment-foot { width: min(330px, 54vw); max-width: 360px; }
.chat-attachment-foot > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-attachment-foot button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 7.5px;
  cursor: pointer;
}
.chat-attachment-foot button:hover { color: #1d4ed8; text-decoration: underline; }
.chat-attachment-foot .icon { width: 10px; height: 10px; }
.chat-file-card {
  width: min(310px, 58vw);
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e3e7ee;
  border-radius: 10px;
  background: #f5f6f8;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .045);
  transition: border-color .16s, box-shadow .16s;
}
.chat-file-card:hover { border-color: #bcd3ed; box-shadow: 0 5px 14px rgba(37, 99, 235, .08); }
.chat-file-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef5ff;
  color: #2563eb;
}
.chat-file-icon .icon { width: 15px; height: 15px; }
.chat-file-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #000; font-size: 10px; font-weight: 500; }
.chat-file-copy small { color: #8193a8; font-size: 7.5px; }
.chat-file-download { flex: 0 0 auto; color: #2563eb; }
.chat-file-download .icon { width: 14px; height: 14px; }

.chat-new-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 12px;
  border: 1px solid #e4ecf7;
  border-radius: 10px;
  background: #eef4fc;
}
.chat-new-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #61758d;
  font-size: 9.5px;
  cursor: pointer;
}
.chat-new-tab .icon { width: 12px; height: 12px; }
.chat-new-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .09); }
.chat-group-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 6px;
  color: #526983;
  font-size: 8.5px;
}
.chat-group-pick-head span:last-child { color: #2563eb; }
.chat-group-list { max-height: 280px; }
.chat-group-contact { cursor: pointer; }
.chat-group-contact input {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  accent-color: #2563eb;
  cursor: pointer;
}
.chat-group-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #e3edf8;
  border-radius: 8px;
  background: #f8fbff;
  color: #71859c;
  font-size: 8px;
  line-height: 1.6;
}
.chat-group-note .icon { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 1px; color: #2563eb; }

/* Composer tools, emoji, stickers and voice */
.chat-input-shell { padding-left: 7px; gap: 5px; }
.chat-input-tools { display: flex; align-items: center; gap: 1px; flex: 0 0 auto; }
.chat-input-tools .chat-attach { width: 27px; height: 27px; background: transparent; color: #667d96; }
.chat-input-tools .chat-attach:hover:not(:disabled) { background: #eef5ff; color: #1d4ed8; }
.chat-input-tools .chat-attach.active { background: #eaf2ff; color: #1d4ed8; }
.chat-input-tools .chat-attach.recording { background: #fee2e2; color: #dc2626; animation: chatVoicePulse 1.1s infinite; }
.chat-attach .icon { width: 14px; height: 14px; }
@keyframes chatVoicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .22); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, .06); }
}

.chat-emoji-panel {
  margin: 0 0 8px;
  padding: 9px;
  border: 1px solid #e2ebf6;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}
.chat-emoji-panel[hidden],
.chat-recording[hidden],
.chat-upload-status[hidden] { display: none !important; }
.chat-emoji-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.chat-emoji-tabs { display: flex; gap: 2px; padding: 2px; border-radius: 7px; background: #f1f6fd; }
.chat-emoji-tab {
  height: 25px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6a8098;
  font-size: 8.5px;
  cursor: pointer;
}
.chat-emoji-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.chat-emoji-close {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8295aa;
  cursor: pointer;
}
.chat-emoji-close:hover { background: #f2f6fb; color: #1d4ed8; }
.chat-emoji-close .icon { width: 12px; height: 12px; }
.chat-emoji-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 1px;
  max-height: 174px;
  overflow-y: auto;
}
.chat-emoji-item {
  height: 31px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.chat-emoji-item:hover { background: #f2f7fe; transform: scale(1.08); }
.chat-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 198px;
  overflow-y: auto;
}
.chat-sticker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid #e7eef7;
  border-radius: 9px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.chat-sticker-item:hover { border-color: #bfd5ec; background: #fff; transform: translateY(-1px); }
.chat-sticker-item img { width: 64px; height: 64px; object-fit: contain; }
.chat-sticker-item span { display: none; }

.chat-recording {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  padding: 6px 8px;
  border: 1px solid #f0dada;
  border-radius: 9px;
  background: #fff8f8;
  color: #8a5b5b;
  font-size: 8px;
}
.chat-recording-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #dc2626;
  animation: chatVoicePulse 1.1s infinite;
}
.chat-recording strong { color: #b91c1c; font-family: var(--font-num); font-size: 8.5px; }
.chat-recording-label { flex: 1; color: #987373; }
.chat-recording .btn { height: 24px; padding: 0 8px; font-size: 7.5px; }
.chat-recording .btn .icon { width: 10px; height: 10px; }

.chat-sticker-bubble { padding: 0; border: 0; background: transparent; box-shadow: none; }
.chat-sticker {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .12));
}
.chat-voice-wrap { width: min(260px, 48vw); max-width: 290px; }
.chat-voice-bubble {
  width: min(260px, 48vw);
  max-width: 290px;
  overflow: hidden;
  border: 1px solid #e3e7ee;
  border-radius: 11px 11px 0 0;
  background: #f5f6f8;
}
.chat-message.own .chat-voice-bubble { border-color: #2563eb; background: linear-gradient(135deg, #3b82f6, #2563eb); }
.chat-voice-play {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: #334155;
  cursor: pointer;
}
.chat-message.own .chat-voice-play { color: #fff; }
.chat-voice-play-icon,
.chat-voice-pause-icon { display: grid; place-items: center; flex: 0 0 auto; }
.chat-voice-pause-icon { display: none; }
.chat-voice-play .icon { width: 12px; height: 12px; }
.chat-voice-bubble.is-playing .chat-voice-play-icon { display: none; }
.chat-voice-bubble.is-playing .chat-voice-pause-icon { display: grid; }
.chat-voice-wave { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 86px; height: 22px; }
.chat-voice-wave i {
  width: 2px;
  height: var(--voice-h, 9px);
  border-radius: 2px;
  background: #94a3b8;
  opacity: .8;
}
.chat-message.own .chat-voice-wave i { background: rgba(255, 255, 255, .78); }
.chat-voice-bubble.is-playing .chat-voice-wave i { animation: chatVoiceWave .8s ease-in-out infinite alternate; }
.chat-voice-bubble.is-playing .chat-voice-wave i:nth-child(3n) { animation-delay: .18s; }
.chat-voice-bubble.is-playing .chat-voice-wave i:nth-child(3n+1) { animation-delay: .32s; }
@keyframes chatVoiceWave {
  from { transform: scaleY(.55); }
  to { transform: scaleY(1.15); }
}
.chat-voice-time { flex: 0 0 auto; font-family: var(--font-num); font-size: 8px; }
.chat-voice-bubble audio { display: none; }
.chat-voice-foot {
  width: min(260px, 48vw);
  max-width: 290px;
  border-color: #dbe8f7;
}
.chat-message.own .chat-voice-foot { border-color: #dbe8f7; background: #fff; color: #71859c; }

@media (max-width: 900px) {
  .chat-input-tools .chat-attach { width: 25px; height: 25px; }
  .chat-input-shell { padding-left: 4px; gap: 3px; }
  .chat-emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .chat-sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chat-sticker-item img { width: 56px; height: 56px; }
  .chat-voice-wrap, .chat-voice-foot, .chat-voice-bubble { width: min(230px, 62vw); }
  .chat-sticker { width: 96px; height: 96px; }
}


@media (max-width: 900px) {
  .chat-image-frame, .chat-attachment-foot { width: min(240px, 58vw); }
  .chat-video-frame, .chat-video-frame + .chat-attachment-foot { width: min(290px, 68vw); }
  .chat-file-card { width: min(280px, 72vw); }
}


@media (max-width: 1180px) {
  .chat-shell { height: calc(100vh - var(--topbar-h) - 74px); }
}
@media (max-width: 900px) {
  .chat-shell {
    height: calc(100vh - var(--topbar-h) - 59px);
    min-height: 500px;
    grid-template-columns: 1fr;
    border-radius: 14px;
  }
  .chat-sidebar { border-right: 0; }
  .chat-main { display: none; }
  .chat-shell.chat-mobile-open .chat-sidebar { display: none; }
  .chat-shell.chat-mobile-open .chat-main { display: flex; }
  .chat-back { display: grid; }
  .chat-header { height: 61px; flex-basis: 61px; padding: 0 13px; }
  .chat-header-status { display: none; }
  .chat-messages { padding: 12px 12px 6px; }
  .chat-composer { padding: 9px 12px 10px; }
  .chat-welcome { padding-top: 12vh; }
}
@media (max-width: 760px) {
  .chat-shell { height: calc(100vh - var(--topbar-h) - 59px); }
  .chat-sidebar-head { padding: 16px 14px 11px; }
  .chat-search { margin: 0 12px 10px; }
  .chat-list { padding: 0 6px 8px; }
  .chat-conversation { padding: 9px 8px; }
  .chat-sidebar-foot { padding: 0 13px; }
  .chat-header { padding: 0 11px; }
  .chat-bubble { font-size: 10.5px; }
  .chat-empty h2 { font-size: 15px; }
}



/* Clear chat zoning: white conversation surface, light-grey rails */
.chat-shell { background: #eef2f7; border-color: #dbe5f0; }
.chat-sidebar {
  background: #eef2f7;
  border-right-color: #dbe5f0;
}
.chat-sidebar-head,
.chat-sidebar-foot { background: transparent; }
.chat-main { background: #ffffff; }
.chat-header {
  background: #f4f7fb;
  border-bottom-color: #e0e8f1;
  backdrop-filter: none;
}
.chat-composer {
  background: #f4f7fb;
  border-top-color: #e0e8f1;
  backdrop-filter: none;
}
.chat-input-shell { background: #ffffff; }
.chat-input-shell:focus-within { background: #ffffff; }
.chat-search { background: #ffffff; }
.chat-conversation:hover { background: rgba(255, 255, 255, .62); }
.chat-conversation.active:hover { background: linear-gradient(135deg, #2f7cf6 0%, #1d4ed8 100%); }
