/* QQ Hub —— 类 QQ NT 风格 */
:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --list-bg: #f7f8fc;
  --rail-bg: #e9ebf1;
  --border: #e3e5ec;
  --text: #1f2329;
  --text-sub: #8a9099;
  --accent: #0099ff;
  --accent-weak: rgba(0, 153, 255, 0.09);
  --danger: #fa5151;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, "SF Pro SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

#app { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 左侧账号栏 ---------- */
#rail {
  width: 64px;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 10px;
  flex-shrink: 0;
}
.rail-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #41b0ff, #0099ff);
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
#accountList { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: 1; }
.account-item { position: relative; cursor: pointer; line-height: 0; }
.account-item .avatar { width: 40px; height: 40px; }
.account-item.active .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--rail-bg);
}
.status-dot.online { background: #2fc25b; }
.status-dot.connecting { background: #ffb300; }
.status-dot.offline { background: #c3c9d4; }
#railFooter {
  font-size: 11px; color: var(--text-sub);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  writing-mode: initial;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: #2fc25b; }
.dot.gray { background: #c3c9d4; }

/* ---------- 会话列表 ---------- */
#listPane {
  width: 300px;
  background: var(--list-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}
.list-top { padding: 12px 12px 8px; }
#search {
  width: 100%; padding: 8px 12px;
  border: none; border-radius: 8px;
  background: #eceef4; font-size: 13px;
  outline: none;
}
#search:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent-weak); }
#statusLine {
  padding: 0 14px 6px;
  font-size: 12px; color: var(--text-sub);
}
#convList { flex: 1; overflow-y: auto; padding: 4px 6px 10px; }

.conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: var(--radius);
  cursor: pointer; position: relative;
}
.conv-item:hover { background: #eceef4; }
.conv-item.selected { background: #e2e7f0; }
.conv-item .avatar { width: 44px; height: 44px; flex-shrink: 0; }
.conv-main { flex: 1; min-width: 0; }
.conv-row1 { display: flex; align-items: baseline; gap: 6px; }
.conv-name {
  flex: 1; font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { font-size: 11px; color: var(--text-sub); flex-shrink: 0; }
.conv-row2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.conv-preview {
  flex: 1; font-size: 12px; color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; flex-shrink: 0;
}
.conv-chip {
  font-size: 10px; color: var(--text-sub);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0 3px; flex-shrink: 0;
}

/* ---------- 头像 ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 30%;
  object-fit: cover; display: block;
  background: #dfe3ec;
}
.avatar.fallback {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 600;
  user-select: none;
}

/* ---------- 聊天区 ---------- */
#chatPane { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
#openHistorySearch { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; margin-top:8px; padding:7px; border:1px solid #cbd6e4; border-radius:7px; background:#fff; color:#305b84; font:inherit; font-size:13px; cursor:pointer; }
#historySearchPanel { position:fixed; z-index:20; inset:0 0 0 auto; width:min(520px,100vw); display:flex; flex-direction:column; background:#fff; border-left:1px solid #d4deeb; box-shadow:-8px 4px 24px rgba(24,45,74,.12); }
#historySearchPanel[hidden], #historySearchContext[hidden], #historySearchResults[hidden] { display:none; }
.history-search-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:20px 20px 12px; }
.history-search-header h2 { margin:0; font-size:18px; color:#25384d; }
#historySearchPanel button { border:1px solid #cbd6e4; background:#fff; color:#236098; padding:8px 12px; border-radius:7px; min-height:36px; font:inherit; font-size:13px; cursor:pointer; }
#historySearchPanel button:hover, #openHistorySearch:hover { background:#edf5fd; }
#historySearchPanel button:disabled { color:#708094; background:#f1f4f8; cursor:wait; }
#historySearchPanel button:focus-visible, #openHistorySearch:focus-visible { outline:2px solid #0875c9; outline-offset:2px; }
#historySearchForm { padding:0 20px; }
.history-query-row { display:flex; gap:8px; }
#historyKeyword { flex:1; min-width:0; border:1px solid #b9c9dc; border-radius:7px; padding:10px 12px; font:inherit; font-size:14px; color:#26384e; }
#historyKeyword:focus, .history-filters select:focus { outline:2px solid #0875c9; outline-offset:1px; }
#historySearchPanel #runHistorySearch { background:#0875c9; color:white; border-color:#0875c9; }
.history-filters { display:flex; gap:12px; margin-top:12px; }
.history-filters label { display:flex; align-items:center; gap:6px; color:#596a7e; font-size:12px; min-width:0; flex:1; }
.history-filters select { flex:1; min-width:0; border:1px solid #cbd6e4; border-radius:6px; background:#fff; color:#26384e; padding:7px; font:inherit; }
.history-search-help { margin:10px 0 0; color:#617187; font-size:12px; line-height:1.5; }
#historySearchStatus { padding:14px 20px; color:#617187; font-size:13px; line-height:1.5; }
#historySearchStatus.error { color:#a52c27; }
#historySearchResults { flex:1; overflow-y:auto; padding:0 20px; }
.history-hit { padding:14px 0; border-top:1px solid #e6ecf3; }
.history-hit-title { font-size:14px; font-weight:600; color:#26384e; overflow-wrap:anywhere; }
.history-hit-meta { color:#657388; font-size:12px; line-height:1.6; margin-top:5px; overflow-wrap:anywhere; }
.history-hit-text { color:#26384e; line-height:1.7; font-size:14px; margin:9px 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.history-recall { font-size:12px; color:#79581e; margin:7px 0; }
#moreHistoryResults { margin:12px 20px 18px; flex-shrink:0; }
#historySearchContext { min-height:0; flex:1; display:flex; flex-direction:column; padding:0 20px 18px; }
.history-context-actions { display:flex; justify-content:space-between; gap:8px; }
#historyContextTitle { color:#43576e; line-height:1.5; font-size:13px; }
#historyContextMessages { flex:1; min-height:0; overflow-y:auto; }
.history-context-message { padding:12px; border-top:1px solid #e6ecf3; }
.history-context-message.target { background:#edf6ff; border:1px solid #a6cbea; border-radius:8px; }
.history-context-message .msg-img { display:block; max-width:100%; max-height:200px; border-radius:6px; cursor:zoom-in; }
@media(max-width:520px) { #historyKeyword { font-size:16px; } #app #listPane .list-top { display:flex; gap:6px; align-items:center; } #listPane #search { min-width:0; flex:1; } #openHistorySearch { flex:0 0 auto; width:auto; margin:0; padding:7px; font-size:12px; } #openHistorySearch svg { display:none; } .history-search-header { padding:16px 14px 12px; } #historySearchForm { padding:0 14px; } #historySearchStatus { padding:12px 14px; } #historySearchResults { padding:0 14px; } }
#chat { display: flex; flex-direction: column; height: 100%; }
#chatEmpty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--text-sub);
}
.empty-icon { font-size: 42px; }

#chatHeader {
  position: relative;
  padding: 14px 150px 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
#chatTitle { font-size: 16px; font-weight: 600; }
#chatSub { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
#chat { position: relative; }
#chatHeader #groupMembersBtn { position: absolute; right: 18px; top: 16px; }
#groupMembersBtn, #memberPanel button, #loadHistory { border: 1px solid #cbd6e4; background: #fff; color: #236098; padding: 8px 12px; border-radius: 7px; font: inherit; cursor: pointer; min-height: 36px; }
#groupMembersBtn:hover, #memberPanel button:hover, #loadHistory:hover { background: #edf5fd; }
#memberPanel button:disabled, #loadHistory:disabled { cursor: wait; opacity: .65; }
#memberPanel button:focus-visible, #groupMembersBtn:focus-visible, #loadHistory:focus-visible { outline: 2px solid #0875c9; outline-offset: 2px; }
#storageError { padding: 8px 16px; background: #fff1d7; color: #755211; font-size: 13px; }
#historyBar { text-align: center; background: #eef1f6; font-size: 12px; }
#historyBar button { margin: 8px; padding: 5px 12px; font-size: 12px; }
#historyError { color: #ad2727; }
#memberPanel { position: absolute; z-index: 6; inset: 0 0 0 auto; width: min(360px,100%); background: #fff; border-left: 1px solid #d4deeb; display: flex; flex-direction: column; box-shadow: -8px 4px 24px rgba(24,45,74,.12); }
#memberPanel[hidden] { display: none; }
#memberPanel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 12px; }
#memberCount { font-size: 12px; color: #617187; margin: 5px 0 0; }
.member-tools { display: flex; gap: 8px; padding: 0 16px 12px; }
#memberSearch { min-width: 0; flex: 1; padding: 8px; border: 1px solid #cbd6e4; border-radius: 6px; font: inherit; font-size: 13px; }
#memberStatus { padding: 0 16px; color: #645b4b; font-size: 13px; line-height: 1.6; }
#memberStatus:empty { display: none; }
#memberList { overflow-y: auto; flex: 1; padding: 0 12px 12px; }
.member-row { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #edf1f6; }
.member-row .avatar { width: 34px; height: 34px; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #26384e; }
.member-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-role { flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 5px; line-height: 1.5; border-radius: 4px; }
.member-role.owner { color: #a24a0b; background: #ffebd6; }
.member-role.admin { color: #096aa7; background: #e0f1ff; }
.sender-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.sender-heading .sender-name { margin: 0; }
.msg-row.self .sender-heading { justify-content: flex-end; }
.member-id { margin-top: 4px; color: #67768b; font-size: 12px; }
.member-row button { font-size: 12px !important; flex-shrink: 0; }
#memberPanel .profile-avatar{border:0;background:transparent;padding:0;min-height:0;align-self:center}
.member-name-row{flex-wrap:wrap;gap:4px}
.group-title{max-width:140px;overflow:hidden;text-overflow:ellipsis}
@media(max-width:520px) { #chat #chatHeader { padding-right: 120px; } #chatHeader #groupMembersBtn { right: 8px; top: 8px; padding: 8px; font-size: 12px; } }

#msgList { flex: 1; overflow-y: auto; overflow-anchor:none; padding: 18px 24px 10px; }

.msg-day {
  text-align: center; font-size: 11px; color: var(--text-sub);
  margin: 12px 0;
}
.msg-day span { background: rgba(0, 0, 0, 0.045); padding: 3px 10px; border-radius: 10px; }

.msg-row { display: flex; gap: 10px; margin: 3px 0; }
.msg-row.head { margin-top: 12px; }
.msg-row.self { flex-direction: row-reverse; }
.msg-row .avatar { width: 36px; height: 36px; flex-shrink: 0; margin-top: 2px; }
.avatar-spacer { width: 36px; flex-shrink: 0; }

.msg-body { max-width: min(560px, 62%); display: flex; flex-direction: column; min-width: 0; }
.msg-row.self .msg-body { align-items: flex-end; }
.sender-name {
  font-size: 12px; color: var(--text-sub);
  margin: 0 2px 3px;
}
.msg-bubble {
  padding: 9px 13px;
  border-radius: 4px 12px 12px 12px;
  background: var(--panel);
  box-shadow: 0 1px 1px rgba(31, 35, 41, 0.05);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  width: fit-content;
}
.msg-row.self .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-radius: 12px 4px 12px 12px;
  box-shadow: none;
}
.msg-bubble .msg-img {
  max-width: 240px; max-height: 200px;
  border-radius: 8px; display: block; cursor: zoom-in;
}
.msg-bubble .placeholder { color: inherit; opacity: 0.75; }
.msg-img:focus-visible { outline: 2px solid #0875c9; outline-offset: 3px; }
#imagePreview {
  position: fixed; inset: 0; margin: auto;
  width: min(1120px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 64px));
  max-width: none; max-height: none;
  border: 0; border-radius: 16px;
  padding: 56px 24px 24px;
  background: #151d29; color: #f5f7fb;
  overflow: hidden;
}
#imagePreview::backdrop { background: rgba(10, 16, 26, 0.78); }
#imagePreview[open] { display: flex; align-items: center; justify-content: center; }
#imagePreviewImage { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
#imagePreviewClose {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 10px;
  color: #f5f7fb; background: transparent; cursor: pointer;
}
#imagePreviewClose:hover { background: #2c394c; }
#imagePreviewClose:focus-visible { outline: 2px solid #b8d9ff; outline-offset: -2px; }
#imagePreviewError { font-size: 14px; line-height: 1.6; text-align: center; }
@media (max-width: 520px) {
  #imagePreview { width: calc(100vw - 16px); height: calc(100dvh - 32px); padding: 56px 12px 20px; border-radius: 12px; }
}
.msg-row.self .at { color: #e3f4ff; background: rgba(255, 255, 255, 0.18); }
.at {
  color: var(--accent); background: var(--accent-weak);
  border-radius: 4px; padding: 0 2px;
}
.quote {
  display:block;width:100%;text-align:left;font-family:inherit;cursor:pointer;border:0;
  border-left: 3px solid #c9cfdb;
  background: rgba(0, 0, 0, 0.035);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px; color: var(--text-sub);
  margin-bottom: 5px;
  max-width: 100%;
  overflow:hidden;white-space:normal;
}
.quote:hover{background:#e4ebf5}
.quote:focus-visible{outline:2px solid #438ce1;outline-offset:2px}
.quote-author{display:block;font-weight:600;margin-bottom:4px}
.quote-content{display:block;max-height:110px;overflow:hidden;overflow-wrap:anywhere;line-height:1.6;white-space:pre-wrap}
.quote-thumb{display:inline-block;width:64px;height:64px;object-fit:cover;vertical-align:middle;border-radius:5px;margin:2px 6px 2px 0}
.quote-content .qq-face{max-width:28px;max-height:28px;vertical-align:middle}
.quote:disabled{cursor:default}
.msg-row.message-target .msg-bubble{outline:2px solid #6aabe9;outline-offset:3px;box-shadow:0 0 0 6px #2c8ee519}
.msg-row.self .quote { background:#e8eef8;color:var(--text-sub);border-left-color:#a7c9ec; }
.msg-recalled { font-size: 12px; color: #79581e; line-height: 1.5; padding: 5px 2px 2px; }

/* ---------- 输入区 ---------- */
#composer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 16px 24px 18px;
  flex-shrink: 0;
}
.composer-field {
  border: 1px solid #d4dce8;
  border-radius: 14px;
  background: #f7f9fc;
  padding: 14px 16px 12px;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
.composer-field:focus-within { border-color: #0875c9; background: var(--panel); }
.composer-toolbar { display: flex; align-items: center; gap: 12px; margin: -4px 0 8px; color: #677689; font-size: 12px; }
#pickImages,#pickFaces,#pickVideo,#chatHistoryBtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 8px; background: transparent; color: #40536b; border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
#pickImages:hover,#pickFaces:hover,#pickVideo:hover,#chatHistoryBtn:hover { color: #086fbd; background: #e8f2fc; }
#pickImages:focus-visible,#pickFaces:focus-visible, .attachment button:focus-visible { outline: 2px solid #0875c9; outline-offset: 2px; }
#attachments { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; max-height: 186px; overflow-y: auto; padding: 4px; }
#attachments[hidden] { display: none; }
.attachment { position: relative; width: 76px; height: 76px; }
.attachment-preview { padding: 0; width: 100%; height: 100%; border: 1px solid #d6e0ed; border-radius: 8px; background: #edf2f8; overflow: hidden; cursor: zoom-in; }
.attachment-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-remove { position: absolute; top: -4px; right: -4px; width: 28px; height: 28px; border: 2px solid white; border-radius: 50%; background: #33455d; color: white; cursor: pointer; font-size: 18px; line-height: 20px; }
.attachment-remove:hover { background: #15283f; }
#composer.drag-over .composer-field { border: 2px dashed #0875c9; background: #eaf4ff; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-top: 8px; }
#sendHint { color: #596779; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#input {
  display: block; width: 100%; min-width: 0; resize: none;
  border: none; outline: none;
  background: transparent;
  padding: 0;
  color: var(--text); caret-color: #0875c9;
  font-size: 15px; font-family: inherit; line-height: 1.65;
  min-height: 66px; max-height: 168px;
  scrollbar-width: thin; scrollbar-color: #b7c5d6 transparent;
}
#input::placeholder { color: #647286; opacity: 1; }
#input::selection { background: #cfe8ff; color: #153c60; }
#sendBtn {
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #0875c9; color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600;
  min-height: 40px; padding: 9px 18px; margin-left: auto;
  border-radius: 9px; flex-shrink: 0;
  transition: background-color 160ms ease-out;
}
#sendBtn:hover:not(:disabled) { background: #0563ad; }
#sendBtn:active:not(:disabled) { background: #064e88; }
#sendBtn:focus-visible { outline: 2px solid #0875c9; outline-offset: 3px; }
#sendBtn:disabled { background: #e1e8f0; color: #627286; cursor: not-allowed; }
#sendError {
  font-size: 13px; line-height: 1.5; color: #ae2727;
  padding: 0 2px 10px; overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  #composer { padding: 12px; }
  .composer-field { padding: 12px; }
}
@media (max-width: 520px) {
  #app { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: 148px minmax(0, 1fr); height: 100dvh; }
  #rail { grid-row: 1 / -1; width: 48px; }
  #app #listPane { grid-column: 2; grid-row: 1; width: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  #listPane .list-top { padding: 8px 10px 4px; }
  #convList { display: flex; overflow-x: auto; overflow-y: hidden; padding: 0 6px 6px; }
  #convList .conv-item { flex: 0 0 240px; margin: 0 4px; }
  #chatPane { grid-column: 2; grid-row: 2; min-height: 0; }
  #chat { min-height: 0; }
  #chatHeader { padding: 10px 14px; }
  #msgList { min-height: 0; padding: 12px; }
  #chat .msg-body { max-width: calc(100% - 46px); }
  .msg-bubble .msg-img { max-width: 100%; }
  #composer { padding: 8px; }
  .composer-field { padding: 8px; border-radius: 10px; }
  #input { font-size: 16px; }
  #sendBtn { padding: 8px 10px; min-height: 44px; }
  #sendBtn svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .composer-field, #sendBtn { transition: none; }
}

/* ---------- 账号管理 ---------- */
#settingsBtn,
#desktopBtn,
#addAccountBtn {
  width: 40px; height: 40px;
  border: none; border-radius: 12px;
  background: #dde1ea; color: var(--text-sub);
  font-size: 18px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
#addAccountBtn { font-size: 22px; }
#settingsBtn:hover, #addAccountBtn:hover { background: var(--accent); color: #fff; }
#desktopBtn:not(:disabled):hover, .mini-btn.vnc-btn:not(:disabled):hover {
  background: var(--accent-weak); color: var(--text);
}
#desktopBtn { font-size: 12px; font-weight: 600; color: var(--text); }
#desktopBtn:disabled { opacity: 0.5; cursor: not-allowed; }
#desktopBtn:focus-visible, .acct-actions .mini-btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* ---------- 登录页 ---------- */
#loginOverlay {
  position: fixed; inset: 0; z-index: 50;
  background: #10141b;
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: min(380px, 92vw);
  background: #161b23; color: #e8ecf3;
  border: 1px solid #232a35; border-radius: 16px;
  padding: 34px 34px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #41b0ff, #0099ff);
  color: #fff; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-card h2 { font-size: 20px; margin-bottom: 2px; }
.login-sub { font-size: 12px; color: #7d8593; margin-bottom: 22px; }
.login-card .wiz-field { text-align: left; margin-bottom: 12px; }
.login-card input {
  width: 100%;
  background: #0e1218; color: #e8ecf3;
  border: 1px solid #2a323e; border-radius: 10px;
  padding: 11px 13px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
#loginBtn {
  width: 100%; margin-top: 6px;
  border: none; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-size: 14px; padding: 11px 0; cursor: pointer;
}
#loginBtn:hover { background: #008ae6; }
#loginErr { margin-top: 10px; }

.settings-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

#modalOverlay {
  position: fixed; inset: 0;
  background: rgba(31, 35, 41, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
}
#modal {
  width: min(580px, 92vw); max-height: 88vh;
  overflow-y: auto;
  background: var(--panel); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
#modalHeader {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel);
}
#modalHeader h2 { font-size: 16px; }
#modalClose {
  border: none; background: none;
  font-size: 24px; line-height: 1;
  color: var(--text-sub); cursor: pointer;
}
#modalClose:hover { color: var(--text); }
.modal-body { padding: 14px 18px 18px; }
.modal-body h3 { font-size: 14px; margin: 16px 0 10px; }
.modal-body h4 { font-size: 13px; margin: 14px 0 8px; color: var(--text-sub); }

.seg-tabs {
  display: flex; gap: 4px;
  background: var(--list-bg);
  border-radius: 10px; padding: 4px;
  margin-bottom: 14px;
}
.seg-tab {
  flex: 1; border: none; border-radius: 8px;
  background: transparent; color: var(--text-sub);
  font-size: 13px; padding: 7px 0; cursor: pointer;
}
.seg-tab.active { background: var(--panel); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(31,35,41,.1); }

/* ---------- SnowLuma 一键接入 ---------- */
#slPane label, #slLogin label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-sub); margin-bottom: 10px;
}
#slPane input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
  outline: none; background: var(--list-bg);
  color: var(--text); font-family: inherit;
}
#slPane input:focus { border-color: var(--accent); background: #fff; }
#slConnectBtn {
  border: none; border-radius: 8px;
  background: var(--accent); color: #fff;
  padding: 8px 18px; font-size: 13px; cursor: pointer;
}
#slConnectBtn:hover { background: #008ae6; }
#slConnectBtn:disabled { background: #b9d9f5; cursor: not-allowed; }
#slError { font-size: 12px; color: var(--danger); }
.sl-hint { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin-top: 10px; }
.sl-connected {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-sub);
  padding: 8px 10px; margin-bottom: 4px;
  background: var(--accent-weak); border-radius: 8px;
}
.sl-connected span { flex: 1; color: var(--text); word-break: break-all; }

.sl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 6px;
}
.sl-row .avatar { width: 34px; height: 34px; }
.sl-main { flex: 1; min-width: 0; }
.sl-title { font-size: 13px; font-weight: 500; }
.sl-sub { font-size: 11px; color: var(--text-sub); margin-top: 1px; }
.sl-badge {
  font-size: 11px; color: #2fa356;
  background: rgba(47, 194, 91, 0.12);
  border-radius: 5px; padding: 2px 8px; flex-shrink: 0;
}
.sl-warn {
  font-size: 11px; color: #b8860b;
  background: rgba(255, 179, 0, 0.12);
  border-radius: 5px; padding: 2px 8px; flex-shrink: 0;
}
.sl-empty { font-size: 12px; color: var(--text-sub); padding: 6px 2px; }

/* ---------- 添加账号向导 ---------- */
.wiz-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.wiz-step-dot {
  font-size: 11px; color: var(--text-sub);
  background: var(--list-bg); border-radius: 10px;
  padding: 3px 10px;
}
.wiz-step-dot.active { background: var(--accent-weak); color: var(--accent); font-weight: 500; }
.wiz-step-dot.done { color: #2fa356; }
.wiz-title { font-size: 15px; margin: 2px 0 8px; }
.wiz-sub { font-size: 12px; color: var(--text-sub); line-height: 1.7; margin: 0 0 12px; }
.wiz-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-sub); margin-bottom: 10px;
}
.wiz-field input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
  outline: none; background: var(--list-bg);
  color: var(--text); font-family: inherit;
}
.wiz-field input:focus { border-color: var(--accent); background: #fff; }
.form-err { font-size: 12px; color: var(--danger); }

.method-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s;
}
.method-card:hover { border-color: var(--accent); background: var(--accent-weak); }
.method-icon { font-size: 24px; flex-shrink: 0; }
.method-main { flex: 1; min-width: 0; }
.method-name { font-size: 14px; font-weight: 500; }
.method-tag {
  font-size: 10px; color: var(--accent);
  background: var(--accent-weak);
  border-radius: 4px; padding: 1px 5px;
  margin-left: 4px; vertical-align: 1px;
}
.method-desc { font-size: 12px; color: var(--text-sub); margin-top: 3px; line-height: 1.5; }

.wiz-guide {
  margin: 6px 0 4px; padding-left: 20px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-sub); line-height: 1.6;
}
.wiz-block { margin: 10px 0; }
.wiz-waiting {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.spinner {
  width: 14px; height: 14px; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; display: inline-block;
  animation: wiz-spin 1s linear infinite;
}
@keyframes wiz-spin { to { transform: rotate(360deg); } }
.wiz-waiting .mini-btn { margin-left: auto; }
.detected-hint { font-size: 12px; color: var(--text); margin-bottom: 6px; }
.wiz-done-info {
  background: var(--list-bg); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; line-height: 1.7;
}
.wiz-done-info .sl-sub { margin-top: 2px; }
.wiz-footer-link { margin-top: 14px; text-align: center; }
.link-btn {
  border: none; background: none; cursor: pointer;
  color: var(--accent); font-size: 12px; padding: 4px;
}
.link-btn:hover { text-decoration: underline; }

/* 协议文档展示 */
.doc-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.doc-tabs button {
  border: 1px solid var(--border); background: var(--list-bg);
  border-radius: 6px; padding: 4px 12px;
  font-size: 12px; cursor: pointer; color: var(--text-sub);
}
.doc-tabs button.active { background: var(--accent-weak); color: var(--accent); border-color: var(--accent); }
.doc-text {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--list-bg);
  padding: 10px 12px;
  font-size: 12px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.wiz-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text); margin: 10px 0;
}
.mini-btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.mini-btn.primary:hover { background: #008ae6; color: #fff; }
.mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 内嵌登录窗口(远控桌面) */
.embed-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-sub);
  padding: 0 2px 6px;
}
.login-embed {
  width: 100%; height: 420px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #1c1f26;
  display: block;
}
.qr-view {
  width: 100%; max-width: 360px;
  display: block; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff;
}

.acct-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px;
}
.acct-row .avatar { width: 38px; height: 38px; }
.acct-info { flex: 1; min-width: 0; }
.acct-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.acct-url {
  font-size: 12px; color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.acct-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.mini-btn {
  border: 1px solid var(--border);
  background: var(--list-bg);
  border-radius: 6px; padding: 4px 9px;
  font-size: 12px; cursor: pointer; color: var(--text);
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mini-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.mini-btn.confirm { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (max-width: 520px) {
  .acct-row { flex-wrap: wrap; }
  .acct-actions { width: 100%; justify-content: flex-start; }
}
.acct-empty { font-size: 12px; color: var(--text-sub); padding: 8px 2px; }

#acctForm { display: flex; flex-direction: column; gap: 10px; }
#acctForm label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--text-sub);
}
#acctForm label.vnc-field { color: var(--text); }
#acctForm .vnc-field input::placeholder { color: var(--text); opacity: 0.7; }
#acctForm input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
  outline: none; background: var(--list-bg);
  color: var(--text); font-family: inherit;
}
#acctForm input:focus { border-color: var(--accent); background: #fff; }
.form-actions { display: flex; align-items: center; gap: 10px; }
#formSubmit {
  border: none; border-radius: 8px;
  background: var(--accent); color: #fff;
  padding: 8px 18px; font-size: 13px; cursor: pointer;
}
#formSubmit:hover { background: #008ae6; }
#formSubmit:disabled { background: #b9d9f5; cursor: not-allowed; }
#formError { font-size: 12px; color: var(--danger); }

.guide {
  margin-top: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; background: var(--list-bg);
}
.guide summary { cursor: pointer; font-size: 13px; }
.guide ol {
  margin: 10px 0 4px; padding-left: 20px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-sub); line-height: 1.6;
}
.guide code {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px; padding: 0 4px;
}

/* ---------- 滚动条 / 其他 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #ccd2dd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b4bccb; }

#toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(31, 35, 41, 0.9); color: #fff;
  font-size: 13px; padding: 9px 18px; border-radius: 8px;
  z-index: 10; pointer-events: none;
}

@media (max-width: 760px) {
  #listPane { width: 220px; }
  .msg-body { max-width: 78%; }
}

/* ---------- 设置与安全弹窗 ---------- */
#settingsOverlay {
  position: fixed; inset: 0;
  background: rgba(31, 35, 41, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
}
#settingsModal {
  width: min(520px, 92vw); max-height: 86vh;
  overflow-y: auto;
  background: var(--panel); color: var(--text);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
#settingsModal h4 { font-size: 13px; margin: 14px 0 8px; color: var(--text-sub); }
#settingsModal .wiz-field { margin-bottom: 8px; }
#settingsModal .form-actions { margin-bottom: 4px; }
#settingsModal .form-actions input {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px;
  outline: none; background: var(--list-bg); color: var(--text);
}
#settingsModal .form-actions input:focus { border-color: var(--accent); }
#settingsModal .sl-sub { margin: 8px 0 4px; }
.msg-video { display:block; width:320px; max-width:100%; max-height:360px; border-radius:10px; background:#17212e; }
.video-error { display:block; margin-top:8px; max-width:320px; font-size:12px; }
.video-error[hidden] { display:none; }
.qq-face { width:28px; height:28px; object-fit:contain; display:inline-block; vertical-align:middle; margin:0 2px; }
.qq-face-animated { width:72px; height:72px; max-width:100%; }
.face-fallback { font-size:13px; }
#composer { position:relative; }
#facePicker { position:absolute; z-index:15; bottom:calc(100% - 8px); left:24px; width:min(380px,calc(100% - 48px)); padding:14px; border:1px solid #d8e1ed; border-radius:14px; background:#fff; color:#26364a; box-shadow:0 8px 28px #23375024; }
#facePicker[hidden] { display:none; }
#facePicker header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
#facePicker header button { border:0; background:transparent; color:#52677e; padding:6px 8px; cursor:pointer; }
#faceSearch { width:100%; padding:9px 11px; margin-bottom:10px; border:1px solid #d8e1ed; border-radius:8px; background:#f7f9fc; font-size:14px; }
#faceGrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(36px,1fr)); gap:4px; max-height:min(250px,35vh); overflow-y:auto; overscroll-behavior:contain; }
.face-option { display:flex; align-items:center; justify-content:center; min-width:0; height:38px; padding:4px; border:0; border-radius:7px; background:transparent; cursor:pointer; }
.face-option img { width:30px; height:30px; object-fit:contain; }
.face-option:hover,.face-option:focus-visible { background:#e7f2ff; outline:2px solid #0875c9; outline-offset:-2px; }
.face-option-fallback { font-size:10px; overflow:hidden; }
#facePickerStatus { margin:10px 0 0; font-size:12px; color:#64758a; }
@media(max-width:520px){ #facePicker{left:8px;width:calc(100% - 16px);padding:12px;} #faceSearch{font-size:16px;} .composer-toolbar>span{display:none;} }
.voice-message{min-width:140px;max-width:360px;white-space:normal}
.voice-header{display:flex;align-items:center;justify-content:space-between;gap:24px}
.voice-label{font-size:15px;color:#566170}
.voice-transcribe{border:0;border-radius:6px;background:#edf4ff;color:#2673c9;padding:5px 9px;font:inherit;font-size:12px;cursor:pointer;white-space:nowrap}
.voice-transcribe:hover{background:#dfecff}
.voice-transcribe:focus-visible{outline:2px solid #438ce1;outline-offset:2px}
.voice-transcribe:disabled{opacity:.6;cursor:default}
.voice-transcript{border-top:1px solid rgba(100,120,145,.16);margin-top:10px;padding-top:10px;font-size:14px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;color:#283545;user-select:text}
.voice-error{color:#986225;font-size:12px}
.profile-avatar{border:0;background:transparent;padding:0;cursor:pointer;flex-shrink:0;align-self:flex-start;border-radius:10px;line-height:0}
.profile-avatar:hover{filter:brightness(.95)}
.profile-avatar:focus-visible{outline:2px solid #0875c9;outline-offset:3px}
.group-level,.group-title{display:inline-block;flex-shrink:0;font-size:11px;line-height:18px;padding:0 5px;border-radius:4px;font-weight:600;white-space:nowrap}
.group-level.member,.group-title{background:#e7e9ed;color:#5a626d}
.group-level.admin{background:#e1f1ff;color:#096eae}
.group-level.owner{background:#fff0df;color:#a24f08}
.sender-heading{flex-wrap:wrap}
#profilePanel{position:fixed;z-index:30;left:12px;top:12px;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 24px);background:#fff;box-shadow:0 16px 48px rgba(24,45,74,.22);border-radius:20px;overflow-y:auto;overflow-x:hidden;padding:24px;color:#1f2329;color-scheme:light;scrollbar-color:#b7c3d1 #fff}
.profile-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.profile-toolbar h2{font-size:13px;font-weight:500;color:#5a6574}
#profilePanel button{font:inherit;font-size:13px;border:1px solid #cbd6e4;background:transparent;color:#236098;padding:8px 14px;border-radius:10px;cursor:pointer;min-height:36px}
#profilePanel button:hover{background:#edf5fd}
#profilePanel button:focus-visible{outline:2px solid #0875c9;outline-offset:2px}
#profilePanel button:disabled{opacity:.55;cursor:default}
#profilePanel #profileClose{border:0;padding:5px 8px;min-height:30px;color:#5a6574}
.profile-identity{display:flex;align-items:center;gap:18px;margin-bottom:28px}
.profile-identity>div:last-child{min-width:0}
#profileAvatar .avatar{width:76px;height:76px;border-radius:50%;object-fit:cover}
#profileName{font-size:24px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}
#profileQQ{font-size:14px;color:#5a6574;margin:6px 0 10px;font-variant-numeric:tabular-nums;user-select:text}
#profileStatus{font-size:13px;line-height:1.6;color:#896129;margin-bottom:16px}
#profileStatus:empty{display:none}
#profileFields{display:grid;grid-template-columns:86px minmax(0,1fr);gap:15px 16px;font-size:14px;line-height:1.65;user-select:text}
#profileFields:empty{display:none}
#profileFields dt{color:#5a6574}
#profileFields dd{overflow-wrap:anywhere;white-space:pre-wrap;font-variant-numeric:tabular-nums}
#profileRetry{margin-top:20px}
#profileBadges .group-title{max-width:100%;white-space:normal;overflow-wrap:anywhere}
#profileBadges .group-level.member,#profileBadges .group-title{background:#e7e9ed;color:#5a626d}
#profileBadges .group-level.admin,#profileBadges .member-role.admin{background:#e1f1ff;color:#096eae}
#profileBadges .group-level.owner,#profileBadges .member-role.owner{background:#fff0df;color:#a24f08}
.profile-actions{display:flex;justify-content:flex-end;margin-top:24px;position:sticky;bottom:-24px;padding:12px 0 0;background:#fff}
#profilePanel #profileMessage{background:#0868c4;color:#fff;border:0;min-width:140px;min-height:42px;font-size:15px;font-weight:500}
#profilePanel #profileMessage:hover{background:#1678d6}
#profilePanel ::selection{background:#c4e4ff;color:#163d61}
@media(max-width:520px){#profilePanel{left:12px!important;top:12px!important;padding:20px}#profileName{font-size:21px}.profile-identity{gap:14px}#profileAvatar .avatar{width:64px;height:64px}}

.qq-level-icons{display:flex;align-items:center;flex-wrap:wrap;gap:3px;min-height:24px}
.qq-level-icon{display:block;width:24px;height:24px;flex:0 0 24px;object-fit:contain}
.msg-audio{display:block;width:280px;max-width:100%;height:40px;margin-top:10px}
.voice-load{margin-top:10px;border:1px solid #cedff4;border-radius:8px;background:#edf4ff;color:#2463a9;padding:8px 14px;font:inherit;cursor:pointer}
.voice-load:disabled{opacity:.6;cursor:wait}
.voice-load:focus-visible{outline:2px solid #438ce1;outline-offset:2px}
.voice-message .voice-error{margin-top:8px;line-height:1.5}
.file-message{width:360px;max-width:100%;white-space:normal}
.file-name{font-size:14px;font-weight:600;overflow-wrap:anywhere;line-height:1.5}
.file-size{font-size:12px;color:#718095;margin-top:4px}
.file-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.file-actions button{border:1px solid #d8e3f1;background:#f1f6fd;border-radius:7px;color:#2862a4;font:inherit;font-size:13px;padding:6px 12px;cursor:pointer}
.file-actions button:disabled{opacity:.6;cursor:wait}
.file-actions button:focus-visible{outline:2px solid #438ce1;outline-offset:2px}
.file-video{margin-top:12px;width:100%}
.file-status{font-size:12px;color:#986225;margin-top:8px;line-height:1.6}
.file-share-box{margin-top:10px}
.file-share-url{box-sizing:border-box;width:100%;min-width:0;border:1px solid #d8e3f1;border-radius:7px;background:#fff;color:#33445c;padding:8px;font:inherit;font-size:12px}
.file-copy{margin-top:6px;border:1px solid #d8e3f1;border-radius:7px;background:#f1f6fd;color:#2862a4;padding:6px 12px;font:inherit;font-size:13px;cursor:pointer}
.file-share-note{font-size:12px;color:#718095;margin-top:6px;line-height:1.6}
.file-share-url:focus-visible,.file-copy:focus-visible{outline:2px solid #438ce1;outline-offset:2px}

/* Chat tools inherit the existing white / blue conversation surface. */
#groupNoticesBtn{position:absolute;right:155px;top:16px;padding:7px 12px;border:1px solid #d5deea;border-radius:7px;background:#fff;color:#2862a4;cursor:pointer;font:inherit;font-size:13px}
#chatTitle,#chatSub{padding-right:250px}
#chatHistoryBtn{margin-left:auto}
.message-reply{order:4;align-self:flex-start;border:0;background:transparent;color:#386890;font:inherit;font-size:12px;padding:3px 0;cursor:pointer;opacity:0}
.msg-row:hover .message-reply,.msg-row:focus-within .message-reply{opacity:1}
.message-reply:focus-visible,.history-reply:focus-visible{outline:2px solid #438ce1;outline-offset:2px}
#replyDraft{display:flex;align-items:center;gap:12px;justify-content:space-between;background:#eef3fa;border:1px solid #dbe5f2;border-radius:8px;margin:6px 0;padding:9px 12px;font-size:13px;color:#40556d}
#replyDraft[hidden]{display:none}#replyDraft>div{min-width:0}#replyDraft p{margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:65ch}
#replyDraftCancel{flex-shrink:0;border:0;background:transparent;color:#2862a4;cursor:pointer;padding:6px}
#imagePrevious,#imageNext{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:52px;display:grid;place-items:center;border:0;border-radius:8px;background:#fff;color:#245c92;cursor:pointer;z-index:2}
#imagePrevious{left:12px}#imageNext{right:12px}#imagePrevious:disabled,#imageNext:disabled{opacity:.35;cursor:default}
#imageCounter{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);padding:5px 12px;background:#fff;color:#344c67;border-radius:6px;font-size:13px;font-variant-numeric:tabular-nums;margin:0}
#historySearchPanel{width:min(720px,100vw)}
#historyTypeTabs{display:flex;gap:6px;overflow-x:auto;border-bottom:1px solid #e0e7ef;margin-top:12px;padding-bottom:4px}
#historyTypeTabs button{flex-shrink:0;border:0;border-radius:0;background:transparent;padding:10px;color:#53677e;font:inherit;font-size:14px;cursor:pointer}
#historyTypeTabs button[aria-pressed=true]{color:#0969ba;box-shadow:inset 0 -2px #147dcc;font-weight:600}
.history-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.history-filters label{display:flex;flex-direction:column;align-items:stretch;gap:6px}
.history-type-bar{display:flex;align-items:center;gap:12px;border-bottom:1px solid #e6ecf3;margin-top:12px}
#historySearchPanel .history-type-bar #historyTypeTabs{flex:1;min-width:0;margin:0;border:0;gap:8px}
#historySearchPanel #historyFilterToggle{display:flex;align-items:center;flex-shrink:0;gap:5px;padding:6px 8px;border:0;background:transparent;color:#405a76;white-space:nowrap}
#historyFilterToggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#historyFilterToggle .filter-chevron{width:14px;height:14px}
#historySearchPanel #historyFilterToggle[aria-expanded="true"]{color:#0875c9;background:#edf5fd}
#historyFilterToggle[aria-expanded="true"] .filter-chevron{transform:rotate(180deg)}
.history-filter-summary{display:flex;align-items:center;gap:12px;min-height:34px;padding:4px 0;color:#617187;font-size:12px}
#historyFilterSummary{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#historySearchPanel .history-filter-summary #historyReset{border:0;padding:3px 0;min-height:28px;font-size:12px;background:transparent;flex-shrink:0}
#historyAdvancedFilters[hidden],#historyReset[hidden]{display:none}
#historyAdvancedFilters{padding:4px 0 12px;border-bottom:1px solid #e6ecf3;max-height:45vh;overflow:auto}
#historyAdvancedFilters .history-filters{margin-top:2px}
.history-filter-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.history-filter-actions .history-search-help{margin:0}
#historySearchPanel #historyApplyFilters{flex-shrink:0;background:#0875c9;color:#fff;border-color:#0875c9}
#historySearchForm{flex-shrink:0}
#historySearchPanel .history-type-bar #historyTypeTabs button{white-space:nowrap;padding:9px 8px}
@media(max-width:440px){.history-type-bar{gap:4px}#historySearchPanel .history-type-bar #historyTypeTabs{gap:2px}#historySearchPanel #historyFilterToggle{padding:6px 4px}.history-filter-actions{align-items:flex-end}}
#historySearchPanel .history-type-bar #historyTypeTabs{scrollbar-width:none}
#historyTypeTabs::-webkit-scrollbar{display:none}
.history-source{font-size:12px;color:#617187;padding:8px 0 2px;overflow-wrap:anywhere}
#historySearchResults .history-hit{padding:12px 0;border-top:0;border-bottom:1px solid #edf0f4}
.history-hit-head{display:flex;align-items:center;gap:10px;min-width:0;min-height:28px}
.history-hit-sender{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;color:#52647a}
.history-hit-time{font-size:12px;color:#617187;white-space:nowrap;font-variant-numeric:tabular-nums}
.history-hit-actions{display:flex;margin-left:auto;gap:8px;flex-shrink:0}
#historySearchPanel .history-hit-actions button{padding:2px 0;min-height:28px;border:0;background:transparent;font-size:12px}
#historySearchPanel .history-hit-actions button:hover{text-decoration:underline;text-underline-offset:3px}
#historySearchResults .history-hit-text{margin:4px 0 0}
#historySearchResults .history-day{font-size:12px;padding:12px 0 6px;margin:0;color:#617187}
@media(hover:hover) and (pointer:fine){.history-hit-actions{opacity:0}.history-hit:hover .history-hit-actions,.history-hit:focus-within .history-hit-actions{opacity:1}}
#historySearchResults .history-hit.history-has-next{border-bottom:0;padding-bottom:2px}
#historySearchResults .history-hit.history-continued{padding-top:6px}
.history-continued .history-hit-head{height:0;min-height:0;position:relative}
.history-continued .history-hit-actions{position:absolute;right:0;top:0}
#historySearchResults .history-continued .history-hit-text{margin-top:0;padding-right:108px}
#videoAttachment{display:flex;align-items:center;gap:14px;padding:10px;margin:0 0 12px;border:1px solid #d6e0ed;border-radius:8px;background:#fff}
#videoAttachment[hidden]{display:none}
.draft-video{width:200px;max-width:50%;max-height:140px;border-radius:6px;background:#17212e}
.draft-video-details{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:12px;color:#596779;overflow-wrap:anywhere}
.draft-video-details strong{font-size:13px;color:#26384e}
.draft-video-details button{align-self:flex-start;border:0;background:transparent;padding:4px 0;color:#236098;font:inherit;cursor:pointer}
#pickVideo:focus-visible,.draft-video-details button:focus-visible{outline:2px solid #0875c9;outline-offset:2px}
.history-filters input{width:100%;box-sizing:border-box;min-width:0;border:1px solid #cad6e5;border-radius:6px;padding:8px;background:#fff;color:#26384d;font:inherit;font-size:13px}
#historyReset{border:0;background:transparent;color:#2862a4;padding:4px 8px;cursor:pointer}
.history-day{font-size:14px;margin:20px 0 8px;color:#52657a}.history-hit{border:0;border-bottom:1px solid #e0e7ef;border-radius:0;padding:16px 2px;margin:0}
.history-hit-text .msg-img{max-width:180px;max-height:140px;object-fit:contain;cursor:zoom-in;display:inline-block;vertical-align:middle;border-radius:6px;margin:6px 6px 6px 0}
.history-hit-text .msg-video{max-width:100%}.history-hit-text .qq-face{max-width:48px;max-height:48px}
.history-reply{margin-left:8px;border:1px solid #d5deea;border-radius:6px;padding:6px 10px;background:#fff;color:#2862a4;cursor:pointer;font:inherit;font-size:13px}
#noticePanel{position:absolute;z-index:35;right:16px;top:70px;bottom:16px;width:min(420px,calc(100% - 32px));box-sizing:border-box;overflow-y:auto;background:#fff;box-shadow:0 12px 36px #1e3b5b26;border-radius:12px;padding:20px;color:#26384d}
#noticePanel header,.notice-tools{display:flex;align-items:center;justify-content:space-between;gap:12px}#noticePanel h2{font-size:18px;margin:0}#noticePanel button:not(.notice-image){border:1px solid #d5deea;border-radius:6px;background:#fff;color:#2862a4;padding:7px 12px;cursor:pointer}
.notice-tools{margin-top:16px;font-size:13px;color:#53677e}#noticeStatus{font-size:13px;line-height:1.5}.group-notice{padding:18px 0;border-top:1px solid #e0e7ef}.notice-meta{font-size:12px;color:#5d6e82}.notice-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.75;margin:10px 0}
.notice-image{display:block;padding:0;border:0;background:transparent;cursor:zoom-in}.notice-image img{display:block;max-width:100%;max-height:220px;border-radius:6px}
@media(max-width:640px){#chatTitle,#chatSub{padding-right:0}#chatHeader{padding-bottom:48px}#groupNoticesBtn{top:auto;bottom:10px;left:16px;right:auto}#chat #chatHeader #groupMembersBtn{top:auto;bottom:10px;right:16px}.message-reply{opacity:1}#replyDraft p{max-width:180px}.composer-toolbar{flex-wrap:wrap}#chatHistoryBtn{margin-left:0}.composer-toolbar>span{display:none}.history-filters{gap:8px}#noticePanel{top:112px}}
