.chat-start{max-width:720px;margin:40px auto}.chat-layout{max-width:900px;margin:auto}.chat-thread{display:flex;flex-direction:column;gap:12px;max-height:520px;overflow-y:auto;padding:8px 4px 20px}.chat-bubble{max-width:78%;padding:14px 16px;border-radius:18px;background:#eef2f5;align-self:flex-start}.chat-bubble.admin{align-self:flex-start;background:#dff5e9;border-bottom-left-radius:5px}.chat-bubble.visitor{align-self:flex-end;border-bottom-right-radius:5px}.chat-bubble strong{display:block;margin-bottom:6px}.chat-bubble small{display:block;margin-top:8px;color:var(--muted)}.admin-shell .chat-thread{background:rgba(3,9,24,.65);border:1px solid var(--line);border-radius:18px;padding:18px}.admin-shell .chat-bubble{background:rgba(25,38,70,.9);border:1px solid rgba(95,117,255,.25);color:var(--ink)}.admin-shell .chat-bubble.admin{background:linear-gradient(135deg,rgba(75,70,229,.4),rgba(0,209,255,.18));border-color:rgba(0,209,255,.35)}.admin-shell .chat-bubble small{color:var(--muted)}
@media(max-width:650px){.chat-bubble{max-width:92%}}
.chat-media{display:block;max-width:100%;max-height:420px;margin-top:10px;border-radius:12px;background:#02060d;object-fit:contain}.chat-bubble video.chat-media{width:min(560px,100%)}
#xiaozhi-chat-launcher{position:fixed;right:24px;bottom:24px;z-index:80;border:0;border-radius:999px;padding:15px 20px;background:linear-gradient(135deg,#176c4a,#159b70);color:#fff;font-weight:800;font-size:15px;box-shadow:0 14px 38px rgba(16,82,59,.32);cursor:pointer;transition:.2s}#xiaozhi-chat-launcher:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(16,82,59,.4)}#xiaozhi-chat-launcher span{display:inline-grid;place-items:center;width:25px;height:25px;margin-right:6px;border-radius:50%;background:rgba(255,255,255,.2)}#xiaozhi-chat-launcher.hidden{opacity:0;pointer-events:none;transform:translateY(12px)}#xiaozhi-chat-window{position:fixed;right:24px;bottom:24px;z-index:81;width:min(410px,calc(100vw - 32px));height:min(680px,calc(100vh - 48px));display:flex;flex-direction:column;background:#f7faf8;border:1px solid #d8e6df;border-radius:22px;box-shadow:0 28px 80px rgba(18,42,32,.3);overflow:hidden;opacity:0;pointer-events:none;transform:translateY(18px) scale(.97);transform-origin:bottom right;transition:.22s}#xiaozhi-chat-window.open{opacity:1;pointer-events:auto;transform:none}.chat-widget-head{height:64px;flex:0 0 64px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;background:linear-gradient(135deg,#145d42,#1b8d68);color:#fff}.chat-widget-head strong{display:flex;align-items:center;gap:9px}.chat-widget-head i{display:block;width:9px;height:9px;border-radius:50%;background:#74ffc0;box-shadow:0 0 12px #74ffc0}.chat-widget-head button{padding:4px 9px;background:transparent;font-size:27px;font-weight:400}#xiaozhi-chat-frame{width:100%;height:100%;border:0;background:#f7faf8}.chat-embed{background:#f7faf8}.chat-embed main{padding:16px;min-height:100vh}.chat-embed .chat-start,.chat-embed .chat-layout{margin:0}.chat-embed .panel{padding:16px;border-radius:14px}.chat-embed h1{font-size:23px;margin:10px 0}.chat-embed .chat-thread{max-height:335px}.chat-login-required{text-align:center;padding:58px 20px}.chat-login-required h2{margin:12px 0 8px}.chat-login-required p{color:#66736d;line-height:1.6}.chat-login-icon{width:58px;height:58px;margin:auto;display:grid;place-items:center;border-radius:20px;background:linear-gradient(135deg,#dff4e8,#fff4df);font-size:27px;color:#176c4a}.chat-error{margin:0 0 12px}
#xiaozhi-chat-window[hidden]{display:none!important}
@media(min-width:901px){body.store-shell:not(.chat-embed) main{max-width:calc(100% - 430px);margin-left:max(5vw,24px);margin-right:430px}body.store-shell:not(.chat-embed) #xiaozhi-chat-launcher{display:none}body.store-shell:not(.chat-embed) #xiaozhi-chat-window{display:flex;right:24px;top:96px;bottom:24px;width:min(390px,30vw);height:auto;border-radius:20px;opacity:1;pointer-events:auto;transform:none}body.store-shell:not(.chat-embed) #xiaozhi-chat-frame{min-height:0;height:100%}body.store-shell:not(.chat-embed) #xiaozhi-chat-close{display:none}}
@media(min-width:901px){.chat-embed main{max-width:none;margin:0;padding:20px 18px;min-height:100vh}.chat-embed .chat-thread{max-height:none;overflow:visible}.chat-embed .chat-layout,.chat-embed .chat-start{max-width:none}.chat-embed .panel{padding:14px}.chat-embed .chat-bubble{max-width:100%}}
@media(min-width:651px) and (max-width:900px){body.store-shell:not(.chat-embed) main{max-width:calc(100% - 350px);margin-left:16px;margin-right:334px;padding:28px 8px}body.store-shell:not(.chat-embed) #xiaozhi-chat-launcher{display:none}body.store-shell:not(.chat-embed) #xiaozhi-chat-window{display:flex;right:12px;top:90px;bottom:16px;width:318px;height:auto;border-radius:18px;opacity:1;pointer-events:auto;transform:none}body.store-shell:not(.chat-embed) #xiaozhi-chat-frame{min-height:0;height:100%}body.store-shell:not(.chat-embed) #xiaozhi-chat-close{display:none}}
@media(max-width:650px){#xiaozhi-chat-launcher{right:16px;bottom:16px}#xiaozhi-chat-window{right:8px;bottom:8px;width:calc(100vw - 16px);height:calc(100vh - 16px);border-radius:18px}.chat-widget-head{height:58px;flex-basis:58px}}
body.store-shell #xiaozhi-chat-launcher{background:linear-gradient(135deg,#2c75ee,#0b4fc9);box-shadow:0 14px 38px rgba(26,91,210,.28)}
body.store-shell #xiaozhi-chat-window{background:#f7faff;border-color:#d5e2f3;box-shadow:0 28px 80px rgba(29,78,145,.2)}
body.store-shell .chat-widget-head{background:linear-gradient(135deg,#195dcc,#103b8f)}
body.store-shell #xiaozhi-chat-frame{background:#f7faff}
body.store-shell .chat-embed{background:#f7faff}
body.store-shell .chat-bubble{background:#eef4fc;border:1px solid #d5e2f3;color:#173764}
body.store-shell .chat-bubble.admin{background:#e2efff;border-color:#bdd6f7}
body.store-shell .chat-bubble small{color:#6b7f9e}
body.store-shell .chat-login-icon{background:linear-gradient(135deg,#e7f1ff,#f8fbff);color:#1458d8}
body.store-shell .chat-contact-qr a{border-color:#d5e2f3}
.admin-shell .account-email{color:#7ee8ff;font-weight:700}.customer-flag{display:inline-block;margin:0 0 7px;padding:4px 8px;border-radius:99px;background:#fff0c2;color:#8a5200;font-size:12px;font-weight:800}.admin-shell .customer-flag{background:rgba(255,190,70,.14);color:#ffd47d;border:1px solid rgba(255,190,70,.28)}.admin-shell td textarea{min-width:210px}
.chat-contact-qr{display:flex;justify-content:flex-end;gap:8px;margin:-2px 0 8px}.chat-contact-qr a{display:block;width:88px;height:88px;padding:4px;background:#fff;border:1px solid #d8e6df;border-radius:8px}.chat-contact-qr img{display:block;width:100%;height:100%;object-fit:contain}.chat-embed .chat-contact-qr{margin:0 0 8px}@media(max-width:650px){.chat-contact-qr a{width:74px;height:74px}}
