/* cs-widget.css — 干活呗智能客服悬浮窗
   2026-10-17：统一官网浅蓝主题；类名以 cs- 前缀，与站点隔离
*/
:root {
  --cs-brand: #1d4ed8;
  --cs-brand-2: #3B82F6;
  --cs-brand-dark: #1E3A8A;
  --cs-brand-bg: #EFF6FF;
  --cs-brand-soft: #DBEAFE;
  --cs-line: #DCE7F8;
  --cs-text: #1F2937;
  --cs-sub: #4b5563;
  --cs-danger: #EF4444;
}

/* === 悬浮按钮 === */
.cs-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF 0%, #EFF6FF 100%);
  border: 2px solid rgba(37, 99, 235, 0.32);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.20), 0 2px 8px rgba(30, 58, 138, 0.10);
  cursor: pointer;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  color: var(--cs-brand);
  overflow: hidden;
}
.cs-btn .cs-btn-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.cs-btn .cs-btn-bee {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.cs-btn.cs-breathing { animation: cs-breathe 5s ease-in-out infinite; }
.cs-btn:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28), 0 3px 10px rgba(30, 58, 138, 0.14);
}
.cs-btn.cs-active,
.cs-btn.cs-open {
  background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%);
  border-color: transparent;
  color: #fff;
  animation: none;
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.34);
}
@keyframes cs-breathe {
  0%, 92%, 100% { transform: scale(1); }
  94% { transform: scale(1.08); }
  96% { transform: scale(1.04); }
  98% { transform: scale(1.06); }
}
.cs-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  background: var(--cs-danger);
  color: #fff;
  border-radius: 999px;
  border: 2px solid #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cs-badge.cs-show { display: flex; }

/* === 聊天面板（W113：PC 端放大，视口偏矮时自适应，不再溢出屏幕） === */
.cs-panel {
  position: fixed;
  right: 24px;
  bottom: 94px;
  z-index: 899;
  width: 440px;
  height: 680px; /* 老浏览器兜底：不支持 min() 时用它 */
  height: min(680px, calc(100vh - 130px));
  min-height: 420px;
  background: #fff;
  border: 1px solid rgba(191, 219, 254, 0.78);
  border-radius: 18px;
  box-shadow: 0 20px 54px rgba(30, 58, 138, 0.18), 0 4px 16px rgba(37, 99, 235, 0.10);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--cs-text);
  animation: cs-slide-up 0.2s ease;
}
.cs-panel.cs-show { display: flex; }
@keyframes cs-slide-up {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Header === */
.cs-head {
  min-height: 64px;
  background: linear-gradient(135deg, var(--cs-brand-dark) 0%, var(--cs-brand) 58%, #60A5FA 100%);
  color: #fff;
  padding: 10px 14px 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}
.cs-head::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -46px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}
.cs-head-title { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cs-head-title b { font-weight: 700; font-size: 16px; line-height: 1.15; display: block; letter-spacing: 0.01em; }
.cs-head-title small { font-size: 11px; opacity: 0.88; display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.cs-head-title small::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  display: inline-block;
}
.cs-head-close {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.94;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease;
}
.cs-head-close:hover { background: rgba(255, 255, 255, 0.20); }

/* === 消息流 === */
.cs-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 12px;
  background:
    radial-gradient(circle at 18% 0%, rgba(219, 234, 254, 0.68) 0, rgba(219, 234, 254, 0) 34%),
    linear-gradient(180deg, #F8FBFF 0%, #F3F7FD 100%);
  -webkit-overflow-scrolling: touch;
}
.cs-body::-webkit-scrollbar { width: 5px; }
.cs-body::-webkit-scrollbar-thumb { background: #BFDBFE; border-radius: 3px; }
.cs-body::-webkit-scrollbar-track { background: transparent; }

.cs-msg { display: flex; margin-bottom: 12px; align-items: flex-end; }
.cs-msg-user { justify-content: flex-end; }
.cs-msg-bot, .cs-msg-card, .cs-msg-guide, .cs-msg-fallback { justify-content: flex-start; }
.cs-msg .cs-avatar {
  width: 30px;
  height: 30px;
  background: var(--cs-brand-soft);
  color: var(--cs-brand);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 7px;
  overflow: hidden;
}
.cs-msg .cs-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.cs-msg-user .cs-avatar { display: none; }

.cs-bubble {
  max-width: 79%;
  padding: 10px 12px;
  border-radius: 13px;
  line-height: 1.58;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: none;
  position: relative;
}
.cs-msg-bot .cs-bubble {
  background: #fff;
  color: var(--cs-text);
  border: 1px solid #E2EDFC;
  border-bottom-left-radius: 4px;
}
.cs-msg-user .cs-bubble {
  background: #95ec69;
  color: #000;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.cs-bubble.cs-welcome {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  color: var(--cs-brand-dark);
  border: 1px solid #BFDBFE;
}
.cs-bubble.cs-loading { min-width: 42px; min-height: 24px; }
.cs-bubble.cs-loading::after {
  content: "...";
  display: inline-block;
  color: var(--cs-brand);
  letter-spacing: 2px;
  animation: cs-dots 1.2s infinite;
}
@keyframes cs-dots {
  0% { opacity: .25; }
  50% { opacity: 1; }
  100% { opacity: .25; }
}
.cs-time {
  align-self: center;
  margin: 2px auto 10px;
  background: #DBEAFE;
  color: #475569;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  line-height: 1.5;
}

/* === 快捷问题 === */
.cs-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px 37px;
}
.cs-quick-tag,
.cs-tag {
  background: #fff;
  border: 1px solid #BFDBFE;
  color: var(--cs-brand);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}
.cs-quick-tag:hover,
.cs-tag:hover { background: var(--cs-brand-bg); border-color: #93C5FD; transform: translateY(-1px); }

/* === 服务卡片 === */
.cs-card {
  background: #fff;
  border: 1px solid #E2EDFC;
  border-left: 4px solid var(--cs-brand);
  border-radius: 13px;
  padding: 13px 14px;
  margin: 4px 0 10px;
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.06);
  max-width: 100%;
}
.cs-card-head { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.cs-card-icon { font-size: 16px; }
.cs-card-name { font-weight: 700; }
.cs-card-summary { font-size: 12px; color: var(--cs-sub); margin-bottom: 9px; line-height: 1.55; }
.cs-card-prices { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; font-size: 12px; color: #666; }
.cs-card-market { text-decoration: line-through; }
.cs-card-sale { color: #c2410c; font-size: 18px; font-weight: 800; }
.cs-card-cycle { font-size: 12px; color: #666; margin-bottom: 9px; }
.cs-card-btn,
.cs-card-book {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}
.cs-card-btn:hover,
.cs-card-book:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* === 引导卡片 === */
.cs-guide {
  background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
  border: 1px solid #BFDBFE;
  border-radius: 13px;
  padding: 13px 14px;
  margin: 4px 0 10px;
  max-width: 100%;
}
.cs-guide-title { font-weight: 700; font-size: 14px; color: var(--cs-brand-dark); margin-bottom: 6px; }
.cs-guide-desc { font-size: 12px; color: var(--cs-sub); margin-bottom: 11px; line-height: 1.55; }
.cs-guide-actions { display: flex; gap: 8px; }
.cs-guide-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%);
  color: #fff;
  border: 0;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}
.cs-guide-btn.cs-ghost { background: #fff; color: var(--cs-brand); border: 1px solid #93C5FD; }
.cs-guide-btn.cs-primary { background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%); color: #fff; }

/* === 兜底问题 === */
.cs-fallback {
  background: #fff;
  border-radius: 13px;
  padding: 11px 13px;
  margin: 4px 0 10px;
  border: 1px dashed #93C5FD;
  max-width: 100%;
}
.cs-fallback-title { font-size: 13px; color: var(--cs-sub); margin-bottom: 8px; }
.cs-fallback-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-fallback-tags button,
.cs-fallback-q {
  background: var(--cs-brand-bg);
  border: 1px solid #BFDBFE;
  color: var(--cs-brand);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.cs-fallback-tags button:hover,
.cs-fallback-q:hover { background: var(--cs-brand-soft); }

/* === 输入区 === */
.cs-input-bar {
  flex-shrink: 0;
  border-top: 1px solid #E2EDFC;
  background: rgba(255, 255, 255, 0.96);
  padding: 9px 10px 10px;
}
.cs-input-row { display: flex; flex-direction: column; }
.cs-textarea {
  width: 100%;
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  height: 68px;
  min-height: 52px;
  max-height: 140px;
  box-sizing: border-box;
  outline: none;
  background: transparent;
  transition: box-shadow 0.15s ease;
}
.cs-textarea:focus { box-shadow: none; }
.cs-toolbar { display: flex; align-items: center; gap: 4px; padding: 2px 10px 6px; }
.cs-tool-btn { width: 34px; height: 34px; background: transparent; border: none; border-radius: 8px; color: #64748B; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.cs-tool-btn:hover { background: #F1F5F9; color: #1E293B; }
.cs-send {
  margin-left: auto;
  height: 34px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  transition: filter 0.15s ease;
}
.cs-send:hover { filter: brightness(1.05); }
.cs-send.cs-disabled,
.cs-send:disabled { background: #CBD5E1; cursor: not-allowed; }
.cs-img { max-width: 50px; max-height: 75px; width: auto; height: auto; object-fit: contain; border-radius: 8px; display: block; cursor: pointer; }
.cs-file { display: inline-flex; align-items: center; gap: 6px; color: #2563EB; text-decoration: none; font-size: 13px; word-break: break-all; }

/* === 留资 Modal === */
.cs-modal-mask {
  position: fixed;
  /* 不用 inset：老浏览器不识别，会导致遮罩铺不满 */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cs-modal-mask.cs-show { display: flex; }
.cs-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 330px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.cs-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #E2EDFC;
  background: linear-gradient(135deg, #EFF6FF 0%, #fff 100%);
}
.cs-modal-head h4 { margin: 0; font-size: 15px; color: var(--cs-brand-dark); }
.cs-modal-close { background: transparent; border: 0; font-size: 22px; color: #94A3B8; cursor: pointer; padding: 0 4px; line-height: 1; }
.cs-modal-body { padding: 15px 16px; }
.cs-field { margin-bottom: 11px; }
.cs-field label { display: block; font-size: 12px; color: var(--cs-sub); margin-bottom: 5px; }
.cs-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #CBD5E1;
  border-radius: 9px;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  background: #F8FAFC;
}
.cs-field input:focus { border-color: var(--cs-brand); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10); }
.cs-field-err { font-size: 12px; color: var(--cs-danger); margin-top: 4px; display: none; }
.cs-field.cs-error input,
.cs-field.cs-err input { border-color: var(--cs-danger); }
.cs-field.cs-error .cs-field-err,
.cs-field.cs-err .cs-field-err { display: block; }
.cs-modal-tip { font-size: 11px; color: #94A3B8; margin: 0; }
.cs-modal-foot { padding: 0 16px 15px; }
.cs-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--cs-brand) 0%, var(--cs-brand-2) 100%);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cs-submit.cs-disabled,
.cs-submit:disabled { background: #CBD5E1; cursor: not-allowed; }

/* === Toast === */
.cs-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 58, 138, 0.92);
  color: #fff;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 901;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.24);
}
.cs-toast.cs-show { opacity: 1; transform: translateX(-50%) translateY(2px); }

/* === 老浏览器兜底（不支持 CSS 变量时，var() 整条声明会被丢弃，这里兜关键色） === */
.cs-btn { color: #1d4ed8; }
.cs-badge { background: #EF4444; }
.cs-panel { color: #1F2937; }
.cs-msg .cs-avatar { background: #DBEAFE; color: #1d4ed8; }
.cs-card { border-left-color: #1d4ed8; }
.cs-card-summary,
.cs-guide-desc,
.cs-fallback-title,
.cs-field label { color: #475569; }
.cs-quick-tag,
.cs-tag,
.cs-fallback-tags button,
.cs-fallback-q,
.cs-guide-btn.cs-ghost { color: #1d4ed8; }
.cs-fallback-tags button,
.cs-fallback-q { background: #EFF6FF; }
.cs-bubble.cs-welcome { color: #1E3A8A; }
.cs-guide-title,
.cs-modal-head h4 { color: #1E3A8A; }
.cs-textarea:focus,
.cs-field input:focus { border-color: #1d4ed8; }
.cs-field-err { color: #EF4444; }
.cs-field.cs-err input { border-color: #EF4444; }

/* === W113 回电条（常驻输入框上方：留手机号 → 顾问回电） === */
.cs-callback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #F0F6FF 0%, #F8FBFF 100%);
  border: 1px solid #DBEAFE;
  border-radius: 12px;
  flex: none;
}
.cs-callback .cb-tip { font-size: 12px; color: #475569; flex: none; }
.cs-callback input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #1F2937;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cs-callback input:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10); }
.cs-callback input::placeholder { color: #A9B6C8; }
.cs-cb-btn {
  flex: none;
  height: 34px;
  padding: 0 13px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s;
}
.cs-cb-btn:hover { filter: brightness(1.08); }
.cs-cb-btn:disabled { background: #CBD5E1; cursor: default; filter: none; }
.cs-callback.cs-error { border-color: #EF4444; background: #FEF2F2; }
.cs-callback.cs-done { border-color: #86EFAC; background: #F0FDF4; }
.cs-callback .cb-done-msg { font-size: 12px; color: #15803D; font-weight: 600; }

/* === 移动端 === */
@media (max-width: 600px) {
  .cs-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border-radius: 0;
    border: 0;
  }
  .cs-btn { right: 16px; bottom: 84px; }
  .cs-callback .cb-tip { display: none; }
}

/* ============================================================
   W121 · 多访客隔离：访客端「结束咨询」按钮
   共用设备（门店/前台）换人时点一下 → 结束当前会话 + 轮换 tab_id，
   下一个人打开即全新会话，看不到上一个人的聊天记录。
   ============================================================ */
.cs-head-end {
  height: 30px;
  padding: 0 10px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0.94;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.cs-head-end:hover { background: rgba(255, 255, 255, 0.20); }
.cs-head-end:active { background: rgba(255, 255, 255, 0.30); }

/* 📱 手机端：头部空间紧张 → 按钮收紧，但仍保证可点击 */
@media(max-width:560px){
  .cs-head-end { font-size:11px; padding:0 8px; height:28px; margin-right:4px; }
}

/* ============================================================
   W121 · 多访客隔离：访客端「结束咨询」按钮
   共用设备（门店/前台）换人时点一下 → 结束当前会话 + 轮换 tab_id，
   下一个人打开即全新会话，看不到上一个人的聊天记录。
   ============================================================ */
.cs-head-end {
  height: 30px;
  padding: 0 10px;
  margin-right: 6px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0.94;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.cs-head-end:hover { background: rgba(255, 255, 255, 0.20); }
.cs-head-end:active { background: rgba(255, 255, 255, 0.30); }

/* 📱 手机端：头部空间紧张 → 按钮收紧，但仍保证可点击 */
@media(max-width:560px){
  .cs-head-end { font-size:11px; padding:0 8px; height:28px; margin-right:4px; }
}

/* ============================================================
   W124 · 访客端提示音开关（头部喇叭按钮）
   访客可一键静音；移动端轻振动配合。
   样式对齐 W121 的 .cs-head-end，保证头部三按钮视觉一致。
   ============================================================ */
.cs-head-sound {
  width: 30px;
  height: 30px;
  padding: 0;
  margin-right: 4px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.94;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
}
.cs-head-sound:hover { background: rgba(255, 255, 255, 0.20); }
.cs-head-sound:active { background: rgba(255, 255, 255, 0.30); }
.cs-head-sound.off { opacity: 0.45; }

/* 加企微按钮（有活码配置时显示） */
.cs-head-wecom {
  height: 26px;
  padding: 0 10px;
  margin-right: 4px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.15s ease;
  font-family: inherit;
}
.cs-head-wecom:hover { background: rgba(255, 255, 255, 0.30); }

/* 📱 手机端：头部空间紧张 → 收紧，但仍保证 28px 可点 */
@media(max-width:560px){
  .cs-head-sound { width:28px; height:28px; font-size:13px; margin-right:2px; }
}

/* ===== 阶段1 · 体验层增强 ===== */
/* 表情面板（微信风：8 列网格 + 滚动） */
.cs-emoji-panel{position:absolute;bottom:52px;left:8px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 8px 24px rgba(15,23,42,.14);padding:8px;display:none;grid-template-columns:repeat(8,1fr);gap:2px;z-index:30;width:320px;max-height:230px;overflow:auto}
.cs-emoji-panel.cs-show{display:grid}
.cs-emoji{width:100%;height:34px;border:0;background:none;font-size:20px;cursor:pointer;border-radius:6px;line-height:1;padding:0}
.cs-emoji:hover{background:#eef2f7}
/* 语音模式（按住说话占位） */
.cs-textarea.cs-voice-mode{background:#f1f5f9;color:#64748b;text-align:center;caret-color:transparent}

/* 客服真人名片 + 等待时间 */
.cs-head-title{flex:1;min-width:0}
.cs-agent-line{display:flex;align-items:center;gap:10px}
.cs-agent-avatar{width:38px;height:38px;border-radius:10px;object-fit:cover;flex:none;background:#dbeafe;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;color:#1d4ed8}
.cs-agent-info{min-width:0}
.cs-agent-name{font-weight:700;font-size:15px;color:#fff;display:flex;align-items:center}
.cs-agent-role{font-size:11px;color:#fff;background:rgba(255,255,255,.18);padding:1px 7px;border-radius:999px;margin-left:6px;font-weight:400}
.cs-agent-sub{font-size:12px;color:#fff;opacity:.85;margin-top:2px;display:flex;align-items:center;gap:6px}
.cs-wait-dot{width:7px;height:7px;border-radius:50%;background:#4ade80;display:inline-block;flex:none}

/* 满意度评价 */
.cs-satisfy{background:#f8fafc;border-top:1px solid #e2e8f0;padding:12px 16px;flex:none}
.cs-sat-q{font-size:13px;font-weight:600;color:#1e293b;margin-bottom:8px}
.cs-sat-btns{display:flex;gap:8px}
.cs-sat-btns button{flex:1;padding:9px 0;border-radius:9px;border:1px solid #e2e8f0;background:#fff;font-size:14px;cursor:pointer;font-weight:600}
.cs-sat-btns button.good{border-color:#bbf7d0;color:#16a34a}
.cs-sat-btns button.good:hover{background:#f0fdf4}
.cs-sat-btns button.bad{border-color:#fecaca;color:#dc2626}
.cs-sat-btns button.bad:hover{background:#fef2f2}
.cs-sat-reasons{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.cs-sat-reasons span{padding:4px 10px;border-radius:999px;border:1px solid #e2e8f0;background:#fff;font-size:12px;cursor:pointer;color:#475569}
.cs-sat-reasons span.on{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.cs-sat-done{font-size:12px;color:#16a34a;margin-top:8px}

/* 打字状态 + 已读回执 */
.cs-typing-dot{display:inline-flex;gap:4px;align-items:center}
.cs-typing-dot span{width:6px;height:6px;border-radius:50%;background:#94a3b8;animation:csTyping 1.2s infinite}
.cs-typing-dot span:nth-child(2){animation-delay:.18s}
.cs-typing-dot span:nth-child(3){animation-delay:.36s}
@keyframes csTyping{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
.cs-read-tag{font-size:11px;color:#94a3b8;text-align:right;margin:2px 4px 0;display:block}

/* 文件消息 · 微信风蓝色横条卡片 */
.cs-bubble.cs-media{background:transparent!important;border:none!important;padding:0!important;box-shadow:none!important;max-width:none!important}.file-icon{width:40px;height:48px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;color:#fff;flex:none;letter-spacing:.5px}.fi-doc{background:#2b579a}.fi-xls{background:#217346}.fi-pdf{background:#d93025}.fi-ppt{background:#d24726}.fi-txt{background:#64748b}.fi-zip{background:#a16207}.fi-generic{background:#94a3b8}.file-card{display:inline-flex;align-items:center;gap:10px;background:#fff;border:1px solid #E2EDFC;border-radius:12px;padding:9px 14px;text-decoration:none;max-width:230px;box-shadow:0 2px 6px rgba(37,99,235,.12)}
.file-info .file-name{color:#1E293B}.file-info .file-size{color:#94a3b8}
.file-info{display:flex;flex-direction:column;min-width:0}
.file-name{color:#fff;font-size:13px;font-weight:600;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-size{color:rgba(255,255,255,.78);font-size:11px;margin-top:1px}
