*{box-sizing:border-box}
:root{--teal:#0d9488;--teal-deep:#0f766e;--ink:#10212f;--muted:#6e7f90;--line:#dfe8ea;--paper:#fff;--soft:#f2f7f7;--danger:#b42318}
html,body{min-height:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink)}
button,input,textarea{font:inherit}
button{cursor:pointer}
.hide{display:none!important}
.public-page{background:radial-gradient(circle at 15% 0,#b8f3e8 0,transparent 32%),linear-gradient(160deg,#f6fbfa 0%,#eaf7f4 45%,#f7fafc 100%)}
.public-app{min-height:100dvh;display:flex;flex-direction:column;max-width:780px;margin:0 auto;padding:max(18px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.public-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 2px 18px}
.brand{display:flex;align-items:center;gap:10px}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:linear-gradient(145deg,#11b8a6,#08756c);color:white;font-size:22px;font-weight:900;box-shadow:0 8px 22px #0f766e32}.brand b,.brand small{display:block}.brand b{font-size:17px}.brand small{font-size:11px;color:var(--muted);margin-top:2px;letter-spacing:.08em}.online-pill{font-size:12px;font-weight:800;color:#08766c;background:#fff;border:1px solid #bee9e3;border-radius:999px;padding:8px 12px;white-space:nowrap}.online-pill i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#12b886;margin-right:5px;box-shadow:0 0 0 4px #12b8861c}
.public-main{flex:1;display:flex;flex-direction:column;justify-content:center;max-width:680px;width:100%;margin:0 auto}.card{background:#fffffff2;border:1px solid #ffffff;border-radius:24px;box-shadow:0 20px 60px #174c4930;backdrop-filter:blur(16px)}
.welcome{padding:clamp(24px,6vw,46px)}.welcome-badge{display:inline-flex;padding:7px 11px;border-radius:999px;background:#d9f6f1;color:#08756c;font-size:12px;font-weight:900}.welcome h1{font-size:clamp(30px,8vw,48px);letter-spacing:-.04em;line-height:1.1;margin:20px 0 10px}.welcome p{color:var(--muted);line-height:1.8;font-size:15px;margin:0 0 24px}.welcome label,.login label{display:block;font-size:12px;font-weight:800;color:#486174;margin-bottom:7px}.welcome input,.login input{width:100%;border:1px solid #cbdadd;background:#f8fbfb;border-radius:14px;padding:14px 15px;font-size:16px;outline:none}.welcome input:focus,.login input:focus{border-color:#3ab5a8;box-shadow:0 0 0 4px #14b8a619}.welcome button,.login button,.composer button{border:0;border-radius:14px;background:var(--teal-deep);color:white;font-weight:900;padding:14px 20px;margin-top:12px;box-shadow:0 8px 20px #0f766e38}.welcome button{width:100%}.privacy-note{margin-top:14px;text-align:center;color:#8796a3;font-size:11px}
.chat{height:min(720px,calc(100dvh - 125px));min-height:500px;display:flex;flex-direction:column;overflow:hidden}.chat-title{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid var(--line);background:#fff}.chat-title b,.chat-title small{display:block}.chat-title small{font-size:11px;color:var(--muted);margin-top:2px}.chat-title>span{font-size:11px;color:#0a7b70;font-weight:800}.messages{flex:1;overflow:auto;padding:20px 16px;background:linear-gradient(180deg,#f8fcfb,#f1f7f6);scroll-behavior:smooth}.greeting-card{width:max-content;max-width:88%;margin:2px auto 20px;padding:10px 13px;border-radius:13px;background:#e7f7f4;border:1px solid #c9ebe5;color:#4e6c69;font-size:12px;line-height:1.6;text-align:center}.message{display:flex;margin:0 0 12px}.message .bubble{max-width:82%;padding:11px 14px;border-radius:17px;font-size:14px;line-height:1.65;word-break:break-word;white-space:pre-wrap;box-shadow:0 2px 6px #1b4c4910}.message.visitor{justify-content:flex-end}.message.visitor .bubble{background:var(--teal-deep);color:#fff;border-bottom-right-radius:5px}.message.admin .bubble{background:#fff;border:1px solid #dfe9e8;border-bottom-left-radius:5px}.message .time{display:block;font-size:9px;opacity:.65;margin-top:5px;text-align:right}.typing{padding:5px 18px 10px;font-size:11px;color:var(--muted);background:#f1f7f6}.typing i{display:inline-block;width:5px;height:5px;border-radius:50%;background:#70a9a4;margin-right:3px;animation:blink 1.2s infinite}.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}@keyframes blink{0%,80%,100%{opacity:.3}40%{opacity:1}}
.composer{display:flex;gap:9px;align-items:flex-end;padding:12px;background:#fff;border-top:1px solid var(--line)}.composer textarea{flex:1;resize:none;min-height:48px;max-height:130px;border:1px solid #cfdcdc;background:#f7faf9;border-radius:15px;padding:13px 14px;font-size:15px;line-height:1.5;outline:none}.composer textarea:focus{border-color:#44bbae;box-shadow:0 0 0 4px #14b8a616}.composer button{width:74px;min-height:48px;padding:0 14px;margin:0}.composer button:disabled{opacity:.5}.error{min-height:0;padding:0 14px;background:#fff;color:var(--danger);font-size:12px;line-height:1.4}.error:not(:empty){min-height:26px;padding-top:6px;padding-bottom:6px}.public-app footer{text-align:center;color:#84929d;font-size:10px;letter-spacing:.08em;padding-top:18px}
.admin-page{background:#eaf0f3;min-height:100dvh}.admin-app{min-height:100dvh}.login{width:min(430px,calc(100% - 32px));margin:12vh auto 0;padding:30px}.admin-brand{margin-bottom:28px}.login h1{font-size:29px;margin:0 0 8px}.login p{color:var(--muted);font-size:13px;margin:0 0 22px}.login button{width:100%}.workspace{min-height:100dvh;display:flex;flex-direction:column}.admin-head{height:66px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 18px;background:#0b1722;color:white}.admin-head .brand-mark{width:36px;height:36px;border-radius:11px;font-size:18px}.admin-head .brand b{font-size:15px}.admin-head .brand small{color:#8fa9bb}.admin-tools{display:flex;gap:8px}.soft{border:1px solid #ffffff25;background:#ffffff12;color:#e7f4f1;padding:8px 11px;border-radius:9px;font-size:11px;font-weight:800}.workspace-body{flex:1;min-height:0;display:grid;grid-template-columns:340px 1fr;background:#f3f6f7}.conversation-pane{border-right:1px solid #dbe4e8;background:#fff;min-height:0;display:flex;flex-direction:column}.pane-head{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid #e3eaed}.pane-head b,.pane-head small{display:block}.pane-head b{font-size:16px}.pane-head small{font-size:10px;color:var(--muted);margin-top:3px}.icon-btn{width:34px;height:34px;border:0;border-radius:9px;background:#eef4f5;color:#365e69;font-size:20px}.conversation-list{flex:1;overflow:auto}.conversation-item{width:100%;border:0;border-bottom:1px solid #edf1f3;background:#fff;text-align:left;padding:14px 16px}.conversation-item:hover,.conversation-item.active{background:#effaf8}.conversation-item.is-new{background:#e8fbf7}.conv-top{display:flex;justify-content:space-between;gap:8px}.conv-name{font-weight:900;font-size:14px}.conv-time{font-size:10px;color:#8796a2}.conv-preview{font-size:12px;color:#738390;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:6px}.unread{display:inline-grid;place-items:center;min-width:19px;height:19px;padding:0 5px;border-radius:99px;background:#e04747;color:white;font-size:10px;font-weight:900;margin-left:6px}.admin-chat-pane{min-width:0;min-height:0;background:#eef3f4;display:flex;flex-direction:column}.empty-chat-tip{margin:auto;text-align:center;color:#8b9aa6}.empty-icon{font-size:38px}.empty-chat-tip h2{font-size:19px;color:#526674;margin:10px 0 5px}.empty-chat-tip p{font-size:12px;margin:0}.admin-chat{height:100dvh;max-height:100dvh;display:flex;flex-direction:column}.admin-chat-head{height:66px;background:white;border-bottom:1px solid #dfe7ea;display:flex;align-items:center;gap:10px;padding:0 16px}.admin-chat-head b,.admin-chat-head small{display:block}.admin-chat-head small{font-size:10px;color:var(--muted);margin-top:2px}.back-btn{display:none}.admin-chat .messages{background:#f4f8f8}.conv-empty{padding:36px 18px;text-align:center;color:#8b9aa6;font-size:12px}
@media(max-width:760px){.admin-head{height:60px;padding:0 12px}.admin-tools .soft{padding:7px 9px}.workspace-body{display:block}.conversation-pane{height:calc(100dvh - 60px);border-right:0}.admin-chat-pane{display:none}.workspace.mobile-chat .conversation-pane{display:none}.workspace.mobile-chat .admin-chat-pane{display:flex;height:calc(100dvh - 60px)}.back-btn{display:block}.admin-chat{height:calc(100dvh - 60px)}.chat{height:calc(100dvh - 110px);min-height:420px;border-radius:19px}.public-app{padding-left:10px;padding-right:10px}.welcome{padding:24px 20px}.message .bubble{max-width:88%}}
