/* 截图参考外观：保留原有组件和业务接口 */
:root {
  --bg:#f2f4f6; --panel:#fff; --panel2:#f1f2f4; --line:#e8eaec; --text:#101318; --muted:#8a96a2;
  --accent:#40a2d7; --accent-ink:#fff; --danger:#ed5668; --bubble:#fff; --bubble-me:#efffda; --bubble-me-text:#17251b;
  --selected:#40a2d7; --wall:#8ebc8f; --wall-lines:.45; --shadow:0 12px 45px #172c3926; color-scheme:light;
}
:root[data-theme="dark"] {
  --bg:#111b24; --panel:#17232d; --panel2:#213240; --line:#13212c; --text:#f3f6f8; --muted:#7c94a6;
  --accent:#48a9e0; --accent-ink:#fff; --bubble:#192b39; --bubble-me:#2c5779; --bubble-me-text:#fff;
  --selected:#2d5679; --wall:#15222b; --wall-lines:.36; --shadow:0 12px 45px #0005; color-scheme:dark;
}
body { font-family:Arial,"Microsoft YaHei","PingFang SC",sans-serif; font-size:14px; }
button, input, textarea { -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:not-allowed; }
.app { grid-template-columns:64px 252px minmax(0,1fr); }
.app.rail-collapsed { grid-template-columns:0 316px minmax(0,1fr); }
.rail-collapsed .rail { overflow:hidden; visibility:hidden; }
.rail { padding:12px 3px; gap:10px; }
.rail-me { order:5; margin: auto 0 10px; }
.rail-btn { width:56px; border-radius:11px; padding:8px 0 5px; gap:4px; }
.rail-btn .icon { width:20px; height:20px; }
.rail-btn.active { background:var(--accent); color:#fff; }
.rail-label { font-size:11px; }
.list-head { padding:0 12px; min-height:60px; gap:14px; }
.list-head .btn { flex-shrink:0; }
.list-search { display:flex; align-items:center; gap:8px; min-width:0; flex:1; color:var(--muted); }
.list-search .icon { width:17px; height:17px; flex-shrink:0; }
.list-search input { border:0; background:transparent; outline:none; min-width:0; width:100%; padding:10px 0; font-size:13px; }
.list-search:focus-within { color:var(--accent); }
.list-body { padding-bottom:0; scrollbar-width:thin; }
.item { padding:9px 10px; gap:11px; min-height:72px; }
.item.active, button.item.active:hover { background:var(--selected); color:#fff; box-shadow:none; }
.item.active .preview,.item.active time { color:#fff; }
.item.active .badge { background:#ffffff26; color:#fff; }
.item-top { margin-bottom:4px; }
.item-top strong { font-size:14px; }
.item-top time { font-size:11px; }
.item-sub .preview { line-height:19px; }
.badge { background:#98a5b4; font-size:11px; min-width:19px; height:19px; }
.rail-btn .badge { background:#ef5467; border:1px solid var(--panel); }
.avatar { width:54px; height:54px; font-size:20px; font-weight:500; }
.avatar.group { border-radius:50%; }
.avatar.small { width:44px; height:44px; border-radius:11px; font-size:17px; }
.dot { width:14px; height:14px; right:0; bottom:0; }
.dot.on { background:#45c45c; }
.chat-head { height:56px; min-height:56px; padding:5px 12px 5px 14px; gap:12px; border-bottom:0; }
.chat-head>.avatar { width:46px; height:46px; border-radius:11px; }
.chat-title { gap:3px; }
.chat-title .muted { font-size:12px; }
.chat-title .presence-online { color:#3fc466; }
.chat-actions { display:flex; align-items:center; gap:3px; }
.chat-actions .icon { width:19px; height:19px; }
.btn.icon-btn { padding:7px; border-radius:8px; }
.btn.icon-btn:disabled { opacity:.45; }
.chat-workspace { display:flex; flex:1; min-height:0; min-width:0; }
.chat-thread { display:flex; flex-direction:column; min-height:0; min-width:0; flex:1; background:var(--wall); }
.msgs { isolation:isolate; position:relative; padding:20px 28px; background-image:linear-gradient(130deg,#afce8d33,#6aa29833),url('/wallpaper.svg'); background-size:auto,420px 420px; scrollbar-width:thin; }
[data-theme="dark"] .msgs { background-image:linear-gradient(#10202b18,#0c192230),url('/wallpaper.svg'); }
.msg { gap:10px; margin:14px 0 20px; }
.msg-body { max-width:min(78%,560px); }
.msg-name { color:#426356; margin-bottom:5px; }
[data-theme="dark"] .msg-name { color:#8dacc0; }
.bubble { padding:12px 14px; border-radius:13px 13px 13px 3px; font-size:14px; line-height:1.6; box-shadow:0 1px 2px #18382812; }
.msg.mine .bubble { border-radius:13px 4px 13px 13px; }
.msg-time { font-size:11px; color:#526c65; margin:4px 2px 0; }
[data-theme="dark"] .msg-time { color:#7b98aa; }
.sys { color:#fff; background:#314d4538; width:fit-content; padding:3px 12px; border-radius:15px; font-size:12px; margin:12px auto 22px; }
.more { background:#ffffffd9; color:#3e7564; border-radius:20px; }
[data-theme="dark"] .more { background:#243947; color:#a8c0d1; }
.composer { min-height:54px; padding:9px 12px calc(9px + env(safe-area-inset-bottom)); align-items:center; border-top:0; gap:2px; }
.composer-input { background:transparent; border:0; border-radius:0; padding:6px; font-size:14px; line-height:22px; }
.composer-input:focus { outline:none; }
.composer-input::placeholder { color:var(--muted); }
.composer .send { width:32px; height:32px; background:none; color:var(--muted); border-radius:8px; }
.composer .send:hover { background:var(--panel2); color:var(--accent); }
.composer .icon { width:19px; height:19px; }
.composer .attach-image { display:none; }
.emoji-toggle[aria-expanded="true"] { background:var(--panel2); color:var(--accent); }
.emoji-panel { width:340px; min-width:280px; background:var(--panel); display:flex; flex-direction:column; border-left:1px solid var(--line); }
.emoji-head { height:53px; min-height:53px; display:flex; align-items:center; justify-content:center; position:relative; border-bottom:1px solid var(--line); color:var(--accent); }
.emoji-head strong { height:100%; display:grid; place-items:center; border-bottom:2px solid var(--accent); padding:0 7px; }
.emoji-head button { position:absolute; right:10px; }
.emoji-head .icon { width:17px; height:17px; }
.emoji-search { display:flex; align-items:center; gap:7px; margin:14px 12px 8px; padding:6px 12px; border-radius:30px; background:var(--panel2); color:var(--muted); }
.emoji-search .icon { width:16px; height:16px; }
.emoji-search input { width:100%; min-width:0; border:0; outline:0; background:transparent; font-size:13px; }
.emoji-content { flex:1; overflow:auto; padding:0 12px 16px; scrollbar-width:thin; }
.emoji-content h4 { color:var(--muted); font-size:12px; font-weight:400; margin:16px 0 8px; }
.emoji-content section:first-child h4 { display:none; }
.emoji-grid { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); }
.emoji-char { background:transparent; border:0; padding:7px 0; min-height:39px; font-size:23px; border-radius:7px; line-height:1; font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif; }
.emoji-char:hover { background:var(--panel2); }
.menu-row { display:flex; align-items:center; gap:14px; background:none; border:0; padding:10px 8px; text-align:left; border-radius:8px; }
.menu-row:hover { background:var(--panel2); }
.menu-row .icon { color:var(--muted); }
.search-results { max-height:50vh; overflow:auto; }
.search-result { padding:13px 0; border-bottom:1px solid var(--line); }
.search-result p { white-space:pre-wrap; overflow-wrap:anywhere; }
.placeholder { background:var(--panel); padding:28px 40px; border-radius:20px; }
.placeholder img { opacity:.9; filter:none; }
.auth { background:#fff; color:#101116; position:relative; padding:74px 24px 32px; display:flex; align-items:center; justify-content:center; }
.auth-card { background:none; border:0; box-shadow:none; width:min(410px,100%); padding:0; border-radius:0; }
.auth-top { position:absolute; top:28px; left:32px; right:32px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.auth-status { font-size:12px; color:#7b8290; display:flex; align-items:center; gap:7px; }
.auth-status:before { content:''; width:7px; height:7px; background:#39c464; border-radius:50%; }
.language-pill { background:#f1f2f4; color:#26282c; border:0; padding:9px 16px; border-radius:28px; display:flex; align-items:center; gap:8px; font-size:13px; }
.auth-logo { width:100px; height:100px; border-radius:26px; }
.auth-card h1 { color:#0c0d10; font-size:32px; font-weight:750; margin:20px 0 26px; letter-spacing:2px; }
.auth-description { font-size:12px; color:#8c939e; margin-top:-12px; }
.auth-form { margin-top:26px; }
.auth-field { display:flex; align-items:center; gap:14px; background:#f1f2f5; border-radius:20px; padding:0 20px; margin-bottom:18px; min-height:68px; color:#9ba2ae; }
.auth-field:focus-within { box-shadow:0 0 0 2px #42cfd138; }
.auth-field>.icon { width:24px; height:24px; flex-shrink:0; }
.auth-field .input { background:none; color:#13151b; border:0; padding:16px 0; font-size:18px; outline:none; box-shadow:none; }
.auth-field .input::placeholder { color:#9ba2ae; }
.auth-field button { border:0; background:none; padding:0; color:#9ba2ae; display:flex; }
.auth-form .btn.primary { background:#0b0c10; color:#fff; border-radius:20px; padding:18px; font-size:21px; margin-top:18px; }
.auth-switch { margin:26px 0 14px; color:#848a95; font-size:16px; }
.auth-switch .btn { color:#101116; font-weight:700; font-size:17px; }
.auth .notice { color:#646e7b; background:#f1f2f5; }
.auth-policy-note { color:#9aa0a9; font-size:12px; margin-top:18px; }
.auth-first { font-size:12px; line-height:1.7; color:#7a8491; margin-bottom:18px; }
.avatar.brand-avatar { background:transparent!important; }
.avatar.brand-avatar img { width:100%; height:100%; border-radius:inherit; }
@media(min-width:761px) and (max-width:1080px) { .app { grid-template-columns:58px 250px minmax(0,1fr); } .emoji-panel { width:300px; min-width:280px; } .msgs { padding:16px; } .chat-actions { gap:0; } }
@media(max-width:760px) {
  .app,.app.rail-collapsed { display:flex; }
  .rail,.rail-collapsed .rail { visibility:visible; overflow:visible; flex-direction:row; padding:5px 4px calc(5px + env(safe-area-inset-bottom)); gap:0; }
  .rail-me { display:none; }
  .rail-btn { width:64px; padding:5px; }
  .rail-btn.active { background:none; color:var(--accent); }
  .rail-label { font-size:11px; }
  .list-head { min-height:59px; }
  .list-search { background:var(--panel2); border-radius:20px; padding:0 12px; }
  .item { padding:10px 15px; min-height:76px; gap:13px; }
  .chat-head { padding:7px 10px; gap:8px; min-height:58px; height:58px; }
  .chat-head>.avatar { display:none; }
  .chat-title { align-items:center; }
  .chat-actions .call-placeholder,.chat-actions .layout-action { display:none; }
  .chat-actions .icon { width:20px; height:20px; }
  .chat-workspace { flex-direction:column; }
  .msgs { padding:14px 12px; background-size:auto,360px 360px; }
  .msg { margin-bottom:16px; gap:8px; }
  .msg-body { max-width:calc(100% - 62px); }
  .avatar.small { width:39px; height:39px; border-radius:10px; font-size:15px; }
  .bubble { padding:10px 12px; font-size:15px; }
  .composer { padding:8px 8px calc(8px + env(safe-area-inset-bottom)); gap:3px; min-height:58px; }
  .composer-input { background:var(--panel2); border-radius:24px; padding:8px 12px; margin:0; }
  .emoji-panel { width:100%; min-width:0; height:290px; flex:0 0 290px; border-top:1px solid var(--line); border-left:0; }
  .emoji-head { min-height:38px; height:38px; }
  .emoji-search { margin:8px 12px 0; }
  .emoji-content { padding-top:5px; }
  .emoji-char { font-size:25px; padding:8px 0; }
  .auth { align-items:flex-start; padding:132px 38px 35px; }
  .auth-top { top:34px; left:24px; right:24px; }
  .auth-logo { width:88px; height:88px; border-radius:23px; }
  .auth-card h1 { font-size:29px; margin:22px 0 28px; }
  .auth-form { margin-top:22px; }
  .auth-field { min-height:66px; border-radius:20px; margin-bottom:16px; gap:14px; }
  .auth-field .input { font-size:17px; }
  .auth-form .btn.primary { margin-top:14px; padding:15px; font-size:20px; border-radius:19px; }
  .auth-switch { margin-top:26px; font-size:14px; }
  .auth-switch .btn { font-size:15px; }
  .auth-status { font-size:12px; }
}
@media(max-width:360px) { .auth { padding-left:24px; padding-right:24px; } .chat-actions .search-action { display:none; } }
