* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --sidebar-width: 300px; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; background: #f0f2f5; height: 100vh; display: flex; flex-direction: column; }
body.is-resizing-sidebar { cursor: col-resize; user-select: none; }

/* 顶栏 */
.topbar { background: linear-gradient(135deg, #0f6ad9, #2490ff); color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.topbar-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.topbar-logo { width: 24px; height: 24px; object-fit: cover; border-radius: 6px; display: block; }
.topbar button { padding: 5px 11px; border: none; border-radius: 8px; cursor: pointer; font-size: 11px; background: rgba(255,255,255,.18); color: #fff; }
.topbar button:hover { background: rgba(255,255,255,.35); }
.topbar button:disabled { opacity: .65; cursor: not-allowed; }
.topbar-session { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-profile-btn { display: inline-flex; align-items: center; gap: 9px; min-width: 0; max-width: 240px; }
.topbar-profile-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92); color: #1890ff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.topbar-profile-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.topbar-profile-name, .topbar-profile-hint { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-profile-name { font-size: 11px; font-weight: 600; }
.topbar-profile-hint { font-size: 9px; opacity: .82; }
.topbar .status { font-size: 10px; opacity: .8; }

/* 登录页 */
html[data-auth-restoring='1'] #authCard { display: none; }
html[data-auth-restoring='1'] #authRecoveryCard { display: flex !important; }

.auth-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background:
	radial-gradient(circle at top left, rgba(36, 144, 255, 0.18), transparent 34%),
	radial-gradient(circle at bottom right, rgba(15, 106, 217, 0.16), transparent 30%),
	linear-gradient(180deg, #eef6ff 0%, #f5f7fb 100%); }
.auth-card { width: min(360px, 100%); background: rgba(255,255,255,0.97); border: 1px solid rgba(191, 219, 254, 0.9); border-radius: 18px; padding: 18px; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08); }
.auth-recovery-card { width: min(620px, 100%); min-height: min(280px, calc(100vh - 220px)); background: rgba(255,255,255,0.97); border: 1px solid rgba(219, 234, 254, 0.95); border-radius: 24px; padding: 28px 24px; box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.auth-card-copy { margin-bottom: 14px; }
.auth-card-title { font-size: 18px; font-weight: 700; color: #0f172a; letter-spacing: -0.02em; }
.auth-card-subtitle { margin-top: 4px; font-size: 11px; line-height: 1.5; color: #64748b; }
.auth-card-status { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 8px 10px; border-radius: 11px; background: #eff6ff; color: #0f6ad9; font-size: 11px; font-weight: 600; }
.auth-card-status-dot { width: 10px; height: 10px; border-radius: 50%; background: #2490ff; box-shadow: 0 0 0 0 rgba(36, 144, 255, 0.45); animation: auth-pulse 1.4s ease-out infinite; }
.auth-recovery-avatar { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(180deg, #2d64f0, #2453d9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; box-shadow: 0 6px 14px rgba(37, 84, 217, 0.16); }
.auth-recovery-title { margin-top: 18px; font-size: clamp(15px, 1.8vw, 22px); line-height: 1.15; font-weight: 800; color: #0b132b; letter-spacing: -0.03em; }
.auth-recovery-subtitle { margin-top: 8px; max-width: 460px; font-size: clamp(10px, 1vw, 12px); line-height: 1.55; color: #5b6b84; }
.auth-recovery-progress { width: min(420px, 100%); height: 8px; margin-top: 20px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.auth-recovery-progress-bar { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #68a7ff, #376df2); animation: auth-recovery-progress 1.8s ease-in-out infinite; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.auth-field span { font-size: 11px; font-weight: 600; color: #334155; }
.auth-field input { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 11px; background: #fff; font-size: 13px; color: #0f172a; }
.auth-field input:focus { outline: none; border-color: #2490ff; box-shadow: 0 0 0 4px rgba(36, 144, 255, 0.14); }
.auth-field input:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; min-width: 0; }
.auth-code-row button { flex-shrink: 0; min-width: 88px; padding: 0 12px; border: none; border-radius: 11px; background: #dbeafe; color: #0f6ad9; font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-code-row button:hover { background: #bfdbfe; }
.auth-code-row button:disabled { opacity: .65; cursor: not-allowed; }
.auth-login-btn { width: 100%; min-height: 40px; border: none; border-radius: 12px; background: linear-gradient(135deg, #0f6ad9, #2490ff); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 14px rgba(15, 106, 217, 0.16); }
.auth-login-btn:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }

@keyframes auth-pulse {
	0% { box-shadow: 0 0 0 0 rgba(36, 144, 255, 0.45); }
	70% { box-shadow: 0 0 0 10px rgba(36, 144, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(36, 144, 255, 0); }
}

@keyframes auth-recovery-progress {
	0% { transform: translateX(-8%); width: 38%; }
	50% { transform: translateX(72%); width: 28%; }
	100% { transform: translateX(-8%); width: 38%; }
}

/* 主体 */
.main { flex: 1; display: flex; overflow: hidden; }

/* 左侧栏 */
.sidebar { width: var(--sidebar-width); min-width: 0; flex: 0 0 var(--sidebar-width); background: #fff; border-right: 1px solid #e8e8e8; display: flex; flex-direction: column; }
.sidebar-resizer { width: 10px; flex: 0 0 10px; cursor: col-resize; position: relative; background: linear-gradient(180deg, rgba(24, 144, 255, 0), rgba(24, 144, 255, 0.06), rgba(24, 144, 255, 0)); touch-action: none; }
.sidebar-resizer::before { content: ''; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 999px; background: rgba(148, 163, 184, 0.5); transition: background .15s ease, transform .15s ease; }
.sidebar-resizer:hover::before,
body.is-resizing-sidebar .sidebar-resizer::before { background: #1890ff; transform: scaleX(1.2); }
.sidebar-header { padding: 12px; border-bottom: 1px solid #f0f0f0; display: flex; gap: 6px; }
.sidebar-header button { flex: 1; padding: 8px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
.tab-btn { background: #f5f5f5; color: #666; }
.tab-btn.active { background: #1890ff; color: #fff; }
.sidebar-list { flex: 1; overflow-y: auto; }

.contact-item { padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #fafafa; }
.contact-item:hover { background: #f5f7fa; }
.contact-item.active { background: #e6f7ff; }
.contact-item .avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; flex-shrink: 0; }
.avatar-peer { background: #52c41a; }
.avatar-agent { background: #1890ff; }
.avatar-group { background: #722ed1; }
.contact-item .name { font-size: 14px; color: #333; }
.contact-main { min-width: 0; flex: 1; }
.contact-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.contact-title { font-size: 14px; color: #333; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-subtext { margin-top: 3px; font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-status-row { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.contact-status-row.is-online { color: #389e0d; }
.contact-status-row.is-offline { color: #8c8c8c; }
.contact-meta-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.contact-inline-id { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-badge { font-size: 10px; background: #fff4c2; color: #8a5a00; padding: 2px 7px; border-radius: 999px; vertical-align: middle; flex-shrink: 0; border: 1px solid #f0d77a; }
.contact-item .badge { background: #ff4d4f; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.online-dot.on { background: #52c41a; }
.online-dot.off { background: #d9d9d9; }

/* 会话列表项 (消息 tab) */
.conv-item { align-items: flex-start; }
.conv-item .conv-info { flex: 1; min-width: 0; }
.conv-item .conv-top { display: flex; justify-content: space-between; align-items: center; }
.conv-item .conv-name { font-size: 14px; color: #333; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .conv-subname { margin-top: 2px; font-size: 11px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .conv-time { font-size: 11px; color: #bbb; flex-shrink: 0; margin-left: 8px; }
.conv-item .conv-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.conv-item .conv-preview { font-size: 12px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* 加载更多历史消息 */
.load-more-hint { text-align: center; padding: 8px; color: #999; font-size: 12px; }

/* 右侧聊天区 */
.chat-area { flex: 1; display: flex; flex-direction: column; background: #f5f5f5; }
.chat-header { padding: 14px 20px; background: #fff; border-bottom: 1px solid #e8e8e8; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-peer-title { padding: 0; border: none; background: transparent; color: #1f1f1f; font: inherit; font-weight: 600; cursor: pointer; }
.chat-peer-title:hover { color: #1890ff; }
.chat-header .members { font-size: 12px; color: #999; font-weight: 400; }
.group-member-preview { min-width: 0; max-width: min(420px, 45vw); font-size: 12px; color: #64748b; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-group-members { padding: 0; border: none; background: transparent; color: #64748b; font-size: 12px; font-weight: 500; cursor: pointer; }
.chat-group-members:hover { color: #1890ff; }
.group-header-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.group-header-actions button { margin-left: 0 !important; }
.chat-peer-summary { font-size: 12px; color: #999; font-weight: 400; }
.chat-agent-badge { margin-left: auto; }
.chat-header > button:not(.chat-peer-title) { margin-left: auto; padding: 4px 12px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.msg-wrap { display: flex; flex-direction: column; max-width: 70%; }
.msg-wrap-self { align-self: flex-end; align-items: flex-end; }
.msg-wrap-other { align-self: flex-start; align-items: flex-start; flex-direction: row; gap: 10px; max-width: 78%; }
.msg-wrap-system { align-self: center; align-items: center; }
.msg-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; line-height: 1; flex-shrink: 0; box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12); margin-top: 2px; }
.msg { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg-self { background: #1890ff; color: #fff; border-bottom-right-radius: 4px; }
.msg-other { background: #fff; color: #333; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg-sender { font-size: 12px; color: #64748b; margin-bottom: 6px; font-weight: 600; }
.msg-system { font-size: 12px; color: #999; background: transparent; padding: 4px; }
.msg-receipt-chip { margin-top: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 244, 194, 0.95); color: #8a5a00; font-size: 12px; line-height: 1; border: 1px solid rgba(240, 215, 122, 0.95); }

/* Message action buttons */
.msg-actions { display: flex; gap: 4px; margin-top: 3px; opacity: 0; transition: opacity .2s; }
.msg-wrap:hover .msg-actions { opacity: 1; }
.msg-action-btn { background: none; border: 1px solid #d9d9d9; border-radius: 4px; padding: 2px 8px; font-size: 11px; color: #888; cursor: pointer; transition: all .15s; }
.msg-action-btn:hover { background: #f0f0f0; color: #333; border-color: #bbb; }

/* Markdown content in messages */
.md-content p { margin: 0 0 0.4em 0; }
.md-content p:last-child { margin-bottom: 0; }
.md-content h1, .md-content h2, .md-content h3, .md-content h4, .md-content h5, .md-content h6 { margin: 0.4em 0 0.2em 0; line-height: 1.3; }
.md-content h1 { font-size: 1.3em; } .md-content h2 { font-size: 1.15em; } .md-content h3 { font-size: 1.05em; }
.md-content ul, .md-content ol { margin: 0.3em 0; padding-left: 1.6em; }
.md-content li { margin: 0.15em 0; }
.md-content blockquote { margin: 0.4em 0; padding: 0.3em 0.8em; border-left: 3px solid rgba(128,128,128,0.4); opacity: 0.9; }
.md-content code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 0.88em; padding: 0.15em 0.4em; border-radius: 4px; }
.md-content hr { border: none; border-top: 1px solid rgba(128,128,128,0.3); margin: 0.5em 0; }
.md-content table { border-collapse: collapse; margin: 0.4em 0; font-size: 0.92em; }
.md-content th, .md-content td { border: 1px solid rgba(128,128,128,0.3); padding: 0.3em 0.6em; }
.md-content strong { font-weight: 700; }
.md-content em { font-style: italic; }
.md-content a { text-decoration: underline; }
.md-content img { max-width: 100%; border-radius: 4px; }

/* Code block container */
.code-block { margin: 0.5em 0; border-radius: 8px; overflow: hidden; border: 1px solid #e5e7eb; }
.code-block-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 12px; }
.code-lang { font-weight: 600; text-transform: capitalize; }
.code-copy-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 2px 8px; border-radius: 4px; transition: background .15s; }
.code-copy-btn:hover { background: rgba(128,128,128,0.15); }
.code-block pre { margin: 0; padding: 12px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; white-space: pre; word-break: normal; overflow-wrap: normal; }
.code-block pre code { padding: 0; background: none; font-size: 13px; color: inherit; border-radius: 0; white-space: pre; word-break: normal; overflow-wrap: normal; }

/* Light theme (msg-other) */
.msg-other.md-content code { background: rgba(0,0,0,0.06); color: #c7254e; }
.msg-other.md-content .code-block code { background: none; color: inherit; }
.msg-other .code-block { background: #fff; border-color: #e5e7eb; }
.msg-other .code-block-header { background: #f7f8fa; color: #555; border-bottom: 1px solid #e5e7eb; }
.msg-other .code-copy-btn { color: #666; }
.msg-other .code-block pre { background: #fff; color: #1f2328; }
.msg-other.md-content a { color: #1890ff; }

/* Dark-on-blue theme (msg-self) */
.msg-self.md-content code { background: rgba(255,255,255,0.18); color: #fff; }
.msg-self.md-content .code-block code { background: none; color: inherit; }
.msg-self .code-block { background: rgba(0,0,0,0.12); border-color: rgba(255,255,255,0.15); }
.msg-self .code-block-header { background: rgba(0,0,0,0.18); color: rgba(255,255,255,0.85); border-bottom: 1px solid rgba(255,255,255,0.1); }
.msg-self .code-copy-btn { color: rgba(255,255,255,0.7); }
.msg-self .code-block pre { background: rgba(0,0,0,0.12); color: #e8ecf0; }
.msg-self.md-content a { color: #b7dcff; }

.input-area { padding: 12px 20px; background: #fff; border-top: 1px solid #e8e8e8; display: flex; gap: 8px; }
.input-area textarea { flex: 1; padding: 10px; border: 1px solid #d9d9d9; border-radius: 8px; resize: none; height: 44px; font-size: 14px; font-family: inherit; }
.input-area button { padding: 0 20px; background: #1890ff; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.input-area button:disabled { background: #d9d9d9; cursor: not-allowed; }

.empty-chat { flex: 1; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 16px; }

/* 建群弹窗 */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal label { font-size: 13px; color: #666; display: block; margin-bottom: 4px; margin-top: 12px; }
.modal input { width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; }
.modal .check-list { max-height: 200px; overflow-y: auto; margin-top: 8px; }
.modal .check-item { padding: 6px 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.modal .btn-row { margin-top: 20px; display: flex; gap: 8px; justify-content: flex-end; }
.modal .btn-row button { padding: 8px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.btn-cancel { background: #f5f5f5; color: #666; }
.btn-confirm { background: #1890ff; color: #fff; }

/* @ 提及 */
.mention-dropdown { position: fixed; background: #fff; border: 1px solid #d9d9d9; border-radius: 8px; box-shadow: 0 -4px 12px rgba(0,0,0,.12); max-height: 180px; overflow-y: auto; display: none; z-index: 9999; min-width: 160px; }
.mention-dropdown.show { display: block; }
.mention-item { padding: 8px 14px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.mention-item:hover, .mention-item.active { background: #e6f7ff; }
.mention-item .m-avatar { width: 24px; height: 24px; border-radius: 50%; background: #52c41a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.mention-text { min-width: 0; display: flex; flex-direction: column; }
.mention-name { color: #1f2937; line-height: 1.2; }
.mention-id { color: #94a3b8; font-size: 11px; line-height: 1.2; }
.input-wrapper { flex: 1; }
.input-wrapper textarea { width: 100%; }
.mention-tag { color: #0052d9; font-weight: 600; background: #d4e8ff; padding: 2px 6px; border-radius: 4px; }
.mention-tag-self { color: #d4380d; font-weight: 600; background: #ffd8bf; padding: 2px 6px; border-radius: 4px; }
.msg-self .mention-tag { color: #1890ff; background: #fff; padding: 2px 8px; border-radius: 4px; margin: 0 4px; }
.msg-self .mention-tag-self { color: #d4380d; background: #fff; padding: 2px 8px; border-radius: 4px; margin: 0 4px; }

/* 好友相关 */
.section-header { padding: 8px 16px; font-size: 11px; color: #999; background: #fafafa; border-bottom: 1px solid #f0f0f0; text-transform: uppercase; letter-spacing: 0.5px; }
.request-item { position: relative; }
.btn-accept, .btn-reject { padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; margin-left: 4px; }
.btn-accept { background: #52c41a; color: #fff; }
.btn-reject { background: #ff4d4f; color: #fff; }
.btn-accept:hover { background: #389e0d; }
.btn-reject:hover { background: #cf1322; }
.btn-add-friend { padding: 3px 10px; border: 1px solid #1890ff; border-radius: 4px; background: #fff; color: #1890ff; cursor: pointer; font-size: 12px; margin-left: auto; white-space: nowrap; }
.btn-add-friend:hover { background: #e6f7ff; }
.btn-add-friend:disabled { border-color: #d9d9d9; color: #999; cursor: default; background: #f5f5f5; }
.btn-remove-friend { padding: 3px 10px; border: 1px solid #ff4d4f; border-radius: 4px; background: #fff; color: #ff4d4f; cursor: pointer; font-size: 12px; margin-left: auto; }
.req-badge { background: #ff4d4f; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 8px; margin-left: 4px; vertical-align: top; }
.discover-group { border-bottom: 1px solid #f3f4f6; }
.discover-group-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: none; background: #fff; cursor: pointer; text-align: left; }
.discover-group-toggle:hover { background: #f8fbff; }
.discover-group.is-collapsed { border-bottom-color: #eef2f7; }
.discover-group-arrow { color: #64748b; font-size: 12px; width: 12px; text-align: center; flex-shrink: 0; }
.discover-group-name { min-width: 0; font-size: 13px; font-weight: 700; color: #334155; }
.discover-group-count { margin-left: auto; font-size: 12px; color: #94a3b8; }
.discover-group-list { padding-bottom: 6px; }
.discover-item { padding-left: 24px; }
.discover-group-list-friends .contact-item,
.discover-group-list-discover .contact-item { padding-left: 24px; }

/* 好友详情 */
.detail-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.32); z-index: 1000; align-items: center; justify-content: center; }
.detail-modal-overlay.show { display: flex; }
.detail-modal { width: min(480px, calc(100vw - 32px)); background: #fff; border-radius: 18px; box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18); overflow: hidden; }
.invite-members-modal { width: min(560px, calc(100vw - 32px)); }
.detail-modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid #eef2f7; gap: 12px; }
.detail-modal-title { font-size: 18px; font-weight: 700; color: #1f2937; }
.detail-modal-subtitle { margin-top: 4px; font-size: 12px; color: #94a3b8; }
.detail-close-btn, .detail-secondary-btn, .detail-primary-btn { border: none; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: 13px; }
.detail-close-btn, .detail-secondary-btn { background: #eef2f7; color: #475569; }
.detail-primary-btn { background: #1890ff; color: #fff; }
.detail-modal-body { padding: 18px 20px; }
.detail-profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.detail-profile-row .avatar { width: 52px; height: 52px; font-size: 18px; }
.detail-profile-main { min-width: 0; }
.detail-profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-profile-name { font-size: 20px; font-weight: 700; color: #0f172a; }
.detail-profile-id { margin-top: 4px; font-size: 13px; color: #64748b; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-item { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; }
.detail-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.detail-value { font-size: 14px; color: #0f172a; font-weight: 600; word-break: break-word; }
.detail-value-code { font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; font-size: 12px; }
.detail-empty-text { color: #94a3b8; font-size: 14px; text-align: center; padding: 12px 0; }
.detail-member-list { display: flex; flex-direction: column; gap: 12px; }
.detail-member-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; }
.invite-member-list { gap: 10px; }
.invite-member-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; cursor: pointer; }
.invite-member-item:hover { border-color: #bfd7ff; background: #f6faff; }
.invite-member-checkbox { width: 16px; height: 16px; flex-shrink: 0; }
.invite-member-main { min-width: 0; }
.invite-member-id { margin-top: 4px; font-size: 12px; color: #64748b; }
.invite-online { font-size: 11px; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 2px 8px; }
.invite-online.is-online { color: #237804; background: #eefbf3; }
.detail-member-main { min-width: 0; }
.detail-member-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-member-name { font-size: 15px; font-weight: 700; color: #0f172a; }
.detail-member-id { margin-top: 4px; font-size: 12px; color: #64748b; }
.detail-member-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.detail-member-status, .detail-member-toggle { font-size: 12px; line-height: 1; border-radius: 999px; padding: 8px 12px; border: 1px solid #d6e4ff; background: #f5f9ff; color: #36558f; }
.detail-member-status.is-enabled, .detail-member-toggle.is-enabled { background: #eefbf3; border-color: #b7ebc6; color: #237804; }
.detail-member-toggle { cursor: pointer; }
.detail-member-toggle:hover { filter: brightness(0.98); }
.detail-member-kick { font-size: 12px; line-height: 1; border-radius: 999px; padding: 8px 12px; border: 1px solid #ffc1bf; background: #fff3f2; color: #cf1322; cursor: pointer; }
.detail-member-kick:hover { background: #ffe8e6; }
.group-owner-badge { font-size: 11px; color: #6b4e00; background: #fff7e6; border: 1px solid #ffd591; border-radius: 999px; padding: 2px 8px; }
.detail-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 20px; border-top: 1px solid #eef2f7; }

.my-profile-modal { width: min(560px, calc(100vw - 32px)); }
.my-profile-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.my-profile-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #69b1ff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.my-profile-hero-copy { min-width: 0; }
.my-profile-hero-name { font-size: 20px; font-weight: 700; color: #0f172a; }
.my-profile-hero-meta { margin-top: 4px; font-size: 13px; color: #64748b; word-break: break-word; }
.my-profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.my-profile-field { display: flex; flex-direction: column; gap: 8px; }
.my-profile-field span { font-size: 12px; color: #64748b; font-weight: 600; }
.my-profile-field input, .my-profile-field textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9e2ec; border-radius: 12px; font-size: 14px; font-family: inherit; color: #0f172a; background: #fff; }
.my-profile-field textarea { min-height: 108px; resize: vertical; }
.my-profile-field input:disabled, .my-profile-field textarea:disabled { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }
.my-profile-field-wide { grid-column: 1 / -1; }

@media (max-width: 720px) {
	.topbar { padding: 10px 12px; }
	.topbar-session { width: 100%; justify-content: flex-end; }
	.auth-screen { padding: 18px 12px; }
	.auth-card { width: min(340px, 100%); padding: 16px 14px; border-radius: 16px; }
	.auth-recovery-card { min-height: 0; padding: 22px 16px; border-radius: 18px; }
	.auth-recovery-avatar { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
	.auth-recovery-title { margin-top: 12px; font-size: 16px; }
	.auth-recovery-subtitle { margin-top: 8px; font-size: 11px; }
	.auth-recovery-progress { height: 8px; margin-top: 18px; }
	.auth-card-title { font-size: 17px; }
	.auth-code-row { flex-direction: column; }
	.auth-code-row button { min-height: 38px; width: 100%; }
	.detail-grid { grid-template-columns: 1fr; }
	.chat-header > button:not(.chat-peer-title) { margin-left: 0; }
	.chat-agent-badge { margin-left: 0; }
	.my-profile-form { grid-template-columns: 1fr; }
	.topbar-profile-btn { max-width: 100%; }
	:root { --sidebar-width: min(72vw, 320px); }
	.sidebar-resizer { width: 12px; flex-basis: 12px; }
}

/* Toast 提示 */
.toast { position: fixed; top: 50px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.7); color: #fff; padding: 8px 20px; border-radius: 6px; font-size: 13px; z-index: 10000; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
