/* ============================================================
   客服端工作台（桌面优先）— AlipayHK 视觉语言
   三栏：会话队列 / 对话 / 访客上下文
   深色高密度，长时间盯着不累；窄屏自动收成单栏
   ============================================================ */

html,
body.workbench {
  background: var(--ink-900);
  color: var(--ink-100);
  overflow: hidden;
}

/* ============================================================ 登录页 */

body.login-page {
  display: grid;
  place-items: center;
  min-height: 100%;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(0, 156, 232, 0.26), transparent 60%),
    radial-gradient(900px 520px at 92% 108%, rgba(139, 92, 246, 0.18), transparent 62%),
    linear-gradient(160deg, #071522 0%, #0a2133 55%, #06121d 100%);
  color: var(--ink-100);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 404px;
  background: rgba(16, 36, 51, 0.86);
  border: 1px solid rgba(92, 195, 242, 0.18);
  border-radius: var(--radius-xl);
  padding: 40px 34px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  animation: card-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}
.login-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  display: grid;
  place-items: center;
  font-size: 23px;
  box-shadow: 0 8px 26px rgba(0, 156, 232, 0.42);
}
.login-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}
.login-sub {
  font-size: 12.5px;
  color: var(--ink-400);
  margin-top: 3px;
}

.login-field {
  display: block;
  margin-bottom: 15px;
}
.login-field span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-400);
  margin-bottom: 7px;
  font-weight: 600;
}
.login-field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(138, 164, 184, 0.22);
  background: rgba(7, 21, 34, 0.7);
  color: var(--ink-50);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.login-field input:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(0, 156, 232, 0.16);
}

.login-submit {
  width: 100%;
  margin-top: 11px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-brand);
  transition: transform 0.12s ease, filter 0.16s ease;
}
.login-submit:hover {
  filter: brightness(1.08);
}
.login-submit:active {
  transform: scale(0.985);
}
.login-error {
  margin-top: 13px;
  font-size: 13px;
  color: #ff9a86;
  min-height: 18px;
  text-align: center;
}
.login-foot {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--ink-500);
  text-align: center;
  line-height: 1.7;
}

/* ============================================================ 工作台骨架 */

.wb {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr) 282px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ---------------------------------------------------- 左栏：会话队列 */

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ink-800);
  border-right: 1px solid rgba(138, 164, 184, 0.12);
}

.side-top {
  flex: none;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(138, 164, 184, 0.12);
  position: relative;
}
/* 与访客端呼应的顶部品牌色条 */
.side-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500) 70%, var(--brand-400));
}

.me-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}
.me-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.me-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me-status {
  font-size: 11.5px;
  color: var(--ink-400);
  display: flex;
  align-items: center;
  gap: 5px;
}
.me-row .avatar {
  width: 37px;
  height: 37px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff;
}

.icon-plain {
  width: 33px;
  height: 33px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--ink-300);
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-plain:hover {
  background: rgba(138, 164, 184, 0.14);
  color: var(--brand-300);
}

.tabs {
  display: flex;
  gap: 4px;
  background: rgba(7, 21, 34, 0.55);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-400);
  transition: background 0.16s ease, color 0.16s ease;
}
.tab:hover {
  color: var(--ink-200);
}
.tab.active {
  background: rgba(0, 156, 232, 0.18);
  color: #7fd4ff;
}
.tab .badge {
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  background: var(--danger);
}

.queue-search {
  padding: 11px 15px 0;
}
.queue-search input {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(138, 164, 184, 0.16);
  background: rgba(7, 21, 34, 0.6);
  color: var(--ink-100);
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease;
}
.queue-search input:focus {
  border-color: rgba(0, 156, 232, 0.5);
}

.queue {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 8px 20px;
}

.conv {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  transition: background 0.14s ease;
  margin-bottom: 2px;
}
.conv:hover {
  background: rgba(138, 164, 184, 0.08);
}
.conv.active {
  background: rgba(0, 156, 232, 0.14);
}
.conv.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-400);
}

.conv-avat {
  position: relative;
}
.conv-avat .avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--ink-500), var(--ink-700));
  font-size: 15px;
}
.conv-avat .dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  border: 2px solid var(--ink-800);
}

.conv-body {
  min-width: 0;
}
.conv-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.conv-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-50);
}
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  flex: none;
  letter-spacing: 0.02em;
}
.tag.wait {
  background: rgba(245, 166, 35, 0.18);
  color: #f8c471;
}
.tag.mine {
  background: rgba(0, 156, 232, 0.18);
  color: #7fd4ff;
}
.tag.peer {
  background: rgba(138, 164, 184, 0.18);
  color: var(--ink-300);
}
.tag.closed {
  background: rgba(138, 164, 184, 0.14);
  color: var(--ink-400);
}

.conv-preview {
  font-size: 12.5px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.conv-preview.typing {
  color: #7fd4ff;
  font-style: italic;
}

.conv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: none;
}
.conv-time {
  font-size: 11px;
  color: var(--ink-500);
  white-space: nowrap;
}

.empty-hint {
  padding: 44px 22px;
  text-align: center;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.85;
}

/* ---------------------------------------------------- 中栏：对话 */

.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, #0c1c2a 0%, #0a1520 100%);
  position: relative;
}

.chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(138, 164, 184, 0.12);
  background: rgba(12, 28, 42, 0.9);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.chat-head-main {
  flex: 1 1 auto;
  min-width: 0;
}
.chat-head-name {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-head-sub {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 2px;
}
.chat-head-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(138, 164, 184, 0.12);
  color: var(--ink-200);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}
.act-btn:hover {
  background: rgba(138, 164, 184, 0.2);
}
.act-btn:active {
  transform: scale(0.97);
}
.act-btn.primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.act-btn.primary:hover {
  filter: brightness(1.08);
}
.act-btn.danger {
  background: rgba(244, 68, 46, 0.16);
  color: #ff9a86;
}
.act-btn.danger:hover {
  background: rgba(244, 68, 46, 0.26);
}
.act-btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* 消息流 */
.stream {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 20px 22px 10px;
  scroll-behavior: smooth;
}
.stream-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
  justify-content: flex-end;
  max-width: 980px;
  margin: 0 auto;
}

.day-sep {
  align-self: center;
  margin: 18px 0 9px;
  padding: 4px 13px;
  border-radius: var(--radius-pill);
  background: rgba(138, 164, 184, 0.12);
  color: var(--ink-400);
  font-size: 11.5px;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-top: 10px;
  animation: msg-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
.row.out {
  flex-direction: row-reverse;
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}
.row .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  margin-bottom: 2px;
}
.row.out .avatar {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff;
}
.row.in .avatar {
  background: linear-gradient(135deg, var(--ink-500), var(--ink-700));
}

.bubble-col {
  max-width: min(70%, 640px);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.row.out .bubble-col {
  align-items: flex-end;
}

.bubble {
  padding: 10px 15px;
  border-radius: var(--radius);
  background: var(--ink-700);
  color: var(--ink-50);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}
.row.in .bubble {
  border-bottom-left-radius: 6px;
}
.row.out .bubble {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 500;
  border-bottom-right-radius: 6px;
  box-shadow: var(--shadow-brand);
}

.meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-500);
  padding: 0 4px;
}
.meta-line .tick {
  font-size: 12px;
}
.meta-line .tick.read {
  color: var(--brand-300);
  font-weight: 700;
}

.sys-row {
  align-self: center;
  margin: 11px 0;
  max-width: 80%;
  text-align: center;
}
.sys-pill {
  display: inline-block;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: rgba(138, 164, 184, 0.1);
  color: var(--ink-400);
  font-size: 12px;
}
.sys-pill.call {
  background: rgba(0, 156, 232, 0.13);
  color: #7fd4ff;
  font-weight: 600;
}

.media-img {
  max-width: min(40vw, 340px);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  background: var(--ink-700);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.media-img img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

.voice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 104px;
  padding: 10px 15px;
  border-radius: var(--radius);
  background: var(--ink-700);
  color: var(--ink-50);
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}
.row.in .voice {
  border-bottom-left-radius: 6px;
}
.row.out .voice {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-bottom-right-radius: 6px;
}
.voice-play {
  width: 19px;
  height: 19px;
  flex: none;
}
.voice-wave {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 19px;
}
.voice-wave i {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.5;
}
.voice.playing .voice-wave i {
  animation: wave 0.9s ease-in-out infinite;
  opacity: 0.95;
}
@keyframes wave {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}
.voice-secs {
  font-size: 11.5px;
  opacity: 0.75;
  flex: none;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--ink-700);
  color: inherit;
  text-decoration: none;
  max-width: 270px;
}
.file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(0, 156, 232, 0.16);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #7fd4ff;
  flex: none;
}
.file-info {
  min-width: 0;
}
.file-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-size: 11px;
  color: var(--ink-400);
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 3px 0;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-300);
  animation: bounce 1.2s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* 空态 */
.chat-empty {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
}

/* 同事接待中的会话：消息不可见时的占位说明 */
.foreign-notice {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 50px 28px;
  min-height: 100%;
}
.foreign-notice[hidden] {
  display: none;
}
.foreign-notice .fn-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.26);
  color: #f8c471;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.foreign-notice h3 {
  margin: 0 0 9px;
  font-size: 16.5px;
  color: var(--ink-100);
}
.foreign-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-400);
  max-width: 340px;
}

.chat-empty-inner {
  max-width: 340px;
}
.chat-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 22px;
  border-radius: var(--radius-xl);
  background: rgba(0, 156, 232, 0.1);
  border: 1px solid rgba(0, 156, 232, 0.2);
  display: grid;
  place-items: center;
  color: var(--brand-300);
}
.chat-empty h2 {
  font-size: 17.5px;
  margin: 0 0 9px;
  color: var(--ink-100);
}
.chat-empty p {
  font-size: 13px;
  color: var(--ink-400);
  line-height: 1.85;
  margin: 0;
}

/* 输入区 */
.composer {
  flex: none;
  border-top: 1px solid rgba(138, 164, 184, 0.12);
  background: rgba(12, 28, 42, 0.95);
  padding: 11px 20px 15px;
}
.composer-inner {
  max-width: 980px;
  margin: 0 auto;
}
.quick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.quick-row::-webkit-scrollbar {
  display: none;
}
.quick-chip {
  flex: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(138, 164, 184, 0.12);
  color: var(--ink-200);
  font-size: 12px;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.quick-chip:hover {
  background: rgba(0, 156, 232, 0.18);
  color: #7fd4ff;
}
.quick-chip.add {
  background: transparent;
  border: 1px dashed rgba(138, 164, 184, 0.3);
  color: var(--ink-400);
}

.text-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.tools {
  display: flex;
  gap: 2px;
  flex: none;
}
.tool-btn {
  width: 37px;
  height: 37px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--ink-300);
  transition: background 0.14s ease, color 0.14s ease;
}
.tool-btn:hover {
  background: rgba(138, 164, 184, 0.14);
  color: var(--brand-300);
}
.input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 15px;
  border-radius: var(--radius);
  border: 1px solid rgba(138, 164, 184, 0.16);
  background: rgba(7, 21, 34, 0.65);
  color: var(--ink-50);
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.16s ease;
}
.input:focus {
  border-color: rgba(0, 156, 232, 0.55);
}
.send-btn {
  flex: none;
  padding: 0 22px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-brand);
  transition: transform 0.12s ease, opacity 0.16s ease, filter 0.16s ease;
}
.send-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.send-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.send-btn:disabled {
  background: rgba(138, 164, 184, 0.18);
  color: var(--ink-500);
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------------------------------------------------- 右栏：访客上下文 */

.detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ink-800);
  border-left: 1px solid rgba(138, 164, 184, 0.12);
  overflow-y: auto;
}
.detail-sec {
  padding: 17px;
  border-bottom: 1px solid rgba(138, 164, 184, 0.1);
}
.detail-sec h3 {
  margin: 0 0 13px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.detail-kv {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px 10px;
  font-size: 12.5px;
}
.detail-kv dt {
  color: var(--ink-500);
}
.detail-kv dd {
  margin: 0;
  color: var(--ink-100);
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 12px;
}

.visitor-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px;
  border-bottom: 1px solid rgba(138, 164, 184, 0.1);
}
.visitor-card .avatar {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--ink-500), var(--ink-700));
  font-size: 18px;
}
.visitor-card-info {
  min-width: 0;
}
.visitor-card-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visitor-card-sub {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-box {
  background: rgba(7, 21, 34, 0.5);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.stat-num {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7fd4ff;
}
.stat-label {
  font-size: 11px;
  color: var(--ink-400);
  margin-top: 2px;
}

.detail-actions {
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------------------------------------------------- 弹窗 */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 20, 0.72);
  display: grid;
  place-items: center;
  z-index: 500;
  padding: 20px;
  animation: fade-in 0.16s ease;
  backdrop-filter: blur(4px);
}
.modal-mask[hidden] {
  display: none;
}
@keyframes fade-in {
  from { opacity: 0; }
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--ink-700);
  border: 1px solid rgba(138, 164, 184, 0.18);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.08);
  max-height: 86vh;
  overflow-y: auto;
}
@keyframes modal-in {
  from {
    transform: translateY(14px) scale(0.97);
    opacity: 0;
  }
}
.modal h3 {
  margin: 0 0 17px;
  font-size: 16px;
}
.modal-field {
  margin-bottom: 13px;
}
.modal-field span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-400);
  margin-bottom: 7px;
}
.modal-field input,
.modal-field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(138, 164, 184, 0.2);
  background: rgba(7, 21, 34, 0.6);
  color: var(--ink-50);
  outline: none;
  font-size: 13.5px;
}
.modal-field input:focus,
.modal-field textarea:focus {
  border-color: var(--brand-400);
}
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 19px;
}
.modal-foot .act-btn {
  padding: 10px 20px;
}

/* ---------------------------------------------------- 通话浮层 */

.call-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  padding: 56px 24px 52px;
  animation: fade-in 0.2s ease;
}
.call-screen[hidden] {
  display: none;
}
.call-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, #0a7fb8 0%, #052c42 46%, #041018 100%);
  z-index: -1;
}
.call-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8vh;
}
.call-avatar {
  width: 94px;
  height: 94px;
  font-size: 33px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 12px;
  position: relative;
}
.call-screen.incoming .call-avatar::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(92, 195, 242, 0.5);
  animation: ripple 1.6s ease-out infinite;
}
@keyframes ripple {
  from { transform: scale(0.9); opacity: 0.9; }
  to { transform: scale(1.25); opacity: 0; }
}
.call-name {
  font-size: 22px;
  font-weight: 700;
}
.call-status {
  font-size: 14px;
  opacity: 0.75;
}
.call-timer {
  font-size: 30px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.call-timer[hidden] {
  display: none;
}
.call-note {
  font-size: 12px;
  opacity: 0.55;
  margin-top: 14vh;
  text-align: center;
}
.call-actions {
  display: flex;
  gap: 26px;
  align-items: center;
}
.call-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s ease, filter 0.16s ease;
}
.call-btn:active {
  transform: scale(0.93);
}
.call-btn.accept {
  background: linear-gradient(135deg, #33dd94, var(--ok));
}
.call-btn.reject {
  background: linear-gradient(135deg, #ff6b52, #d93a22);
}
.call-btn.mute {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.16);
}
.call-btn.mute.on {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-800);
}
.call-btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.call-btn-label {
  font-size: 11.5px;
  opacity: 0.7;
  margin-top: 8px;
}

/* ---------------------------------------------------- 图片预览 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(3, 10, 16, 0.95);
  display: grid;
  place-items: center;
}
.lightbox[hidden] {
  display: none;
}
.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: var(--radius);
  object-fit: contain;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

/* ---------------------------------------------------- 响应式
   三栏要放得下：队列 292 + 对话区最小可用 460 + 详情 282 ≈ 1034，
   再留出滚动条与边框余量，所以 1160 以下就收起详情栏，
   900 以下把队列改为抽屉——避免中间对话区被压到不可用的宽度 */

.wb {
  position: relative;
}

/* 详情栏收起：靠「详情」按钮切换 */
@media (max-width: 1160px) {
  .wb {
    grid-template-columns: 272px minmax(0, 1fr);
  }
  .detail {
    display: none;
  }
  .wb.show-detail {
    grid-template-columns: 0 minmax(0, 1fr) 272px;
  }
  .wb.show-detail .side {
    display: none;
  }
  .wb.show-detail .detail {
    display: flex;
  }
}

/* 队列改为抽屉：默认隐藏，点顶部按钮滑出 */
@media (max-width: 900px) {
  .wb {
    grid-template-columns: minmax(0, 1fr);
  }
  .side {
    position: absolute;
    inset: 0 auto 0 0;
    width: 300px;
    z-index: 40;
    transform: translateX(-102%);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
  }
  .wb.side-open .side {
    transform: none;
  }
  .wb.show-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .wb.show-detail .detail {
    display: none;
  }
  .chat-head-sub {
    display: none;
  }
  .composer {
    padding: 9px 13px 13px;
  }
  .stream {
    padding: 15px 14px 8px;
  }
  .bubble-col {
    max-width: 86%;
  }
  .menu-btn {
    display: grid !important;
  }
}

.menu-btn {
  display: none;
}

/* 超宽屏：对话区不再无限拉伸，保证行长可读 */
@media (min-width: 1800px) {
  .wb {
    grid-template-columns: 320px minmax(0, 1fr) 300px;
  }
  .stream-inner,
  .composer-inner {
    max-width: 1100px;
  }
}
