.chat-share-detail{margin:18px 0 8px;color:var(--blue);font-weight:600}
.chat-screen{display:flex;flex-direction:column;height:calc(100dvh - 105px - var(--safe-top) - var(--safe-bottom));min-height:0;margin:0 -18px -15px}html.chat-page #app{padding-top:calc(10px + var(--safe-top))}html.chat-page #header h1{font-size:18px;margin:0 0 8px}html.chat-input-focused nav{display:none}html.chat-input-focused #app{padding-bottom:0}
.chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:8px 12px 16px;background:linear-gradient(145deg,var(--bg),var(--soft));scrollbar-width:thin}
.chat-empty{text-align:center;margin:36px auto;color:var(--muted);font-size:12px}.chat-empty button,.chat-older{display:block;margin:8px auto 16px;color:var(--blue);font-size:12px}
.chat-date-separator{display:flex;justify-content:center;margin:12px 0 14px;clear:both}.chat-date-separator span{padding:4px 11px;border-radius:12px;background:var(--card);border:1px solid var(--line);box-shadow:0 2px 6px #1734520a;color:var(--muted);font-size:10px;font-weight:600;text-align:center}
.chat-unread-badge{position:absolute;top:-5px;left:calc(50% + 5px);display:grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:#e5484d;color:#fff;font-size:9px;font-weight:700;line-height:1;box-shadow:0 0 0 2px var(--card);pointer-events:none}
.chat-message{display:flex;align-items:flex-end;gap:8px;margin:0 0 7px}.chat-message.mine{flex-direction:row-reverse}
.chat-bubble{position:relative;touch-action:pan-y;user-select:none;-webkit-user-select:none}.chat-bubble::after{content:'↩';position:absolute;right:-32px;top:50%;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:var(--card);color:var(--blue);box-shadow:0 2px 8px #17345226;opacity:0;transform:translateY(-50%) scale(.65);transition:opacity .12s,transform .12s;pointer-events:none}.chat-bubble.chat-swiping::after{opacity:.65;transform:translateY(-50%) scale(.9)}.chat-bubble.chat-swipe-ready::after{opacity:1;transform:translateY(-50%) scale(1.1)}.chat-message.chat-highlight .chat-bubble{outline:2px solid var(--blue);outline-offset:2px}
.chat-avatar{position:relative;flex:none;width:34px;height:34px;border-radius:50%;overflow:hidden;background:#b9d4ff;color:#1d54ac;font-weight:700;font-size:15px;display:grid;place-items:center;padding:0}.chat-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.chat-bubble{max-width:calc(100% - 55px);min-width:72px;background:var(--card);border:1px solid var(--line);border-radius:15px 15px 15px 4px;padding:6px 9px;box-shadow:0 2px 8px #1734520a;overflow-wrap:anywhere}.chat-message.mine .chat-bubble{background:var(--soft);border-color:#c8d9ff;border-radius:15px 15px 4px 15px}.chat-message.mine .chat-message-head{display:none}
.chat-message-head{display:flex;align-items:center;justify-content:space-between;gap:14px;line-height:1.2}.chat-message-head button:first-child{padding:0;color:var(--blue);font-size:10px;font-weight:700;text-align:left}.chat-bubble p{margin:2px 0 0;font-size:12px;white-space:pre-wrap;line-height:1.35}.chat-bubble time{display:block;text-align:right;color:var(--muted);font-size:9px;line-height:1;margin-top:2px}
.chat-message.premium .chat-bubble,.chat-message.mine.premium .chat-bubble{background:#f6f1ff;border-color:#cbb8ee}html[data-theme="dark"] .chat-message.premium .chat-bubble,html[data-theme="dark"] .chat-message.mine.premium .chat-bubble{background:#302640;border-color:#795ca9}
.chat-message.deleted .chat-bubble{background:var(--bg);border-style:dashed;box-shadow:none}.chat-message.deleted .chat-bubble::after{display:none}.chat-message.deleted .chat-deleted-note{color:var(--muted);font-style:italic}
.chat-reply-quote{display:block;width:100%;margin:3px 0;padding:4px 7px;border-left:3px solid var(--blue);border-radius:7px;background:var(--bg);text-align:left}.chat-reply-quote strong,.chat-reply-quote span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.25}.chat-reply-quote strong{color:var(--blue)}.chat-reply-quote span{color:var(--muted)}.chat-reply-draft{border-left:3px solid var(--blue);background:var(--soft)}
.chat-context-menu{position:fixed;z-index:11;width:150px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--card);box-shadow:0 10px 28px #14223a38}.chat-context-menu button{display:block;width:100%;padding:9px 10px;color:var(--blue);text-align:left;font-size:12px;font-weight:600;border-radius:8px}.chat-context-menu button[data-chat-delete]{color:#b52727}.chat-context-menu button:active{background:var(--soft)}
.chat-tender{display:block;width:100%;padding:9px 11px;margin-top:7px;text-align:left;border-radius:11px;background:var(--bg);border:1px solid var(--line)}.chat-tender b,.chat-tender small{display:block}.chat-tender b{font-size:11px;color:var(--text)}.chat-tender small{font-size:9px;color:var(--muted);margin-top:5px}
.chat-media-image,.chat-media-video{display:block;max-width:100%;max-height:280px;border-radius:10px;margin-top:5px}.chat-file{display:flex;align-items:center;gap:8px;margin-top:5px;color:var(--blue);font-size:11px;text-decoration:none}.chat-file span{overflow-wrap:anywhere}
.chat-media-thumb{position:relative;display:block;max-width:100%;padding:0;margin-top:5px;border-radius:10px;overflow:hidden;text-align:left}.chat-media-thumb img,.chat-media-thumb video{margin:0;pointer-events:none}.chat-video-thumb>span{position:absolute;left:50%;top:50%;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;background:#0c121bcc;color:#fff;font-size:20px;transform:translate(-50%,-50%);pointer-events:none}
.chat-media-viewer{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border-radius:0;background:#0b1220;color:#fff}.chat-media-viewer::backdrop{background:#000}.chat-media-viewer[open]{display:flex;flex-direction:column}.chat-media-viewer-bar{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 12px 8px 18px;background:#0b1220;color:#fff}.chat-media-viewer-bar span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.chat-media-viewer-bar button{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:50%;background:#ffffff22;color:#fff;font-size:28px}.chat-media-viewer-body{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;padding:8px 8px calc(12px + env(safe-area-inset-bottom))}.chat-media-viewer-body img,.chat-media-viewer-body video{display:block;max-width:100%;max-height:100%;object-fit:contain}.chat-media-viewer-body video{width:100%;height:auto}
.chat-message:has(.chat-voice) .chat-bubble{width:min(290px,calc(100% - 45px))}.chat-voice{display:flex;align-items:center;gap:9px;width:100%;min-height:42px;margin-top:3px}.chat-voice audio{display:none}.chat-voice-play{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;background:var(--blue);color:#fff;font-size:16px;padding:0 0 0 2px}.chat-voice-body{min-width:0;flex:1}.chat-voice-track{display:block;width:100%;height:26px;padding:0;text-align:left}.chat-voice-wave{display:flex;align-items:center;justify-content:space-between;height:26px;gap:2px}.chat-voice-wave i{display:block;width:3px;min-width:2px;max-height:26px;border-radius:3px;background:#9db7e9}.chat-voice-wave i.played{background:var(--blue)}.chat-voice-time{display:block;color:var(--muted);font-size:10px;line-height:1.1}
.chat-composer{flex:none;padding:7px 10px 9px;background:var(--card);border-top:1px solid var(--line)}.chat-composer-row{display:flex;align-items:center;gap:7px}.chat-composer-row input{flex:1;border-radius:22px;padding:10px 12px;font-size:12px}.chat-attach,.chat-mic,.chat-send{flex:none;width:35px;height:35px;border-radius:50%;display:grid;place-items:center;font-size:20px;cursor:pointer}.chat-attach,.chat-mic{color:var(--blue);background:var(--soft)}.chat-send{color:#fff;background:var(--blue);font-size:17px}.chat-mic{touch-action:none;user-select:none;-webkit-user-select:none}.chat-mic.recording{background:#e74141;color:white;animation:chat-pulse 1s infinite alternate}@keyframes chat-pulse{to{opacity:.55}}
.chat-record-status{display:flex;align-items:center;gap:8px;margin:0 0 7px;padding:7px 10px;border-radius:11px;background:#fff1f1;color:#a32828;font-size:11px}.chat-record-status[hidden]{display:none}.chat-record-status .chat-record-dot{width:9px;height:9px;border-radius:50%;background:#e74141;animation:chat-pulse 1s infinite alternate}.chat-record-status strong{font-variant-numeric:tabular-nums}.chat-record-hint{flex:1;text-align:center;color:#955555}.chat-record-status button{font-size:17px}.chat-record-status.cancel{background:#ffe3e3}.chat-record-status.cancel .chat-record-hint{font-weight:700;color:#c52929}html[data-theme="dark"] .chat-record-status{background:#462428;color:#ffd0d0}html[data-theme="dark"] .chat-record-hint{color:#ffc0c0}
.chat-record-status button{order:-1}.chat-record-status .chat-record-hint{order:0}.chat-record-status .chat-record-dot{order:1}.chat-record-status strong{order:2}
.chat-draft-item{display:flex;justify-content:space-between;gap:8px;align-items:center;background:var(--soft);border-radius:8px;padding:5px 9px;margin-bottom:5px;color:var(--muted);font-size:10px}.chat-draft-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-draft-item button{font-size:17px}
@media(max-width:360px){nav button{font-size:8px}.chat-composer-row{gap:4px}.chat-attach,.chat-mic,.chat-send{width:31px;height:31px}}
