:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif;color:#253156;background:#f3f4f8;font-synthesis:none;--navy:#060f3f;--blue:#3c7ef7;--line:#e6e9f0;--muted:#8993a9}
*{box-sizing:border-box}html,body{height:100%}body{margin:0;min-width:0}button,input,textarea,select{font:inherit}button{border:0;background:none;cursor:pointer;color:inherit}button:disabled{cursor:not-allowed;opacity:.5}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #76a6ff;outline-offset:2px}button,input,textarea{letter-spacing:0}svg{width:18px;height:18px;flex:none}button{touch-action:manipulation}[hidden]{display:none!important}
.app-shell{height:100vh;height:100dvh;display:flex;overflow:hidden}.rail{width:82px;flex:0 0 82px;min-width:82px;background:var(--navy);display:flex;flex-direction:column;align-items:center;color:#aeb8df}.rail-brand{height:90px;display:grid;place-items:center}.rail-brand img{width:46px;height:46px;object-fit:contain;box-sizing:border-box;padding:7px;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000002e}.rail-nav,.rail-bottom{display:flex;flex-direction:column;align-items:center;gap:14px}.rail-bottom{margin-top:auto;padding-bottom:25px}.rail-button{position:relative;display:grid;place-items:center;width:52px;height:48px;border-radius:5px}.rail-button svg{width:23px;height:23px}.rail-button:hover{background:#182351;color:white}.rail-button.active{background:#1e3266;color:#fff}.rail-badge{position:absolute;right:4px;top:3px;background:#ff675d;color:white;font-size:10px;min-width:17px;height:17px;border-radius:9px;display:grid;place-items:center;border:2px solid var(--navy)}.agent-chip{position:relative;margin-top:12px}.agent-avatar{display:grid;place-items:center;width:36px;height:36px;background:#6176bf;color:white;border-radius:50%;font-size:12px}.presence-dot{position:absolute;width:10px;height:10px;bottom:0;right:0;background:#20c393;border:2px solid var(--navy);border-radius:50%}
.workspace{flex:1;min-width:0;height:100%;min-height:0;display:grid;grid-template-columns:284px minmax(0,1fr) 310px}.conversation-column,.chat-column,.customer-column{min-width:0;min-height:0;display:flex;flex-direction:column}.conversation-column{background:#fff;border-right:1px solid var(--line)}.column-header,.chat-header,.customer-header{height:88px;min-height:88px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:12px}.column-header h1{font-size:22px;margin:0;font-weight:600}.column-header p,.chat-title p{font-size:12px;color:var(--muted);margin:7px 0 0}.header-actions{display:flex;gap:5px}.icon-button{width:32px;height:32px;display:inline-grid;place-items:center;color:#7d89a2;border-radius:4px;vertical-align:middle;flex:none}.icon-button:hover{background:#edf2fc;color:var(--blue)}.inbox-tabs{display:flex;gap:23px;padding:0 24px;border-bottom:1px solid var(--line);height:48px;flex:none}.inbox-tab{position:relative;white-space:nowrap;font-size:13px;color:#8a94a9;padding:0 0 12px}.inbox-tab span{margin-left:3px;font-size:12px}.inbox-tab.active{color:var(--blue);font-weight:600}.inbox-tab.active:after{content:"";position:absolute;bottom:0;left:0;right:0;height:3px;background:var(--blue)}.conversation-search{height:36px;flex:none;margin:20px 20px 16px;display:flex;align-items:center;gap:8px;background:#f6f7fa;border:1px solid #ecedf3;border-radius:4px;padding:0 10px;color:#a0a8b9}.conversation-search svg{width:15px;height:15px}.conversation-search input{width:100%;min-width:0;border:0;outline:none;background:transparent;font-size:12px;color:var(--text)}.conversation-search input::placeholder{color:#a0a8b9}.conversation-search kbd{font-size:11px;border:1px solid #e3e6ed;padding:0 4px;border-radius:2px}.conversation-list{overflow:auto;flex:1;min-height:0}.group-title{font-size:12px;color:#8c96aa;display:flex;gap:8px;padding:14px 23px 10px;border-bottom:1px solid #f2f3f7}.group-title:first-child{color:#4c5975}.conversation-item{display:flex;text-align:left;width:100%;min-width:0;gap:12px;padding:19px 22px 16px;border-bottom:1px solid #f0f2f7;position:relative}.conversation-item:hover{background:#f7f9fd}.conversation-item.active{background:#edf3ff}.conversation-item.active:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--blue)}.conversation-item-avatar{width:40px;height:40px;flex:none;border-radius:50%;color:#fff;display:grid;place-items:center;font-size:15px}.conversation-copy{display:block;min-width:0;flex:1}.conversation-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.conversation-name{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-time{font-size:10px;color:#9ba4b5;white-space:nowrap;flex:none}.conversation-preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#8c96aa;font-size:12px;margin-top:8px;line-height:18px}.conversation-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:9px;min-height:16px}.conversation-status{font-size:10px;color:#a2aabd}.unread{background:#3c7ef7;color:#fff;font-size:10px;min-width:16px;height:16px;border-radius:8px;padding:0 4px;display:grid;place-items:center}.new-conversation{height:52px;flex:none;border-top:1px solid var(--line);color:var(--blue);display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px}.new-conversation:hover{background:#f6f9ff}
.chat-column{background:#f3f4f8;position:relative;--message-jump-bottom:184px}.chat-header{background:white;border-bottom:1px solid var(--line);padding:0 24px;flex-wrap:wrap;gap:8px}.chat-title{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.chat-title>div{min-width:0}.channel-icon{width:34px;height:34px;flex:none;display:grid;place-items:center;background:#f0f5ff;color:var(--blue);border-radius:50%}.chat-title h2{font-size:15px;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-header-actions{display:flex;gap:5px;align-items:center;flex:none}.conversation-label{font-size:10px;color:#c59042;background:#fff7e9;padding:4px 7px;white-space:nowrap;margin-right:6px}.header-action{display:inline-flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;padding:0 8px;height:32px;font-size:12px;color:#758099;border:1px solid #e7eaf1;border-radius:4px}.header-action svg{width:15px;height:15px}.header-action:hover{color:var(--blue);background:#f0f5ff;border-color:#cadafa}.chat-meta{display:flex;justify-content:space-between;align-items:center;height:42px;flex:none;padding:0 25px;font-size:11px;color:#929cb1}.chat-meta>span,.chat-meta button{display:flex;align-items:center;gap:5px}.chat-meta svg{width:13px;height:13px}.message-stream{flex:1;min-height:0;overflow:auto;padding:4px 28px 24px;overscroll-behavior:contain}.message-jump-button{position:absolute;right:28px;bottom:var(--message-jump-bottom);z-index:4;display:inline-flex;align-items:center;gap:6px;min-height:32px;max-width:calc(100% - 56px);padding:0 12px;border:1px solid #bfd2f5;border-radius:16px;background:#fff;color:#326cc9;font-size:11px;box-shadow:0 4px 14px #1c3b731c}.message-jump-button:hover{background:#f0f5ff;border-color:#8fb2ee}.message-jump-button:focus-visible{outline:2px solid #76a6ff;outline-offset:2px}.message-jump-button svg{width:14px;height:14px}.system-message{text-align:center;font-size:11px;color:#a0a8b9;margin:13px 0 26px;line-height:1.6}.message-row{display:flex;align-items:flex-start;gap:10px;margin-bottom:24px}.message-avatar{width:32px;height:32px;flex:none;border-radius:50%;color:white;display:grid;place-items:center;font-size:12px;margin-top:19px}.bubble-wrap{max-width:82%;min-width:0}.message-meta{font-size:10px;line-height:14px;margin-bottom:6px;color:#98a2b6}.bubble{padding:12px 15px;background:#fff;border:1px solid #e7eaf0;border-radius:0 6px 6px 6px;font-size:13px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 1px 2px #12215304;position:relative}.message-row.agent{flex-direction:row-reverse}.agent .message-meta{text-align:right}.agent .bubble{background:#e0ecff;border-color:#d6e4fb;border-radius:6px 0 6px 6px;color:#29497b}.internal .bubble{background:#fff8df;border-color:#f0e5b9}.composer-wrap{margin:0 24px 22px;background:white;border:1px solid #e0e5ee;border-radius:5px;flex:none;overflow:hidden}.composer-tabs{display:flex;align-items:center;height:45px;border-bottom:1px solid #f0f2f6;padding:0 14px;gap:18px}.composer-tab{height:45px;position:relative;font-size:12px;color:#929bae;padding:0;white-space:nowrap}.composer-tab.active{color:var(--blue)}.composer-tab.active:after{position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--blue);content:""}.composer-tools{display:flex;margin-left:auto;gap:0}.composer-tools .icon-button{width:28px}.composer-tools svg{width:16px;height:16px}.message-composer textarea{resize:none;display:block;width:100%;height:96px;max-height:160px;min-height:65px;padding:15px 17px;border:0;outline:none;color:#31415f;font-size:13px;line-height:1.6;background:white}.message-composer textarea::placeholder{color:#acb3c1}.message-composer textarea:disabled{background:#fafbfc}.composer-footer{min-height:50px;padding:0 14px 12px;display:flex;align-items:flex-end;justify-content:space-between;gap:8px}.composer-hint{color:#a4adbe;font-size:10px;padding-bottom:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.send-button{height:33px;background:var(--blue);color:#fff;padding:0 17px;border-radius:4px;display:flex;align-items:center;gap:9px;font-size:12px;flex:none}.send-button svg{width:13px;height:13px}.send-button:hover:not(:disabled){background:#2e6de1}
.customer-column{background:#fff;border-left:1px solid var(--line)}.customer-header{padding:0 22px}.customer-header h2{font-size:15px;margin:0;font-weight:600}.customer-header>div{display:flex}.customer-identity{display:flex;align-items:center;gap:13px;padding:12px 25px 18px}.customer-avatar{display:grid;place-items:center;color:white;font-size:22px;width:52px;height:52px;border-radius:50%;flex:none}.customer-identity>div{min-width:0}.customer-identity h3{font-size:16px;margin:0 0 8px;overflow-wrap:anywhere}.customer-identity p{margin:0;color:#939db1;font-size:11px;line-height:1.5}.tag-row{display:flex;gap:6px;flex-wrap:wrap;padding:0 25px 25px;min-height:24px}.tag{font-size:10px;background:#edf3ff;color:#6d91cb;padding:4px 8px;border-radius:3px}.tag:nth-child(even){background:#eaf8f2;color:#66a68f}.customer-tabs{display:flex;justify-content:space-around;padding:0 16px;border-bottom:1px solid var(--line);flex:none;height:43px}.customer-tab{position:relative;color:#929bae;font-size:12px;padding:0 6px 13px;border-radius:4px}.customer-tab:hover{color:var(--blue)}.customer-tab:active{transform:translateY(1px)}.customer-tab:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.customer-tab.active{color:var(--blue)}.customer-tab.active:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--blue)}.customer-panel{padding:0 24px;flex:1;overflow:auto;min-height:0}.info-section{padding:23px 0;border-bottom:1px solid #eef0f5}.info-section h4{margin:0 0 20px;font-size:12px;font-weight:600}.info-section dl{margin:0}.info-row{display:flex;gap:12px;line-height:1.7;font-size:11px;margin:12px 0}.info-row dt{color:#a0a9ba;width:63px;flex:none}.info-row dd{margin:0;color:#6d7891;min-width:0;overflow-wrap:anywhere}.note-text{margin:0;color:#758099;font-size:12px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.ticket-card{padding:17px 0;border-bottom:1px solid var(--line)}.ticket-card h4{font-size:13px;margin:0 0 8px;overflow-wrap:anywhere}.ticket-card p{font-size:12px;color:#8994a9;line-height:1.7;overflow-wrap:anywhere}.ticket-line{display:flex;justify-content:space-between;gap:8px;color:#9da7ba;font-size:10px;align-items:center;flex-wrap:wrap}.ticket-status{color:#d89636}.empty-state{display:grid;place-items:center;min-height:160px;color:#9aa4b8;font-size:13px;text-align:center}
.settings-dialog,.ticket-dialog{border:1px solid #e0e5ee;border-radius:8px;padding:28px;width:450px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);color:#253156;box-shadow:0 18px 80px #101b4233}.settings-dialog::backdrop,.ticket-dialog::backdrop{background:#0b173c66}.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.dialog-heading h2{font-size:20px;margin:4px 0 0}.eyebrow{color:#8e99ae;font-size:11px;margin:0}dialog label{display:block;margin:18px 0;font-size:12px;color:#64718b}dialog input:not([type=checkbox]),dialog textarea,dialog select{display:block;width:100%;border:1px solid #dce2ee;background:#fff;color:#34435f;padding:10px 12px;border-radius:4px;margin-top:8px;font-size:13px;resize:vertical}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:26px}.primary-button,.secondary-button{height:36px;border-radius:4px;padding:0 16px;font-size:12px}.primary-button{background:var(--blue);color:#fff}.secondary-button{border:1px solid #dee4ee;background:white;color:#7b879c}dialog .switch-line{display:flex;align-items:center;gap:12px;position:relative}.switch-line>span:first-child{flex:1}.switch-line input{position:absolute;right:0;opacity:0;width:36px;height:22px}.switch{width:36px;height:21px;border-radius:11px;background:#d8deea;pointer-events:none;position:relative}.switch:after{content:"";width:15px;height:15px;border-radius:50%;background:#fff;position:absolute;left:3px;top:3px;transition:transform .15s}.switch-line input:checked+.switch{background:var(--blue)}.switch-line input:checked+.switch:after{transform:translateX(15px)}.switch-line input:focus-visible+.switch{outline:2px solid #76a6ff}.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 28px);background:#253554;color:white;font-size:13px;padding:12px 20px;border-radius:5px;box-shadow:0 4px 18px #24335522;z-index:20}
body.customer-panel-hidden .workspace{grid-template-columns:minmax(285px,26%) minmax(0,1fr)}body.customer-panel-hidden .customer-column{display:none}.customer-open{display:none}body.customer-panel-hidden .customer-open{display:inline-grid}
.language-filter{height:30px;margin:0 20px 12px;padding:0 8px;border:1px solid var(--line);border-radius:4px;background:#fff;color:var(--muted);font-size:12px;flex:none}
/* 右侧客户栏内的快捷回复面板（与客户资料在同一列切换） */
.customer-column{position:relative}.dock-panel{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:#fff}.dock-panel[hidden]{display:none}.dock-panel-header{height:52px;min-height:52px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--line)}.dock-panel-header h2{font-size:15px;margin:0;font-weight:600}.dock-panel-actions{display:flex;gap:2px}.dock-panel-actions .icon-button{width:28px;height:28px}.dock-panel-actions .icon-button svg{width:15px;height:15px}.dock-search{display:flex;align-items:center;gap:8px;height:38px;margin:12px 12px 6px;padding:0 10px;background:#f6f7fa;border:1px solid #ecedf3;border-radius:4px;color:#a0a8b9;flex:none}.dock-search svg{width:14px;height:14px}.dock-search input{flex:1;min-width:0;border:0;outline:none;background:transparent;font-size:12px;color:inherit}.dock-search .icon-button{width:24px;height:24px;border-radius:3px}.dock-search .icon-button:hover{background:#e8eefb;color:var(--blue)}.dock-tree{flex:1;min-height:0;overflow:auto;padding:6px 10px 18px}.dock-tree-group{margin:2px 0}.dock-tree-cat{display:flex;align-items:center;gap:7px;padding:9px 8px;border-radius:5px;cursor:pointer;font-size:13px;color:#3c4c6e;font-weight:600}.dock-tree-cat:hover{background:#f3f6fc}.dock-tree-cat .dock-chevron{width:14px;height:14px;flex:none;transition:transform .12s;color:#9aa5bb}.dock-tree-cat.open .dock-chevron{transform:rotate(90deg)}.dock-tree-cat .dock-count{margin-left:auto;font-size:11px;font-weight:400;color:#a0a9ba}.dock-tree-cat-actions{margin-left:auto;display:flex;gap:2px;opacity:0;transition:opacity .12s}.dock-tree-cat:hover .dock-tree-cat-actions{opacity:1}.dock-tree-cat-actions .text-button{font-size:11px;color:#7d89a2}.dock-tree-children{margin-left:16px;border-left:1px solid #eef0f5;padding-left:6px}.dock-tree-child{display:flex;align-items:center;gap:7px;padding:8px 8px;border-radius:5px;cursor:pointer;font-size:12px;color:#5b6b8b}.dock-tree-child:hover{background:#f3f6fc}.dock-tree-child .dock-chevron{width:13px;height:13px;flex:none;transition:transform .12s}.dock-tree-child.open .dock-chevron{transform:rotate(90deg)}.dock-tree-child .dock-count{margin-left:auto;font-size:11px;color:#a0a9ba}.dock-tree-child-actions{margin-left:auto;display:flex;gap:2px;opacity:0}.dock-tree-child:hover .dock-tree-child-actions{opacity:1}.dock-reply-item{display:flex;align-items:center;gap:8px;padding:9px 10px;margin:4px 0 0 26px;border:1px solid #eef0f5;border-radius:5px;cursor:pointer;font-size:12px;color:#4c5a78;line-height:1.5;background:#fff;overflow-wrap:anywhere}.dock-reply-item:hover{background:#f0f5ff;border-color:#cadafa}.dock-reply-item .text-button{margin-left:auto;opacity:0;font-size:11px;color:#7d89a2}.dock-reply-item:hover .text-button{opacity:1}.dock-empty{padding:26px 12px;text-align:center;color:#a0a9ba;font-size:12px}
/* 输入区 # 快捷回复联想浮层 */
.quick-reply-suggest{position:absolute;left:18px;right:18px;bottom:calc(100% + 8px);max-height:246px;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:6px;box-shadow:0 10px 36px #1c3b7322;z-index:9;padding:6px}.quick-reply-suggest .suggest-head{padding:5px 9px;font-size:11px;color:#8b96ac}.quick-reply-suggest .suggest-item{padding:8px 10px;border-radius:4px;cursor:pointer;font-size:12px;color:#4a5878;line-height:1.5}.quick-reply-suggest .suggest-item.active,.quick-reply-suggest .suggest-item:hover{background:#f0f5ff;color:var(--blue)}.quick-reply-suggest .suggest-item small{display:block;color:#a0a9ba;font-size:11px;margin-top:2px}
@media(min-width:1700px){.workspace{grid-template-columns:437px minmax(0,1fr) 362px}}
@media(max-width:1400px){.conversation-label{display:none}.header-action{font-size:0;width:30px;padding:0}.header-action svg{width:16px;height:16px}.chat-header{padding:0 18px}.composer-tabs{gap:13px}.composer-tools .icon-button{width:25px}.workspace{grid-template-columns:300px minmax(0,1fr) 280px}.customer-panel{padding:0 20px}.customer-identity{padding-left:20px}.composer-wrap{margin-left:18px;margin-right:18px}}
@media(max-width:1100px){.workspace{grid-template-columns:265px minmax(0,1fr) 250px}.rail{width:64px;flex-basis:64px}.column-header{padding:0 18px}.inbox-tabs{padding:0 18px;gap:19px}.conversation-item{padding-left:17px;padding-right:17px;gap:9px}.composer-tabs{gap:10px;padding:0 10px}.composer-tools{gap:0}.composer-tools .icon-button{width:23px}.composer-tab{font-size:11px}.customer-header{padding:0 16px}.customer-identity{padding:12px 16px 18px}.customer-panel{padding:0 16px}.message-stream{padding-left:18px;padding-right:18px}body.customer-panel-hidden .workspace{grid-template-columns:265px minmax(0,1fr)}}
@media(max-width:960px){.workspace{grid-template-columns:280px minmax(0,1fr)}.customer-column{display:none}.customer-open{display:inline-grid}.customer-column.mobile-open{display:flex;position:fixed;right:0;top:0;bottom:0;width:min(330px,calc(100vw - 64px));box-shadow:-8px 0 30px #15224322;z-index:5}body.customer-panel-hidden .customer-column.mobile-open{display:flex}.composer-tab{font-size:12px}}
@media(max-width:640px){.rail{width:54px;flex-basis:54px}.rail-brand img{width:40px;height:40px}.rail-button{width:42px;height:44px}.rail-nav,.rail-bottom{gap:10px}.workspace,body.customer-panel-hidden .workspace{grid-template-columns:minmax(0,1fr)}.conversation-column{display:none}.chat-header{padding:0 12px;height:76px;min-height:76px}.chat-title{gap:8px}.chat-title h2{max-width:130px}.chat-header-actions{gap:3px}.chat-header-actions .header-action{width:27px}.channel-icon{display:none}.chat-meta{padding:0 14px}.message-stream{padding-left:12px;padding-right:12px}.composer-wrap{margin:0 10px 12px}.composer-tabs{gap:10px;flex-wrap:wrap;height:auto;min-height:44px}.composer-tab{font-size:11px;height:35px}.composer-tools{margin-left:auto}.composer-tools .icon-button{width:23px}.composer-footer{padding-left:10px;padding-right:10px}.composer-hint{max-width:130px}.message-composer textarea{font-size:12px;padding:12px;height:80px}.bubble-wrap{max-width:calc(100% - 40px)}.bubble{padding:10px 12px;font-size:12px}.chat-title p{font-size:10px}.customer-column.mobile-open{width:min(330px,calc(100vw - 54px))}.rail-brand{height:76px}.conversation-column.mobile-open{position:fixed;display:flex;left:54px;right:0;top:0;bottom:0;z-index:4;box-shadow:8px 0 25px #15224322}}
 .interaction-dialog{border:1px solid #e0e5ee;border-radius:8px;padding:28px;width:450px;max-width:calc(100vw - 32px);color:#253156;box-shadow:0 18px 80px #101b4233}.interaction-dialog::backdrop{background:#0b173c66}.attachment-preview{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid #eef1f6;background:#f8faff;font-size:12px;color:#64718b}.attachment-preview img{width:34px;height:34px;object-fit:cover;border-radius:3px}.attachment-preview button{margin-left:auto;color:#7d89a2;font-size:18px}.mobile-inbox-open{display:none}
@media(max-width:640px){.mobile-inbox-open{display:inline-grid}.conversation-column.mobile-open{display:flex;position:fixed;left:54px;right:0;top:0;bottom:0;z-index:8;box-shadow:8px 0 30px #15224322}}
.message-attachment{display:flex;align-items:center;gap:12px;margin-top:9px;padding:12px 14px;background:#f6f9ff;border:1px solid #dce7fb;border-radius:6px;color:#3d6cb4;text-decoration:none;font-size:12px;max-width:min(100%,380px)}
.message-image{display:block;width:clamp(180px,38vw,360px);max-width:100%;padding:0;background:transparent;border:0;border-radius:6px;cursor:zoom-in}
.message-image:focus-visible{outline:2px solid #6d9cf3;outline-offset:3px}
.message-image img{display:block;width:100%;height:auto;max-height:360px;object-fit:contain;background:#f6f8fb;border:1px solid #d6e1f2;border-radius:6px;box-shadow:0 2px 7px #1e376214}
.message-video{display:block;max-width:min(100%,380px)}
.message-attachment video{width:100%;max-width:320px;border-radius:4px;display:block;background:#000}
.message-file{width:clamp(220px,36vw,340px);max-width:100%;min-height:72px}
.message-file svg{width:30px;height:34px;color:#3c7ef7;flex:none}
.message-file svg:last-child{width:18px;height:18px;color:#7e9bd0;margin-left:auto}
.attachment-details{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px;line-height:1.35}
.attachment-details strong{font-weight:500;overflow-wrap:anywhere;word-break:break-word;color:#365d9d}
.attachment-details small{display:block;color:#8fa3c4;font-size:10px}
.message-video .attachment-details{margin-top:2px}
.image-backdrop{position:fixed;inset:0;background:#13181fd9;z-index:40;display:flex;align-items:center;justify-content:center;padding:48px 24px}
.image-backdrop>img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 8px 30px #0006}
.image-close{position:absolute;right:18px;top:18px;display:flex;align-items:center;justify-content:center;background:transparent;border:0;color:#fff;height:38px;width:38px;cursor:pointer}
.image-close svg{width:25px;height:25px}
/* ---------- 模块页（总览/接待记录/工单/客户/统计/渠道设置） ---------- */
body.module-open .workspace{display:none}
.module-view{flex:1;min-width:0;height:100vh;height:100dvh;overflow:auto;background:#f3f4f8;padding:0 28px 44px}
.module-header{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:26px 0 20px;flex-wrap:wrap}
.module-header h1{font-size:22px;margin:0;font-weight:600}
.module-header p{margin:7px 0 0;font-size:12px;color:var(--muted)}
.module-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:12px}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:6px;padding:16px 18px;display:flex;flex-direction:column;gap:6px;min-width:0}
.stat-value{font-size:24px;font-weight:600;color:#1f2c4d}
.stat-label{font-size:12px;color:#7d89a2}
.stat-hint{font-size:10px;color:#a5aebf}
.module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;margin-top:14px;align-items:start}
.module-card{background:#fff;border:1px solid var(--line);border-radius:6px;padding:18px 20px;min-width:0}
.module-card h3{margin:0 0 14px;font-size:13px;font-weight:600}
.card-hint{margin:-6px 0 12px;font-size:11px;color:#98a2b6;line-height:1.6}
.module-card>label,.module-card form:not(.inline-form):not(.dir-add-form)>label:not(.switch-line){display:block;font-size:12px;color:#64718b;margin:0 0 13px;min-width:0}
.module-card>label input:not([type=checkbox]),.module-card>label textarea,.module-card>label select,.module-card form:not(.inline-form):not(.dir-add-form)>label:not(.switch-line) input:not([type=checkbox]),.module-card form:not(.inline-form):not(.dir-add-form)>label:not(.switch-line) textarea,.module-card form:not(.inline-form):not(.dir-add-form)>label:not(.switch-line) select{display:block;width:100%;min-width:0;border:1px solid #dce2ee;border-radius:4px;padding:9px 11px;font-size:12px;line-height:1.35;margin-top:7px;resize:vertical;color:#34435f;background:#fff}
.module-card form:not(.inline-form):not(.dir-add-form)>label:not(.switch-line) select[multiple]{min-height:132px;padding:5px}
.load-row{display:flex;align-items:center;gap:10px;margin:10px 0;font-size:12px}
.load-name{width:76px;flex:none;color:#5a6a8a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.load-bar{flex:1;height:8px;background:#eef1f7;border-radius:4px;overflow:hidden}
.load-bar span{display:block;height:100%;background:var(--blue);border-radius:4px}
.load-bar .rating-fill.rating-good{background:#0fae84}.load-bar .rating-fill.rating-neutral{background:#dc9d31}.load-bar .rating-fill.rating-bad{background:#ef5d6e}
.load-count{flex:none;color:#8a94a9;font-size:11px;min-width:62px;text-align:right}
.activity-row{display:flex;gap:10px;align-items:baseline;width:100%;text-align:left;padding:9px 0;border-bottom:1px solid #f2f3f7;font-size:12px}
.activity-row:last-child{border-bottom:0}
.activity-who{flex:none;font-weight:600;color:#3c4a68;min-width:64px}
.activity-text{flex:1;min-width:0;color:#6d7891;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.activity-row:hover .activity-text{color:var(--blue)}
.activity-time{flex:none;color:#a0a9ba;font-size:10px}
.quick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(126px,1fr));gap:9px}
.quick-item{display:flex;align-items:center;gap:8px;padding:11px 12px;border:1px solid var(--line);border-radius:5px;font-size:12px;color:#5a6a8a;background:#fbfcfe}
.quick-item:hover{border-color:#cadafa;color:var(--blue);background:#f4f9ff}
.quick-item svg{width:15px;height:15px}
.filter-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.filter-spacer{flex:1}
.filter-chip{height:30px;padding:0 13px;border:1px solid var(--line);border-radius:15px;background:#fff;font-size:12px;color:#7d89a2;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.filter-chip:hover{color:var(--blue);border-color:#cadafa}
.filter-chip.active{background:var(--blue);border-color:var(--blue);color:#fff}
.module-search{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #e3e7ef;border-radius:16px;padding:0 12px;height:32px;min-width:200px;color:#a0a8b9}
.module-search svg{width:14px;height:14px;flex:none}
.module-search input{border:0;outline:0;background:transparent;font-size:12px;min-width:0;flex:1;color:#3c4a68}
.table-card{padding:0;overflow-x:auto}
.module-table{width:100%;border-collapse:collapse;font-size:12px;min-width:620px}
.module-table.slim{min-width:0}
.module-table th{font-size:11px;color:#98a2b6;font-weight:500;text-align:left;padding:12px 14px;border-bottom:1px solid var(--line);white-space:nowrap;background:#fafbfd}
.module-table td{padding:12px 14px;border-bottom:1px solid #f2f3f7;vertical-align:top;color:#5d6a86}
.module-table td small{color:#98a2b6;font-size:11px}
.module-table tr:last-child td{border-bottom:0}
.module-table select{border:1px solid #dce2ee;border-radius:4px;padding:5px 8px;font-size:12px;color:#34435f;background:#fff;max-width:130px}
.table-row{cursor:pointer}
.table-row:hover td{background:#f7f9fd}
.text-button{display:inline-flex;align-items:center;gap:5px;color:var(--blue);font-size:12px;padding:4px 6px;border-radius:4px}
.text-button:hover{background:#f0f5ff}
.text-button.danger{color:#e05a68}.text-button.danger:hover{background:#fdf0f1}
.text-button svg{width:14px;height:14px}
.module-table.slim th,.module-table.slim td{padding:9px 10px}
.status-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:10px;font-size:10px;white-space:nowrap}
.chip-active{background:#e7f8f1;color:#0f9d70}
.chip-waiting{background:#fff4e3;color:#c98a1d}
.chip-closed{background:#eef0f4;color:#8a94a9}
.rating-badge{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:10px;font-size:10px;white-space:nowrap}
.rating-good{background:#e7f8f1;color:#0f9d70}
.rating-neutral{background:#fdf3e0;color:#c98a1d}
.rating-bad{background:#fdecec;color:#e05a68}
.rating-line{display:flex;align-items:center;justify-content:space-between;gap:8px}
.mini-avatar{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;color:#fff;font-size:11px;vertical-align:middle;margin-right:6px;flex:none}
.customers-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:14px;align-items:start}
.customer-drawer{background:#fff;border:1px solid var(--line);border-radius:6px;padding:18px 20px;position:sticky;top:16px;min-width:0}
.customer-select-cell{width:42px;text-align:center}.customer-select-cell input,[data-customer-select-all]{width:20px;height:20px;min-width:20px;min-height:20px;accent-color:var(--blue);cursor:pointer}.bulk-task-hint{font-size:11px;color:#8a94a9}.bulk-file-button{display:inline-flex;align-items:center;gap:6px;cursor:pointer}.customer-bulk-dialog{width:min(760px,calc(100vw - 28px));max-height:min(88dvh,820px);padding:0;border:0;border-radius:8px;box-shadow:0 22px 70px #17294a35;color:var(--text)}.customer-bulk-dialog::backdrop{background:#15234266}.customer-bulk-form{display:flex;flex-direction:column;max-height:min(88dvh,820px);padding:22px 24px}.customer-bulk-form #customer-bulk-body{overflow:auto;min-height:0}.bulk-import-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:14px 0}.bulk-status{padding:9px 11px;border:1px dashed #dce2ee;background:#fafbfd;color:#68768a;font-size:12px;border-radius:4px;margin:10px 0}.bulk-mapping-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:10px 0 14px}.bulk-mapping-grid label{font-size:11px;color:#64718b}.bulk-mapping-grid select{display:block;width:100%;margin-top:5px;border:1px solid #dce2ee;border-radius:4px;padding:8px;font-size:12px;background:#fff;color:#34435f}.bulk-summary{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.bulk-summary-hint{font-size:11px;color:#98a2b6}.bulk-preview-table{max-height:270px;overflow:auto;border:1px solid #eef0f5;border-radius:5px}.bulk-preview-table .module-table{min-width:0}.bulk-preview-table .module-table td,.bulk-preview-table .module-table th{padding:8px 10px}.bulk-empty{padding:24px;text-align:center;color:#98a2b6;font-size:12px;border:1px dashed #e3e7ef;border-radius:5px}.bulk-file-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #e3e7ef;border-radius:5px;background:#fafbfd}.bulk-file-row>span{display:flex;align-items:center;gap:8px;min-width:0;color:var(--blue)}.bulk-file-row strong{color:#3c4a68;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bulk-file-row small{color:#98a2b6;white-space:nowrap}.bulk-delete-preview{padding:14px;border:1px solid #f0e0e1;background:#fffafb;border-radius:5px;color:#6d7891;font-size:12px;line-height:1.7}.bulk-risk-list{display:flex;flex-direction:column;gap:4px}.bulk-risk-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #f0f2f6;padding:10px 0}.bulk-risk-row>span{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:center;column-gap:7px;min-width:0}.bulk-risk-row strong{font-size:12px;color:#3c4a68;overflow-wrap:anywhere}.bulk-risk-row small{grid-column:2;color:#98a2b6;font-size:11px;margin-top:3px;overflow-wrap:anywhere}.bulk-risk-row svg{grid-row:1 / span 2;color:#e05a68;width:16px;height:16px}.bulk-all-or-nothing{margin-top:12px}.customer-bulk-dialog .dialog-actions{flex:none;margin-top:16px}
.drawer-head{display:flex;gap:12px;align-items:center;margin-bottom:14px}
.drawer-head h3{margin:0;font-size:15px;overflow-wrap:anywhere}
.drawer-head p{margin:5px 0 0;font-size:11px;color:#939db1}
.drawer-head .icon-button{margin-left:auto;flex:none}
.drawer-tabs{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}
.drawer-body{min-width:0}
.drawer-body form label,.settings-grid form label{display:block;font-size:12px;color:#64718b;margin:0 0 12px}
.drawer-body form input,.drawer-body form textarea,.settings-grid form input,.settings-grid form textarea{display:block;width:100%;border:1px solid #dce2ee;border-radius:4px;padding:8px 10px;font-size:12px;margin-top:6px;resize:vertical;color:#34435f;background:#fff}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:8px;flex-wrap:wrap}
.inline-form{display:flex;align-items:flex-end;flex-wrap:wrap;gap:10px;margin:0 0 14px;padding:10px 0;border-bottom:1px solid #f0f2f6}.inline-form label{margin:0;min-width:0;flex:1 1 180px}.inline-form input{width:100%;box-sizing:border-box}.inline-form button{flex:none;white-space:nowrap}
.analytics-filter{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));align-items:end;gap:10px;margin:0 0 16px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:6px}.analytics-filter label{display:block;min-width:0;font-size:11px;color:#64718b}.analytics-filter input,.analytics-filter select{display:block;width:100%;height:36px;margin-top:6px;padding:7px 9px;border:1px solid #dce2ee;border-radius:4px;background:#fff;color:#34435f;font-size:12px;box-sizing:border-box}.analytics-filter-actions{display:flex;align-items:center;gap:8px;height:36px}.analytics-filter-actions button{height:36px;white-space:nowrap}.analytics-table{overflow:auto}.analytics-table h3{position:sticky;left:0}.analytics-error{margin:0 0 14px;padding:9px 11px;border:1px solid #f2c8cc;border-radius:4px;background:#fff8f9;color:#b24350;font-size:12px}
.danger-button{height:36px;padding:0 14px;border-radius:4px;border:1px solid #f3ccd0;color:#e05a68;font-size:12px;background:#fff}
.danger-button:hover{background:#fdf0f1}
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:14px;align-items:start}
.faq-list{margin-bottom:6px}
.faq-row{display:flex;gap:10px;justify-content:space-between;align-items:flex-start;padding:10px 0;border-bottom:1px solid #f2f3f7}
.faq-row:last-child{border-bottom:0}
.faq-row>div:first-child{min-width:0}
.faq-row strong{display:block;font-size:12px;color:#3c4a68;font-weight:600;overflow-wrap:anywhere}
.faq-row span{display:block;font-size:11px;color:#8a94a9;margin-top:4px;white-space:pre-wrap;overflow-wrap:anywhere}
.faq-row.single>div:first-child{display:flex;align-items:center}
.faq-row.single span{margin:0;font-size:12px;color:#5d6a86}
.row-actions{display:flex;gap:2px;flex:none}
.copy-block{margin-top:12px;border-top:1px dashed #e6e9f0;padding-top:12px}
.copy-block label{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#64718b;margin:0 0 6px}
.copy-block input,.copy-block textarea{width:100%;border:1px solid #e3e7ef;background:#fafbfd;border-radius:4px;padding:8px 10px;font-size:11px;color:#6d7891;resize:vertical;font-family:inherit}
.module-card .switch-line{display:flex;align-items:center;gap:12px;font-size:12px;color:#64718b;margin:0 0 14px;position:relative;cursor:pointer}
.module-card .switch-line>span:first-child{flex:1}
.bar-chart{display:flex;align-items:flex-end;gap:10px;height:150px;padding-top:8px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:5px;height:100%;justify-content:flex-end;min-width:0}
.bar{width:70%;max-width:34px;background:linear-gradient(180deg,#6ea4ff,var(--blue));border-radius:4px 4px 0 0;min-height:3px}
.bar-label{font-size:10px;color:#9aa4b8}
.bar-count{font-size:10px;color:#6d7891}
.help-body p{font-size:12px;line-height:1.8;color:#5d6a86;margin:0 0 12px}
.help-body a{color:var(--blue)}
.dialog-note{font-size:12px;color:#8a94a9;line-height:1.7;margin:6px 0}
.agent-chip{cursor:pointer}
.presence-dot.away{background:#98a2b7}.presence-dot.busy{background:#f5b83d}
@media(max-width:1200px){.customers-layout{grid-template-columns:minmax(0,1fr)}.customer-drawer{position:static}}
@media(max-width:900px){.module-view{padding:0 16px 44px}.module-header{padding:20px 0 16px}.stat-grid{grid-template-columns:repeat(auto-fit,minmax(128px,1fr))}}
@media(max-width:640px){.module-view{padding:0 12px 44px}.stat-value{font-size:20px}.form-row{grid-template-columns:1fr}}
.settings-layout{display:grid;grid-template-columns:216px minmax(0,1fr);gap:14px;align-items:start}
.settings-nav{background:#fff;border:1px solid var(--line);border-radius:6px;padding:10px 0;display:flex;flex-direction:column;position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow:auto}
.settings-group-title{font-size:11px;color:#98a2b6;padding:10px 16px 6px;font-weight:600}
.settings-nav-item{display:block;text-align:left;padding:8px 16px;font-size:12px;color:#5a6a8a;border-left:2px solid transparent;white-space:nowrap}
.settings-nav-item:hover{color:var(--blue);background:#f7f9fd}
.settings-nav-item.active{color:var(--blue);border-left-color:var(--blue);background:#f0f5ff}
.settings-content{min-width:0;display:flex;flex-direction:column;gap:14px}
.dir-add-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}
.dir-add-form label{display:block;font-size:12px;color:#64718b;margin:0}
.dir-add-form input{display:block;width:100%;border:1px solid #dce2ee;border-radius:4px;padding:8px 10px;font-size:12px;margin-top:5px;color:#34435f;background:#fff}
.table-card.inline{border:1px solid #f0f2f7;border-radius:5px;margin-bottom:14px}
.table-card.inline .module-table{min-width:0}
.settings-content .module-card .module-table select{max-width:110px}
.summary-tabs{margin-bottom:14px}.summary-metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin:12px 0}.summary-template-content{max-width:360px;white-space:pre-wrap;word-break:break-word}.dir-add-grid .span-wide{grid-column:1/-1}
@media(max-width:1100px){.settings-layout{grid-template-columns:minmax(0,1fr)}.settings-nav{position:sticky;top:0;z-index:3;flex-direction:row;flex-wrap:nowrap;gap:6px;padding:8px;max-width:100%;max-height:none;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin}.settings-group{display:flex;align-items:center;flex:none;flex-wrap:nowrap;gap:4px}.settings-group+.settings-group{border-left:1px solid #e6eaf2;padding-left:6px}.settings-group-title{width:auto;flex:none;padding:4px 7px;color:#7f8ba2}.settings-nav-item{flex:none;border-left:0;border-bottom:2px solid transparent;padding:8px 10px}.settings-nav-item.active{border-left-color:transparent;border-bottom-color:var(--blue)}}
.message-attachment video{width:100%;max-width:260px;border-radius:4px;display:block;background:#000}
.loading-state{display:grid;place-items:center;gap:8px;min-height:150px;padding:28px;color:#8c96aa;font-size:12px;text-align:center}.loading-state span{display:inline-block;width:7px;height:7px;margin:0 2px;border-radius:50%;background:#78a4f5;animation:loading-dot 1s ease-in-out infinite}.loading-state span:nth-child(2){animation-delay:.12s}.loading-state span:nth-child(3){animation-delay:.24s}.loading-state em{font-style:normal;font-size:11px}.is-loading .loading-state{display:grid}@keyframes loading-dot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}
.message-retract{display:none;font-size:10px;color:#a4adbe;margin-top:5px;padding:2px 6px;border-radius:3px;cursor:pointer}
.message-row:hover .message-retract{display:inline-block}
.message-row:focus-within .message-retract{display:inline-block}
.message-retract:hover{color:#e05a68;background:#fdf0f1}
.message-row.agent .message-retract{float:right}
@media (hover:none),(pointer:coarse){.message-row.agent .message-retract{display:inline-block;min-height:28px;padding:6px 9px;margin-top:6px}}
.message-translate{display:inline-block;font-size:10px;color:#3c7ef7;margin-top:5px;padding:2px 6px;border-radius:3px;cursor:pointer;border:1px solid #dce6fb;background:#f5f8ff}
.message-translate:hover{background:#e9f0ff}
.message-translate:disabled{opacity:.6;cursor:default}
.message-translation{margin-top:8px;padding:0;color:#44506b;font-size:12px;line-height:1.5;min-width:0}
.message-translation .translation-rule{border-top:1px dashed #cdd9ec;margin:0 0 6px}
.message-translation .translation-label{display:block;font-size:10px;color:#8fa3c8;margin-bottom:3px;font-weight:600}
.message-translation .translation-text{white-space:pre-wrap;word-break:break-word;color:#51617f}
.message-more{display:none;position:absolute;right:auto;left:calc(100% + 6px);top:50%;transform:translateY(-50%);width:22px;height:22px;border-radius:50%;background:#fff;color:#8a94aa;border:1px solid #e2e6ee;font-size:14px;line-height:1;align-items:center;justify-content:center}
.message-row:hover .message-more,.message-row:focus-within .message-more{display:inline-flex}
.message-more:hover{color:var(--blue);border-color:#bfd2f5}
.message-row.agent .message-more{left:auto;right:calc(100% + 6px)}
.message-menu{position:absolute;top:calc(100% + 6px);right:0;left:auto;min-width:128px;background:#fff;border:1px solid #e0e5ef;border-radius:6px;box-shadow:0 8px 26px #1c3b7326;z-index:8;padding:4px}
.message-menu button{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;font-size:12px;color:#44506b;border-radius:4px;text-align:left}
.message-menu button:hover{background:#f0f5ff;color:var(--blue)}
.message-menu button.danger:hover{background:#fdf0f1;color:#d9534f}
.message-row.agent .message-menu{right:auto;left:0}
.composer-quote{display:flex;align-items:center;gap:8px;padding:6px 10px;border-left:3px solid var(--blue);background:#f2f6ff;margin:0 0 8px;border-radius:3px}
.composer-quote[hidden]{display:none}
.composer-quote-body{flex:1;min-width:0;display:flex;flex-direction:column}
.composer-quote-name{font-size:11px;color:#5b8def;font-weight:600}
.composer-quote-text{font-size:11px;color:#7a8699;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bubble-quote{border-left:3px solid #c3d4f5;background:#f3f6fc;border-radius:3px;padding:5px 8px;margin-bottom:6px;font-size:11px;color:#7b879c}
.bubble-quote .bubble-quote-name{display:block;color:#5b8def;font-weight:600;margin-bottom:1px}
.bubble-quote .bubble-quote-text{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.message-quote{display:none;font-size:10px;color:#a4adbe;margin-top:5px;padding:2px 6px;border-radius:3px;cursor:pointer}
.message-row:hover .message-quote,.message-row:focus-within .message-quote{display:inline-block}
.message-quote:hover{color:var(--blue);background:#f0f5ff}
.typing-bubble{display:inline-flex;align-items:center;gap:4px;padding:8px 12px;margin:0 0 10px 52px;background:#fff;border:1px solid #e7e9ed;border-radius:14px;width:max-content;max-width:min(70%,560px)}.typing-bubble .typing-preview{font-size:12px;line-height:1.4;color:#8a94aa;max-width:min(420px,45vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.typing-bubble .typing-preview:empty{display:none}.typing-bubble .typing-dot{width:6px;height:6px;flex:none;border-radius:50%;background:#a4adbe;animation:typing-dot 1.2s ease-in-out infinite}.typing-bubble .typing-dot:nth-child(3){animation-delay:.2s}.typing-bubble .typing-dot:nth-child(4){animation-delay:.4s}.typing-bubble[hidden]{display:none}@keyframes typing-dot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}
.table-row[role="button"]:focus-visible{outline:2px solid #6d9cf3;outline-offset:-2px}
.reply-due{display:inline-flex;align-items:center;height:14px;padding:0 5px;margin-left:5px;border-radius:3px;background:#fdecec;color:#e05a68;font-size:9px;vertical-align:1px}
.queue-banner{flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:6px;font-size:11px;color:#1677e8;background:#eaf4ff;border-bottom:1px solid #d8eaff;padding:7px 12px}
.queue-banner:empty{display:none}
.composer-wrap{position:relative;overflow:visible}
.attachment-preview{min-height:50px}.attachment-preview .attachment-status{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px;overflow:hidden}.attachment-preview .attachment-status strong{font-size:12px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-preview .attachment-status small{font-size:10px;color:#97a2b6}.attachment-preview .attachment-status.error{display:block;color:#d95562;line-height:1.5}.attachment-preview button[data-attachment-action]{flex:none;margin-left:4px;padding:3px 6px;border-radius:3px;color:#6f7d98;font-size:11px}.attachment-preview button[data-attachment-action]:hover{background:#edf3ff;color:var(--blue)}.attachment-preview button[data-attachment-action="remove"]{font-size:18px;padding:0 4px}.attachment-preview>img{flex:none}
.emoji-picker{position:absolute;right:12px;bottom:58px;z-index:12;width:280px;padding:10px;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px;background:#fff;border:1px solid #dfe5f0;border-radius:6px;box-shadow:0 12px 32px #19264d24}.emoji-option{width:100%;aspect-ratio:1;display:grid;place-items:center;border-radius:4px;font-size:20px;line-height:1}.emoji-option:hover,.emoji-option:focus-visible{background:#edf3ff}
.dragging-attachment{outline:2px dashed var(--blue);outline-offset:2px}.connection-notice{position:fixed;z-index:30;top:14px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;max-width:calc(100vw - 32px);padding:8px 10px 8px 14px;border:1px solid #f0c7cc;border-radius:5px;background:#fff5f6;color:#c54d5a;font-size:12px;box-shadow:0 5px 18px #16234a1c}.connection-notice[data-state="connecting"]{border-color:#cfe0ff;background:#f3f7ff;color:#376fc9}.connection-notice button{height:26px;padding:0 10px;border:1px solid currentColor;border-radius:3px;color:inherit;font-size:11px}.connection-notice button:hover:not(:disabled){background:#fff}.events-disconnected .chat-column{box-shadow:inset 0 2px 0 #e05a68}.events-connecting .chat-column{box-shadow:inset 0 2px 0 #6095ef}.is-loading .chat-column{cursor:progress}
@media(max-width:640px){.emoji-picker{left:6px;right:6px;bottom:58px;width:auto;grid-template-columns:repeat(8,minmax(0,1fr));padding:8px}.emoji-option{font-size:18px}.connection-notice{top:8px;left:8px;right:8px;transform:none;max-width:none;justify-content:space-between}.connection-notice span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-preview{padding-left:9px;padding-right:9px}}

/* Interaction hardening: dialogs stay operable on short screens and hidden
   message actions remain keyboard reachable. */
.settings-dialog,.ticket-dialog,.interaction-dialog{max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
.message-retract{display:inline-block;opacity:0;pointer-events:none;transition:opacity .12s}
.message-row:hover .message-retract,.message-row:focus-within .message-retract{opacity:1;pointer-events:auto}
@media (hover:none),(pointer:coarse){.message-row.agent .message-retract{opacity:1;pointer-events:auto}}
@media(max-width:640px){.conversation-column.mobile-open{left:54px}.settings-dialog,.ticket-dialog,.interaction-dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:20px}}

/* Small-screen reachability and top-layer feedback. */
.rail{overflow-y:auto;overflow-x:hidden;scrollbar-width:none;overscroll-behavior:contain}
.rail::-webkit-scrollbar{display:none}
.rail-brand,.rail-nav,.rail-bottom,.rail-button,.agent-chip{flex-shrink:0}
.toast{inset:auto auto 26px 50%;margin:0;border:0;z-index:50}
@media(max-width:640px){
  .module-grid,.settings-grid{grid-template-columns:minmax(0,1fr)}
  .module-search{min-width:0;width:100%}
  .module-card{padding:14px}
}
@media(max-height:600px){
  .rail-brand{height:52px;min-height:52px}
  .rail-nav,.rail-bottom{gap:4px}
  .rail-button{height:36px}
  .rail-bottom{padding-bottom:8px}
  .agent-chip{margin-top:4px}
}

/* ============================================================
   HARDENED DESKTOP LAYOUT  (additive, overrides base for robustness)
   Guarantees: full-height shell, fixed rail, strict grid,
   min-width:0 everywhere, no horizontal overflow, no overlap.
   ============================================================ */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #253156;
  background: #f3f4f8;
  overflow: hidden;
}
.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
}
.app-shell *, .module-view * { box-sizing: border-box; }

/* ---- 1. LEFT NAV fixed 82px ---- */
.rail {
  width: 82px;
  flex: 0 0 82px;
  min-width: 82px;
  overflow: hidden auto;
}

/* ---- 2. WORKSPACE GRID: 284px + minmax(0,1fr) + 310px ---- */
.workspace {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr) 310px;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
.conversation-column, .chat-column, .customer-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- 3. COLUMN INTERNALS: inner scroll ---- */
.conversation-list, .message-stream, .customer-panel, .dock-panel, .dock-tree {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
}
.column-header, .chat-header, .customer-header { flex: 0 0 auto; }

/* ---- 4. CONVERSATION ITEM ---- */
.conversation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
}
.conversation-item-avatar { flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px; }
.conversation-copy { flex: 1 1 auto; min-width: 0; display: block; }
.conversation-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.conversation-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { flex: 0 0 auto; white-space: nowrap; }
.conversation-preview {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 8px;
}
.conversation-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 9px;
}
.conversation-status { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-due, .unread { flex: 0 0 auto; white-space: nowrap; }

/* ---- 5. CHAT: header/footer fixed, stream scrolls ---- */
.chat-column { position: relative; }
.chat-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 0;
}
.chat-title { min-width: 0; flex: 1 1 auto; }
.chat-title h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; min-width: 0; }
.message-stream { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.composer-wrap { flex: 0 0 auto; min-width: 0; overflow: hidden; }

.message-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-width: 0; position: relative; }
.message-avatar { flex: 0 0 32px; width: 32px; height: 32px; min-width: 32px; }
.bubble-wrap { flex: 0 1 auto; min-width: 0; max-width: 82%; position: relative; }
.message-meta { min-width: 0; }
.bubble { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }

/* ---- 6. CUSTOMER COLUMN ---- */
.customer-column { position: relative; }
.customer-identity { flex: 0 0 auto; display: flex; align-items: center; gap: 13px; min-width: 0; }
.customer-identity > div { min-width: 0; }
.customer-identity h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.customer-identity p { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-tabs { flex: 0 0 auto; min-width: 0; }
.customer-tab { white-space: nowrap; }

/* ---- 7. NEW CONVERSATION: pinned bottom of left column ---- */
.conversation-column { position: relative; }
.new-conversation {
  position: relative;
  flex: 0 0 auto;
  min-height: 52px;
  margin-top: auto;
  width: calc(100% - 32px);
  margin-left: 16px;
  margin-right: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

/* ---- 8. NARROW / TABLET: customer column becomes overlay drawer ---- */
@media (max-width: 960px) {
  .workspace { grid-template-columns: 280px minmax(0, 1fr); }
  .customer-column:not(.mobile-open) { display: none; }
  .customer-column.mobile-open {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(330px, calc(100vw - 64px));
    display: flex;
    flex-direction: column;
    z-index: 30;
    box-shadow: -8px 0 30px rgba(21,34,67,0.25);
    background: #fff;
  }
  .customer-open.mobile-open { display: inline-grid; }
  body.customer-panel-hidden .customer-column.mobile-open { display: flex; }
}

/* ---- 9. SMALL SCREENS: single column + left drawer ---- */
@media (max-width: 640px) {
  .rail { width: 54px; flex: 0 0 54px; min-width: 54px; }
  .workspace, body.customer-panel-hidden .workspace { grid-template-columns: minmax(0, 1fr); }
  .conversation-column { display: none; }
  .conversation-column.mobile-open {
    position: fixed;
    left: 54px;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    z-index: 30;
    box-shadow: 8px 0 24px rgba(21,34,67,0.25);
  }
}

/* ---- TYPE scale + language neutralization ---- */
.module-view {
  font-size: 14px;
  line-height: 1.5;
  color: #253156;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.stat-grid, .stat-card, .activity-row, .module-card { min-width: 0; }
.stat-card, .module-card { overflow: hidden; }
.stat-card .stat-value, .activity-row > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-card p, .module-card label { overflow-wrap: anywhere; word-break: break-word; }

/* Freeze: never let content widen the viewport sideways */
.app-shell, .workspace, .conversation-column, .chat-column, .customer-column { max-width: 100vw; }

/* ===== 历史记录：聊天区卡片内展开会话列表 ===== */
.history-block { flex: 0 0 auto; margin: 12px 24px 0; }
.history-block[hidden] { display: none; }
.history-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; text-align: left; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, background .12s, border-radius .12s;
}
.history-card:hover { border-color: #cadafa; box-shadow: 0 4px 14px rgba(28,59,115,0.1); background: #fbfcff; }
.history-card:active { transform: translateY(1px); }
.history-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.history-block.expanded .history-card { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }
.history-card-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #eef4ff; color: var(--blue); }
.history-card-icon svg { width: 20px; height: 20px; }
.history-card-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.history-card-copy strong { font-size: 14px; font-weight: 600; color: #253156; }
.history-card-copy small { font-size: 11px; color: #8a94a9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-card-arrow { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; color: #b0b9ce; transition: transform .18s; }
.history-card-arrow svg { width: 18px; height: 18px; }
.history-block.expanded .history-card-arrow { transform: rotate(90deg); }
.history-list { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; max-height: 300px; overflow-y: auto; }
.history-list[hidden] { display: none; }
.history-list-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-bottom: 1px solid #f0f2f7; text-align: left; cursor: pointer; }
.history-list-item:last-child { border-bottom: 0; }
.history-list-item:hover { background: #f7f9fd; }
.history-list-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.history-list-item .hli-main { flex: 1 1 auto; min-width: 0; }
.history-list-item .hli-title { font-size: 13px; font-weight: 600; color: #253156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list-item .hli-sub { font-size: 11px; color: #8a94a9; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list-item .hli-arrow { flex: 0 0 auto; color: #c3cbd9; }
.history-list-empty { padding: 20px; text-align: center; color: #98a2b6; font-size: 12px; }
@media (max-width: 640px) { .history-block { margin: 10px 12px 0; } }

/* ===== 历史详情：右侧贴边白色面板 + 左侧半透明遮罩 ===== */
.history-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.38); z-index: 44; opacity: 0; transition: opacity .2s ease; }
.history-scrim.open { opacity: 1; }
.history-scrim[hidden] { display: none; }
.history-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; flex-direction: column; background: #fff;
  box-shadow: -8px 0 28px rgba(16, 27, 66, 0.18);
  transform: translateX(100%); transition: transform .2s ease;
  will-change: transform;
}
.history-drawer.open { transform: translateX(0); }
.history-drawer[hidden] { display: none; }
.history-drawer-header { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; }
.history-drawer-heading { flex: 1 1 auto; min-width: 0; }
.history-drawer-heading h2 { font-size: 15px; font-weight: 600; margin: 0; color: #253156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-drawer-heading p { font-size: 11px; color: #8a94a9; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 20px 28px; background: #f7f8fb; }

/* 历史时间线 */
.history-drawer-body .history-day { text-align: center; font-size: 10px; color: #a0a8b9; margin: 14px 0 10px; }
.history-drawer-body .history-msg-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; min-width: 0; }
.history-drawer-body .history-msg-row.agent { flex-direction: row-reverse; }
.history-drawer-body .history-bubble-wrap { max-width: 82%; min-width: 0; }
.history-drawer-body .history-msg-meta { font-size: 10px; line-height: 14px; margin-bottom: 4px; color: #98a2b6; }
.history-drawer-body .history-msg-row.agent .history-msg-meta { text-align: right; }
.history-drawer-body .history-bubble { padding: 10px 14px; background: #fff; border: 1px solid #e7eaf0; border-radius: 0 6px 6px 6px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; min-width: 0; color: #253156; }
.history-drawer-body .history-msg-row.agent .history-bubble { background: #e0ecff; border-color: #d6e4fb; border-radius: 6px 0 6px 6px; color: #29497b; }
.history-drawer-body .history-system { text-align: center; font-size: 10px; color: #98a2b6; margin: 8px 0 16px; line-height: 1.5; }
.history-drawer-body .history-session-closed { text-align: center; font-size: 10px; color: #b0b9ce; margin: 20px 0 8px; line-height: 1.5; border-top: 1px solid #eef0f5; padding-top: 16px; }
.history-drawer-body .history-empty, .history-drawer-body .history-error { display: grid; place-items: center; min-height: 160px; color: #98a2b6; font-size: 13px; text-align: center; padding: 24px; }
.history-drawer-body .history-error button { margin-top: 12px; height: 34px; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--blue); font-size: 12px; cursor: pointer; }
.history-drawer-body .history-error button:hover { background: #f0f5ff; }
.history-drawer-body .history-translate-btn { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--blue); padding: 2px 7px; border-radius: 3px; cursor: pointer; border: 1px solid #dce6fb; background: #f5f8ff; }
.history-drawer-body .history-translate-btn:hover { background: #e9f0ff; }
.history-drawer-body .history-translation-loading { font-size: 10px; color: #8fa3c8; margin-top: 5px; }

@media (max-width: 960px) {
  .history-scrim { display: none !important; }
  .history-drawer { width: 100% !important; max-width: 100% !important; box-shadow: none; }
  .history-back { display: inline-flex; width: 44px; height: 44px; }
  .history-close { display: none; }
  .history-drawer-header { min-height: 56px; }
}
@media (min-width: 961px) {
  .history-back { display: none; }
}

/* 设置弹窗-翻译接口 */
.settings-translate{margin:12px 0;border:1px solid var(--line);border-radius:6px;padding:8px 12px}.settings-translate summary{cursor:pointer;font-size:12px;color:#64718b}.settings-translate[open] summary{margin-bottom:10px}.settings-translate label{margin:12px 0}.settings-translate input[type=password]{font-family:inherit}
