/* 独立客服入口使用ID定位，避免提示框的relative样式覆盖fixed。 */
#support-launch{position:fixed;inset:auto 24px 24px auto;z-index:1100;display:inline-flex;align-items:center;gap:11px;min-width:150px;height:62px;box-sizing:border-box;margin:0;padding:9px 18px 9px 10px;border:1px solid #ffffff66;border-radius:32px;background:linear-gradient(125deg,#245be8,#4057e9);color:#fff;box-shadow:0 8px 28px #173a7c38,0 0 0 4px #ffffffa6;font:600 15px/1.4 "Microsoft YaHei",sans-serif;cursor:pointer;touch-action:manipulation;transition:box-shadow .18s,background .18s}
#support-launch:hover{background:#214fda;box-shadow:0 10px 30px #173a7c48,0 0 0 4px #ffffffba}
#support-launch:focus-visible,#support-panel button:focus-visible,#support-panel textarea:focus-visible{outline:3px solid #7ba8ff;outline-offset:4px}
.support-launch-mark{display:grid;place-items:center;width:40px;height:40px;flex:0 0 40px;border-radius:50%;background:#ffffff20}
.support-launch-mark svg{width:25px;height:25px;animation:support-greet 2.2s ease-in-out 3;transform-origin:50% 70%}
.support-launch-label{display:flex;flex-direction:column;align-items:flex-start;gap:1px;white-space:nowrap}
.support-launch-label strong{font:inherit;letter-spacing:.5px}.support-launch-label>span{font:400 11px/1.4 sans-serif;color:#e3ebff}
#support-launch[hidden]{display:none}#support-launch[aria-expanded="true"] .support-launch-mark svg{animation:none}
@keyframes support-greet{0%,55%,100%{transform:rotate(0)}65%{transform:rotate(-9deg)}78%{transform:rotate(8deg)}90%{transform:rotate(-4deg)}}
#support-panel{position:fixed;inset:auto 24px calc(24px + var(--support-keyboard-offset,0px)) auto;z-index:1101;width:min(390px,calc(100% - 48px));height:min(620px,calc(100vh - 48px));height:min(620px,calc(var(--support-visible-height,100dvh) - 48px));min-height:0;box-sizing:border-box;border:1px solid #dce4f3;border-radius:18px;background:#fff;box-shadow:0 14px 48px #18304a30;color:#17304b;font:14px/1.6 "Microsoft YaHei",sans-serif;display:flex;flex-direction:column;overflow:visible}
#support-panel[hidden]{display:none}.support-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:12px 16px;border-bottom:1px solid #e8edf6;border-radius:18px 18px 0 0;background:#fff}.support-head strong{font-size:17px}.support-icon{display:grid;place-items:center;width:40px;height:40px;padding:0;background:transparent;border:0;border-radius:8px;color:#536883;font-size:24px;cursor:pointer}.support-icon:hover{background:#f1f5fc}.support-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;background:#f6f8fc}.support-message{margin:0 32px 12px 0;padding:10px 12px;border-radius:10px;background:#fff;overflow-wrap:anywhere;white-space:pre-wrap}.support-message.self{margin:0 0 12px 32px;background:#e6eeff}.support-message small{display:block;color:#718298;font-size:11px;margin-bottom:4px}.support-message a{color:#245be8}.support-message img{display:block;width:160px;max-width:100%;height:auto;margin:10px 0}.support-note{flex-shrink:0;padding:8px 16px;color:#536883;font-size:12px;min-height:20px;line-height:1.6}.support-compose{flex-shrink:0;border-top:1px solid #e8edf6;padding:12px;display:flex;align-items:flex-end;gap:8px}.support-compose textarea{flex:1;min-width:0;resize:none;height:65px;box-sizing:border-box;border:1px solid #d5dfef;border-radius:8px;padding:8px;font:14px/1.5 sans-serif}.support-action{border:0;border-radius:8px;min-height:44px;padding:10px 12px;background:#245be8;color:#fff;cursor:pointer;white-space:nowrap}.support-action:disabled{opacity:.5;cursor:default}.support-tip{position:relative;display:inline-flex}.support-tip::before{content:attr(data-tip);display:none;position:absolute;bottom:calc(100% + 8px);right:0;background:#17304b;color:#fff;border-radius:5px;padding:5px 8px;white-space:nowrap;font:12px/1.5 sans-serif;pointer-events:none;z-index:1200}.support-tip:hover::before,.support-tip:focus-within::before{display:block}
@media(max-width:600px){#support-launch{right:12px;bottom:max(16px,env(safe-area-inset-bottom));min-width:132px;height:56px;padding:7px 14px 7px 8px;gap:9px}.support-launch-mark{width:36px;height:36px;flex-basis:36px}#support-launch[aria-expanded="true"]{display:none}#support-panel{right:12px;bottom:calc(12px + env(safe-area-inset-bottom) + var(--support-keyboard-offset,0px));width:calc(100% - 24px);height:min(680px,calc(100vh - 24px));height:min(680px,calc(var(--support-visible-height,100dvh) - 24px - env(safe-area-inset-bottom)));border-radius:16px}.support-head{border-radius:16px 16px 0 0}.support-compose textarea{font-size:16px}.support-message{margin-right:20px}.support-message.self{margin-left:20px}.support-compose{padding:10px;gap:6px}.support-note{padding:6px 12px}}
@media(prefers-reduced-motion:reduce){.support-launch-mark svg{animation:none}#support-launch{transition:none}}
.support-welcome{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;padding:24px 6px;box-sizing:border-box;text-align:center}.support-welcome-mark{display:grid;place-items:center;width:58px;height:58px;margin-bottom:18px;border-radius:18px;background:#e7edff;color:#315de6;font-size:30px}.support-welcome strong{font-size:17px;color:#17304b}.support-welcome p{max-width:285px;margin:10px 0 20px;color:#63758d;line-height:1.8}.support-welcome>small{margin-top:20px;color:#7b8ba0;font-size:12px}.support-suggestions{display:flex;flex-wrap:wrap;justify-content:center;gap:9px}.support-suggestion{padding:8px 12px;min-height:40px;border:1px solid #dce4f3;border-radius:20px;background:#fff;color:#2956d5;font:13px/1.5 sans-serif;cursor:pointer}.support-suggestion:hover{border-color:#91aaf2;background:#eef3ff}
.support-head-actions{display:flex;align-items:center;gap:4px}.support-text-button{min-height:36px;padding:5px 7px;border:0;border-radius:6px;background:transparent;color:#315de6;font:13px/1.5 sans-serif;cursor:pointer}.support-text-button:hover{background:#edf2ff}.support-text-button:disabled{color:#8797ab;cursor:default}.support-message a{display:inline;overflow-wrap:anywhere;text-decoration:underline;text-underline-offset:3px}.support-message a.support-tip::before{white-space:normal;min-width:105px;max-width:150px}
.support-unread{position:absolute;top:-4px;right:0;min-width:24px;min-height:24px;padding:2px 5px;border:2px solid #fff;border-radius:20px;background:#e24453;color:#fff;text-align:center;font:600 12px/20px sans-serif;box-sizing:border-box}.support-unread[hidden],.support-rating[hidden],.support-new-replies[hidden]{display:none}.support-remind{animation:support-nudge .65s ease-in-out}@keyframes support-nudge{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px) rotate(-2deg)}50%{transform:translateX(4px) rotate(2deg)}75%{transform:translateX(-2px)}}
.support-new-replies{flex-shrink:0;border:0;border-bottom:1px solid #dce4f3;padding:7px;background:#edf3ff;color:#245be8;font:13px/1.5 sans-serif;cursor:pointer}
/* 评价使用独立视图，避免同时显示留言和问题两个输入框。 */
#support-panel.support-evaluating .support-log,#support-panel.support-evaluating .support-note,#support-panel.support-evaluating .support-compose,#support-panel.support-evaluating .support-new-replies,#support-panel.support-evaluating #support-rate-open,#support-panel.support-evaluating #support-end{display:none}
.support-rating{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;gap:20px;padding:28px 24px;border-radius:0 0 18px 18px;background:linear-gradient(180deg,#f6f8ff,#fff 55%);box-sizing:border-box}
.support-rating-intro{text-align:center}.support-rating-mark{display:grid;place-items:center;width:48px;height:48px;margin:0 auto 12px;border-radius:16px;background:#eaf0ff;color:#315de6;font:30px/1 sans-serif}.support-rating-intro strong{display:block;font-size:17px}.support-rating-intro p{margin:5px 0 0;color:#718298;font-size:13px}
.support-stars{display:flex;justify-content:center;gap:8px}.support-star{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;padding:0;border:0;border-radius:50%;background:transparent;color:#8797ad;cursor:pointer;touch-action:manipulation;transition:background .15s,color .15s}.support-star svg{display:block;width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linejoin:round}.support-star.selected{background:transparent;color:#d58a0a}.support-star.selected svg{fill:#f4b538;stroke:#c98307}.support-star.support-tip::before{right:50%;transform:translateX(50%)}
@media(hover:hover){.support-star:not(:disabled):hover{background:#fff1d5;color:#c98307}.support-star:not(:disabled):hover svg{fill:#ffe1a2}}
@media(max-width:360px){.support-stars{gap:4px}}
@media(prefers-reduced-motion:reduce){.support-star{transition:none}}
.support-rating-value{min-height:22px;margin-top:8px;text-align:center;color:#718298;font-size:13px}.support-rating-value.selected{color:#ad7112;font-weight:600}
.support-rating-field label{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:13px;font-weight:600}.support-rating-field label span{font-size:12px;font-weight:400;color:#8795a9}.support-rating textarea{display:block;width:100%;height:96px;min-height:48px;box-sizing:border-box;resize:none;padding:10px 12px;border:1px solid #d5dfef;border-radius:10px;background:#fff;color:#17304b;font:14px/1.6 sans-serif;transition:border-color .15s,box-shadow .15s}.support-rating textarea::placeholder{color:#8795a9}.support-rating-field small{display:block;margin-top:5px;text-align:right;color:#8795a9;font:12px/1.5 sans-serif}
#support-panel textarea:focus-visible{outline:0;border-color:#6587f2;box-shadow:0 0 0 3px #e8eeff}
.support-rating-actions{display:flex;align-items:center;gap:10px}.support-rating-actions>button{flex:1;min-width:0;min-height:44px;justify-content:center;font:14px/1.5 sans-serif}.support-rating-back{border:1px solid #dce4f3;border-radius:8px;background:#fff;color:#536883;cursor:pointer}.support-rating-back:hover{background:#f3f6fc}.support-rating-hint{text-align:center;color:#8795a9;font-size:12px;line-height:1.6}.support-rating-error{color:#ba3341;font-size:13px}.support-rating-error[hidden]{display:none}
@media(max-width:600px){.support-head{padding:8px 10px}.support-head strong{font-size:16px}.support-head-actions{gap:0}.support-text-button{font-size:12px;padding:5px}.support-rating{padding:24px 18px;border-radius:0 0 16px 16px}.support-rating textarea{font-size:16px}.support-compose textarea{height:58px}}
@media(max-height:600px){.support-head{padding-top:5px;padding-bottom:5px}.support-note{padding-top:3px;padding-bottom:3px}.support-compose{padding-top:6px;padding-bottom:6px}.support-compose textarea{height:44px}}
/* visualViewport 会随软键盘缩小；紧凑状态保留评分、留言和提交。 */
#support-panel.support-short .support-rating{justify-content:flex-start;gap:8px;padding:10px 16px}
#support-panel.support-short .support-rating-mark,#support-panel.support-short .support-rating-intro p{display:none}
#support-panel.support-short .support-rating-intro strong{font-size:15px}
#support-panel.support-short .support-rating-value{margin-top:2px}
#support-panel.support-short .support-rating-field label{margin-bottom:4px}
#support-panel.support-short .support-rating textarea{height:52px;padding:6px 10px}
#support-panel.support-short .support-rating-field small{margin-top:1px}
#support-panel.support-short .support-rating-hint{font-size:11px}
#support-panel.support-tiny .support-rating{gap:8px;padding:8px 16px}
#support-panel.support-tiny .support-rating-intro,#support-panel.support-tiny .support-rating-hint,#support-panel.support-tiny .support-rating-field label,#support-panel.support-tiny .support-rating-field small{display:none}
.support-star:disabled{cursor:default;opacity:1}.support-rating-back:disabled{cursor:default;opacity:.6}
@media(hover:none){#support-panel .support-tip:hover::before,#support-panel .support-tip:focus-within::before{display:none}}
@media(prefers-reduced-motion:reduce){.support-remind{animation:none}}
.support-link-tip{position:fixed;z-index:1300;pointer-events:none;background:#17304b;color:#fff;border-radius:5px;padding:5px 8px;font:12px/1.5 sans-serif}.support-link-tip[hidden]{display:none}
/* 受限Markdown：原文安全建DOM，表格仅在自己的区域滑动。 */
.support-rich{white-space:normal;min-width:0}.support-rich p{margin:0 0 8px;white-space:pre-wrap}.support-rich p:last-child{margin-bottom:0}.support-rich h4{margin:12px 0 6px;font-size:14px;color:#17304b}.support-rich h4:first-child{margin-top:0}.support-rich ul,.support-rich ol{margin:6px 0 10px;padding-left:23px}.support-rich li{padding-left:2px;margin:6px 0;white-space:pre-wrap}.support-rich li::marker{color:#315de6;font-weight:600}.support-rich strong{font-weight:600;color:#17304b}.support-rich pre{margin:8px 0;padding:10px;border-radius:8px;background:#f2f5fa;font:12px/1.7 monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.support-table-wrap{max-width:100%;margin:10px 0;overflow-x:auto;border:1px solid #dce4f3;border-radius:8px;overscroll-behavior-x:contain}.support-table-wrap table{width:100%;border-collapse:collapse;table-layout:auto;min-width:240px;font-size:12px;line-height:1.6}.support-table-wrap th,.support-table-wrap td{padding:8px;text-align:left;vertical-align:top;min-width:66px;max-width:180px;border-bottom:1px solid #e8edf6;overflow-wrap:anywhere}.support-table-wrap th{background:#eef3ff;font-weight:600;color:#294f9c}.support-table-wrap tbody tr:last-child td{border-bottom:0}.support-table-wrap tbody tr:nth-child(even){background:#f8faff}.support-table-wrap:focus-visible{outline:2px solid #7ba8ff;outline-offset:2px}
/* 状态栏承担等待提示，聊天正文只保留双方消息。 */
.support-note{overflow-wrap:anywhere}
.support-note[data-state="waiting"]{color:#294f9c;background:#f0f5ff}
@media(max-width:600px){.support-table-wrap table{min-width:220px}.support-table-wrap th,.support-table-wrap td{padding:7px;min-width:60px}}
/* 扩大只调整布局，保留输入、消息和原连接。手机扩大为可见视口。 */
#support-panel.support-expanded{width:min(860px,calc(100% - 48px));height:calc(var(--support-visible-height,100dvh) - 48px);max-height:900px}
#support-size svg{width:20px;height:20px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.support-restore-icon{display:none}.support-expanded .support-expand-icon{display:none}.support-expanded .support-restore-icon{display:block}
#support-panel .support-head-actions>[hidden],#support-panel .support-rating-actions>[hidden]{display:none}
#support-panel .support-head strong{white-space:nowrap;flex-shrink:0}
@media(max-width:600px){#support-panel.support-expanded{right:0;bottom:var(--support-keyboard-offset,0px);width:100%;height:var(--support-visible-height,100dvh);max-height:none;border-radius:0;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}#support-panel.support-expanded .support-head{border-radius:0}.support-head-actions .support-icon{width:36px;height:40px}.support-head-actions .support-tip::before{white-space:normal;max-width:160px;min-width:100px}}
@media(max-width:360px){.support-head{padding-left:8px;padding-right:6px}.support-head strong{font-size:15px}.support-text-button{padding:5px 4px}.support-head-actions .support-icon{width:32px}.support-log{padding:12px}}
/* 阅读优先：正文留白、紧凑时间标记、明确的输入及触控区域。 */
#support-panel{width:min(420px,calc(100% - 48px));font-size:15px;line-height:1.75}
.support-log{padding:18px 16px}.support-message{padding:12px 14px;margin-bottom:16px;line-height:1.75}
.support-message small{margin-bottom:6px;font-size:11px;line-height:1.5;color:#78889e}
.support-rich h4{font-size:15px;line-height:1.65}.support-rich p{margin-bottom:10px}.support-rich li{margin:8px 0}
.support-table-wrap table{font-size:13px}.support-note{min-height:18px;padding:6px 16px;line-height:1.5;border-top:1px solid #edf1f8}
.support-compose{padding:12px;gap:10px}.support-compose textarea{height:76px;padding:10px 12px;font-size:15px;line-height:1.6}
.support-compose .support-action{min-width:56px;min-height:46px;font-size:14px}.support-text-button{min-height:40px}
.support-expanded .support-message{max-width:700px}.support-expanded .support-message.self{margin-left:auto}
@media(max-width:600px){#support-panel{width:calc(100% - 24px)}.support-log{padding:14px 12px}.support-message{padding:11px 12px;margin-bottom:14px}.support-compose{padding:10px;gap:8px}.support-compose textarea{font-size:16px;height:64px}.support-note{padding:6px 12px}.support-rating textarea:disabled{color:#536883;-webkit-text-fill-color:#536883;opacity:1;background:#f6f8fc}}
#support-panel.support-short .support-head{padding-top:5px;padding-bottom:5px}#support-panel.support-short .support-note{padding-top:3px;padding-bottom:3px}#support-panel.support-short .support-compose{padding-top:6px;padding-bottom:6px}#support-panel.support-short .support-compose textarea{height:48px}
.support-rating-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:12px;width:100%}
.support-rating-actions>button{display:flex;align-items:center;justify-content:center;width:100%;height:46px;min-height:46px;box-sizing:border-box;margin:0;padding:0 12px;font:14px/1.4 "Microsoft YaHei",sans-serif;white-space:nowrap}
.support-rating.support-rated .support-rating-actions{grid-template-columns:minmax(0,1fr)}

/* 标题栏统一图标尺寸及中心线，不受页面button默认行高影响。 */
#support-panel .support-head{gap:12px;box-sizing:border-box}
#support-panel .support-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin:0;line-height:1;flex-shrink:0}
#support-panel .support-head-actions>.support-text-button{align-items:center;justify-content:center;height:40px;min-height:40px;box-sizing:border-box;margin:0;padding:0 7px;line-height:20px;flex:0 0 auto}
#support-panel .support-head-actions>span.support-tip{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 40px;line-height:1}
#support-panel .support-icon{display:flex;align-items:center;justify-content:center;width:40px;height:40px;box-sizing:border-box;margin:0;padding:0;line-height:1}
#support-panel .support-icon svg{display:block;width:20px;height:20px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#support-panel .support-rating-back{border:1px solid #8ca9ef;background:#edf3ff;color:#2454c4;font-weight:600}
#support-panel .support-rating-back:hover{border-color:#315de6;background:#e0eaff}
@media(max-width:600px){#support-panel .support-head-actions>.support-text-button{padding:0 5px}}
@media(max-width:360px){#support-panel .support-head{gap:4px}#support-panel .support-head-actions{gap:0}#support-panel .support-head-actions>.support-text-button{padding:0 4px}#support-panel .support-head-actions>span.support-tip{width:32px;flex-basis:32px}#support-panel .support-icon{width:32px}}

/* Keep action colours above the host page's generic button hover rules. */
#support-panel .support-action{background:#245be8;color:#fff;border:1px solid transparent;opacity:1;box-shadow:none}
#support-panel .support-action:not(:disabled):hover,#support-panel .support-action:not(:disabled):focus-visible{background:#1949c6;color:#fff;border-color:#1949c6}
#support-panel .support-action:not(:disabled):active{background:#123a9e;color:#fff}
#support-panel .support-action:disabled,#support-panel .support-action:disabled:hover{background:#e5ebf5;color:#536883;border-color:#d5dfef;opacity:1;cursor:not-allowed}
#support-panel .support-rating-back:hover,#support-panel .support-rating-back:focus-visible{background:#e0eaff;color:#1847af;border-color:#315de6}
/* Streaming mode: the composer remains editable; only sending is serialised. */
#support-panel .support-thinking{padding:12px 18px;color:#587098;font-size:14px;line-height:1.6}
#support-panel .support-thinking::before{content:"";display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;background:#4274ff;animation:support-pulse 1.2s infinite}
#support-panel .support-verification{display:flex;justify-content:center;flex:0 0 auto;max-width:100%;background:white}
#support-panel .support-history-more{display:block;margin:0 auto 12px;padding:6px 12px;border:1px solid #cbd8f4;border-radius:8px;background:white;color:#3563cc;font-size:12px}
#support-panel .support-message p{overflow-wrap:anywhere}
#support-panel .support-human-card{display:flex;align-items:center;flex-direction:column;gap:10px;margin-top:14px;padding:14px 10px;border:1px solid #dce5f6;border-radius:12px;background:#f8faff;text-align:center}
#support-panel .support-human-card>strong{font-size:14px;color:#17375c}
#support-panel .support-human-qr{display:block;width:216px;max-width:100%;padding:6px;box-sizing:border-box;border-radius:8px;background:#fff;line-height:0}
#support-panel .support-human-qr img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain}
#support-panel .support-human-card>small{font-size:12px;line-height:1.6;color:#627895}
#support-panel.support-evaluating .support-verification{display:none}
#support-panel .support-tip::before,#support-launch.support-tip::before{display:none!important}
#support-panel .support-note{min-height:34px;padding:8px 14px;line-height:1.5;box-sizing:border-box}
#support-panel .support-compose{align-items:flex-end}
#support-panel .support-compose textarea{font-size:15px;line-height:1.6}
#support-panel.support-expanded{max-height:calc(var(--support-visible-height,100dvh) - 24px)}
@keyframes support-pulse{50%{opacity:.35}}
@media(prefers-reduced-motion:reduce){#support-panel .support-thinking::before{animation:none}}
@media(max-width:600px){#support-panel .support-note{font-size:12px;padding:7px 12px}#support-panel .support-head{padding-left:12px;padding-right:8px}#support-panel .support-compose textarea{font-size:16px}}
