:root{--bg:#10131a;--panel:#171c26;--me:#2b5cff;--her:#222a38;--text:#e9eefb;--dim:#8b95a8}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--text);font:15px/1.45 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;display:flex;flex-direction:column;overflow:hidden}
header{display:flex;align-items:center;gap:10px;padding:calc(env(safe-area-inset-top) + 10px) 16px 10px;background:rgba(16,19,26,.9);backdrop-filter:blur(12px);border-bottom:1px solid #1f2531;position:sticky;top:0;z-index:5}
header .title{font-weight:600;font-size:17px}
header .status{font-size:12px;color:var(--dim);margin-left:auto}
main{flex:1;overflow-y:auto;padding:12px 14px 20px;display:flex;flex-direction:column;gap:10px;-webkit-overflow-scrolling:touch}
.hint{color:var(--dim);text-align:center;font-size:13px;padding:24px 0}
.msg{max-width:78%;padding:9px 13px;border-radius:16px;word-break:break-word;white-space:pre-wrap;font-size:15px;line-height:1.5}
.me{align-self:flex-end;background:var(--me);color:#fff;border-bottom-right-radius:6px}
.her{align-self:flex-start;background:var(--her);border-bottom-left-radius:6px}
.msg img{max-width:100%;border-radius:10px;display:block;margin-top:4px}
.time{font-size:11px;color:var(--dim);text-align:center;margin:4px 0}
footer{display:flex;gap:8px;align-items:flex-end;padding:8px 12px calc(env(safe-area-inset-bottom) + 8px);background:rgba(16,19,26,.95);border-top:1px solid #1f2531}
textarea{flex:1;resize:none;max-height:120px;padding:10px 14px;border-radius:20px;border:1px solid #262e3d;background:#131822;color:var(--text);font:inherit;outline:none}
textarea:focus{border-color:#3a4a6a}
button{border:none;background:var(--me);color:#fff;border-radius:50%;width:38px;height:38px;font-size:18px;display:flex;align-items:center;justify-content:center}
#plus{background:#1d2430;color:var(--dim);font-size:20px}
button:active{transform:scale(.95)}
.typing{align-self:flex-start;color:var(--dim);font-size:13px;padding:4px 8px}

#hist{background:transparent;color:var(--dim);font-size:13px;border:1px solid #262e3d;border-radius:14px;padding:5px 10px;width:auto;height:auto}
.drawer{position:fixed;inset:0;background:#0d1017ee;backdrop-filter:blur(6px);z-index:20;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top)}
.drawer.hidden{display:none}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;font-weight:600;border-bottom:1px solid #1f2531}
.drawer-head button{background:transparent;color:var(--dim);font-size:22px;width:auto;height:auto}
#drawer-list{overflow-y:auto;padding:8px 12px}
.sess{padding:12px 14px;border-radius:12px;margin-bottom:8px;background:#151a24}
.sess:active{background:#1d2430}
.sess .t{font-size:14px}
.sess .d{font-size:11px;color:var(--dim);margin-top:4px}

.botmsg{align-self:flex-start;max-width:82%;display:flex;flex-direction:column;gap:6px}
.think{font-size:12px;color:#6f7a8d;background:#12161f;border:1px solid #1d2330;border-radius:10px;padding:6px 10px}
.think summary{cursor:pointer;outline:none}
.think-body{margin-top:6px;color:#8b95a8;white-space:pre-wrap;line-height:1.5}
.msg .meme{max-width:140px;max-height:140px;border-radius:10px;display:block;margin:4px 0}

details.think > .think-body{display:none}
details.think[open] > .think-body{display:block}
.playbtn{align-self:flex-start;background:transparent;color:#7f8ca3;border:1px solid #232b3a;border-radius:12px;font-size:11px;padding:3px 9px;width:auto;height:auto;margin-top:2px}
.playbtn:active{background:#1d2430}

#voice{background:transparent;color:var(--dim);font-size:12px;border:1px solid #262e3d;border-radius:14px;padding:5px 10px;width:auto;height:auto;white-space:nowrap;flex:none}
#hist{flex:none}

.picker{position:fixed;left:0;right:0;bottom:0;max-height:56vh;background:#12161f;border-top:1px solid #232b3a;z-index:25;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)}
.picker.hidden{display:none}
.picker-head{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;color:#8b95a8;font-size:13px}
.picker-head button{background:transparent;color:#8b95a8;font-size:20px;width:auto;height:auto}
.picker-grid{overflow-y:auto;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:6px 12px 14px}
.picker-grid img{width:100%;border-radius:8px;background:#1a202b}

#send{width:auto;min-width:64px;height:38px;border-radius:19px;font-size:15px;flex:none}
footer{align-items:flex-end}

.banner{background:#3a1220;color:#ffb4c4;font-size:12px;padding:8px 12px;border-bottom:1px solid #5a1c2c;white-space:pre-wrap}
.banner.hidden{display:none}
