:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#111;background:#ededed}
*{box-sizing:border-box}html,body,#app{margin:0;width:100%;height:100%;overflow:hidden}body{background:#ededed}
button,input,textarea{font:inherit}.hidden{display:none!important}.page{height:100%;width:100%}.grow{flex:1}
.topbar{height:56px;padding:env(safe-area-inset-top) 12px 0;display:flex;align-items:center;gap:10px;background:#f5f5f5;border-bottom:1px solid #ddd;position:relative;z-index:5}
.title{font-weight:600;font-size:17px}.sub{font-size:11px;color:#999}.iconBtn,.textBtn{border:0;background:transparent;font-size:28px;padding:5px 10px}.textBtn{font-size:14px}
.messages{height:calc(100% - 56px - 62px - env(safe-area-inset-bottom));overflow-y:auto;padding:14px 12px 20px;background:#ededed;-webkit-overflow-scrolling:touch}
.msgRow{display:flex;margin:10px 0;align-items:flex-start;gap:8px}.msgRow.mine{flex-direction:row-reverse}
.avatar{width:38px;height:38px;border-radius:5px;background:#7a9;color:white;display:grid;place-items:center;font-weight:700;flex:0 0 auto}
.msgCol{max-width:min(76%,620px)}.sender{font-size:11px;color:#888;margin:0 4px 3px}.mine .sender{text-align:right}
.bubble{position:relative;background:#fff;border-radius:4px;padding:9px 11px;line-height:1.45;word-break:break-word;white-space:pre-wrap;box-shadow:0 0 0 1px #00000008}
.mine .bubble{background:#95ec69}.time{font-size:10px;color:#aaa;margin:4px 3px}.mine .time{text-align:right}
.mediaThumb{display:block;max-width:min(280px,65vw);max-height:360px;border-radius:5px;object-fit:cover;background:#111}
.videoThumb{display:block;max-width:min(320px,70vw);max-height:360px;border-radius:5px;background:#000}
.composer{height:calc(62px + env(safe-area-inset-bottom));padding:8px 8px calc(8px + env(safe-area-inset-bottom));display:flex;align-items:flex-end;gap:7px;background:#f7f7f7;border-top:1px solid #ddd}
.nameInput{width:70px}.composer input,.composer textarea,.centerCard input,.panel input,.modalCard input{border:1px solid #ddd;background:#fff;border-radius:6px;padding:10px;outline:none}
.composer textarea{flex:1;min-height:40px;max-height:100px;resize:none}.attachBtn{width:38px;height:38px;border:1px solid #bbb;border-radius:50%;display:grid;place-items:center;font-size:25px}
.sendBtn,.primary{border:0;background:#07c160;color:#fff;border-radius:6px;padding:10px 16px}.secondary{border:1px solid #ccc;background:#fff;border-radius:6px;padding:9px 14px}.small{padding:6px 10px}
.modalCard,.centerCard{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#fff;width:min(92vw,380px);padding:22px;border-radius:10px;box-shadow:0 10px 40px #0002;z-index:10}
.modalCard input,.centerCard input,.panel input{display:block;width:100%;margin:9px 0}.centerCard{text-align:center}.logo{width:64px;height:64px;border-radius:14px;background:#07c160;color:white;display:grid;place-items:center;font-size:34px;margin:auto}
.muted{color:#888;font-size:14px}.error{color:#d33;font-size:13px;min-height:18px;margin-top:7px}.uploadStatus{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:#000b;color:#fff;padding:8px 12px;border-radius:18px;z-index:20;font-size:13px}
.adminPage{overflow:auto;background:#ededed}.adminMain{max-width:760px;margin:auto;padding:16px}.panel{background:#fff;border-radius:8px;padding:16px;margin-bottom:14px}.panel h2{margin:0 0 10px;font-size:18px}.panelHead{display:flex;align-items:center;justify-content:space-between}
.roomItem{border-top:1px solid #eee;padding:12px 0}.roomItem:first-child{border-top:0}.roomTitle{font-weight:600}.roomMeta{font-size:12px;color:#888;margin:4px 0 8px}.roomActions{display:flex;gap:6px;flex-wrap:wrap}.danger{border:0;background:#fa5151;color:#fff;border-radius:5px;padding:7px 10px}.copyBtn{border:1px solid #ccc;background:#fff;border-radius:5px;padding:7px 10px}
.mediaModal{position:fixed;inset:0;background:#000e;z-index:50;display:flex;align-items:center;justify-content:center;padding:20px}.mediaModal img,.mediaModal video{max-width:100%;max-height:90vh}.mediaClose{position:absolute;right:18px;top:18px;background:#0008;color:#fff;border:0;border-radius:50%;font-size:30px;width:44px;height:44px}
@media(max-width:700px){.nameInput{width:58px}.messages{padding-left:8px;padding-right:8px}.msgCol{max-width:80%}.topbar{height:52px}.messages{height:calc(100% - 52px - 62px - env(safe-area-inset-bottom))}}
