@charset "UTF-8";
/* =====================================================================
   在线客服 —— 访客端悬浮窗
   ---------------------------------------------------------------------
   配色全部走站点令牌（--qf-*），因此各站自动呈现各自的色系，
   与页面、右下角 WhatsApp 按钮保持同一家族。
   聊天界面按要求**不显示对方昵称**，只有气泡。
   ===================================================================== */

.qchat-root {
  position: fixed;
  /* 位置由 chat-widget.js 实测同区域其它悬浮按钮后写入（同一竖轴 + 叠在最上面）；
     这里的值是脚本未运行时的兜底。 */
  right: var(--qchat-right, 20px);
  bottom: var(--qchat-bottom, 84px);
  z-index: 2147482000;
  font-family: var(--qf-font-body, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

/* ---------- 悬浮按钮 ---------- */
.qchat-fab {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--qf-secondary, #fb5b21);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
  transition: background-color .18s ease, transform .18s ease;
}
.qchat-fab:hover { background: var(--qf-tertiary, #e04a14); transform: translateY(-2px); }
.qchat-fab:focus-visible { outline: 3px solid var(--qf-focus-ring, #e04a14); outline-offset: 2px; }
.qchat-fab svg { width: 26px; height: 26px; fill: currentColor; }
.qchat-fab .qchat-dot {
  position: absolute;
  margin: -30px 0 0 30px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #e5484d; border: 2px solid #fff;
  display: none;
}
.qchat-root.qchat-has-unread .qchat-fab .qchat-dot { display: block; }

/* ---------- 对话面板 ---------- */
/* 面板层级高于悬浮按钮：否则按钮会盖住面板底部（实测手机端正好压住「发送」键） */
.qchat-fab { z-index: 1; }
.qchat-panel {
  z-index: 2;
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 342px;
  max-height: min(70vh, 560px);
  display: none;
  flex-direction: column;
  background: var(--qf-surface, #fff);
  color: var(--qf-body, #3b3b3b);
  border: 1px solid var(--qf-border, #e6e6e6);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.qchat-root.qchat-open .qchat-panel { display: flex; }

.qchat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--qf-secondary, #fb5b21);
  color: #fff;
}
.qchat-head .qchat-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.qchat-head .qchat-avatar svg { width: 18px; height: 18px; fill: #fff; }
.qchat-head-text { line-height: 1.25; min-inline-size: 0; }
.qchat-title { font-size: 15px; font-weight: 600; }
.qchat-status { font-size: 12px; opacity: .9; }
.qchat-close {
  margin-inline-start: auto;
  background: transparent; border: 0; color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.qchat-close:hover { background: rgba(255, 255, 255, .18); }

.qchat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--qf-surface-alt, #f7f7f7);
}

.qchat-bubble {
  max-inline-size: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.qchat-bubble.qchat-agent {
  align-self: flex-start;
  background: var(--qf-surface, #fff);
  color: var(--qf-on-surface, #101010);
  border: 1px solid var(--qf-border, #e6e6e6);
  border-end-start-radius: 5px;
}
.qchat-bubble.qchat-visitor {
  align-self: flex-end;
  background: var(--qf-secondary, #fb5b21);
  color: #fff;
  border-end-end-radius: 5px;
}
.qchat-bubble.qchat-typing { opacity: .65; font-style: italic; }
.qchat-bubble.qchat-recalled {
  background: transparent;
  border: 1px dashed var(--qf-border, #e6e6e6);
  color: #8b8b8b;
  font-style: italic;
}
/* 已读 / 未读 回执（只挂在访客自己发出的消息下面） */
.qchat-receipt {
  align-self: flex-end;
  margin: -3px 4px 2px;
  font-size: 10.5px;
  line-height: 1.4;
  color: #9a9a9a;
}
.qchat-receipt.qchat-read { color: var(--qf-accent, #12876f); }
.qchat-bubble.qchat-recalled {
  background: transparent;
  border: 1px dashed var(--qf-border, #e6e6e6);
  color: #8b8b8b;
  font-style: italic;
}
/* 已读 / 未读 回执（只挂在访客自己发出的消息下面） */
.qchat-receipt {
  align-self: flex-end;
  margin: -3px 4px 2px;
  font-size: 10.5px;
  line-height: 1.4;
  color: #9a9a9a;
}
.qchat-receipt.qchat-read { color: var(--qf-accent, #12876f); }

.qchat-foot {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--qf-border, #e6e6e6);
  background: var(--qf-surface, #fff);
}
.qchat-input {
  flex: 1 1 auto;
  min-block-size: 38px;
  max-block-size: 96px;
  resize: none;
  padding: 9px 11px;
  font: inherit;
  font-size: 14.5px;
  color: var(--qf-on-surface, #101010);
  background: var(--qf-surface-alt, #f7f7f7);
  border: 1px solid var(--qf-border, #e6e6e6);
  border-radius: 10px;
}
.qchat-input:focus { outline: none; border-color: var(--qf-secondary, #fb5b21); }
.qchat-send {
  flex: none;
  height: 38px; padding: 0 15px;
  border: 0; border-radius: 10px;
  background: var(--qf-secondary, #fb5b21);
  color: #fff; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.qchat-send:hover { background: var(--qf-tertiary, #e04a14); }
.qchat-send[disabled] { opacity: .5; cursor: default; }
.qchat-note { padding: 0 12px 10px; font-size: 11.5px; color: var(--qf-muted, #7a7a7a); }

/* ---------- 手机版 ---------- */
@media (max-width: 600px) {
  .qchat-root {
    right: var(--qchat-right, 14px);
    bottom: var(--qchat-bottom, 78px);
  }
  .qchat-panel {
    position: fixed;
    inset-inline: 10px;
    /* 必须让开悬浮按钮自身的占位（按钮 50 + 间距 8），
       否则按钮会压在面板底部、档住发送键（实测手机端点不到 Send）。
       用同一个变量计算，按钮被脚本抬高时面板跟着抬高。 */
    bottom: calc(var(--qchat-bottom, 78px) + 58px);
    width: auto;
    max-height: 62vh;
  }
  .qchat-fab { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .qchat-fab, .qchat-fab:hover { transition: none; transform: none; }
}

/* ---------- 新消息提示气泡（指向悬浮按钮，不遮挡页面内容） ---------- */
.qchat-tip {
  position: absolute;
  right: calc(100% + 12px);     /* 贴在按钮左侧 */
  bottom: 4px;
  box-sizing: border-box;
  /* ⚠️ 必须给显式宽度：本元素是 root 内的绝对定位元素，而 root≈按钮宽(52px)，
     不给宽度就会收缩成 52px 换行、高度涨到上千 px（实测 1314px），还会让 y 变负点不到 */
  width: 236px;
  max-width: calc(100vw - 86px);
  padding: 9px 26px 9px 12px;
  background: var(--qf-surface, #fff);
  color: var(--qf-body, #3b3b3b);
  border: 1px solid var(--qf-border, #e6e6e6);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
  display: none;
  opacity: 0;
  transform: translateX(8px) scale(.98);
  transform-origin: 100% 85%;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
  z-index: 3;
}
.qchat-root.qchat-has-tip .qchat-tip { display: block; }
.qchat-tip.qchat-tip-in { opacity: 1; transform: none; pointer-events: auto; }
/* 指向按钮的小尖角 */
.qchat-tip::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 13px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-right: 1px solid var(--qf-border, #e6e6e6);
  border-bottom: 1px solid var(--qf-border, #e6e6e6);
  transform: rotate(-45deg);
}
.qchat-tip-txt { word-break: break-word; }
.qchat-tip-close {
  position: absolute;
  top: 1px;
  right: 3px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: #9aa0a6;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.qchat-tip-close:hover { color: var(--qf-body, #3b3b3b); }
@media (max-width: 600px) {
  .qchat-tip {
    width: 224px;
    max-width: calc(100vw - 86px);   /* 小屏不越出左边 */
    font-size: 12px;
    padding: 8px 24px 8px 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qchat-tip { transition: none; transform: none; }
}
