:root{
  --app-height:100dvh;
  --green:#07c160;
  --green-dark:#06ad56;
  --danger:#fa5151;
  --warn:#f5a623;
  --bg:#f2f2f2;
  --panel:#ffffff;
  --side:#f7f7f7;
  --line:#e4e4e4;
  --text:#1a1a1a;
  --muted:#8c8c8c;
  --faint:#b4b4b4;
  --bubble-self:#95ec69;
  --bubble-other:#ffffff;
  --bubble-self-text:#111111;
  --rail:#242424;
  --rail-text:#9d9d9d;
  --hover:#ececec;
  --active:#e4e4e4;
  --shadow:0 8px 30px rgba(0,0,0,.08);
  --radius:10px;
}
html[data-theme="dark"]{
  --bg:#111214;
  --panel:#191b1e;
  --side:#151719;
  --line:#2a2d31;
  --text:#e9e9e9;
  --muted:#9aa0a6;
  --faint:#6d7379;
  --bubble-self:#2f7d4f;
  --bubble-other:#26292d;
  --bubble-self-text:#f2fff6;
  --rail:#0c0d0e;
  --rail-text:#8b9095;
  --hover:#222529;
  --active:#2a2e33;
  --shadow:0 8px 30px rgba(0,0,0,.5);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden}
body{
  font-family:"PingFang SC","Microsoft YaHei UI","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;
  overflow:hidden;position:fixed;inset:0;width:100%;
}
button,input,textarea,select{font-family:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--green)}
.app-root{height:100%}
html.kb-open .app-root{height:var(--app-height,100%)}
.boot{display:grid;place-items:center;height:100%;color:var(--muted);font-size:14px}
.hidden{display:none !important}

/* ---------------- 认证页 ---------------- */
.auth-page{
  height:100%;display:flex;align-items:center;justify-content:center;
  background:
    radial-gradient(1000px 600px at 10% 0%,rgba(7,193,96,.18),transparent 60%),
    radial-gradient(900px 600px at 100% 100%,rgba(7,193,96,.12),transparent 55%),
    var(--bg);
  padding:24px;
}
.auth-card{
  width:100%;max-width:400px;background:var(--panel);border:1px solid var(--line);
  border-radius:18px;box-shadow:var(--shadow);padding:30px 28px 26px;
}
.auth-brand{display:flex;align-items:center;gap:11px;margin-bottom:6px}
.auth-logo{
  width:42px;height:42px;border-radius:13px;background:var(--green);color:#fff;
  display:grid;place-items:center;font-weight:700;font-size:19px;
}
.auth-brand h1{font-size:19px;font-weight:650;letter-spacing:.5px}
.auth-sub{font-size:12.5px;color:var(--muted);margin:8px 0 22px;line-height:1.6}
.auth-tabs{display:flex;background:var(--side);border-radius:10px;padding:3px;margin-bottom:20px}
.auth-tabs button{
  flex:1;border:0;background:transparent;height:34px;border-radius:8px;
  font-size:13.5px;color:var(--muted);
}
.auth-tabs button.on{background:var(--panel);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.08);font-weight:600}
.field{margin-bottom:13px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.field input{
  width:100%;height:42px;border:1px solid var(--line);background:var(--side);
  border-radius:9px;padding:0 12px;font-size:14px;outline:none;
}
.field input:focus{border-color:var(--green);background:var(--panel)}
.captcha-row{display:flex;gap:9px}
.captcha-row input{flex:1}
.captcha-row img{width:120px;height:42px;border-radius:9px;border:1px solid var(--line);cursor:pointer;background:#f6f8f6}
.btn{
  border:1px solid var(--line);background:var(--panel);border-radius:9px;height:38px;
  padding:0 15px;font-size:13.5px;display:inline-flex;align-items:center;justify-content:center;gap:6px;
}
.btn:hover{background:var(--hover)}
.btn.primary{background:var(--green);border-color:var(--green);color:#fff;font-weight:600}
.btn.primary:hover{background:var(--green-dark)}
.btn.danger{color:var(--danger);border-color:rgba(250,81,81,.35);background:transparent}
.btn.danger:hover{background:rgba(250,81,81,.08)}
.btn.block{width:100%;height:44px;font-size:15px;margin-top:6px}
.btn[disabled]{opacity:.55;cursor:not-allowed}
.auth-foot{font-size:11.5px;color:var(--faint);text-align:center;margin-top:16px;line-height:1.6}
.auth-error{
  font-size:12.5px;color:var(--danger);background:rgba(250,81,81,.08);
  border:1px solid rgba(250,81,81,.18);border-radius:8px;padding:8px 10px;margin-bottom:12px;
  white-space:pre-wrap;
}

/* ---------------- 主框架 ---------------- */
.shell{height:100%;display:flex;background:var(--panel)}
html.kb-open .shell{height:var(--app-height,100%)}
.shell.admin{background:var(--panel)}
.shell.user{flex-direction:column;width:100%}
.shell.user .chat-head{flex:none;width:100%}
.shell.user .stream{width:100%}
.shell.user .composer{width:100%}
.rail{
  width:66px;flex:none;background:var(--rail);display:flex;flex-direction:column;
  align-items:center;padding:20px 0 16px;gap:8px;
}
.rail .logo{
  width:36px;height:36px;border-radius:10px;background:var(--green);color:#fff;
  display:grid;place-items:center;font-weight:700;font-size:16px;margin-bottom:16px;
}
.rail button{
  width:44px;height:44px;border:0;background:transparent;border-radius:10px;
  display:grid;place-items:center;color:var(--rail-text);position:relative;
}
.rail button:hover{background:rgba(255,255,255,.07)}
.rail button.on{color:var(--green);background:rgba(7,193,96,.12)}
.rail button svg{width:22px;height:22px}
.rail .grow{flex:1}
.rail .badge{
  position:absolute;top:7px;right:6px;min-width:16px;height:16px;padding:0 4px;
  border-radius:8px;background:var(--danger);color:#fff;font-size:10px;display:grid;place-items:center;
}
.rail .me{
  width:34px;height:34px;border-radius:50%;background:var(--green);color:#fff;
  display:grid;place-items:center;font-size:14px;font-weight:600;cursor:pointer;
}

.side{
  width:332px;flex:none;background:var(--side);border-right:1px solid var(--line);
  display:flex;flex-direction:column;min-height:0;
}
.side-head{padding:16px 15px 10px;display:flex;align-items:center;gap:8px}
.side-head .title{font-size:17px;font-weight:650;flex:1}
.side-head .icon-btn{width:32px;height:32px;border-radius:8px;border:0;background:transparent;color:var(--muted);display:grid;place-items:center}
.side-head .icon-btn:hover{background:var(--hover)}
.side-head .icon-btn svg{width:19px;height:19px}
.side-search{padding:0 15px 8px}
.side-search input{
  width:100%;height:34px;border-radius:8px;border:1px solid transparent;background:var(--hover);
  padding:0 11px;font-size:13px;outline:none;
}
.side-search input:focus{background:var(--panel);border-color:var(--green)}
.side-tabs{display:flex;gap:6px;padding:4px 15px 8px}
.side-tabs button{
  border:1px solid var(--line);background:transparent;border-radius:14px;height:25px;
  padding:0 10px;font-size:11.5px;color:var(--muted);
}
.side-tabs button.on{background:var(--green);border-color:var(--green);color:#fff}
.user-list{flex:1;overflow-y:auto;padding:2px 0 8px}
.user-item{
  display:flex;gap:10px;padding:10px 14px;cursor:pointer;position:relative;align-items:center;
}
.user-item:hover{background:var(--hover)}
.user-item.on{background:var(--active)}
.user-item .avatar{width:43px;height:43px;flex:none}
.user-item .body{flex:1;min-width:0}
.user-item .row{display:flex;align-items:baseline;gap:6px}
.user-item .name{font-size:14px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-item .time{margin-left:auto;font-size:10.5px;color:var(--faint);flex:none}
.user-item .last{font-size:12px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-item .badge{
  position:absolute;right:14px;bottom:11px;min-width:17px;height:17px;border-radius:9px;
  background:var(--danger);color:#fff;font-size:10px;display:grid;place-items:center;padding:0 5px;
}
.user-item .dot-on{
  position:absolute;left:46px;top:40px;width:9px;height:9px;border-radius:50%;
  background:var(--green);border:2px solid var(--side);
}
.user-item .muted{color:var(--faint)}
.side-foot{border-top:1px solid var(--line);padding:10px 12px;display:flex;gap:7px;flex-wrap:wrap}
.side-foot .btn{height:30px;font-size:12px;padding:0 10px;border-radius:7px}
.empty-list{padding:26px 16px;text-align:center;color:var(--faint);font-size:12.5px;line-height:1.7}

.main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg)}
.chat-head{
  height:60px;flex:none;background:var(--panel);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:10px;padding:0 16px;
}
.chat-head .back{display:none;width:32px;height:32px;border:0;background:transparent;color:var(--text);font-size:20px}
.chat-head .peer{display:flex;flex-direction:column;min-width:0}
.chat-head .peer .name{font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-head .peer .sub{font-size:11px;color:var(--muted);margin-top:2px;display:flex;align-items:center;gap:5px}
.chat-head .grow{flex:1}
.chat-head .icon-btn{
  width:33px;height:33px;border:0;background:transparent;border-radius:8px;color:var(--muted);
  display:grid;place-items:center;position:relative;
}
.chat-head .icon-btn:hover{background:var(--hover)}
.chat-head .icon-btn svg{width:19px;height:19px}
.icon-btn .badge{
  position:absolute;top:-3px;right:-4px;min-width:16px;height:16px;padding:0 4px;
  border-radius:8px;background:var(--danger);color:#fff;font-size:10px;
  display:grid;place-items:center;line-height:1;border:2px solid var(--panel);
}
.mini-badge{
  min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--danger);
  color:#fff;font-size:10.5px;display:inline-grid;place-items:center;flex:none;
}
.chat-head .avatar{width:36px;height:36px}

.stream{
  flex:1;overflow-y:auto;padding:18px 18px 8px;display:flex;flex-direction:column;gap:14px;
  scroll-behavior:smooth;
}
.stream::-webkit-scrollbar{width:8px}
.stream::-webkit-scrollbar-thumb{background:rgba(120,120,120,.28);border-radius:4px}
.sys{text-align:center;font-size:11.5px;color:var(--faint);padding:2px 0}
.time-sep{text-align:center;margin:4px 0 2px}
.time-sep span{font-size:11px;color:var(--faint);background:rgba(0,0,0,.04);padding:2px 9px;border-radius:9px}
html[data-theme="dark"] .time-sep span{background:rgba(255,255,255,.06)}
.load-more{text-align:center;padding:4px 0 8px}
.load-more button{border:0;background:rgba(0,0,0,.04);color:var(--muted);font-size:11.5px;border-radius:12px;padding:4px 12px}
html[data-theme="dark"] .load-more button{background:rgba(255,255,255,.06)}

.msg{display:flex;gap:9px;align-items:flex-start;max-width:100%}
.msg.mine{flex-direction:row-reverse}
.avatar{
  width:38px;height:38px;border-radius:8px;flex:none;display:grid;place-items:center;
  color:#fff;font-size:14px;font-weight:600;user-select:none;background:#7a8b99;overflow:hidden;
}
.avatar img{width:100%;height:100%;object-fit:cover;display:block;border-radius:inherit}
.rail .me img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.av-0{background:#6f8faf}.av-1{background:#c98a6b}.av-2{background:#7fa87a}.av-3{background:#a58bc9}
.av-4{background:#c9a35b}.av-5{background:#6fa3a3}.av-6{background:#b57b8e}.av-7{background:#8b9a6f}
.msg .wrap{max-width:min(72%,560px);min-width:0}
.msg .bubble{
  position:relative;background:var(--bubble-other);border-radius:8px;padding:9px 12px;
  font-size:14.5px;line-height:1.55;word-break:break-word;box-shadow:0 1px 1px rgba(0,0,0,.03);
  white-space:pre-wrap;
}
.msg .bubble::before{
  content:"";position:absolute;top:12px;width:0;height:0;border:6px solid transparent;
}
.msg:not(.mine) .bubble::before{left:-11px;border-right-color:var(--bubble-other)}
.msg.mine .bubble{background:var(--bubble-self);color:var(--bubble-self-text)}
.msg.mine .bubble::before{right:-11px;border-left-color:var(--bubble-self)}
.msg .bubble a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.msg .bubble .quote{
  border-left:3px solid rgba(0,0,0,.16);background:rgba(0,0,0,.05);border-radius:3px;
  padding:5px 8px;margin-bottom:7px;max-width:100%;white-space:normal;
}
.msg .bubble .quote .qname{display:block;font-size:11px;color:var(--muted);margin-bottom:2px}
.msg .bubble .quote .qtext{display:block;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme="dark"] .quote{background:rgba(255,255,255,.08)}
.msg .meta{font-size:10.5px;color:var(--faint);margin-top:5px;display:flex;gap:6px;align-items:center;user-select:none}
.msg.mine .meta{justify-content:flex-end}
.msg .meta .ok{color:var(--green)}
.msg .meta .fail{color:var(--danger);cursor:pointer;font-weight:600}
.msg .meta .sending{color:var(--faint)}
.msg .tag{
  display:inline-block;font-size:10px;color:var(--muted);border:1px solid var(--line);
  border-radius:8px;padding:0 5px;margin-right:5px;vertical-align:1px;
}
.msg .bubble.img{padding:0;background:transparent;box-shadow:none}
.msg .bubble.img::before{display:none}
.msg .bubble.img img{
  display:block;max-width:min(320px,60vw);max-height:420px;border-radius:8px;cursor:zoom-in;
  background:var(--side);object-fit:cover;
}
.msg .bubble.video{padding:0;background:transparent;box-shadow:none;position:relative}
.msg .bubble.video::before{display:none}
.msg .bubble.video video{display:block;max-width:min(360px,66vw);max-height:440px;border-radius:8px;background:#000}
.video-save{
  position:absolute;top:8px;right:8px;z-index:3;display:inline-flex;align-items:center;gap:4px;
  padding:5px 9px;border-radius:14px;background:rgba(0,0,0,.58);color:#fff;
  font-size:12px;line-height:1;text-decoration:none;white-space:nowrap;
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
}
.video-save:active{background:rgba(0,0,0,.78)}
.voice-btn{
  display:flex;align-items:center;gap:8px;min-width:120px;border:0;background:transparent;
  padding:0;color:inherit;
}
.voice-btn svg{width:18px;height:18px;flex:none}
.voice-btn .wave{display:flex;align-items:center;gap:2px;flex:1;height:16px}
.voice-btn .wave i{display:block;width:2px;border-radius:1px;background:currentColor;opacity:.45}
.voice-btn.playing .wave i{animation:vw .9s ease-in-out infinite alternate}
.voice-btn .dur{font-size:12px;opacity:.72;min-width:24px;text-align:right}
@keyframes vw{from{transform:scaleY(.5)}to{transform:scaleY(1.15)}}
.msg .expired{font-size:12.5px;color:var(--muted);font-style:italic}

/* ---------------- 输入框 ---------------- */
.composer{
  flex:none;background:var(--panel);border-top:1px solid var(--line);
  padding:8px 14px calc(10px + env(safe-area-inset-bottom));
  position:relative;
}
.composer .quote-bar{
  display:flex;align-items:center;gap:8px;background:var(--side);border-radius:7px;
  padding:6px 9px;margin-bottom:6px;font-size:12px;color:var(--muted);
}
.composer .quote-bar .t{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.composer .quote-bar button{border:0;background:transparent;color:var(--faint);font-size:16px}
.composer .tools{display:flex;align-items:center;gap:2px;margin-bottom:3px}
.composer .tools button{
  width:32px;height:32px;border:0;background:transparent;border-radius:7px;
  display:grid;place-items:center;color:var(--muted);
}
.composer .tools button:hover{background:var(--hover)}
.composer .tools button svg{width:21px;height:21px}
.composer .row{display:flex;align-items:flex-end;gap:9px}
.composer textarea{
  flex:1;resize:none;border:0;background:transparent;outline:none;font-size:14.5px;
  line-height:1.5;padding:6px 2px;max-height:120px;min-height:38px;
}
.composer .send{
  height:34px;padding:0 17px;border-radius:7px;border:0;background:var(--green);color:#fff;
  font-size:13.5px;font-weight:600;flex:none;
}
.composer .send:hover{background:var(--green-dark)}
.composer .emoji-panel{
  position:absolute;left:12px;bottom:calc(100% - 6px);width:304px;max-width:calc(100vw - 24px);
  background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);
  padding:10px;z-index:30;
}
.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:2px;max-height:220px;overflow-y:auto}
.emoji-grid button{border:0;background:transparent;font-size:21px;height:33px;border-radius:6px;line-height:1}
.emoji-grid button:hover{background:var(--hover)}
.upload-status{font-size:11.5px;color:var(--muted);display:flex;align-items:center;gap:8px;margin-top:5px}
.upload-status progress{width:120px;height:5px;appearance:none;border:0;border-radius:3px;overflow:hidden}
.record-bar{
  display:flex;align-items:center;gap:9px;background:var(--side);border-radius:9px;
  padding:8px 12px;font-size:12.5px;color:var(--danger);margin-top:4px;
}
.record-bar .dot{width:8px;height:8px;border-radius:50%;background:var(--danger);animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.25}}

/* ---------------- 通用弹层 ---------------- */
.modal-mask{
  position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:80;
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.modal{
  width:100%;max-width:680px;max-height:88vh;overflow:auto;background:var(--panel);
  border-radius:14px;box-shadow:var(--shadow);border:1px solid var(--line);
}
.modal.small{max-width:440px}
.modal-head{
  position:sticky;top:0;background:var(--panel);z-index:2;display:flex;align-items:center;
  gap:10px;padding:15px 18px;border-bottom:1px solid var(--line);
}
.modal-head h3{font-size:15.5px;font-weight:650;flex:1}
.modal-head .x{border:0;background:transparent;font-size:22px;color:var(--faint);line-height:1}
.modal-body{padding:16px 18px 20px}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:0 18px 18px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-grid .full{grid-column:1/-1}
.form-grid label{display:block;font-size:11.5px;color:var(--muted);margin-bottom:5px}
.form-grid input,.form-grid select,.form-grid textarea{
  width:100%;border:1px solid var(--line);background:var(--side);border-radius:8px;
  padding:8px 10px;font-size:13px;outline:none;
}
.form-grid textarea{min-height:74px;resize:vertical}
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus{border-color:var(--green);background:var(--panel)}
.check{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--text)}
.check input{width:16px;height:16px;accent-color:var(--green)}
.hint{font-size:11.5px;color:var(--faint);line-height:1.6}
.kv{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;padding:5px 0;border-bottom:1px dashed var(--line)}
.kv b{font-weight:600}
.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:14px}
.card{background:var(--side);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.card .n{font-size:20px;font-weight:650;line-height:1.2}
.card .l{font-size:11px;color:var(--muted);margin-top:2px}
.tools-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px}
.tools-tabs button{
  border:1px solid var(--line);background:transparent;border-radius:15px;height:28px;padding:0 12px;font-size:12px;color:var(--muted)
}
.tools-tabs button.on{background:var(--green);border-color:var(--green);color:#fff}
.data-table{width:100%;border-collapse:collapse;font-size:12px}
.data-table th,.data-table td{border-bottom:1px solid var(--line);padding:7px 6px;text-align:left;vertical-align:top}
.data-table th{color:var(--muted);font-weight:500;font-size:11px}
.search-result{display:block;width:100%;text-align:left;border:1px solid var(--line);background:var(--side);border-radius:9px;padding:9px 11px;margin-bottom:7px}
.search-result:hover{border-color:var(--green)}
.search-result .t{font-size:13px;line-height:1.5}
.search-result .m{font-size:11px;color:var(--muted);margin-top:4px}
.notice{background:var(--side);border:1px solid var(--line);border-radius:8px;padding:9px 11px;font-size:12.5px;line-height:1.6}
.tpl-item{border:1px solid var(--line);border-radius:9px;padding:9px 10px;margin-bottom:8px;background:var(--side)}
.tpl-item .tpl-head{display:flex;align-items:center;justify-content:space-between;font-size:11.5px;color:var(--muted);margin-bottom:6px}
.tpl-item textarea{width:100%;min-height:54px;border:1px solid var(--line);border-radius:7px;padding:7px 9px;font-size:13px;background:var(--panel);resize:vertical;outline:none}
.tpl-item textarea:focus{border-color:var(--green)}

/* ---------------- 好友 ---------------- */
.drawer-mask{position:fixed;inset:0;background:rgba(0,0,0,.34);z-index:70}
.drawer{
  position:fixed;top:0;right:0;bottom:0;width:min(380px,92vw);background:var(--panel);
  z-index:71;display:flex;flex-direction:column;box-shadow:-10px 0 30px rgba(0,0,0,.15);
}
.drawer-head{display:flex;align-items:center;gap:10px;padding:15px 16px;border-bottom:1px solid var(--line)}
.drawer-head h3{font-size:15px;flex:1}
.drawer-body{flex:1;overflow-y:auto;padding:14px 16px}
.friend-item{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--line)}
.friend-item .grow{flex:1;min-width:0}
.friend-item .n{font-size:13.5px}
.friend-item .s{font-size:11px;color:var(--muted)}
.req{border:1px solid var(--line);border-radius:9px;padding:9px 11px;margin-bottom:8px}
.req .n{font-size:13px;margin-bottom:6px}
.req .a{display:flex;gap:6px}

/* ---------------- 其他 ---------------- */
.toast{
  position:fixed;left:50%;bottom:32px;transform:translateX(-50%);z-index:120;
  background:rgba(20,20,20,.9);color:#fff;font-size:12.5px;padding:9px 15px;border-radius:9px;
  max-width:86vw;text-align:center;line-height:1.5;
}
.lightbox{
  position:fixed;inset:0;z-index:130;background:rgba(0,0,0,.92);
  display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;padding:24px;
}
.lightbox[hidden]{display:none}
.toast[hidden]{display:none}
.lightbox img{max-width:94vw;max-height:84vh;object-fit:contain;border-radius:4px}
.lightbox .lb-close{position:absolute;top:16px;right:20px;border:0;background:transparent;color:#fff;font-size:34px;line-height:1}
.lightbox .lb-download{color:#fff;font-size:13px;border:1px solid rgba(255,255,255,.4);border-radius:16px;padding:6px 14px;text-decoration:none}
.offline-bar{
  position:fixed;top:0;left:0;right:0;z-index:110;background:var(--warn);color:#3b2a00;
  font-size:12px;text-align:center;padding:6px;display:none;
}
.offline-bar.show{display:block}
.pw-note{font-size:11.5px;color:var(--muted);margin-top:8px;line-height:1.6}
.copy-pw{font-family:Consolas,monospace;font-size:15px;letter-spacing:1px;background:var(--side);padding:8px 10px;border-radius:7px;display:block;margin:8px 0}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px){
  /* iOS 聚焦小于 16px 的输入框会自动放大页面，表现为输入框跑到顶部、底部留白 */
  input, textarea, select { font-size: 16px !important; }
  .composer textarea { font-size: 16px !important; }
  .side-search input { font-size: 16px !important; }
  .field input { font-size: 16px !important; }
  .rail{display:none}
  .shell.admin .side{width:100%;border-right:0}
  .shell.admin .main{display:none}
  .shell.admin.chat-open .side{display:none}
  .shell.admin.chat-open .main{display:flex}
  .chat-head .back{display:grid;place-items:center}
  .shell.user{max-width:none}
  .msg .wrap{max-width:78%}
  .side{width:100%}
  .modal{padding:0}
  .form-grid{grid-template-columns:1fr}
  .cards{grid-template-columns:1fr 1fr}
  .stream{padding:14px 12px 6px}
}
@media (min-width: 901px){
  .shell.user{
    max-width:880px;margin:0 auto;border-left:1px solid var(--line);border-right:1px solid var(--line);
    box-shadow:0 0 40px rgba(0,0,0,.06);
  }
  .shell.user .chat-head{height:64px}
}

/* 右键 / 长按菜单 */
.ctx-menu{
  position:fixed;z-index:140;min-width:132px;background:var(--panel);border:1px solid var(--line);
  border-radius:10px;box-shadow:var(--shadow);padding:5px;
}
.ctx-menu button{
  display:block;width:100%;text-align:left;border:0;background:transparent;color:var(--text);
  font-size:13px;padding:8px 11px;border-radius:6px;
}
.ctx-menu button:hover{background:var(--hover)}
.ctx-menu button.danger{color:var(--danger)}
.msg.flash .bubble{box-shadow:0 0 0 2px var(--green)}
.offline-bar{display:none}
.offline-bar.show{display:block}

