:root{font-family:"Microsoft YaHei",system-ui,sans-serif;color:#242424;background:#ededed;font-size:14px}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,input,textarea{font:inherit}button{cursor:pointer;border:0;border-radius:5px;padding:8px 13px;background:#e5e5e5;color:inherit}button:hover{background:#dcdcdc}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible,summary:focus-visible{outline:2px solid #07a958;outline-offset:2px}.primary{background:#07b75b;color:white}.primary:hover{background:#079f50}input,textarea{border:1px solid #d9d9d9;border-radius:5px;background:white;padding:10px;min-width:0;max-width:100%}h1,h2,p{margin:0}h1,h2{font-size:18px;font-weight:600}.hint{font-size:12px;color:#888;line-height:1.7}small{font-size:11px;color:#969696}[hidden]{display:none!important}
#workspace{height:100vh;height:100dvh;width:100%;display:grid;grid-template-columns:64px 280px minmax(0,1fr);overflow:hidden}.rail{background:#2e2e2e;color:#aaa;display:flex;align-items:center;flex-direction:column;gap:15px;padding:24px 6px}.rail-title{color:#07c160;font-size:13px}.rail button{margin-top:auto;color:#ccc;background:transparent;font-size:25px}.rail button small{display:block}.chat-avatar{width:38px;height:38px;flex:0 0 38px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;font-size:17px;font-weight:600;background:#d7e6dd;color:#327052}.chat-avatar.tone-1{background:#dfe7f4;color:#436ba6}.chat-avatar.tone-2{background:#eee2d4;color:#a07649}.chat-avatar.tone-3{background:#e9ddf0;color:#815a99}.chat-avatar.tone-4{background:#e0e6dd;color:#667657}.chat-avatar.tone-5{background:#f0dfdf;color:#a76b6b}.sidebar{min-width:0;min-height:0;display:flex;flex-direction:column;background:#e8e8e8;border-right:1px solid #d9d9d9}.sidebar-heading{height:62px;display:flex;align-items:center;padding:0 18px;gap:8px}.sidebar-heading h1{flex:1}.icon-button{font-size:25px;padding:2px 9px;background:transparent}#list-back{display:none}.search-tools{display:flex;align-items:center;gap:8px;padding:0 14px 14px;position:relative}.search-tools input{width:100%;background:#dcdcdc;border:0;height:34px;font-size:12px}.search-tools .icon-button{background:#dadada;width:33px;height:33px;padding:0;flex-shrink:0}#add-menu{position:absolute;right:14px;top:40px;z-index:6;min-width:155px;padding:5px;background:#303030;border-radius:6px;box-shadow:0 5px 20px #0003}#add-menu button{display:block;text-align:left;width:100%;background:transparent;color:white;padding:12px}#add-menu button:hover{background:#454545}#rooms{flex:1;overflow-y:auto;min-height:0}.list-section{padding:9px 18px 5px;color:#929292;font-size:11px}.chat-row{border-radius:0;display:flex;align-items:center;gap:12px;padding:13px 16px;width:100%;background:transparent;text-align:left;position:relative}.chat-row:hover{background:#dedede}.chat-row.selected{background:#cfcfcf}.row-copy{min-width:0;flex:1}.row-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.row-note{display:block;color:#999;font-size:11px;margin-top:5px}.unread-badge{border-radius:10px;background:#ed5b57;color:white;font-size:11px;min-width:19px;text-align:center;padding:2px 5px}#unread{color:#e95454;font-size:11px}.list-empty{padding:25px 18px;color:#999}.account-settings{padding:12px;border-top:1px solid #d9d9d9;font-size:11px}.account-settings summary{cursor:pointer;display:flex;justify-content:space-between;gap:8px}.settings-body{display:flex;flex-wrap:wrap;gap:8px;padding-top:12px}.settings-body button{font-size:11px}#sound-label{display:flex;align-items:center;gap:6px}#who{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:110px}
.thread{display:flex;flex-direction:column;min-width:0;min-height:0;background:#f5f5f5}.thread-heading{height:70px;flex:0 0 70px;display:flex;align-items:center;gap:9px;border-bottom:1px solid #dedede;padding:0 22px;background:#f5f5f5}.thread-heading h2{font-size:18px}.thread-heading p{font-size:11px;color:#999;margin-top:5px}#thread-content{display:flex;flex:1;flex-direction:column;min-height:0}#thread-empty{display:grid;place-items:center;flex:1;color:#aaa}.history-bar{text-align:center;padding:7px;flex-shrink:0}.history-bar button{padding:3px 9px;font-size:11px;color:#8a8a8a;background:transparent}#messages{overflow:auto;flex:1;min-height:0;padding:14px 28px;overscroll-behavior:contain}.message{display:flex;align-items:flex-start;gap:10px;margin-bottom:22px}.message.mine{flex-direction:row-reverse}.message-content{max-width:min(75%,650px);min-width:0}.message-meta{font-size:11px;color:#aaa;margin-bottom:7px;line-height:1.5}.mine .message-meta{text-align:right}.bubble{padding:10px 13px;border-radius:5px;background:white;position:relative;line-height:1.65;overflow-wrap:anywhere}.mine .bubble{background:#95ec69}.bubble p{white-space:pre-wrap}.bubble a{display:block;font-size:12px;color:#526b7a;text-decoration:none;overflow-wrap:anywhere}.bubble a:hover{text-decoration:underline}.chat-image{display:block;max-width:100%;max-height:320px;border-radius:4px;margin:6px 0}.message-empty{color:#aaa;text-align:center;padding:40px 15px}.composer{flex-shrink:0;border-top:1px solid #ddd;background:#fff;padding:8px 24px 10px;position:relative}.composer-tools{display:flex;align-items:center;gap:8px;margin-bottom:5px}.composer-tools button{background:transparent;font-size:24px;padding:2px 6px}.composer-tools button span{font-size:11px;margin-left:5px;color:#888}.composer-tip{margin-left:auto;color:#aaa;font-size:11px}#send textarea{display:block;width:100%;height:80px;resize:none;border:0;padding:8px 2px;background:transparent;outline:0}.send-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}.send-bottom button{min-width:78px}.send-bottom small{font-size:11px}#status{font-size:11px;color:#929292;margin-top:5px}#status:empty{display:none}#emoji-picker{position:absolute;bottom:100%;left:15px;max-width:340px;display:flex;flex-wrap:wrap;gap:3px;padding:12px;background:white;border:1px solid #ddd;box-shadow:0 -5px 20px #0001;z-index:3;border-radius:8px}#emoji-picker button{background:transparent;font-size:23px;padding:5px}#shot{display:flex;align-items:center;gap:12px;padding:8px;background:#f0f6eb;border-radius:6px}#shot-preview{display:block;max-width:55%;max-height:130px;object-fit:contain}#shot button{margin:3px;font-size:12px}#error{position:fixed;top:10px;left:50%;transform:translateX(-50%);background:#fff0ef;color:#a43535;border:1px solid #f1d3d0;border-radius:7px;z-index:30;max-width:90vw;padding:10px 15px;white-space:pre-wrap}#error:empty{display:none}
#login{background:white;width:380px;max-width:90vw;margin:10vh auto;padding:32px;border-radius:12px;box-shadow:0 5px 30px #0001}#login h1,#login>p{text-align:center;margin-bottom:14px}#login label{display:block;font-size:12px;margin:15px 0}#login input{display:block;width:100%;margin-top:7px}#login>button{width:100%;margin:10px 0}.login-mark{width:52px;height:52px;background:#07b75b;color:white;display:grid;place-items:center;border-radius:13px;font-size:25px;margin:0 auto 18px}
dialog{width:420px;max-width:92vw;max-height:85dvh;border:0;border-radius:10px;padding:24px;box-shadow:0 10px 60px #0003}dialog::backdrop{background:#0005}#create{display:flex;flex-direction:column;gap:13px}#create header{display:flex;align-items:center;justify-content:space-between}#create header button{background:transparent;font-size:25px;padding:0 6px}#create label{font-size:12px;display:flex;flex-direction:column;gap:7px}#members{max-height:250px;overflow:auto;border-block:1px solid #eee;padding:5px 0}#members .member-option{display:flex;flex-direction:row;align-items:center;gap:10px;padding:10px 2px;font-size:14px;cursor:pointer}#members .member-option input{margin-left:auto;accent-color:#07b75b}#create-error{color:#b33;font-size:12px}
@media(max-width:700px){#workspace{display:block;height:100dvh}.rail{display:none}.sidebar{height:100%;border:0;background:#f7f7f7}.sidebar-heading{height:56px;padding:0 13px;background:#ededed}#list-back{display:inline-block}.search-tools{background:#ededed;padding:5px 14px 12px}.chat-row{padding:14px 16px;border-bottom:1px solid #ececec;background:#fff}.chat-row.selected{background:#eee}.thread{display:none;height:100%}.thread-open .sidebar{display:none}.thread-open .thread{display:flex}.thread-heading{padding:0 10px;height:58px;flex-basis:58px;background:#ededed}.thread-heading h2{font-size:17px}.thread-heading p{display:none}#messages{padding:10px 12px;background:#ededed}.message{gap:8px;margin-bottom:19px}.message-content{max-width:76%}.chat-avatar{width:36px;height:36px;flex-basis:36px}.composer{padding:5px 12px max(8px,env(safe-area-inset-bottom));background:#f7f7f7}.composer-tip{font-size:10px}.composer-tools button span{font-size:10px}#send textarea{height:54px;background:white;border-radius:5px;padding:8px}.send-bottom{margin-top:6px}.send-bottom small{font-size:10px}#shot-preview{max-height:90px}.account-settings{padding-bottom:max(12px,env(safe-area-inset-bottom))}#emoji-picker{max-width:calc(100vw - 30px)}dialog{padding:20px}#error{top:5px;font-size:12px}.chat-image{max-height:260px}}

#message-menu{position:fixed;z-index:40;background:white;border:1px solid #ddd;padding:5px;border-radius:6px;box-shadow:0 4px 20px #0002;min-width:145px}#message-menu button{display:block;width:100%;background:transparent;text-align:left}#message-menu button:hover{background:#eee}.recalled{color:#999;font-size:12px;background:transparent!important}.thread-heading>div{min-width:0;flex:1}.thread-heading h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#group-action{font-size:12px;flex-shrink:0}.bubble .image-open{display:block}.image-open .chat-image{margin:0}.message{touch-action:pan-y}

#install-help p{margin:16px 0;line-height:1.8}#install-help button{width:100%}

.retention-setting{display:flex;flex-direction:column;gap:7px;width:100%;font-size:12px}.retention-setting select{font:inherit;padding:7px;border:1px solid #ccc;border-radius:5px;background:white}

/* Keep mobile controls inside the visual viewport when the keyboard opens. */
html{width:100%;overflow-x:hidden}.chat-image{width:260px;height:195px;object-fit:contain}
@media(max-width:700px){
 #workspace{position:fixed;left:0;right:0;top:var(--chat-top,0px);width:100%;max-width:100vw;height:var(--chat-height,100dvh)}
 input,select,textarea,#send textarea,.search-tools input{font-size:16px}
 .thread-heading,.sidebar-heading{padding-top:env(safe-area-inset-top);height:calc(58px + env(safe-area-inset-top));flex-basis:calc(58px + env(safe-area-inset-top))}
 .thread,.sidebar,#thread-content,.composer{min-width:0;max-width:100%}
 .chat-image{width:220px;height:165px;max-height:none}
 .composer-tip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
 #install-help,#contact-dialog{max-height:calc(var(--chat-height,100dvh) - 30px);overflow:auto}
 .account-settings{flex-shrink:0}
}

@media(max-width:700px){
 html,body{width:100%;height:100%;max-width:100%;overflow:hidden;overscroll-behavior-x:none}
 body{position:fixed;inset:0;margin:0}
 #workspace{overflow:hidden;overscroll-behavior-x:none;touch-action:pan-y pinch-zoom}
 #rooms,#messages{overflow-x:hidden;overscroll-behavior-x:none;touch-action:pan-y pinch-zoom}
 .message-content,.bubble,.row-copy{min-width:0;max-width:100%;overflow-wrap:anywhere}
 .message-content{max-width:76%}
 .bubble a{max-width:100%;overflow-wrap:anywhere}
 #shot{max-width:100%;overflow:hidden}#shot>div{min-width:0}
 #members .member-option>span:not(.chat-avatar){min-width:0;overflow-wrap:anywhere}
 #error{overflow-wrap:anywhere}dialog{overflow-x:hidden}
 .account-settings summary>span{min-width:0}
}

#login .remember-login,.remember-login{display:flex;align-items:center;flex-wrap:wrap;gap:7px;font-size:12px}#login .remember-login input,.remember-login input{width:auto;margin:0;flex:none}

body.account-page{position:static;overflow:auto;height:auto}.account-panel{max-width:1000px;margin:25px auto;padding:20px}.account-panel h1{margin:20px 0}.account-panel a{color:#078b4b}.account-panel form{display:flex;flex-wrap:wrap;gap:12px;align-items:end;margin:20px 0}.account-panel label{display:flex;gap:5px;flex-direction:column}.account-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;background:white;margin:10px 0;padding:15px}.account-row strong{flex:1;min-width:140px;overflow-wrap:anywhere}.account-row label{flex-direction:row}#account-error{color:#b33}.account-panel input,.account-panel select{font-size:16px}html:has(body.account-page){overflow-y:auto;height:auto}
