:root{font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:#213547;background:#edf2f5;--blue:#3390ec;--muted:#728596;--line:#e6ecf0}*{box-sizing:border-box}body{margin:0;min-width:320px}button,input,textarea,select{font:inherit}button{cursor:pointer;border:0;background:transparent;color:inherit;border-radius:8px;padding:10px 14px}button:hover{background:#edf4fa}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{outline:2px solid #3390ec;outline-offset:2px}input,textarea,select{border:1px solid #d9e2e9;border-radius:9px;padding:11px;background:#fff;color:inherit;min-width:0}label{display:block;font-size:13px;color:#607789;margin:14px 0}label>input:not([type=checkbox]),label>select,label>textarea{display:block;width:100%;margin-top:7px}.hidden{display:none!important}.primary{background:var(--blue);color:white}.primary:hover{background:#227ed6}.red{color:#dc4450!important}header{display:flex;align-items:center;justify-content:space-between;background:white;border-bottom:1px solid var(--line);padding:16px 22px;gap:12px}h1,h2{margin:0}h2{font-size:20px}small{color:var(--muted)}.logo{width:72px;height:72px;display:grid;place-items:center;background:linear-gradient(145deg,#5db4ef,#2788da);color:white;font-size:36px;border-radius:24px}.logo.small{width:34px;height:34px;font-size:20px;border-radius:11px}.brand{display:flex;align-items:center;gap:10px}#auth{min-height:100dvh;display:grid;place-items:center;padding:25px;background:radial-gradient(ellipse at top,#dfedf8,#f5f8fb 70%)}.auth-card{width:min(410px,100%);background:white;border:1px solid #e0e9f0;border-radius:25px;padding:34px;box-shadow:0 18px 70px #25476b0d}.auth-card>.logo{margin:0 auto 20px}.auth-card h1,.auth-card>p,.auth-card>small{text-align:center;display:block}.auth-card h1{font-size:28px}.auth-card>p{font-size:13px;color:var(--muted);line-height:1.8}.tabs{display:flex;border-bottom:1px solid var(--line);margin-top:24px}.tabs button{flex:1;border-radius:0}.tabs .active{color:var(--blue);border-bottom:2px solid var(--blue)}#auth-submit{width:100%;margin:8px 0 12px}#auth-error,#send-error{color:#ce3d48;font-size:12px;min-height:16px}#app{height:100dvh;display:flex}aside{width:340px;flex-shrink:0;background:white;border-right:1px solid #dce5eb;display:flex;flex-direction:column}aside header{height:75px}#self{padding:16px 22px 4px;font-size:13px;color:var(--muted)}.sidebar-tools{padding:8px 12px;display:flex;justify-content:space-between;font-size:13px}.sidebar-tools button{color:var(--blue)}#search{margin:0 18px;background:#f2f5f7;border:0;border-radius:22px;padding:12px 18px}.section-label{padding:22px 22px 10px;font-size:12px;color:var(--muted);display:flex;justify-content:space-between}#contacts{flex:1;overflow:auto;padding:0 9px}.contact{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:13px 12px}.contact.selected{background:#e9f3fd}.avatar{width:46px;height:46px;display:grid;place-items:center;border-radius:50%;background:#7ca9ce;color:white;font-size:18px;flex-shrink:0}.contact:nth-child(3n) .avatar{background:#81b9a0}.contact:nth-child(3n+2) .avatar{background:#ad96c7}.contact strong{font-size:14px;display:block}.contact small{display:block;margin-top:5px;font-size:12px}.empty-note{padding:25px 18px;color:var(--muted);font-size:13px;line-height:1.8}footer{display:flex;align-items:center;justify-content:space-between;padding:12px;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}footer button{padding:8px}#conversation{flex:1;min-width:0;background:#e1e9ec}#empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px}#empty h2{margin-top:22px;color:#567286;font-weight:500}#empty p{color:#7e94a3;font-size:13px}#chat{height:100%;display:flex;flex-direction:column}#chat header{position:relative;height:75px;padding:12px 22px}.chat-title{flex:1;min-width:0}.chat-title strong{display:block;font-size:15px}.chat-title small{display:block;margin-top:5px;font-size:12px}#chat-menu-button{font-size:27px;color:#83939e;width:42px}#back{display:none;font-size:27px}.dropdown{position:absolute;right:15px;top:65px;background:#fff;border-radius:10px;width:220px;box-shadow:0 4px 18px #15283930;padding:5px;z-index:3}.dropdown button{display:block;width:100%;text-align:left;border-radius:4px;font-size:14px;padding:13px}#messages{flex:1;overflow-y:auto;min-height:0;padding:28px max(22px,7%);background-image:radial-gradient(#93a9b020 1px,transparent 1px);background-size:22px 22px}.message-row{display:flex;margin-bottom:12px;justify-content:flex-start}.message-row.mine{justify-content:flex-end}.bubble{position:relative;background:white;border-radius:13px 13px 13px 3px;padding:10px 12px;max-width:min(80%,650px);min-width:110px;box-shadow:0 1px 2px #16374512}.mine .bubble{background:#e3ffc9;border-radius:13px 13px 3px 13px}.message-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:14px}.message-meta{display:flex;gap:8px;justify-content:flex-end;align-items:center;color:#8b9da6;font-size:10px;margin-top:3px}.message-meta button{padding:1px 5px;font-size:16px;color:#80939a}.sender{font-size:11px;color:#3b8dca;margin-bottom:4px}.bubble a{display:block;color:#2879b4;overflow-wrap:anywhere;padding:8px 0}.composer-wrap{padding:8px 24px 12px;background:white}#burn-status{font-size:11px;color:#8999a4;padding:0 0 5px;min-height:18px}#send-form{display:flex;align-items:flex-end;gap:10px}#attach{font-size:26px;color:#95a3ac;padding:7px 10px}#message{flex:1;resize:none;border:0;background:#f4f7f9;max-height:150px;line-height:1.6}#send-form .send{font-size:21px;border-radius:50%;width:45px;height:45px;padding:0}dialog{border:0;border-radius:16px;padding:0;width:min(500px,calc(100% - 28px));max-height:90dvh;box-shadow:0 15px 80px #172c4155;color:inherit}dialog::backdrop{background:#172c4166}dialog header{position:sticky;top:0;z-index:2;padding:16px 22px}#dialog-body{padding:20px 24px}#dialog-body p{font-size:13px;color:var(--muted);line-height:1.8}.dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.dialog-actions button{flex:1;border:1px solid var(--line)}.row{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:13px 0;border-bottom:1px solid var(--line);font-size:13px}.row div{min-width:0;overflow-wrap:anywhere}.row small{display:block;margin-top:5px}.row button{font-size:12px}.stack{display:grid;gap:8px}.mono{font-family:Consolas,monospace;overflow-wrap:anywhere;background:#f1f6fa;padding:12px;border-radius:8px}.check{display:flex;align-items:center;gap:8px}#toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);z-index:20;background:#284b65;color:white;border-radius:10px;padding:12px 22px;font-size:13px;box-shadow:0 6px 28px #0002;max-width:90%}#admin{min-height:100dvh;background:#f3f6fa}#admin>header{padding:26px max(22px,6%)}#admin h1{font-size:24px;margin-top:6px}#admin nav{display:flex;gap:10px;padding:18px max(22px,6%);overflow-x:auto;border-bottom:1px solid #e0e8ef}#admin nav button{white-space:nowrap}#admin nav .active{background:#dcecfb;color:#287fd0}#admin-content{max-width:1050px;margin:auto;padding:28px}.panel{background:white;padding:24px;border:1px solid #e1e8ef;border-radius:15px;margin-bottom:18px}.panel h2{margin-bottom:14px}.panel p{color:var(--muted);font-size:13px;line-height:1.8}.panel .row{gap:20px}.panel textarea{min-height:190px;font-family:Consolas,"Microsoft YaHei",monospace}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 22px}.text-button{color:var(--blue)}.load-more{display:block;margin:0 auto 16px;background:#fff9;color:#728b9c;font-size:12px}@media(max-width:850px){aside{width:290px}#messages{padding:20px 22px}}@media(max-width:700px){#app{display:block}aside{width:100%;height:100%}#conversation{display:none;height:100%}#app.mobile-chat aside{display:none}#app.mobile-chat #conversation{display:block}#back{display:block;padding:5px}#chat header{height:66px;padding:8px 12px;gap:8px}.avatar{width:42px;height:42px}#messages{padding:17px 12px}.bubble{max-width:90%}.composer-wrap{padding:8px 10px 10px}.auth-card{padding:28px}#admin-content{padding:14px}.panel{padding:17px}.form-grid{grid-template-columns:1fr}.panel .row{align-items:flex-start;flex-direction:column;gap:8px}#admin>header{padding:20px}#admin nav{padding:12px;gap:3px}.dropdown{top:59px}}
.unread-badge{margin-left:auto;background:#3390ec;color:white;border-radius:15px;font-size:11px;padding:3px 7px}.contact>div{min-width:0;flex:1}.contact small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:210px}

/* v2.1 compact conversation list and native-media controls */
body{font-family:"Segoe UI","Microsoft YaHei",system-ui,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
aside header{height:70px;padding:12px 18px}.brand{min-width:0}.brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px}.brand .avatar{width:38px;height:38px}
.avatar{position:relative}.avatar>img{width:100%;height:100%;object-fit:cover;border-radius:50%}#contacts{padding:5px 8px}.contact{padding:9px 10px;gap:11px;min-height:72px;border-radius:12px}.contact.selected{background:#3390ec;color:#fff}.contact.selected small,.contact.selected time{color:#e8f4ff}.contact.selected .unread-badge{background:#fff;color:#3390ec}.contact .avatar{width:50px;height:50px;font-size:22px}.contact-copy{flex:1;min-width:0}.contact-top,.contact-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.contact-top strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}.contact-top time{font-size:11px;white-space:nowrap;flex-shrink:0;color:#728596}.contact-bottom{margin-top:5px}.contact-bottom small{font-size:13px;margin:0;flex:1;max-width:none}.unread-badge{margin-left:0;flex-shrink:0;min-width:20px;text-align:center}.assistant .avatar{background:#57a7d9}footer{padding:14px 18px}footer #admin-button,footer #logout{display:none!important}
.message-text{text-align:left}.message-meta{margin-left:auto;text-align:right;align-self:flex-end}.bubble{display:flex;flex-direction:column}.burn-badge{position:absolute;bottom:-3px;right:-7px;font-size:9px;min-width:23px;height:21px;border:2px solid #fff;border-radius:12px;background:#667d8d;color:#fff;display:grid;place-items:center;padding:0 3px}#burn-status{display:none!important}.composer-wrap{padding-top:12px}.send svg{width:25px;height:25px;fill:none;stroke:white;stroke-width:1.8;stroke-linejoin:round;stroke-linecap:round;vertical-align:middle}#record-button{font-size:25px;color:#8197a6;width:42px;height:45px;padding:0}.send{flex-shrink:0}.media-button{padding:0!important;max-width:100%;overflow:hidden;align-self:flex-start}.message-image{display:block;max-width:100%;width:300px;max-height:300px;object-fit:cover;border-radius:8px}.message-media{max-width:100%;width:300px;max-height:300px}.media-preview,.capture-preview{display:block;max-width:100%;max-height:52dvh;margin:auto;border-radius:10px}.capture-preview{width:100%}.security-card{max-width:480px;margin:16px auto;padding:20px;border-radius:15px;background:white;overflow-wrap:anywhere}.security-card p{font-size:13px;color:#728596;line-height:1.6}.security-card .dialog-actions button{font-size:13px}
#lock-screen{position:fixed;inset:0;z-index:100;background:#eaf1f7;display:grid;place-items:center;padding:20px}#unlock-form{background:white;border-radius:22px;padding:30px;width:min(380px,100%);box-shadow:0 12px 50px #284b6518}#unlock-form h2{text-align:center}#unlock-form p{font-size:13px;color:#728596;text-align:center}.lock-icon{display:block;font-size:50px;color:#3390ec;text-align:center}#unlock-error{color:#ce3d48!important}#unlock-form button{width:100%;margin-top:10px}.stack>button{text-align:left;border-bottom:1px solid #edf2f5}#dialog-body>.avatar{margin-bottom:12px}#dialog-body>.stack{gap:2px}#self-name{font-size:15px}
@media(max-width:700px){#send-form{gap:4px}#attach{padding:6px;width:35px;flex-shrink:0}#record-button{width:34px;flex-shrink:0}#message{width:0;padding:10px}#send-form .send{width:42px;height:42px}.contact{min-height:72px}.bubble{max-width:90%}.message-image{width:260px}}


.receipt-read{color:#168ed0}
