:root{
  --bg:#1b1c20; --side:#17181c; --chat:#202124; --line:#2b2d33;
  --text:#e7e8ea; --muted:#8b8f98; --accent:#5b8cff;
  --her-bubble:#e6f4d8; --her-text:#2c3a2a;
  --me-bubble:#ffffff; --me-text:#22252b;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden}
body{
  background:var(--bg); color:var(--text);
  font:14px/1.55 -apple-system,"Segoe UI","Microsoft YaHei",system-ui,sans-serif;
}
.hidden{display:none!important}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
img{display:block}

/* 登录 */
.login{position:fixed;inset:0;display:grid;place-items:center;
  background:radial-gradient(1200px 600px at 50% -10%, rgba(91,140,255,.18), transparent 60%), var(--bg)}
.login-card{width:320px;text-align:center;padding:32px 28px;border-radius:18px;
  background:rgba(255,255,255,.04);border:1px solid var(--line)}
.login-logo{width:84px;height:84px;margin:0 auto 12px;border-radius:22px}
.login-card h1{margin:0;font-size:22px;letter-spacing:2px}
.login-card .sub{margin:6px 0 20px;color:var(--muted);font-size:13px}
.login-card input{width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--line);
  background:#15161a;color:var(--text);font-size:18px;letter-spacing:8px;text-align:center;outline:none}
.login-card input:focus{border-color:var(--accent)}
.login-card button{width:100%;margin-top:12px;padding:12px;border-radius:12px;background:var(--accent);color:#fff;font-weight:600}
.err{color:#ff6b6b;font-size:12px;min-height:16px;margin:8px 0 0}

/* 主界面：整页固定，只有消息区滚动 */
.app{position:fixed;inset:0;display:grid;grid-template-columns:64px 300px minmax(0,1fr)}

/* 最左侧图标栏（像 QQ） */
.rail{background:#121316;border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;padding:10px 0;gap:6px}
.rail-btn{width:42px;height:42px;border-radius:12px;font-size:19px;color:#a7abb4;display:grid;place-items:center}
.rail-btn:hover{background:rgba(255,255,255,.06)}
.rail-btn.active{background:rgba(91,140,255,.18);color:#fff}
.rail-btn[data-rail="moments"]{opacity:.55}
.rail-grow{flex:1}

.side{background:var(--side);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.side-top{display:flex;align-items:center;gap:8px;padding:12px;flex:0 0 auto}
.my-avatar{width:36px;height:36px;border-radius:12px}
.search{flex:1;min-width:0}
.search input{width:100%;padding:8px 12px;border-radius:10px;border:1px solid transparent;background:#101114;color:var(--text);outline:none;font-size:13px}
.search input:focus{border-color:var(--line)}
.add{width:30px;height:30px;border-radius:9px;background:#101114;font-size:18px;color:var(--muted)}
.sessions{flex:1 1 auto;min-height:0;overflow-y:auto}
.session{display:flex;gap:10px;padding:11px 12px;cursor:pointer;border-left:3px solid transparent}
.session:hover{background:rgba(255,255,255,.03)}
.session.active{background:rgba(91,140,255,.12);border-left-color:var(--accent)}
.avatar{width:42px;height:42px;border-radius:13px;object-fit:cover;background:#2a2c33}
.avatar.big{width:44px;height:44px;border-radius:14px}
.meta{flex:1;min-width:0}
.row1{display:flex;justify-content:space-between;gap:8px}
.name{font-weight:600;font-size:14px}
.time{color:var(--muted);font-size:11px;white-space:nowrap}
.row2 .preview{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.side-bottom{padding:10px 14px;border-top:1px solid var(--line);font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;flex:0 0 auto}
.dot{width:8px;height:8px;border-radius:50%;background:#666;display:inline-block}
.dot.on{background:#3ecf8e;box-shadow:0 0 8px #3ecf8e88}

/* 聊天区：头部/消息/输入栏三段，输入栏永远在底部 */
.chat{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--chat);overflow:hidden}
.chat-head{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line);flex:0 0 auto;background:var(--chat);z-index:2}
.chat-head .title{flex:1;min-width:0}
.chat-head .name{display:flex;align-items:center;gap:6px}
.chat-head .sub{color:var(--muted);font-size:12px;margin-top:2px}
.head-actions{display:flex;gap:4px}
.head-actions button{width:34px;height:34px;border-radius:10px;color:var(--muted);font-size:16px}
.head-actions button:disabled{opacity:.35;cursor:default}
.head-actions button:not(:disabled):hover{background:rgba(255,255,255,.06)}

.msgs{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  padding:16px 18px 10px;display:flex;flex-direction:column;gap:12px}
.msg{display:flex;gap:10px;max-width:min(660px,76%);align-items:flex-start}
.msg.me{align-self:flex-end;flex-direction:row-reverse}
.msg .avatar{width:38px;height:38px;border-radius:12px;flex:0 0 auto}
.bubble{position:relative;padding:9px 13px;border-radius:14px;max-width:100%;word-break:break-word;white-space:pre-wrap;
  box-shadow:0 1px 1px rgba(0,0,0,.12)}

/* 她的气泡：浅绿色（QQ 那款） */
.msg.her .bubble{background:var(--her-bubble);color:var(--her-text);border:1px solid rgba(0,0,0,.05)}
.msg.her .bubble::before{
  content:"";position:absolute;left:-6px;top:12px;width:10px;height:10px;
  background:var(--her-bubble);transform:rotate(45deg);border-left:1px solid rgba(0,0,0,.05);border-bottom:1px solid rgba(0,0,0,.05)
}
/* 我的气泡：白色（QQ 那款） */
.msg.me .bubble{background:var(--me-bubble);color:var(--me-text);border:1px solid rgba(0,0,0,.06)}
.msg.me .bubble::before{
  content:"";position:absolute;right:-6px;top:12px;width:10px;height:10px;
  background:var(--me-bubble);transform:rotate(45deg);border-right:1px solid rgba(0,0,0,.06);border-top:1px solid rgba(0,0,0,.06)
}

.msg .meta-line{display:flex;gap:8px;align-items:center;margin-top:4px;font-size:11px;color:#8d939c}
.msg.her .meta-line{color:#7d8a78}
.msg .meta-line button{font-size:12px;opacity:.75}
.msg .meta-line button:hover{opacity:1}

/* 媒体限制尺寸，绝不撑破布局 */
.msg img.media{max-width:220px;max-height:220px;border-radius:10px;margin-top:2px;cursor:pointer;object-fit:contain}
.msg .file{display:flex;gap:8px;align-items:center;padding:8px 10px;border-radius:10px;background:rgba(0,0,0,.06);margin-top:4px;color:inherit;text-decoration:none}
.msg audio{max-width:230px;margin-top:2px}
.card{display:flex;gap:10px;margin-top:6px;padding:8px;border-radius:12px;background:rgba(0,0,0,.06);color:inherit;text-decoration:none;max-width:340px}
.card img{width:96px;height:60px;border-radius:8px;object-fit:cover;flex:0 0 auto}
.card .c-title{font-weight:600;font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card .c-desc{color:#7c838d;font-size:11px;margin-top:3px}
.msg.her .card{background:rgba(0,0,0,.05);color:#2c3a2a}
.voice-bubble{display:flex;align-items:center;gap:8px;min-width:80px}
.voice-play{width:25px;height:25px;border-radius:50%;background:rgba(0,0,0,.08);display:grid;place-items:center;cursor:pointer}
.voice-tr{display:block;margin-top:4px;font-size:11px;color:#7d8a78;text-decoration:underline;cursor:pointer;background:none;border:0;padding:0}
.voice-text{margin-top:6px;font-size:13px;line-height:1.5;color:#3f4a3c;background:rgba(0,0,0,.05);padding:6px 8px;border-radius:8px;white-space:pre-wrap}
.time-sep{text-align:center;color:var(--muted);font-size:11px;margin:6px 0}

/* 输入栏：工具栏一行、输入框一行（QQ 那样上下分开） */
.composer{position:relative;flex:0 0 auto;border-top:1px solid var(--line);padding:8px 14px 10px;
  background:var(--chat);z-index:2;display:flex;flex-direction:column;gap:6px}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px}
.tools{display:flex;gap:2px}
.tools button{width:34px;height:34px;border-radius:10px;font-size:17px;color:var(--muted)}
.tools button:hover{background:rgba(255,255,255,.06)}
.hist{width:34px;height:34px;border-radius:10px;font-size:16px;color:var(--muted)}
.hist:hover{background:rgba(255,255,255,.06)}
.input-row{display:flex;gap:8px;align-items:flex-end}
textarea#input{flex:1;min-width:120px;min-height:38px;max-height:120px;resize:none;padding:9px 12px;border-radius:12px;
  border:1px solid var(--line);background:#15161a;color:var(--text);outline:none;font:inherit}
textarea#input:focus{border-color:#3a3f4a}
.send{padding:9px 20px;border-radius:12px;background:var(--accent);color:#fff;font-weight:600;height:38px}
.send:disabled{opacity:.5}
.hint{flex-basis:100%;font-size:11px;color:var(--muted);min-height:12px}

/* 表情面板：贴输入栏上方，不挡输入 */
.sticker-panel{position:fixed;left:312px;bottom:78px;width:min(520px,70vw);max-height:320px;overflow-y:auto;
  background:#22242a;border:1px solid var(--line);border-radius:14px;padding:10px;display:grid;
  grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:6px;z-index:30;box-shadow:0 10px 40px #0008}
.sticker-panel img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:8px;cursor:pointer;background:#2a2c33}
.sticker-panel img:hover{outline:2px solid var(--accent)}

@media (max-width:760px){
  .app{grid-template-columns:1fr}
  .side{position:fixed;inset:0 auto 0 0;width:82vw;z-index:40;transform:translateX(-100%);transition:transform .2s}
  .side.open{transform:none;box-shadow:20px 0 60px #000a}
  .chat{grid-column:1}
  .msgs{padding:12px 10px 8px}
  .msg{max-width:88%}
  .sticker-panel{left:8px;right:8px;width:auto;bottom:74px}
}

/* 个人资料卡（仿 QQ） */
.profile-mask{position:fixed;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center;z-index:60}
.profile-card{width:340px;max-width:92vw;max-height:86vh;overflow-y:auto;background:#23262b;border:1px solid #33363d;border-radius:16px;padding:18px;color:#e7e8ea;box-shadow:0 20px 60px #000a}
.pc-head{display:flex;gap:12px;align-items:center}
.pc-avatar{width:72px;height:72px;border-radius:16px;object-fit:cover;cursor:pointer;background:#2a2c33}
.pc-name{font-size:18px;font-weight:600}
.pc-id{color:#8b8f98;font-size:12px;margin-top:2px}
.pc-sign{color:#b9bec7;font-size:12px;margin-top:4px;white-space:pre-wrap}
.pc-rows{margin-top:14px;border-top:1px solid #2e3138;padding-top:10px;display:flex;flex-direction:column;gap:6px}
.pc-row{display:flex;gap:10px;font-size:13px;color:#cfd3da}
.pc-k{width:52px;color:#8b8f98;flex:0 0 auto}
.pc-fields{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.pc-field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#9aa0aa}
.pc-field input,.pc-field textarea{width:100%;padding:8px 10px;border-radius:10px;border:1px solid #343842;background:#191b1f;color:#e7e8ea;outline:none;font:inherit}

/* 统一深色滚动条（和聊天背景一个色系） */
*{scrollbar-width:thin;scrollbar-color:#3a3d44 transparent}
*::-webkit-scrollbar{width:8px;height:8px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:#3a3d44;border-radius:4px}
*::-webkit-scrollbar-thumb:hover{background:#4a4e57}

/* 聊天记录面板 */
.hist-mask{position:fixed;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center;z-index:60}
.hist-card{width:min(680px,92vw);max-height:82vh;display:flex;flex-direction:column;background:#23262b;border:1px solid #33363d;border-radius:16px;overflow:hidden}
.hist-head{display:flex;gap:8px;padding:12px;border-bottom:1px solid #2e3138;align-items:center}
.hist-head input{flex:1;padding:8px 10px;border-radius:10px;border:1px solid #343842;background:#191b1f;color:#e7e8ea;outline:none;font:inherit}
.hist-list{overflow-y:auto;padding:8px 12px;display:flex;flex-direction:column;gap:8px}
.hist-item{display:flex;gap:8px;font-size:13px;border-bottom:1px solid #2a2d33;padding-bottom:6px}
.hist-item .who{color:#8b8f98;flex:0 0 34px}
.hist-item .when{color:#6d727b;flex:0 0 80px;font-size:11px}
.hist-item .what{flex:1;white-space:pre-wrap;word-break:break-word}
.pc-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.pc-btn{padding:8px 14px;border-radius:10px;background:#2e3138;color:#e7e8ea;cursor:pointer}
.pc-btn.primary{background:#5b8cff;color:#fff}
.pc-small{padding:6px 10px;border-radius:8px;background:#2e3138;font-size:12px;color:#b9bec7;cursor:pointer}

/* 聊天背景（调色盘） */
.chat{position:relative;background:var(--chat);background-image:var(--chat-bg,none);background-size:cover;background-position:center}
.chat::before{content:"";position:absolute;inset:0;background:rgba(27,28,32,.72);pointer-events:none;z-index:0}
.chat>*{position:relative;z-index:1}

/* 截图选择层 */
.shot-mask{position:fixed;inset:0;z-index:80;cursor:crosshair;background:#000}
.shot-mask canvas{position:absolute;inset:0;width:100%;height:100%}
.shot-tools{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;gap:8px;z-index:82}
.shot-tools button{padding:8px 16px;border-radius:10px;background:#2e3138;color:#fff;cursor:pointer;font-size:13px}
.shot-tools button.primary{background:#5b8cff}
.shot-tip{position:fixed;left:50%;top:18px;transform:translateX(-50%);color:#fff;font-size:13px;z-index:82;background:#000a;padding:6px 12px;border-radius:10px}

/* 设置 / 调色盘 面板 */
.panel-mask{position:fixed;inset:0;background:rgba(0,0,0,.55);display:grid;place-items:center;z-index:60}
.panel{width:380px;max-width:92vw;max-height:84vh;overflow-y:auto;background:#23262b;border:1px solid #33363d;border-radius:16px;padding:18px;color:#e7e8ea}
.panel h3{margin:0 0 12px;font-size:16px}
.panel .pl-row{display:flex;gap:8px;align-items:center;margin:10px 0;flex-wrap:wrap}
.panel .pl-row label{color:#9aa0aa;font-size:13px;width:64px;flex:0 0 auto}
.panel button{padding:8px 14px;border-radius:10px;background:#2e3138;color:#e7e8ea;cursor:pointer}
.panel button.primary{background:#5b8cff;color:#fff}
.bg-swatches{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.bg-swatch{width:64px;height:44px;border-radius:10px;border:2px solid transparent;background-size:cover;background-position:center;cursor:pointer;background-color:#2a2c33}
.bg-swatch.on{border-color:#5b8cff}

/* 空间说说 */
.panel.wide{width:min(560px,94vw)}
.moment-post{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.moment-post textarea{width:100%;min-height:64px;padding:8px 10px;border-radius:10px;border:1px solid #343842;background:#191b1f;color:#e7e8ea;outline:none;font:inherit;resize:vertical}
.moment-list{display:flex;flex-direction:column;gap:10px}
.moment-item{border-top:1px solid #2e3138;padding-top:10px}
.moment-head{display:flex;justify-content:space-between;color:#9aa0aa;font-size:12px}
.moment-text{margin:6px 0;white-space:pre-wrap;word-break:break-word}
.moment-media{max-width:100%;max-height:220px;border-radius:10px;margin-top:4px}
.moment-acts{display:flex;gap:12px;font-size:12px;color:#8b8f98;margin-top:6px}
.moment-acts button{font-size:12px;color:#8b8f98;cursor:pointer}
.moment-acts button.on{color:#ff6b8a}
.moment-comments{margin-top:6px;font-size:12px;color:#b9bec7;display:flex;flex-direction:column;gap:4px}
.moment-cmt-row{display:flex;gap:8px}
.moment-cmt-row b{color:#9ab0ff;font-weight:600}
.moment-cmt-input{display:flex;gap:6px;margin-top:6px}
.moment-cmt-input input{flex:1;padding:6px 8px;border-radius:8px;border:1px solid #343842;background:#191b1f;color:#e7e8ea;outline:none;font-size:12px}

/* 手机端：列表页 / 聊天页切换 + 底部四个 Tab（像 QQ 手机版） */
.mobile-tabs{display:none}
.mobile-tabs{position:fixed;left:0;right:0;bottom:0;height:56px;background:#17181c;border-top:1px solid var(--line);
  z-index:45;padding-bottom:env(safe-area-inset-bottom)}
.mobile-tabs button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:#8b8f98}
.mobile-tabs button .ico{font-size:19px;line-height:1}
.mobile-tabs button.on{color:#5b8cff}

@media (max-width:760px){
  .rail{display:none}
  .app{grid-template-columns:1fr}
  .side{position:static;width:auto;transform:none!important;display:flex;box-shadow:none}
  .chat{display:none}
  .app.chat-open .side{display:none}
  .app.chat-open .chat{display:flex}
  .mobile-tabs{display:flex}
  .msgs{padding-bottom:8px}
  .composer{padding-bottom:calc(10px + env(safe-area-inset-bottom))}
  .chat{padding-bottom:56px}
  /* 进了聊天页就藏掉底部 Tab（和 QQ 一样） */
  body.in-chat .mobile-tabs{display:none}
  body.in-chat .chat{padding-bottom:0}
  /* 聊天页顶栏：QQ 手机端是细长一条，没有大头像和大段签名 */
  .chat-head{padding:8px 10px;gap:6px;height:50px}
  .chat-head .avatar.big{display:none}
  .chat-head .sub{display:none}
  .chat-head .title{text-align:left}
  .chat-head .name{font-size:16px;justify-content:flex-start;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .head-actions button:not(:last-child){display:none}
}

/* 手机版资料页（仿 QQ 手机端） */
.mpage{position:fixed;inset:0;z-index:70;background:#111214;overflow-y:auto;display:flex;flex-direction:column}
.mpage-cover{height:160px;flex:0 0 auto;position:relative;
  background:radial-gradient(600px 220px at 70% 0%, rgba(91,140,255,.5), transparent 60%), linear-gradient(160deg,#2b3a6b,#1a1c26 70%)}
.mpage-back{position:absolute;left:10px;top:10px;width:36px;height:36px;border-radius:50%;background:#0007;color:#fff;font-size:24px;line-height:1;display:grid;place-items:center;cursor:pointer;z-index:3}
.mpage-body{flex:1;padding:0 16px 30px}
.mpage-avatar{width:86px;height:86px;border-radius:50%;border:3px solid #111214;object-fit:cover;background:#2a2c33;
  position:relative;z-index:2;margin-top:-43px;display:block}
.mpage-name{font-size:21px;font-weight:600;margin-top:8px}
.mpage-id{color:#8b8f98;font-size:12px;margin-top:2px}
.mpage-sign{margin-top:14px;font-size:14px;color:#d7dae0;white-space:pre-wrap}
.mpage-info{margin-top:10px;font-size:13px;color:#9aa0aa}
.mpage-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.mpage-tag{font-size:12px;color:#c9d1de;background:#262a31;border-radius:6px;padding:3px 8px}
.mpage-btns{display:flex;gap:8px;margin-top:24px;flex-wrap:wrap}
.mpage-btns button{flex:1;min-width:90px;padding:10px 12px;border-radius:10px;background:#2e3138;color:#e7e8ea;cursor:pointer}
.mpage-btns button.primary{background:#2f7cf6;color:#fff}

/* 空间页（整页，仿 QQ 空间） */
.space-page{position:fixed;inset:0;z-index:75;background:#111214;overflow-y:auto;display:flex;flex-direction:column}
.space-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;padding:12px 14px;
  background:#17181c;border-bottom:1px solid var(--line)}
.space-head h3{margin:0;font-size:16px}
.space-back{width:34px;height:34px;border-radius:50%;color:#e7e8ea;font-size:20px;line-height:1;display:grid;place-items:center;background:#0007;cursor:pointer}
.space-body{padding:14px 14px 30px;flex:1}
.space-page .moment-item{background:#1a1c20;border:1px solid #262a31;border-radius:12px;padding:12px;margin-bottom:10px}

/* 页面切换动画：从右侧滑入，退出滑回（不再像 PPT） */
.space-page,.compose-page,.mpage{transform:translateX(100%);opacity:0;
  transition:transform .28s cubic-bezier(.22,.9,.3,1),opacity .22s ease}
.space-page.show,.compose-page.show,.mpage.show{transform:none;opacity:1}
@media (max-width:760px){
  .app.chat-open .chat{animation:slideInChat .22s ease}
  @keyframes slideInChat{from{transform:translateX(8%);opacity:.7}to{transform:none;opacity:1}}
}

/* 空间主页头 / 功能格 / 发说说 */
.space-title{flex:1;font-size:16px;font-weight:600;text-align:center}
.space-compose-btn{background:#2f7cf6;color:#fff;border-radius:16px;padding:6px 12px;font-size:12px;cursor:pointer}
.space-prof{display:flex;gap:12px;align-items:center;padding:6px 4px 14px}
.space-avatar{width:64px;height:64px;border-radius:50%;border:2px solid #2a2d33;object-fit:cover;background:#2a2c33}
.space-pname{font-size:18px;font-weight:600}
.space-psum{color:#8b8f98;font-size:12px;margin-top:2px}
.space-grid{display:flex;justify-content:space-between;background:#1a1c20;border-radius:12px;padding:12px 6px;margin-bottom:10px}
.space-grid-item{flex:1;text-align:center;color:#9aa0aa;font-size:11px;cursor:pointer}
.space-grid-ico{font-size:20px;margin-bottom:4px}
.space-grid-item.on{color:#fff}
.space-share{display:flex;align-items:center;padding:10px 12px;background:#1a1c20;border-radius:10px;color:#7f858f;font-size:13px;margin-bottom:12px;cursor:pointer}
.compose-page{position:fixed;inset:0;z-index:80;background:#111214;display:flex;flex-direction:column}
.compose-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:#17181c;border-bottom:1px solid var(--line)}
.compose-head button{padding:6px 12px;border-radius:8px;background:#2e3138;color:#e7e8ea;cursor:pointer}
.compose-head button.primary{background:#2f7cf6;color:#fff}
.compose-body{padding:14px;display:flex;flex-direction:column;gap:10px}
.compose-text{width:100%;min-height:160px;background:transparent;border:0;outline:none;color:#e7e8ea;font:inherit;font-size:15px;resize:none}
.compose-row{display:flex;gap:8px}
.compose-row button{background:#262a31;border-radius:8px;padding:6px 10px;color:#c9d1de;font-size:12px;cursor:pointer}
.moment-head{display:flex;gap:8px;align-items:center}
.moment-avatar{width:34px;height:34px;border-radius:50%;object-fit:cover;background:#2a2c33}
.moment-who{display:flex;flex-direction:column}
.moment-name{font-size:13px;font-weight:600;color:#cfd3da}
.moment-time{font-size:11px;color:#7f858f;margin-top:2px}
.space-page .moment-post textarea{background:#1a1c20}

/* 图片大图 */
.lightbox{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.92);display:grid;place-items:center;cursor:zoom-out}
.lightbox img{max-width:94vw;max-height:92vh;object-fit:contain;border-radius:6px}

/* 视频播放 */
.msg video.media{max-width:280px;max-height:240px;border-radius:10px;margin-top:2px;background:#000}

/* 未读红点 */
.unread{min-width:18px;height:18px;border-radius:9px;background:#ff4d4f;color:#fff;font-size:11px;
  display:inline-grid;place-items:center;padding:0 5px;margin-left:6px}

/* 引用 */
.quote-bar{display:flex;align-items:center;gap:8px;padding:6px 10px;margin-bottom:6px;border-left:3px solid #5b8cff;
  background:rgba(91,140,255,.12);border-radius:8px;font-size:12px;color:#b9c6e6;white-space:pre-wrap}
.quote-bar button{margin-left:auto;color:#8b8f98;cursor:pointer}
.msg .quote-block{border-left:3px solid rgba(0,0,0,.15);padding:2px 8px;margin-bottom:4px;font-size:12px;opacity:.75;white-space:pre-wrap}
.msg.her .quote-block{border-left-color:rgba(0,0,0,.2)}
.recalled{opacity:.6;font-style:italic}

/* 空间四个 Tab 的内容 */
.space-tabbar{display:flex;gap:6px;margin:4px 0 10px}
.space-tabbar button{flex:1;padding:6px 0;border-radius:8px;background:#1a1c20;color:#9aa0aa;font-size:12px;cursor:pointer}
.space-tabbar button.on{background:#2f7cf6;color:#fff}
.album-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.album-grid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;cursor:zoom-in}
.log-item{background:#1a1c20;border-radius:10px;padding:10px;margin-bottom:8px;font-size:13px;white-space:pre-wrap;color:#cfd3da}
.log-date{color:#7f858f;font-size:11px;margin-bottom:4px}
.gb-input{display:flex;gap:6px;margin-bottom:10px}
.gb-input input{flex:1;padding:8px 10px;border-radius:8px;border:1px solid #343842;background:#191b1f;color:#e7e8ea;outline:none}
.gb-item{background:#1a1c20;border-radius:10px;padding:8px 10px;margin-bottom:6px;font-size:13px}
.gb-item b{color:#9ab0ff;font-weight:600}

/* 发送失败的消息（网络差时标红） */
.msg.failed .bubble{outline:2px solid #ff4d4f}
.msg.failed .meta-line::after{content:"  发送失败";color:#ff6b6b}

/* 表情包：不要气泡，直接一张图（QQ 那样） */
.msg .bubble.bare{background:transparent!important;border:0!important;box-shadow:none!important;padding:0}
.msg .bubble.bare::before{display:none!important}
.msg img.media.sticker{max-width:150px;max-height:150px;border-radius:8px;margin:0}

/* 文件卡片（预览 / 下载） */
.file-card{min-width:180px}
.file-name{font-size:13px;margin-bottom:6px;word-break:break-all}
.file-btns{display:flex;gap:6px}
.file-btn{display:inline-block;padding:5px 12px;border-radius:8px;background:rgba(0,0,0,.08);color:inherit;font-size:12px;cursor:pointer;text-decoration:none}
.file-btn.primary{background:#2f7cf6;color:#fff}
.text-viewer{white-space:pre-wrap;word-break:break-word;max-height:60vh;overflow-y:auto;background:#191b1f;border:1px solid #343842;border-radius:10px;padding:10px;font-size:13px;line-height:1.55;color:#d7dae0}
