[hidden] { display: none !important; }
/* ===== 在线客服 · 访客浮窗（v5.5）===== */
.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 9990; font-size: 14px; }
.chat-launcher {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #4f8cff, #7c5cff);
  box-shadow: 0 6px 24px rgba(79, 140, 255, .45);
  transition: transform .2s, box-shadow .2s;
}
.chat-launcher:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(79, 140, 255, .6); }
.chat-panel {
  position: absolute; right: 0; bottom: 66px; width: 340px; height: 470px;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px; border: 1px solid rgba(124, 140, 255, .28);
  background: rgba(13, 18, 33, .92); backdrop-filter: blur(14px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}
.chat-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: linear-gradient(90deg, rgba(79, 140, 255, .22), rgba(124, 92, 255, .18));
  border-bottom: 1px solid rgba(124, 140, 255, .18);
}
.chat-title { font-weight: 600; color: #e8eefc; flex: 1; }
.chat-status { font-size: 12px; color: #8fa0c0; }
.chat-status.on { color: #34d399; }
.chat-status.off { color: #94a3b8; }
.chat-mini-btn {
  width: 28px; height: 28px; border: 0; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #cfe0ff; font-size: 14px; line-height: 1;
}
.chat-mini-btn:hover { background: rgba(255, 255, 255, .16); }
.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 78%; padding: 8px 11px; border-radius: 12px; line-height: 1.5; word-break: break-word; font-size: 13.5px; }
.chat-msg.visitor { align-self: flex-end; background: linear-gradient(135deg, #4f8cff, #7c5cff); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.agent { align-self: flex-start; background: rgba(255, 255, 255, .09); color: #dbe6fb; border-bottom-left-radius: 3px; }
.chat-msg.system { align-self: center; background: transparent; color: #8fa0c0; font-size: 12px; }
.chat-msg audio { max-width: 220px; height: 34px; }
.chat-msg .cm-name { display: block; font-size: 11px; color: #8fa0c0; margin-bottom: 3px; }
.chat-msg .cm-time { float: right; font-size: 10px; color: #7a89ab; margin-left: 8px; line-height: 13px; }
.chat-msg.visitor .cm-time { color: rgba(255, 255, 255, .5); }
.chat-msg.visitor .cm-name { color: rgba(255, 255, 255, .75); }
.chat-start { padding: 10px 14px 14px; color: #b9c7e4; font-size: 13px; }
.chat-start p { margin: 0 0 10px; }
.chat-start-row { display: flex; gap: 8px; }
.chat-start-row input, .chat-foot input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; outline: none;
  border: 1px solid rgba(124, 140, 255, .3); background: rgba(255, 255, 255, .06);
  color: #e8eefc; font-size: 13.5px;
}
.chat-start-row input:focus, .chat-foot input:focus { border-color: #4f8cff; }
.chat-btn-primary {
  padding: 9px 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #4f8cff, #7c5cff); color: #fff; font-size: 13.5px; white-space: nowrap;
}
.chat-btn-primary:active { transform: scale(.97); }
.chat-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(124, 140, 255, .15); }
.chat-foot input { flex: 1; min-width: 0; }
.chat-voice-btn { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
.chat-voice-btn.rec { background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, .6); }
.chat-voice-tip { font-size: 12px; color: #f59e0b; text-align: center; padding: 2px 0 6px; }

/* 视频通话 overlay */
.call-overlay {
  position: fixed; inset: 0; z-index: 9995; background: rgba(5, 8, 18, .85);
  display: flex; align-items: center; justify-content: center;
}
#callRemote { width: min(92vw, 860px); aspect-ratio: 16/9; background: #000; border-radius: 12px; object-fit: cover; }
#callLocal {
  position: absolute; right: 18px; top: 18px; width: 200px; aspect-ratio: 16/9;
  background: #111; border-radius: 10px; object-fit: cover; border: 1px solid rgba(255,255,255,.25);
}
.call-bar {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-radius: 40px;
  background: rgba(10, 14, 28, .8); backdrop-filter: blur(8px);
}
#callState { color: #cfe0ff; font-size: 14px; }
.call-ops { display: flex; gap: 10px; }
.call-btn { padding: 8px 18px; border: 0; border-radius: 22px; cursor: pointer; font-size: 14px; color: #fff; }
.call-accept { background: #22c55e; }
.call-reject { background: #ef4444; }
.call-danger { background: #ef4444; border-radius: 50%; width: 44px; height: 44px; font-size: 18px; }

/* 移动端 */
@media (max-width: 640px) {
  .chat-widget { right: 12px; bottom: 12px; }
  .chat-panel { position: fixed; left: 8px; right: 8px; bottom: 8px; top: 8px; width: auto; height: auto; }
  #callLocal { width: 130px; right: 10px; top: 10px; }
}
