.chat-widget{--chat-visible-height:100dvh;--chat-viewport-lift:0px;--chat-app-right:max(0px,calc((100vw - 500px)/2));--chat-app-width:min(100vw,500px);position:relative;z-index:40;font:14px/1.5 "Microsoft YaHei",system-ui,sans-serif;color:#f2f3fa}
.chat-widget [hidden]{display:none!important}
.chat-widget button,.chat-widget textarea{font:inherit}
.chat-widget button{cursor:pointer}
.chat-widget button:focus-visible,.chat-widget textarea:focus-visible,.chat-messages:focus-visible{outline:2px solid #ffb7ce;outline-offset:3px}
.chat-launcher{position:fixed;right:var(--chat-app-right);bottom:calc(96px + env(safe-area-inset-bottom) + var(--chat-viewport-lift));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:min(72px,var(--chat-app-width));min-height:66px;max-height:calc(var(--chat-visible-height) - 112px - env(safe-area-inset-bottom));padding:10px 8px;border:1px solid #ffb0cb55;border-right:0;border-radius:17px 0 0 17px;background:linear-gradient(140deg,#c2446e,#803957);color:#fff1f6;box-shadow:0 6px 28px #0005;font-size:12px;font-weight:600}
.chat-launcher-label{max-width:100%;min-height:0;overflow-y:auto;overflow-wrap:anywhere;white-space:pre-wrap;line-height:1.35}
.chat-launcher svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.chat-badge{position:absolute;top:-7px;left:-8px;min-width:20px;padding:1px 5px;border:2px solid #121522;border-radius:12px;background:#ff638e;color:#fff;font-size:11px;line-height:16px;text-align:center}
.chat-panel{position:fixed;right:calc(var(--chat-app-right) + 12px);bottom:calc(88px + env(safe-area-inset-bottom) + var(--chat-viewport-lift));width:340px;max-width:max(0px,calc(var(--chat-app-width) - 24px));height:460px;max-height:calc(var(--chat-visible-height) - 104px - env(safe-area-inset-bottom));display:flex;flex-direction:column;overflow:hidden;border:1px solid #474054;border-radius:17px;background:#171b2b;box-shadow:0 18px 60px #0008}
.chat-header{display:flex;flex-shrink:1;min-height:47px;max-height:36%;overflow-y:auto;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 15px;border-bottom:1px solid #303246;background:#202133}
.chat-header>div{flex:1;min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}
.chat-header h2{margin:0;font-size:16px;font-weight:600;color:#ffe1eb}
.chat-header p{margin:3px 0 0;color:#aeb1c6;font-size:11px}
.chat-close{position:sticky;top:0;flex-shrink:0;display:grid;place-items:center;width:31px;height:31px;padding:0;border:1px solid #454357;border-radius:50%;background:#2d2a3f;color:#e7cbd7;font-size:23px!important;line-height:1}
.chat-messages{flex:1;min-height:0;padding:15px 13px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#56506a transparent}
.chat-empty{margin:24px 10px;text-align:center;color:#a6abc2;font-size:12px;line-height:1.8}
.chat-message{display:flex;flex-direction:column;align-items:flex-start;margin:0 0 15px}
.chat-message:last-child{margin-bottom:0}
.chat-message-visitor{align-items:flex-end}
.chat-message-meta{display:flex;max-width:100%;gap:8px;align-items:baseline;margin:0 2px 5px;font-size:10px;color:#9da2bc}
.chat-message-meta>span{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}.chat-message-meta time{flex-shrink:0}
.chat-message-visitor .chat-message-meta{flex-direction:row-reverse}
.chat-bubble{max-width:92%;margin:0;padding:9px 12px;border:1px solid #39384e;border-radius:11px 11px 11px 3px;background:#24273b;color:#e7e8f3;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.chat-message-visitor .chat-bubble{border-color:#a1537444;border-radius:11px 11px 3px 11px;background:#63364d;color:#ffe8f1}
.chat-jump{align-self:center;flex-shrink:0;max-width:calc(100% - 26px);max-height:52px;overflow-y:auto;overflow-wrap:anywhere;white-space:pre-wrap;margin:0 0 8px;padding:4px 11px;border:1px solid #5c465b;border-radius:16px;background:#36293c;color:#ffc5d8;font-size:11px!important}
.chat-error{display:flex;flex-shrink:1;min-height:0;max-height:78px;align-items:center;gap:9px;padding:8px 12px;border-top:1px solid #64475b;background:#362738;color:#f4c4d6;font-size:11px}
.chat-error>span{flex:1;min-width:0;max-height:42px;overflow-y:auto;overflow-wrap:anywhere}
.chat-retry{flex-shrink:0;max-width:82px;max-height:56px;overflow-y:auto;overflow-wrap:anywhere;white-space:pre-wrap;padding:4px 8px;border:1px solid #75536a;border-radius:5px;background:#52354b;color:#ffe2ed;font-size:11px!important}
.chat-form{flex-shrink:0;margin:0;padding:10px 12px 11px;border-top:1px solid #303246;background:#1c1e30}
.chat-input{display:block;resize:none;width:100%;min-height:49px;max-height:90px;margin:0;padding:8px 9px;border:1px solid #3c3d54;border-radius:8px;background:#121624;color:#f1eaf0;font-size:13px!important;line-height:1.5;outline-offset:2px!important}
.chat-input::placeholder{color:#878da7}
.chat-input:read-only{opacity:.75}
.chat-form-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}
.chat-counter{color:#9299b3;font-size:10px;white-space:nowrap}
.chat-send{min-width:68px;max-width:65%;max-height:54px;overflow-y:auto;overflow-wrap:anywhere;white-space:pre-wrap;padding:6px 14px;border:0;border-radius:7px;background:linear-gradient(110deg,#e17479,#c24477);color:white;font-size:12px!important;font-weight:600!important}
.chat-send:disabled{cursor:default;opacity:.45}
.chat-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.chat-compact .chat-header{padding:8px 12px}.chat-compact .chat-header p{display:none}.chat-compact .chat-form{padding:7px 10px}.chat-compact .chat-input{min-height:37px;height:37px}.chat-compact .chat-form-bottom{margin-top:5px}
@media(max-width:360px){.chat-launcher{width:min(72px,var(--chat-app-width));min-height:60px}}
@media(max-height:480px){.chat-header{padding:8px 12px}.chat-header p{display:none}.chat-form{padding:7px 10px}.chat-input{min-height:37px;height:37px}.chat-form-bottom{margin-top:5px}}
