/* Social 2.0 — realtime chat */
.chat-view-v2{max-width:1180px;height:calc(100dvh - 92px);margin:24px auto;padding:0 24px;display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px}
.chat-sidebar-v2,.chat-main-v2{min-height:0;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:0 8px 25px rgba(20,35,80,.035);overflow:hidden}
.chat-sidebar-v2{display:flex;flex-direction:column}
.chat-sidebar-head-v2{padding:18px 16px 12px;border-bottom:1px solid var(--line)}
.chat-sidebar-head-v2 strong{font-size:15px}.chat-sidebar-head-v2 p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.45}
.chat-rooms-v2{padding:9px;overflow:auto}
.chat-room-v2{position:relative;width:100%;min-height:58px;padding:9px 10px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:9px;border:0;border-radius:13px;background:transparent;text-align:left;color:var(--text)}
.chat-room-v2:hover,.chat-room-v2.active{background:#eef3ff;color:var(--blue)}
.chat-room-icon-v2{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#f1f4fa;font-size:17px}
.chat-room-v2>span:nth-child(2){min-width:0;display:grid;gap:2px}
.chat-room-v2 strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-room-v2 small{color:var(--muted);font-size:11px}
.chat-room-v2>b{min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:var(--blue-2);color:#fff;font-size:10px}

.chat-main-v2{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}
.chat-head-v2{padding:14px 17px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}
.chat-head-v2>div{display:grid;gap:3px}
.chat-head-v2 strong{font-size:15px}
.chat-head-v2 small{color:var(--muted);font-size:12px}
.chat-history-tools-v2{padding:8px 12px;display:flex;align-items:center;gap:9px;border-bottom:1px solid var(--line);background:#fff}
.chat-history-search-v2{min-width:180px;flex:1;display:flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid var(--line);border-radius:12px;background:#f8faff;color:var(--muted)}
.chat-history-search-v2:focus-within{border-color:#9bb3ff;box-shadow:0 0 0 3px rgba(26,100,255,.08)}
.chat-history-search-v2 input{min-width:0;width:100%;border:0;background:transparent;outline:0;color:var(--text);font:inherit;font-size:12px}
.chat-history-tools-v2>small{color:var(--muted);font-size:11px;white-space:nowrap}
.chat-history-tools-v2>button{padding:7px 10px;border:1px solid #f0b8b8;border-radius:10px;background:#fff7f7;color:#b42318;font-size:11px;font-weight:700;cursor:pointer;white-space:nowrap}
.chat-messages-v2{padding:18px;overflow:auto;background:linear-gradient(180deg,#fbfcff,#f7f9fd)}
.chat-message-v2{margin:0 0 13px;display:flex;align-items:flex-start;gap:8px}
.chat-message-v2.mine{justify-content:flex-end}
.chat-message-v2.mentioned-v2 .chat-bubble-v2{border-color:#9eb5ff;box-shadow:0 0 0 3px rgba(26,100,255,.07),0 5px 18px rgba(20,35,80,.06)}
.chat-avatar-v2{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border-radius:50%;overflow:hidden;background:#dfe8ff;color:var(--blue);font-size:10px;font-weight:800}
.chat-avatar-v2 img{width:100%;height:100%;display:block;object-fit:cover}
.chat-message-content-v2{max-width:min(72%,560px);display:grid;gap:3px}
.chat-message-content-v2>strong{font-size:12px}
.chat-message-content-v2>small{color:var(--muted);font-size:11px}
.chat-message-v2.mine .chat-message-content-v2>small{text-align:right}
.chat-bubble-wrap-v2{position:relative;display:flex;align-items:center;gap:6px}
.chat-bubble-wrap-v2:has(.chat-reaction-summary-v2:not([hidden])){margin-bottom:11px}
.chat-message-v2.mine .chat-bubble-wrap-v2{flex-direction:row-reverse}
.chat-bubble-v2{min-width:42px;padding:10px 12px;border-radius:5px 15px 15px 15px;background:#fff;border:1px solid var(--line);box-shadow:0 3px 12px rgba(20,35,80,.035)}
.chat-message-v2.mine .chat-bubble-v2{border-color:transparent;border-radius:15px 5px 15px 15px;background:linear-gradient(135deg,var(--blue),var(--blue-2));color:#fff}
.chat-bubble-v2 p{margin:0;font-size:14px;line-height:1.6;word-break:break-word}
.chat-bubble-v2 img{display:block;width:min(340px,100%);max-height:340px;margin-top:6px;border-radius:10px;object-fit:cover}
.private-image-placeholder-v2{display:flex;align-items:center;justify-content:center;min-height:180px;min-width:120px;max-width:100%;padding:16px;background:#eef1f8;color:#526080;text-align:center;font-size:13px;border-radius:10px;text-decoration:none}
.chat-mention-v2{display:inline-block;padding:0 3px;border-radius:5px;background:#e8efff;color:#153cb7;font-weight:800}
.chat-message-v2.mine .chat-mention-v2{background:rgba(255,255,255,.2);color:#fff}
.chat-mention-v2.for-me{box-shadow:inset 0 0 0 1px rgba(26,100,255,.25)}
.chat-message-v2.mine .chat-mention-v2.for-me{box-shadow:inset 0 0 0 1px rgba(255,255,255,.32)}

.chat-message-actions-v2{position:relative;opacity:0;transform:scale(.94);transition:.14s opacity,.14s transform}
.chat-message-v2:hover .chat-message-actions-v2,.chat-message-actions-v2:focus-within,.chat-message-v2.reaction-open-v2 .chat-message-actions-v2{opacity:1;transform:none}
.chat-message-actions-v2>button{width:29px;height:29px;padding:0;border:1px solid var(--line);border-radius:50%;display:grid;place-items:center;background:#fff;color:var(--text);font-size:14px;box-shadow:0 5px 14px rgba(20,35,80,.08)}
.chat-message-reaction-picker-v2{position:absolute;z-index:40;left:34px;top:50%;transform:translateY(-50%);padding:6px;display:flex;gap:2px;border:1px solid var(--line);border-radius:999px;background:#fff;box-shadow:0 12px 30px rgba(18,35,84,.14)}
.chat-message-v2.mine .chat-message-reaction-picker-v2{left:auto;right:34px}
.chat-message-reaction-picker-v2[hidden]{display:none!important}
.chat-message-reaction-picker-v2 button{width:32px;height:32px;padding:0;border:0;border-radius:50%;background:transparent;font-size:18px;transition:.12s transform,.12s background}
.chat-message-reaction-picker-v2 button:hover{background:#f2f5fb;transform:translateY(-2px) scale(1.13)}
.chat-reaction-summary-v2{position:absolute;z-index:8;left:12px;bottom:-12px;display:flex;flex-wrap:wrap;gap:3px;margin:0}
.chat-message-v2.mine .chat-reaction-summary-v2{left:auto;right:12px;justify-content:flex-end}
.chat-reaction-summary-v2[hidden]{display:none!important}
.chat-reaction-chip-v2{min-width:28px;height:24px;padding:0 7px;display:flex;align-items:center;justify-content:center;gap:3px;border:1px solid #d7dce7;border-radius:999px;background:#fff;color:var(--text);font-size:13px;box-shadow:0 3px 10px rgba(20,35,80,.12);cursor:pointer}
.chat-reaction-chip-v2 b{font-size:10px;color:var(--muted)}
.chat-reaction-chip-v2.active{border-color:#9eb5ff;background:#edf3ff;color:var(--blue)}

.chat-unread-divider-v2{margin:11px 0 16px;display:flex;align-items:center;gap:9px;color:var(--blue-2);font-size:11px;font-weight:800;letter-spacing:.01em}
.chat-unread-divider-v2::before,.chat-unread-divider-v2::after{content:"";height:1px;flex:1;background:linear-gradient(90deg,transparent,#b9c9ff)}
.chat-unread-divider-v2::after{background:linear-gradient(90deg,#b9c9ff,transparent)}
.chat-unread-divider-v2 span{padding:4px 9px;border:1px solid #cbd7ff;border-radius:999px;background:#f5f8ff;white-space:nowrap}
.chat-jump-latest-v2{position:absolute;z-index:55;right:18px;bottom:calc(100% + 10px);min-height:34px;padding:0 13px;border:1px solid #c7d3fa;border-radius:999px;background:#fff;color:var(--blue);font-size:11px;font-weight:800;box-shadow:0 8px 24px rgba(20,35,80,.14);cursor:pointer}
.chat-jump-latest-v2:hover{border-color:#9fb4f6;background:#eef3ff}

.chat-form-v2{position:relative;padding:10px 14px 12px;border-top:1px solid var(--line);background:#fff}
.chat-compose-row-v2{display:grid;grid-template-columns:40px 40px minmax(0,1fr) auto;align-items:end;gap:7px}
.chat-tool-btn-v2{width:40px;height:40px;padding:0;border:1px solid var(--line);border-radius:12px;display:grid;place-items:center;background:#f8faff;color:#536079;font-size:17px;cursor:pointer;user-select:none}
.chat-tool-btn-v2:hover{border-color:#b9c8f7;background:#eef3ff;color:var(--blue)}
.chat-emoji-wrap-v2{position:relative}
.chat-input-wrap-v2{position:relative;min-width:0}
.chat-form-v2 textarea{width:100%;min-height:42px;max-height:120px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#f8faff;resize:none;outline:0;font-size:14px;line-height:1.55}
.chat-form-v2 textarea:focus{border-color:#9bb3ff;box-shadow:0 0 0 3px rgba(26,100,255,.08)}
.chat-send-v2{height:42px;padding:0 17px;border:0;border-radius:12px;background:linear-gradient(135deg,var(--blue),var(--blue-2));color:#fff;font-size:13px;font-weight:800}
.chat-send-v2:disabled{opacity:.55;cursor:wait}
.chat-emoji-picker-v2{position:absolute;left:0;bottom:48px;z-index:60;width:286px;max-height:260px;padding:9px;display:grid;grid-template-columns:repeat(8,1fr);gap:3px;overflow:auto;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 18px 44px rgba(18,35,84,.16)}
.chat-emoji-picker-v2[hidden]{display:none!important}
.chat-emoji-picker-v2 button{aspect-ratio:1;padding:0;border:0;border-radius:9px;background:transparent;font-size:19px}
.chat-emoji-picker-v2 button:hover{background:#f0f4ff;transform:scale(1.1)}
.chat-image-preview-v2{position:relative;width:max-content;max-width:100%;margin:0 0 9px 94px;padding:5px;border:1px solid var(--line);border-radius:14px;background:#f8faff}
.chat-image-preview-v2[hidden]{display:none!important}
.chat-image-preview-v2 img{display:block;width:auto;max-width:220px;height:auto;max-height:150px;border-radius:10px;object-fit:cover}
.chat-image-preview-v2 button{position:absolute;top:-8px;right:-8px;width:26px;height:26px;padding:0;border:2px solid #fff;border-radius:50%;display:grid;place-items:center;background:#162033;color:#fff;font-size:15px;line-height:1}

.chat-mention-picker-v2{position:absolute;left:0;right:0;bottom:48px;z-index:70;max-height:300px;padding:7px;overflow:auto;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 18px 44px rgba(18,35,84,.16)}
.chat-mention-picker-v2[hidden]{display:none!important}
.chat-mention-option-v2{width:100%;min-height:48px;padding:6px 8px;display:flex;align-items:center;gap:9px;border:0;border-radius:11px;background:transparent;color:var(--text);text-align:left}
.chat-mention-option-v2:hover,.chat-mention-option-v2.active{background:#eef3ff;color:var(--blue)}
.chat-mention-avatar-v2{width:34px;height:34px;flex:0 0 34px;display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#dfe8ff;color:var(--blue);font-size:12px;font-weight:800}
.chat-mention-avatar-v2 img{width:100%;height:100%;object-fit:cover}
.chat-mention-option-v2>span:last-child{min-width:0;display:grid;gap:2px}
.chat-mention-option-v2 strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-mention-option-v2 small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.chat-empty-v2{height:100%;min-height:280px;display:grid;place-items:center;align-content:center;gap:5px;color:var(--muted);text-align:center}
.chat-empty-v2>span{font-size:28px}
.chat-empty-v2 strong{color:var(--text);font-size:14px}
.chat-empty-v2 small{font-size:12px}
.chat-loading-v2{padding:40px;text-align:center;color:var(--muted);font-size:12px}
.nav-v2 a,.bottom-nav-v2 a{position:relative}
[data-chat-badge-v2]{position:absolute;right:8px;top:7px;min-width:17px;height:17px;padding:0 4px;display:grid;place-items:center;border-radius:999px;background:#ef3c4f;color:#fff;font-size:9px;border:2px solid #fff}
.bottom-nav-v2 [data-chat-badge-v2]{right:20%;top:2px}

@media(hover:none){.chat-message-actions-v2{opacity:.78;transform:none}}

@media(max-width:820px){
  .chat-view-v2{height:calc(100dvh - 128px);margin:8px 0 0;padding:0 8px;grid-template-columns:96px minmax(0,1fr);gap:8px}
  .chat-sidebar-v2,.chat-main-v2{border-radius:16px}
  .chat-sidebar-head-v2{padding:12px 8px}.chat-sidebar-head-v2 strong{font-size:12px}.chat-sidebar-head-v2 p{display:none}
  .chat-rooms-v2{padding:5px}.chat-room-v2{min-height:64px;padding:6px;grid-template-columns:1fr;justify-items:center;text-align:center;gap:3px}.chat-room-icon-v2{width:34px;height:34px}.chat-room-v2>span:nth-child(2){width:100%}.chat-room-v2 strong{font-size:10.5px}.chat-room-v2 small{display:none}.chat-room-v2>b{position:absolute;right:6px;top:5px}
  .chat-head-v2{padding:11px 12px}.chat-messages-v2{padding:12px 8px}.chat-message-content-v2{max-width:88%}.chat-bubble-v2 p{font-size:13.5px}
  .chat-history-tools-v2{padding:7px 8px;align-items:stretch;flex-wrap:wrap;gap:5px}.chat-history-search-v2{min-width:100%;padding:6px 9px}.chat-history-tools-v2>small{flex:1;padding:2px 3px;white-space:normal}.chat-history-tools-v2>button{padding:5px 8px}
  .chat-message-actions-v2>button{width:27px;height:27px}.chat-message-reaction-picker-v2{position:fixed;left:50%!important;right:auto!important;top:auto;bottom:79px;transform:translateX(-50%);max-width:calc(100vw - 22px);overflow-x:auto}.chat-message-reaction-picker-v2 button{flex:0 0 32px}
  .chat-jump-latest-v2{right:10px;bottom:calc(100% + 7px);min-height:32px;padding:0 11px}
  .chat-form-v2{padding:7px 8px 9px}.chat-compose-row-v2{grid-template-columns:36px 36px minmax(0,1fr) auto;gap:5px}.chat-tool-btn-v2{width:36px;height:40px;border-radius:11px;font-size:16px}.chat-form-v2 textarea{font-size:13.5px;padding:10px}.chat-send-v2{padding:0 11px}.chat-image-preview-v2{margin-left:82px}.chat-image-preview-v2 img{max-width:170px;max-height:120px}
  .chat-emoji-picker-v2{position:fixed;left:8px;right:8px;bottom:77px;width:auto;max-height:230px;grid-template-columns:repeat(7,1fr);border-radius:18px}.chat-emoji-picker-v2 button{font-size:18px}
  .chat-mention-picker-v2{position:fixed;left:8px;right:8px;bottom:77px;max-height:280px}.chat-mention-option-v2{min-height:50px}
}
