/* 客服窗口使用独立前缀，避免影响购物、付款和旧目录；手机用视口限制高度与宽度。 */
.bt-chat-widget { position:fixed;right:18px;bottom:18px;z-index:1800;font:14px/1.5 Arial,sans-serif;color:#17324d; }
.bt-chat-widget *, .bt-support-staff * { box-sizing:border-box; }
.bt-chat-widget [x-cloak] { display:none!important; }
.bt-chat-widget button, .bt-support-staff button { cursor:pointer;border:1px solid #cbd9e8;border-radius:7px;padding:8px 12px;background:#fff;color:#154b87;font:inherit; }
.bt-chat-widget button:disabled,.bt-support-staff button:disabled { opacity:.55;cursor:wait; }
.bt-chat-widget button:focus-visible,.bt-chat-widget a:focus-visible,.bt-support-staff button:focus-visible { outline:2px solid #196bde;outline-offset:2px; }
.bt-chat-launch { background:#196bde!important;color:white!important;box-shadow:0 3px 14px #1234;border:0!important;border-radius:24px!important;padding:12px 20px!important; }
.bt-chat-panel { position:absolute;right:0;bottom:58px;width:370px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 105px);display:flex;flex-direction:column;background:white;border:1px solid #cfdeed;border-radius:14px;box-shadow:0 8px 36px #1233;overflow:auto; }
.bt-chat-panel>header { padding:10px 14px;background:#196bde;color:white;display:flex;align-items:center;justify-content:space-between; }
.bt-chat-panel>header button { background:transparent;color:white;border:0;font-size:24px;padding:0 8px; }
.bt-chat-status,.bt-chat-error { margin:8px 12px; }
.bt-chat-error,.bt-chat-required { color:#b91c1c; }
.bt-chat-history,.bt-chat-compose { padding:8px 12px;margin:0; }
.bt-chat-panel label { display:block;margin:5px 0;white-space:normal;overflow-wrap:anywhere; }
.bt-chat-panel select,.bt-chat-panel input,.bt-chat-panel textarea,.bt-support-staff input,.bt-support-staff select,.bt-support-staff textarea { display:block;width:100%;min-width:0;margin-top:4px;padding:8px;border:1px solid #cbd9e8;border-radius:7px;background:#fff;color:#17324d;font:inherit; }
.bt-chat-panel textarea,.bt-support-staff textarea { resize:vertical; }
.bt-chat-log { min-height:70px;max-height:260px;overflow:auto;padding:10px;background:#f3f7fc; }
.bt-chat-message { margin-bottom:8px;padding:8px 10px;border-radius:9px;background:white;border:1px solid #dce6ef;overflow-wrap:anywhere; }
.bt-chat-message.is-buyer { margin-left:20px;background:#eaf3ff; }
.bt-chat-message small,.bt-support-message>small { color:#60758b;font-size:11px; }
.bt-chat-message a,.bt-support-message a { display:block;overflow-wrap:anywhere;color:#196bde; }
.bt-chat-compose small,.bt-chat-privacy { font-size:11px;color:#60758b;overflow-wrap:anywhere; }
.bt-chat-privacy { padding:5px 12px;margin:0 0 6px; }
.bt-chat-rich p { margin:4px 0; }
.bt-chat-rich pre { white-space:pre-wrap;overflow-wrap:anywhere; }
.bt-chat-rich ul,.bt-chat-rich ol { padding-left:20px; }
.bt-chat-widget progress,.bt-support-staff progress { width:100%; }
/* 客服工作台独立布局，桌面队列与会话左右排列，窄屏上下排列，不固定最小宽度。 */
.bt-support-staff { margin:0;background:#f3f7fb;color:#17324d;font:14px/1.5 Arial,"Microsoft YaHei",sans-serif; }
.bt-support-staff>header { display:flex;justify-content:space-between;gap:12px;padding:15px 20px;background:#10345b;color:white; }
.bt-support-staff>header a { color:white; }
.bt-support-desk { display:grid;grid-template-columns:minmax(230px,300px) minmax(0,1fr);gap:16px;padding:16px;max-width:1600px;margin:auto; }
.bt-support-sidebar,.bt-support-conversation,.bt-support-login { background:#fff;border:1px solid #d8e3ef;border-radius:10px;padding:16px;min-width:0; }
.bt-support-sidebar { max-height:calc(100dvh - 95px);overflow:auto; }
.bt-support-sidebar h1,.bt-support-context h2 { font-size:18px;margin:0 0 8px; }
.bt-support-sidebar h2 { font-size:15px;margin:18px 0 8px; }
.bt-support-list-item { display:block;width:100%;text-align:left;margin:6px 0;overflow-wrap:anywhere; }
.bt-support-sidebar small { display:block;color:#60758b; }
.bt-support-queue { padding:8px 0;border-bottom:1px solid #e0e8f1; }
.bt-support-actions { display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin:10px 0; }
.bt-support-context { overflow-wrap:anywhere;border-bottom:1px solid #e0e8f1;padding-bottom:12px; }
.bt-support-context p { margin:5px 0; }
.bt-support-order { display:grid;gap:5px;background:#edf5ff;border:1px solid #cbdff5;border-radius:8px;padding:12px;margin:10px 0; }
.bt-support-messages { max-height:50dvh;min-height:140px;overflow:auto;background:#f8fafc;padding:10px;margin:10px 0; }
.bt-support-message { padding:10px;background:#fff;border:1px solid #dce6ef;border-radius:8px;margin-bottom:8px;overflow-wrap:anywhere; }
.bt-support-message.is-agent { margin-left:30px;background:#edf5ff; }
.bt-support-message blockquote { margin:8px 0;padding:8px;border-left:3px solid #196bde;background:#f1f5f9;white-space:pre-wrap; }
.bt-support-login { max-width:440px;margin:40px auto; }
.bt-support-login label { display:block;margin:12px 0; }
@media(max-width:700px){
 .bt-support-desk { grid-template-columns:minmax(0,1fr);padding:8px;gap:8px; }
 .bt-support-sidebar { max-height:280px; }
 .bt-chat-widget { right:12px;bottom:12px; }
 .bt-chat-panel { width:calc(100vw - 24px); }
 .bt-chat-log { max-height:24dvh; }
 .bt-support-login { margin:16px 8px; }
}

/* 无JS留言表单保留正常页面入口，长语言标签不强制单行。 */
.bt-chat-fallback label { display:block;margin:12px 0; }
.bt-chat-fallback input,.bt-chat-fallback select,.bt-chat-fallback textarea { display:block;width:100%;padding:10px;border:1px solid #cbd9e8;border-radius:7px; }

/* 状态徽标：圆形勾选表示可接待，时钟表示离线留言，图标不单独传达状态。 */
.bt-chat-status {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.bt-chat-status.is-online { color: #137344; background: #eaf8f0; }
.bt-chat-status.is-offline { color: #596779; background: #eef1f5; }
.bt-chat-status svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 轻量排版工具栏：指针不丢失输入选区，键盘仍可Tab访问；窄屏允许按钮换行。 */
.bt-chat-format { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 8px 0 4px; }
.bt-chat-format button { min-width: 32px; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.bt-chat-format svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bt-chat-preview { padding: 8px 10px; margin: 7px 0; border: 1px dashed #ccdbea; border-radius: 7px; background: #f8fbff; overflow-wrap: anywhere; }
/* Tailwind基础样式会清除列表标记，消息及草稿预览显式恢复项目符号与编号。 */
.bt-chat-rich ul { list-style: disc; margin: .35rem 0; }
.bt-chat-rich ol { list-style: decimal; margin: .35rem 0; }

/* 聊天优先分配垂直空间；附件和说明折叠，窗口可一键扩大，手机仍受可视视口约束。 */
.bt-chat-panel { width:420px;height:min(780px,calc(100dvh - 105px));overflow:hidden; }
.bt-chat-panel.is-expanded { width:620px;height:calc(100dvh - 105px); }
.bt-chat-panel>header { flex:none;padding:6px 12px;gap:8px; }
.bt-chat-panel>header strong { flex:1; }
.bt-chat-status { margin:5px 12px;padding:2px 8px; }
.bt-chat-history { padding:0 12px 5px;font-size:12px; }
.bt-chat-history select { padding:5px;font-size:13px; }
.bt-chat-log { flex:1 1 auto;min-height:120px;max-height:none;overscroll-behavior:contain; }
.bt-chat-compose { flex:none;max-height:48%;overflow:auto;padding:5px 12px; }
.bt-chat-compose p { margin:3px 0;font-size:12px; }
.bt-chat-compose label { margin:3px 0; }
.bt-chat-compose textarea { min-height:54px;max-height:130px;padding:6px; }
.bt-chat-compose input { padding:5px; }
.bt-chat-compose details { font-size:12px;margin:5px 0; }
.bt-chat-format { margin:4px 0; }
.bt-chat-privacy { flex:none;max-height:90px;overflow:auto;padding:3px 12px; }
.bt-chat-privacy p { margin:4px 0; }
.bt-chat-panel summary,.bt-support-staff summary { cursor:pointer; }
/* 工作台以flex消息主栏配合独立浏览侧栏，提示信息增减不会改变消息区所占行。 */
.bt-support-desk { max-width:1900px;grid-template-columns:245px minmax(0,1fr);gap:10px;padding:10px; }
.bt-support-sidebar,.bt-support-conversation { padding:10px; }
.bt-support-conversation { height:calc(100dvh - 80px);display:flex;gap:10px; }
.bt-support-main { display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;gap:6px; }
.bt-support-main>p { flex:none;margin:2px 0; }
.bt-support-context { flex:none;padding:3px 0;max-height:23dvh;overflow:auto; }
.bt-support-current-page { flex:0 0 220px;overflow:auto;overflow-wrap:anywhere;border-left:1px solid #e0e8f1;padding:8px; }
.bt-support-current-page a,.bt-support-current-page small { display:block;margin-top:7px; }
.bt-support-current-page small { color:#60758b; }
.bt-support-main>button { align-self:flex-start;flex:none;padding:4px 8px; }
.bt-support-messages { flex:1;max-height:none;min-height:0;margin:0;overscroll-behavior:contain; }
.bt-support-compose { flex:none;max-height:26dvh;overflow:auto; }
.bt-support-compose textarea { min-height:54px;max-height:110px; }
.bt-support-compose details { font-size:12px; }
.bt-support-actions { flex:none;margin:3px 0;gap:5px; }
.bt-support-actions select { padding:4px; }
.bt-support-actions button,.bt-support-compose button { padding:5px 9px; }
.bt-support-staff [x-cloak] { display:none!important; }
@media(max-width:1000px){
 .bt-support-desk { grid-template-columns:210px minmax(0,1fr); }
 .bt-support-conversation { flex-direction:column; }
 .bt-support-current-page { flex:0 0 auto;max-height:90px;border-left:0;border-top:1px solid #e0e8f1;padding:4px; }
}
@media(max-width:700px){
 .bt-support-desk { grid-template-columns:minmax(0,1fr); }
 .bt-support-sidebar { max-height:200px; }
 .bt-support-conversation { height:calc(100dvh - 65px); }
 .bt-chat-panel,.bt-chat-panel.is-expanded { width:calc(100vw - 24px); }
 .bt-chat-log { max-height:none;min-height:90px; }
}

/* 新回复来临时仅让收起的入口轻微闪动；减少动画偏好下保留静态标记。 */
.bt-chat-launch.has-unread { animation:bt-chat-attention 1.3s ease-in-out infinite; }
@keyframes bt-chat-attention { 50% { background:#104b9c!important;box-shadow:0 0 0 6px #196bde44; } }
@media(prefers-reduced-motion:reduce){ .bt-chat-launch.has-unread { animation:none;outline:3px solid #f59e0b; } }
/* 安全链接作为正文内联元素，不额外占一行；译文跟随原消息，按钮缩至右侧。 */
.bt-chat-rich a { display:inline;text-decoration:underline;overflow-wrap:anywhere;color:#196bde; }
.bt-support-message-row { display:flex;align-items:flex-start;gap:8px; }
.bt-support-message-row>.bt-chat-rich { flex:1;min-width:0; }
.bt-support-staff .bt-support-translate { flex:none;font-size:11px;padding:2px 6px;line-height:1.5; }
.bt-support-message blockquote { margin:4px 0;padding:5px 8px;font-size:13px; }
.bt-support-sound-status { display:block;color:#60758b;font-size:11px;margin:5px 0; }
/* 双语草稿并排、常用语折叠；主消息区继续优先获得剩余高度。 */
.bt-support-compose { max-height:37dvh; }
.bt-support-compose fieldset { padding:0;border:0;margin:0;min-width:0; }
.bt-support-drafts { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px; }
.bt-support-drafts label { min-width:0;font-size:12px; }
.bt-support-drafts textarea { min-height:65px;max-height:135px;font-size:13px; }
.bt-support-ai-toolbar { display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:3px 0; }
.bt-support-ai-toolbar label { display:flex;align-items:center;gap:5px;font-size:12px; }
.bt-support-ai-toolbar select,.bt-support-ai-toolbar input { width:auto;max-width:220px;margin:0;padding:4px;font-size:12px; }
.bt-support-ai-toolbar button { padding:4px 7px;font-size:12px; }
.bt-support-ai-toolbar small { font-size:11px;color:#60758b; }
.bt-support-phrases { padding:3px 0; }
@media(max-width:700px){
 .bt-support-drafts { grid-template-columns:minmax(0,1fr); }
 .bt-support-drafts textarea { min-height:50px; }
 .bt-support-compose { max-height:42dvh; }
}
/* 桌面译文与原消息左右对照，窄屏换行；不再为翻译按钮单独占一整行。 */
.bt-support-message-row { flex-wrap:wrap; }
.bt-support-message-row>.bt-chat-rich { flex:1 1 180px; }
.bt-support-message-row>.bt-support-inline-translation { flex:1 1 180px;min-width:0;overflow-wrap:anywhere;margin:0;padding:3px 8px; }
/* 入口用小状态行明确接待状态，不再仅用统一蓝色表达。 */
.bt-chat-widget .bt-chat-launch{display:inline-flex;flex-direction:column;align-items:center;background:white!important;color:#17324d!important;border:1px solid #cbd9e8!important;min-width:130px;padding:8px 18px!important}.bt-chat-launch-status{font-size:11px;line-height:1.3;margin-top:2px}.bt-chat-launch.is-online .bt-chat-launch-status{color:#14804a}.bt-chat-launch.is-offline .bt-chat-launch-status{color:#65758b}.bt-chat-panel>header svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
/* 待接入/未读始终加深，轻微边框提示；减少动画设置下只保留颜色。 */
.bt-support-staff .is-attention{font-weight:700;color:#10375f;border-color:#196bde;background:#edf4ff;animation:bt-support-pending 1.8s ease-in-out infinite}.bt-support-queue.is-attention{padding:5px;border:1px solid #196bde;border-radius:6px}.bt-support-drafts textarea{min-height:100px;max-height:170px}.bt-support-current-page>.bt-support-actions{margin-top:20px;position:sticky;bottom:0;background:white;padding-top:10px}.bt-support-current-page .bt-support-actions label{width:100%}.bt-support-current-page .bt-support-actions select{width:100%}@keyframes bt-support-pending{50%{box-shadow:inset 3px 0 #196bde66}}@media(prefers-reduced-motion:reduce){.bt-support-staff .is-attention{animation:none}}@media(max-width:1000px){.bt-support-current-page{max-height:180px}.bt-support-current-page>.bt-support-actions{margin-top:6px;position:static}.bt-support-current-page .bt-support-actions label{width:auto}.bt-support-drafts textarea{min-height:85px}}
