/* ============ 企业微信 Windows 5.0 风格设计系统(取材于 REA 分析) ============ */
:root {
  --brand: #2B7DE9;            /* 企微蓝 */
  --brand-hover: #1E6AD1;
  --bubble-me: #D9EFFF;        /* 我方气泡浅蓝 */
  --bg-window: #EDEEF0;
  --bg-panel: #F7F8FA;         /* 会话列表底 */
  --bg-white: #FFFFFF;
  --bg-hover: #F2F3F5;
  --bg-active: #E8EDEE;        /* 企微会话选中灰 */
  --text-1: #191F25;
  --text-2: #5F6672;
  --text-3: #9AA0A8;
  --line: #E5E6E8;
  --green: #3EB575;
  --danger: #E64545;
  --radius: 6px;
  --on-brand: #FFFFFF;         /* T13:反白文字(品牌/危险色底),深色模式保持白 */

  /* --- tokenized (T4) --- */
  --purple: #6E50E0;
  --warning-fg: #D97706;
  --warning-fg-hover: #B45309;
  --warning-bar: #FF8F1F;
  --warning-bg: #FFF9F0;
  --star: #FFB400;
  --green-fg: #1E8A54;
  --scrollbar: #D1D5DA;
  --bg-input: #E4E6E9;
  --bg-field: #E9EBED;
  --bg-field-hover: #E2E4E7;
  --divider-bg: #E2E4E8;
  --bg-hover-blue: #F2F7FF;
  --bg-minutes: #FDFDF6;
  --bg-chat: #F5F6F7;
  --bg-soft: #F0F1F3;
  --bg-tint-purple: #FBFAFF;
  --bot-bubble-bg: #F0EAFE;
  --bot-bubble-line: #DCCFF8;
  --muted-1: #C9CDD4;
  --muted-2: #7A8699;
  --muted-3: #B3BAC3;
  --dept-icon: #5B7CA8;
  --disabled-bg: #B8C4D4;
  --line-2: #E4E7EB;
  --on-dark-text: #DDE2E8;
  --on-dark-text-2: #E8ECF0;
  --on-dark-muted: #AEB6C0;
  --staff-tint-1: #EAF2FE;
  --staff-tint-2: #EFECFB;
  --staffgroup-tint-1: #E8F1FD;
  --staffgroup-tint-2: #EFEAFB;
  --t-fast: .12s ease;         /* T14:轻量过渡 */
  --brand-dim: rgba(43, 125, 233, .22);  /* T14:选中描边 */
  --shadow-lg: 0 12px 32px rgba(25, 31, 37, .18);  /* T14:浮层投影 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px; color: var(--text-1); background: var(--bg-window);
  user-select: none; cursor: default;
}
#app { display: flex; flex-direction: column; height: 100vh; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 自绘标题栏 ============ */
#titleBar {
  height: 36px; background: var(--bg-panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  -webkit-app-region: drag; flex-shrink: 0; padding-left: 12px;
}
.tb-left { display: flex; align-items: center; gap: 8px; }
.tb-logo {
  width: 20px; height: 20px; border-radius: 5px; display: block; object-fit: cover;
}
.tb-name { font-size: 12px; color: var(--text-2); }
.tb-right { display: flex; height: 100%; -webkit-app-region: no-drag; }
.tb-btn {
  width: 46px; height: 100%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; color: var(--text-2);
}
.tb-btn:hover { background: var(--bg-hover); }
.tb-btn.close:hover { background: var(--danger); color: var(--on-brand); }

#body { flex: 1; display: flex; min-height: 0; }

/* ============ 左侧窄导航(企微:图标+文字,浅色可选中) ============ */
#navRail {
  width: 64px; background: var(--bg-panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 12px; gap: 2px; flex-shrink: 0;
}
.nav-me { margin-bottom: 10px; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: var(--on-brand); display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.nav-btn {
  position: relative; width: 56px; height: 48px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; margin-bottom: 2px;
  transition: background .12s;
}
.nav-btn:hover { background: var(--bg-hover); }
.nav-btn.active { background: var(--bg-active); }
.nav-ico { font-size: 18px; }
.nav-txt { font-size: 10px; color: var(--text-2); }
.nav-btn.active .nav-txt { color: var(--brand); font-weight: 600; }
.nav-spacer { flex: 1; }
.nav-badge {
  position: absolute; top: 3px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: var(--on-brand); border-radius: 8px; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.nav-badge[hidden] { display: none; }   /* 无未读时不显示角标(否则 display:flex 覆盖 hidden) */

#main { flex: 1; display: flex; min-width: 0; background: var(--bg-white); }
.view { display: none; flex: 1; min-width: 0; }
.view.active { display: flex; }

/* ============ 消息视图:会话列表(企微同款) ============ */
#convPane {
  width: 248px; background: var(--bg-panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.conv-search { padding: 10px 10px 6px; }
.conv-search input {
  width: 100%; height: 28px; border: none; outline: none; border-radius: 5px;
  background: var(--bg-input); padding: 0 10px; font-size: 12px; color: var(--text-1);
}
.conv-search input:focus { background: var(--bg-white); box-shadow: 0 0 0 1.5px var(--brand); }
#convList { flex: 1; overflow-y: auto; padding: 2px 4px 8px; }
.conv-item {
  display: flex; gap: 10px; padding: 10px 10px; cursor: pointer; position: relative;
  align-items: center; border-radius: 6px; transition: background .1s;
}
.conv-item:hover { background: var(--bg-hover); }
.conv-item.active { background: var(--bg-active); }
.avatar {
  width: 38px; height: 38px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-brand); font-weight: 600; font-size: 15px; position: relative;
}
.avatar.bot { border-radius: 50%; background: linear-gradient(135deg,var(--purple),var(--brand))!important; }
.avatar.small { width: 28px; height: 28px; font-size: 12px; border-radius: 5px; }
.conv-main { flex: 1; min-width: 0; }
.conv-row1 { display: flex; justify-content: space-between; align-items: center; }
.conv-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; margin-left: 6px; }
.conv-row2 { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.conv-preview { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-unread {
  min-width: 17px; height: 17px; padding: 0 5px; background: var(--danger); color: var(--on-brand);
  border-radius: 9px; font-size: 10.5px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.conv-pin { position: absolute; top: 7px; right: 9px; font-size: 10px; opacity: .5; }
.conv-mute { font-size: 10px; color: var(--text-3); }

/* ============ 聊天区 ============ */
#chatArea { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-chat); }
#chatHeader {
  height: 50px; background: var(--bg-white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0;
}
.ch-left { display: flex; align-items: baseline; gap: 10px; }
#chatTitle { font-size: 15px; font-weight: 600; }
#chatSub { font-size: 12px; color: var(--text-3); }
.ch-right { display: flex; align-items: center; gap: 12px; }
.tool-btn {
  border: none; background: transparent; font-size: 12px; cursor: pointer;
  color: var(--brand); padding: 4px 8px; border-radius: 4px;
}
.tool-btn:hover { background: rgba(43,125,233,.08); }
.tool-ico { font-size: 15px; cursor: pointer; opacity: .65; }
.tool-ico:hover { opacity: 1; }

#msgList { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.empty-hint { margin: auto; color: var(--text-3); font-size: 13px; }
.msg { display: flex; gap: 10px; max-width: 68%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble {
  padding: 9px 12px; border-radius: 6px; background: var(--bg-white); line-height: 1.55;
  font-size: 14px; white-space: pre-wrap; word-break: break-word; user-select: text;
  box-shadow: 0 1px 2px rgba(25,31,37,.05);
}
.msg.me .msg-bubble { background: var(--bubble-me); }   /* 企微:我方浅蓝气泡 */
.msg.bot .msg-bubble { background: var(--bot-bubble-bg); border: 1px solid var(--bot-bubble-line); }
.msg-meta { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.msg.me .msg-meta { text-align: right; }
.day-divider { align-self: center; font-size: 11px; color: var(--text-3); background: var(--divider-bg); border-radius: 10px; padding: 2px 10px; }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; height: 20px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.25} 40%{opacity:1} }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg-send-fail { color: var(--danger); font-size: 11px; align-self: center; }

/* ---- 输入区(企微:白底工具条+右下发送按钮) ---- */
#chatInputBar { background: var(--bg-white); border-top: 1px solid var(--line); padding: 6px 14px 10px; flex-shrink: 0; }
.input-tools { display: flex; gap: 14px; font-size: 16px; padding: 4px 2px 2px; }
.t-ico { cursor: pointer; opacity: .55; transition: transform .1s; }
.t-ico:hover { opacity: 1; transform: scale(1.12); }
.input-row { display: flex; gap: 10px; align-items: flex-end; margin-top: 2px; }
#msgInput {
  flex: 1; resize: none; border: none; outline: none; font-size: 14px; line-height: 1.6;
  font-family: inherit; height: 96px; max-height: 160px; padding: 8px 4px; background: transparent;
  color: var(--text-1); user-select: text; overflow-y: auto;
}
#btnSend {
  border: none; background: var(--brand); color: var(--on-brand); border-radius: 5px;
  padding: 6px 20px; cursor: pointer; font-size: 13px; margin-bottom: 2px;
}
#btnSend:hover { background: var(--brand-hover); }
#btnSend:disabled { background: var(--disabled-bg); cursor: default; }

/* ============ 通讯录 ============ */
#deptPane { width: 220px; background: var(--bg-panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; }
.pane-title { padding: 14px 16px 8px; font-weight: 600; font-size: 14px; }
#deptList { flex: 1; overflow-y: auto; padding: 0 4px 8px; }
.dept-item { padding: 9px 14px; cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; border-radius: 6px; }
.dept-item:hover { background: var(--bg-hover); }
.dept-item.active { background: var(--bg-active); color: var(--brand); font-weight: 600; }
.dept-count { color: var(--text-3); font-size: 12px; }
#memberPanel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-white); }
#memberHeader { padding: 14px 20px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
#memberList { flex: 1; overflow-y: auto; padding: 8px 0; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 20px; cursor: pointer; }
.member-row:hover { background: var(--bg-hover); }
.member-name { font-weight: 500; font-size: 13.5px; }
.member-title { font-size: 12px; color: var(--text-3); }
.member-online { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-1); margin-left: auto; }
.member-online.on { background: var(--green); }

/* ============ 工作台/文档/纪要 页面 ============ */
.page-wrap { flex: 1; overflow-y: auto; padding: 20px 28px; background: var(--bg-white); }
.page-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.page-header h2 { font-size: 17px; }
.panel-sub { font-size: 12px; color: var(--text-3); }
#appGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.app-card {
  display: flex; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; transition: all .15s; position: relative; background: var(--bg-white);
}
.app-card:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgba(43,125,233,.10); }
.app-icon { width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.app-name { font-weight: 600; font-size: 13.5px; }
.app-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.app-badge {
  position: absolute; top: -6px; right: -6px; background: var(--danger); color: var(--on-brand);
  border-radius: 9px; min-width: 18px; height: 18px; font-size: 11px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.panel-block { margin-top: 22px; }
.panel-block h3 { font-size: 14.5px; margin-bottom: 10px; }
.row-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.primary-btn {
  border: none; background: var(--brand); color: var(--on-brand); border-radius: 5px;
  padding: 7px 16px; cursor: pointer; font-size: 13px;
}
.primary-btn:hover { background: var(--brand-hover); }
.ghost-btn {
  border: 1px solid var(--line); background: var(--bg-white); border-radius: 5px; padding: 6px 14px;
  font-size: 13px; cursor: pointer; color: var(--text-2);
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }
.todo-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.todo-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.todo-text.done { text-decoration: line-through; color: var(--text-3); }
.todo-due { font-size: 12px; color: var(--text-3); margin-left: auto; }
.todo-due.overdue { color: var(--danger); }
.rec-state { font-size: 12px; color: var(--danger); }
.transcript-box, .minutes-box {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 90px;
  font-size: 13px; line-height: 1.7; user-select: text; background: var(--bg-panel); white-space: pre-wrap;
}
.minutes-box { background: var(--bg-minutes); }
.meeting-hist-row { padding: 8px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; cursor: pointer; }
.meeting-hist-row:hover { color: var(--brand); }

/* 文档列表 */
#docList { display: flex; flex-direction: column; gap: 8px; }
.doc-card {
  display: flex; gap: 14px; align-items: center; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; cursor: pointer; background: var(--bg-white); transition: all .15s;
}
.doc-card:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgba(43,125,233,.08); }
.doc-ico { font-size: 24px; }
.doc-info { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; font-size: 13.5px; }
.doc-summary { font-size: 12px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12px; color: var(--text-3); text-align: right; flex-shrink: 0; }
.doc-tags { display: flex; gap: 4px; justify-content: flex-end; margin-top: 4px; }
.doc-tag { font-size: 10px; background: rgba(43,125,233,.08); color: var(--brand); border-radius: 4px; padding: 1px 6px; }

/* ============ AI 侧栏 ============ */
#aiPanel {
  width: 360px; border-left: 1px solid var(--line); background: var(--bg-white); display: flex;
  flex-direction: column; flex-shrink: 0;
}
#aiHeader { display: flex; align-items: center; gap: 8px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.ai-logo { font-size: 17px; }
#aiHeader b { flex: 1; font-size: 14px; }
#aiClose { border: none; background: none; cursor: pointer; font-size: 13px; color: var(--text-3); }
#aiClose:hover { color: var(--text-1); }
#aiTabs { display: flex; gap: 6px; padding: 9px 14px 0; flex-wrap: wrap; }
.ai-tab {
  border: none; background: var(--bg-hover); padding: 5px 12px; border-radius: 14px;
  cursor: pointer; font-size: 12px; color: var(--text-2);
}
.ai-tab.active { background: rgba(43,125,233,.12); color: var(--brand); font-weight: 600; }
#aiBody { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.ai-msg { max-width: 94%; padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; user-select: text; }
.ai-msg.user { align-self: flex-end; background: var(--brand); color: var(--on-brand); }
.ai-msg.bot { align-self: flex-start; background: var(--bg-hover); }
.ai-msg .cite { color: var(--brand); font-size: 11px; display: block; margin-top: 5px; }
.ai-msg .cite-list { font-size: 11.5px; color: var(--text-2); }
.ai-suggest { border: 1px dashed var(--line); border-radius: 7px; padding: 7px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.ai-suggest:hover { border-color: var(--brand); color: var(--brand); }
#aiInputBar { display: flex; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--line); }
#aiInput { flex: 1; border: 1px solid var(--line); border-radius: 6px; outline: none; padding: 7px 11px; font-size: 13px; user-select: text; }
#aiInput:focus { border-color: var(--brand); }
#aiSend { border: none; background: linear-gradient(135deg, var(--purple), var(--brand)); color: var(--on-brand); border-radius: 6px; width: 38px; cursor: pointer; }
.ai-status-bar { padding: 6px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; }
.ai-chip { font-size: 10.5px; padding: 2px 8px; border-radius: 9px; background: var(--bg-hover); color: var(--text-2); }
.ai-chip.on { background: rgba(62,181,117,.12); color: var(--green-fg); }
.ai-chip.off { background: rgba(230,69,69,.08); color: var(--danger); }
.ai-tool-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.ai-tool-row:hover { border-color: var(--brand); }
.ai-tool-row .tool-run { margin-left: auto; font-size: 11px; color: var(--brand); }

/* ============ 全局搜索覆盖层 ============ */
#searchOverlay { position: fixed; inset: 0; background: rgba(25,31,37,.35); z-index: 100; display: flex; justify-content: center; padding-top: 90px; }
#searchPanel {
  width: 620px; max-height: 70vh; background: var(--bg-white); border-radius: 10px; box-shadow: 0 12px 40px rgba(25,31,37,.18);
  display: flex; flex-direction: column; overflow: hidden; align-self: flex-start;
}
#searchPanel > header { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
#searchOverlayInput { flex: 1; border: none; outline: none; font-size: 15px; user-select: text; }
#searchClose { border: 1px solid var(--line); background: var(--bg-hover); border-radius: 5px; font-size: 10px; padding: 3px 6px; color: var(--text-3); cursor: pointer; }
#searchFilters { display: flex; gap: 6px; padding: 9px 15px; border-bottom: 1px solid var(--line); align-items: center; }
.sf { border: none; background: var(--bg-hover); border-radius: 13px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.sf.active { background: var(--brand); color: var(--on-brand); }
.sem-switch { margin-left: auto; font-size: 12px; color: var(--text-2); display: flex; gap: 4px; align-items: center; cursor: pointer; }
.sem-switch input { accent-color: var(--brand); }
#searchResults { overflow-y: auto; padding: 6px; flex: 1; }
.sr-group { font-size: 11px; color: var(--text-3); padding: 8px 10px 4px; }
.sr-item { display: flex; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; align-items: center; }
.sr-item:hover { background: var(--bg-hover); }
.sr-title { font-size: 13px; }
.sr-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.sr-badge { font-size: 10px; color: var(--brand); background: rgba(43,125,233,.08); border-radius: 4px; padding: 1px 6px; margin-left: 6px; flex-shrink: 0; }
.sr-empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 13px; }
.sr-score { margin-left: auto; font-size: 10px; color: var(--muted-1); flex-shrink: 0; }
mark { background: rgba(255, 214, 90, .55); color: inherit; border-radius: 2px; padding: 0 1px; }

#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: rgba(25,31,37,.9); color: var(--on-brand); border-radius: 7px; padding: 8px 17px;
  font-size: 13px; z-index: 200; transition: opacity .3s;
}

/* ============ 基础功能补全:对话框/表情/文件图片气泡/@/系统消息 ============ */
/* 会话列表 + 号 */
.conv-search { display: flex; gap: 6px; }
.conv-search input { flex: 1; }
#btnNewConv {
  width: 28px; height: 28px; border: none; border-radius: 5px; background: var(--bg-input);
  font-size: 16px; color: var(--text-2); cursor: pointer; line-height: 1; flex-shrink: 0;
}
#btnNewConv:hover { background: var(--brand); color: var(--on-brand); }

/* 通用覆盖层 + 对话框 */
.overlay { position: fixed; inset: 0; background: rgba(25,31,37,.4); z-index: 150; display: flex; align-items: center; justify-content: center; }
.dialog {
  width: 460px; max-height: 76vh; background: var(--bg-white); border-radius: 10px;
  box-shadow: 0 16px 48px rgba(25,31,37,.2); display: flex; flex-direction: column; overflow: hidden;
}
.dialog > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.dlg-close { border: none; background: none; cursor: pointer; color: var(--text-3); font-size: 13px; }
.dlg-close:hover { color: var(--text-1); }
.dlg-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.dlg-field { margin-bottom: 12px; }
.dlg-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.dlg-count { color: var(--brand); }
.dlg-field input[type=text] {
  width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 6px;
  outline: none; padding: 0 10px; font-size: 13px; user-select: text;
}
.dlg-field input[type=text]:focus { border-color: var(--brand); }
.dlg-member-list { border: 1px solid var(--line); border-radius: 6px; max-height: 260px; overflow-y: auto; }
.dlg-dept { font-size: 11px; color: var(--text-3); padding: 7px 12px 3px; background: var(--bg-panel); }
.dlg-member {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.dlg-member:hover { background: var(--bg-hover); }
.dlg-member.sel { background: rgba(43,125,233,.07); }
.dlg-member input[type=checkbox] { accent-color: var(--brand); }
.dlg-member .member-title { margin-left: auto; font-size: 11px; color: var(--text-3); }
.dialog > footer {
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px;
  border-top: 1px solid var(--line);
}
/* 中性确认框(退出登录等) */
.confirm-dialog { width: 380px; }
.confirm-dialog .cd-body { font-size: 13px; color: var(--text-2); line-height: 1.75; }
.confirm-dialog .cd-body b { color: var(--text-1); font-weight: 600; }
.confirm-dialog .cd-body .muted { color: var(--text-3); font-size: 12px; }
.confirm-dialog .cd-body .muted-row { margin-top: 6px; }

/* 表情面板 */
#emojiPanel {
  position: fixed; bottom: 120px; left: 320px; width: 288px; background: var(--bg-white);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 32px rgba(25,31,37,.16);
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 10px; z-index: 140;
}
.emoji-item { border: none; background: none; font-size: 20px; cursor: pointer; padding: 4px; border-radius: 6px; }
.emoji-item:hover { background: var(--bg-hover); }

/* @提及浮层 */
#mentionPanel {
  position: fixed; left: 320px; bottom: 120px; width: 220px; max-height: 240px; overflow-y: auto;
  background: var(--bg-white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 32px rgba(25,31,37,.16); z-index: 140; padding: 4px;
}
.mention-item {
  display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none;
  padding: 7px 10px; cursor: pointer; font-size: 13px; border-radius: 6px; text-align: left;
}
.mention-item:hover { background: var(--bg-hover); }

/* 通讯录行 hover 发消息按钮 */
.member-row .msg-quick-btn {
  display: none; margin-left: 8px; border: 1px solid var(--brand); background: var(--bg-white);
  color: var(--brand); border-radius: 5px; font-size: 11px; padding: 3px 9px; cursor: pointer; flex-shrink: 0;
}
.member-row:hover .msg-quick-btn { display: inline-block; }
.msg-quick-btn:hover { background: var(--brand); color: var(--on-brand); }

/* 系统消息(居中灰条) */
.system-msg {
  align-self: center; font-size: 11px; color: var(--text-3); background: var(--divider-bg);
  border-radius: 10px; padding: 3px 12px; max-width: 80%; text-align: center;
}

/* 文件卡片气泡 */
.file-card { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 180px; }
.fc-ico { font-size: 26px; }
.fc-name { font-weight: 600; font-size: 13px; word-break: break-all; }
.fc-size { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.msg.me .file-card .fc-size { color: var(--text-2); }

/* 图片气泡 */
.img-bubble { max-width: 260px; max-height: 200px; border-radius: 6px; cursor: pointer; display: block; }
.img-lost { font-size: 12px; color: var(--text-3); padding: 6px 2px; }

/* @高亮 */
.mention { color: var(--brand); background: rgba(43,125,233,.10); border-radius: 3px; padding: 0 2px; }

/* ============ 真实能力:灯箱/文件操作/日程卡/图片说明 ============ */
/* 图片灯箱 */
#lightbox {
  position: fixed; inset: 0; background: rgba(12,14,16,.88); z-index: 300;
  display: flex; flex-direction: column;
}
#lightbox .lb-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(255,255,255,.06); color: var(--on-dark-text);
}
#lightbox .lb-toolbar button {
  border: none; background: rgba(255,255,255,.10); color: var(--on-brand); width: 30px; height: 26px;
  border-radius: 5px; cursor: pointer; font-size: 13px;
}
#lightbox .lb-toolbar button:hover { background: rgba(255,255,255,.22); }
#lightbox .lb-name { flex: 1; font-size: 12px; color: var(--on-dark-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lightbox .lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#lightbox .lb-stage img { max-width: 92%; max-height: 92%; box-shadow: 0 8px 40px rgba(0,0,0,.5); transition: transform .12s; }

/* 文件卡片操作按钮 */
.fc-actions { display: flex; gap: 6px; margin-left: 8px; flex-shrink: 0; }
.fc-actions button {
  border: 1px solid var(--brand); background: var(--bg-white); color: var(--brand);
  border-radius: 5px; font-size: 11px; padding: 3px 9px; cursor: pointer; white-space: nowrap;
}
.fc-actions button:hover { background: var(--brand); color: var(--on-brand); }

/* 图片说明 */
.img-note { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* 日程卡片 */
.schedule-card { display: flex; gap: 10px; align-items: center; min-width: 190px; }
.sc-ico { font-size: 24px; }
.sc-title { font-weight: 600; font-size: 13px; }
.sc-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ============ 精修:SVG 工具条 / 截图选区蒙层 / 企微表情面板 ============ */
/* 工具条:线性 SVG 图标,hover 上色 */
.input-tools { gap: 16px; }
.t-ico {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2); opacity: 1; transition: color .12s, transform .12s;
}
.t-ico svg { display: block; }
.t-ico:hover { color: var(--brand); transform: translateY(-1px); }
.t-ico.at-text {
  font-size: 17px; font-weight: 600; line-height: 19px; width: 19px; height: 19px;
  font-family: "Segoe UI", sans-serif;
}

/* 截图蒙层 */
#shotMask { position: fixed; inset: 0; z-index: 500; cursor: crosshair; user-select: none; }
#shotMask .shot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
#shotMask .shot-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
#shotMask .shot-sel {
  position: absolute; border: 1.5px solid var(--brand); box-shadow: 0 0 0 9999px rgba(0,0,0,.0);
  overflow: visible; cursor: move;
}
#shotMask .shot-sel-img { position: absolute; max-width: none; pointer-events: none; }
#shotMask .shot-size {
  position: absolute; top: -26px; left: 0; background: rgba(20,24,28,.85); color: var(--on-brand);
  font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
#shotMask .shot-toolbar { display: none; position: absolute; right: 0; bottom: -42px; gap: 8px; }
#shotMask .shot-sel.done .shot-size { display: none; }
.shot-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}
.shot-btn.ok { background: var(--brand); color: var(--on-brand); }
.shot-btn.ok:hover { background: var(--brand-hover); }
.shot-btn.cancel { background: var(--bg-white); color: var(--text-2); }
.shot-btn.cancel:hover { background: var(--bg-soft); }
#shotMask .shot-tip {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(20,24,28,.82); color: var(--on-dark-text-2); font-size: 12px;
  padding: 7px 16px; border-radius: 16px; pointer-events: none;
}

/* 企微式表情面板 */
#emojiPanel {
  position: fixed; bottom: 132px; left: 320px; width: 356px; height: 264px;
  background: var(--bg-white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 36px rgba(25,31,37,.18); z-index: 140;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.emoji-tabs {
  display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line);
  background: var(--bg-panel); flex-shrink: 0;
}
.emoji-tab {
  border: none; background: none; font-size: 12px; color: var(--text-2);
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.emoji-tab:hover { background: var(--bg-hover); }
.emoji-tab.active { background: var(--bg-white); color: var(--brand); font-weight: 600; box-shadow: inset 0 -2px 0 var(--brand); border-radius: 6px 6px 0 0; }
.emoji-grid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(9, 1fr);
  align-content: start; gap: 1px; padding: 6px;
}
.emoji-item { border: none; background: none; font-size: 19px; cursor: pointer; padding: 4px 0; border-radius: 6px; line-height: 1.3; }
.emoji-item:hover { background: var(--bg-hover); }
.emoji-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 12px; padding: 30px 0; }

/* 截图选区:8向手柄 + 移动光标 */
#shotMask .shot-sel { cursor: move; }
#shotMask .shot-handle { position: absolute; width: 9px; height: 9px; background: var(--bg-white); border: 1.5px solid var(--brand); border-radius: 2px; }
.h-n { top: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.h-s { bottom: -5px; left: 50%; margin-left: -5px; cursor: ns-resize; }
.h-e { right: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.h-w { left: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.h-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.h-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.h-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.h-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }

/* ============ 企微式表情面板 v2:最近使用常显行 + 底部图标Tab ============ */
#emojiPanel {
  position: fixed; bottom: 132px; left: 320px; width: 384px; height: 300px;
  background: var(--bg-white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 36px rgba(25,31,37,.18); z-index: 140;
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
/* 顶部最近使用(常显,带浅灰底) */
.emoji-recent {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 6px 10px; background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.emoji-recent-label { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.emoji-recent-row { display: flex; gap: 2px; overflow: hidden; flex: 1; }
.emoji-recent-row .emoji-item { font-size: 17px; padding: 2px 4px; }
/* 中间网格 */
.emoji-grid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(9, 1fr);
  align-content: start; gap: 1px; padding: 6px 8px;
}
.emoji-item { border: none; background: none; font-size: 20px; cursor: pointer; padding: 4px 0; border-radius: 6px; line-height: 1.35; }
.emoji-item:hover { background: var(--bg-hover); }
/* 底部图标式分类 Tab(企微:图标 + 高亮下划线,右侧留白,最左下角设置位) */
.emoji-tabs {
  display: flex; align-items: center; gap: 2px; padding: 4px 10px;
  border-top: 1px solid var(--line); background: var(--bg-panel); flex-shrink: 0;
}
.emoji-tab {
  border: none; background: none; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; opacity: .55;
  border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
}
.emoji-tab .emoji-tab-ico { font-size: 17px; line-height: 1; filter: grayscale(1); transition: filter .12s; }
.emoji-tab:hover { opacity: .85; background: var(--bg-hover); }
.emoji-tab.active { opacity: 1; border-bottom-color: var(--brand); }
.emoji-tab.active .emoji-tab-ico { filter: none; }
.emoji-empty { grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 12px; padding: 30px 0; }

/* ============ 企微式截图:输入区附件草稿条 ============ */
.shot-draft-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px;
  background: var(--bg-panel); border-bottom: 1px solid var(--line);
}
.shot-draft-thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.shot-draft-name { font-size: 12px; color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-draft-remove { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; }
.shot-draft-remove:hover { color: var(--danger); }

/* ============ 通讯录 v3(企微精修:组织树 + 成员列表 + 详情面板) ============ */
/* ---- 左栏:组织树 ---- */
#deptPane { width: 300px; }   /* T59-fix12:左栏放宽,长部门名不再挤压 */
.dept-search { padding: 10px 12px 8px; }
.dept-search input {
  width: 100%; height: 30px; border: 1px solid transparent; outline: none; border-radius: 4px;
  background: var(--bg-field); padding: 0 10px 0 30px; font-size: 13px; color: var(--text-1);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%239AA0A8' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.dept-search input::placeholder { color: var(--text-3); }
.dept-search input:hover { background-color: var(--bg-field-hover); }
.dept-search input:focus { background-color: var(--bg-white); border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43,125,233,.12); }
#deptList { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.ct-root, .ct-node {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; margin: 1px 0;
  cursor: pointer; font-size: 13px; border-radius: 4px; color: var(--text-1); white-space: nowrap;
  transition: background .1s;
}
.ct-root { font-weight: 600; }
.ct-node { padding-left: calc(8px + var(--lv, 0) * 16px); }
.ct-root:hover, .ct-node:hover { background: var(--bg-hover); }
.ct-root.active { background: var(--bg-active); color: var(--text-1); }
.ct-node.active { background: rgba(43,125,233,.10); color: var(--brand); font-weight: 500; }
.ct-node.hit { background: rgba(43,125,233,.05); }
.ct-node .ct-label mark, .ct-root .ct-label mark {
  background: rgba(255,196,0,.35); color: inherit; border-radius: 2px; padding: 0 1px; margin: 0 -1px;
}
.ct-arrow {
  width: 16px; height: 16px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2);   /* 清晰可辨的中灰 */
}
.ct-arrow svg { display: block; transition: transform .15s ease; }
.ct-arrow.open svg { transform: rotate(90deg); }
.ct-arrow.open { color: var(--brand); }
.ct-arrow.leaf { visibility: hidden; }
.ct-ico { font-size: 14px; flex-shrink: 0; line-height: 1; }
.ct-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.dept-count { color: var(--text-3); font-size: 12px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---- 中栏:成员列表 ---- */
#memberHeader {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
}
#memberHeaderTitle { font-size: 14px; font-weight: 600; }
.member-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ct-act-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg-white);
  color: var(--text-2); border-radius: 4px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: all .12s;
}
.ct-act-btn:hover { border-color: var(--brand); color: var(--brand); background: rgba(43,125,233,.04); }
.ct-act-btn.primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.ct-act-btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.ct-act-btn.danger { color: var(--danger); }
.ct-act-btn.danger:hover { border-color: var(--danger); background: rgba(230,69,69,.05); }
#memberList { flex: 1; overflow-y: auto; padding: 6px 0 12px; }
.member-row {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 52px; cursor: pointer;
  transition: background .1s;
}
.member-row:hover { background: var(--bg-hover); }
.member-row .avatar { width: 36px; height: 36px; border-radius: 4px; font-size: 14px; }
.dept-row .avatar.dept-avatar { background: transparent; color: var(--dept-icon); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.member-name { font-weight: 500; font-size: 13.5px; color: var(--text-1); }
.member-title { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.member-online { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-1); margin-left: auto; flex-shrink: 0; }
.member-online.on { background: var(--green); }
.dept-enter { margin-left: auto; color: var(--muted-3); flex-shrink: 0; padding: 0 4px; display: inline-flex; align-items: center; }
.dept-enter svg { display: block; }
.dept-row:hover .dept-enter { color: var(--brand); }
.row-detail-btn {
  display: none; margin-left: 8px; height: 24px; padding: 0 10px; align-items: center;
  border: 1px solid var(--brand); background: var(--bg-white); color: var(--brand);
  border-radius: 4px; font-size: 11.5px; cursor: pointer; flex-shrink: 0; transition: all .12s;
}
.member-row:hover .row-detail-btn { display: inline-flex; }
.member-row:hover .member-online { display: none; }
.row-detail-btn:hover { background: var(--brand); color: var(--on-brand); }
.sr-empty { padding: 40px 0; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---- 中栏:成员列表(固定宽度,把空间让给两侧) ---- */
#memberPanel { flex: 0 0 440px; width: 440px; }

/* ---- 右栏:成员详情 ---- */
#contactDetail {
  flex: 1; width: auto; min-width: 360px; background: var(--bg-white); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
}
#contactDetailBody { padding: 34px 24px 28px; display: flex; flex-direction: column; align-items: center; }
.ct-empty { color: var(--text-3); font-size: 12.5px; margin-top: 64px; text-align: center; line-height: 2; }
.ct-detail-avatar .avatar { width: 64px; height: 64px; font-size: 24px; border-radius: 8px; }
.ct-detail-name { font-size: 17px; font-weight: 600; margin-top: 16px; }
.ct-detail-title { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.ct-detail-rows { width: 100%; margin-top: 24px; }
.ct-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0;
  font-size: 12.5px; border-bottom: 1px solid var(--line); text-align: right; line-height: 1.5;
}
.ct-row:last-child { border-bottom: none; }
.ct-row-k { color: var(--text-3); flex-shrink: 0; }
.ct-row > span:last-child { color: var(--text-1); word-break: break-all; }
.ct-mail { cursor: pointer; }
.ct-mail:hover { color: var(--brand) !important; }
.ct-mail::after { content: '⧉'; font-size: 11px; color: var(--text-3); margin-left: 4px; }
.ct-detail-actions { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.ct-detail-actions .primary-btn, .ct-detail-actions .ghost-btn { height: 30px; padding: 0 16px; font-size: 12.5px; border-radius: 4px; }
.ct-detail-actions .danger { color: var(--danger); border-color: var(--line); }
.ct-detail-actions .danger:hover { border-color: var(--danger); background: var(--danger); color: var(--on-brand); }

/* ---- 弹窗精修(新增/修改/删除成员与部门) ---- */
#simpleDialog .dialog { border-radius: 8px; box-shadow: 0 12px 40px rgba(25,31,37,.18); }
#simpleDialog .dialog > header {
  padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
#simpleDialog .dlg-body { padding: 18px 20px 6px; }
.dlg-field { margin-bottom: 14px; }
.dlg-field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.dlg-field input, .dlg-field select {
  width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 4px;
  padding: 0 10px; font-size: 13px; color: var(--text-1); outline: none;
  transition: border-color .12s, box-shadow .12s; background: var(--bg-white);
}
.dlg-field input:focus, .dlg-field select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43,125,233,.12);
}
.dlg-field input::placeholder { color: var(--text-3); }
#simpleDialog .dialog > footer { padding: 12px 20px 16px; gap: 8px; }
#simpleDialog .primary-btn, #simpleDialog .ghost-btn { height: 30px; padding: 0 18px; border-radius: 4px; font-size: 12.5px; }
#simpleDialog .primary-btn { background: var(--brand); }
#simpleDialog .primary-btn:hover { background: var(--brand-hover); }
#simpleDialog .ghost-btn { border: 1px solid var(--line); color: var(--text-2); }
#simpleDialog .ghost-btn:hover { border-color: var(--brand); color: var(--brand); }
#simpleDialog .dlg-body .panel-sub { font-size: 11.5px; color: var(--text-3); margin: -6px 0 12px; }

/* ============ 微盘(WeDrive,对标企微桌面端) ============ */
#view-docs { padding: 0; }
.wd-shell { display: flex; flex: 1; min-width: 0; height: 100%; min-height: 0; background: var(--bg-white); }   /* T59-fix11:补 flex:1,否则文档页只按内容宽度收缩,右侧留白 */
#wdSide {
  width: 216px; flex-shrink: 0; border-right: 1px solid var(--line);
  background: var(--bg-panel); display: flex; flex-direction: column; padding: 10px 0 12px;
}
#wdNav { flex: 1; overflow-y: auto; padding: 0 8px; }
.wd-nav-group { margin-bottom: 10px; }
.wd-nav-title { font-size: 11px; color: var(--text-3); padding: 6px 10px 4px; letter-spacing: .5px; }
.wd-nav-item {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px;
  border-radius: 5px; font-size: 13px; color: var(--text-1); cursor: pointer; white-space: nowrap;
}
.wd-nav-item:hover { background: var(--bg-hover); }
.wd-nav-item.active { background: rgba(43,125,233,.10); color: var(--brand); font-weight: 600; }
.wd-nav-item .wd-tw { width: 14px; flex-shrink: 0; text-align: center; color: var(--text-3); font-size: 10px; }
.wd-nav-item .wd-nico { width: 16px; flex-shrink: 0; display: inline-flex; }
.wd-nico .wd-fico, .wd-picker-node .wd-fico { width: 16px; height: 16px; }
.wd-nav-item .wd-badge {
  margin-left: auto; font-size: 10.5px; color: var(--text-3); background: var(--bg-hover);
  border-radius: 8px; padding: 0 6px; line-height: 16px;
}
.wd-nav-item.active .wd-badge { background: rgba(43,125,233,.14); color: var(--brand); }

.wd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 16px 14px; }
#wdToolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wd-tb-group { display: flex; align-items: center; gap: 8px; }
.wd-tb-group.right { margin-left: auto; }
.wd-tb-btn {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg-white);
  border-radius: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: all .12s;
}
.wd-tb-btn:hover { border-color: var(--brand); color: var(--brand); }
.wd-tb-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.wd-tb-btn.primary:hover { background: var(--brand-hover); }
.wd-tb-btn.active { border-color: var(--brand); color: var(--brand); background: rgba(43,125,233,.06); }
.wd-caret { font-size: 9px; opacity: .7; }
#wdSearch {
  width: 220px; height: 30px; border: 1px solid var(--line); border-radius: 5px;
  padding: 0 10px; font-size: 12.5px; outline: none; background: var(--bg-panel);
  transition: border-color .12s, box-shadow .12s;
}
#wdSearch:focus { border-color: var(--brand); background: var(--bg-white); box-shadow: 0 0 0 2px rgba(43,125,233,.12); }

#wdCrumb { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.wd-crumb-item { cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.wd-crumb-item:hover { background: var(--bg-hover); color: var(--brand); }
.wd-crumb-item.cur { color: var(--text-1); font-weight: 600; cursor: default; }
.wd-crumb-item.cur:hover { background: transparent; color: var(--text-1); }
.wd-crumb-sep { color: var(--text-3); font-size: 11px; }

#wdBatchBar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 7px 12px;
  background: rgba(43,125,233,.07); border: 1px solid rgba(43,125,233,.25); border-radius: 6px; font-size: 12.5px;
}
#wdBatchBar[hidden] { display: none; }
#wdBatchBar b { color: var(--brand); }
#wdBatchBar .wd-b-act {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg-white);
  border-radius: 4px; font-size: 12px; color: var(--text-2); cursor: pointer;
}
#wdBatchBar .wd-b-act:hover { border-color: var(--brand); color: var(--brand); }
#wdBatchBar .wd-b-act.danger:hover { border-color: var(--danger); color: var(--danger); }
#wdBatchBar .wd-b-cancel { margin-left: auto; border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 12px; }
#wdBatchBar .wd-b-cancel:hover { color: var(--text-1); }

#wdList { flex: 1; min-height: 0; overflow-y: auto; outline: none; border-radius: 6px; }
#wdList.dragover { outline: 2px dashed var(--brand); outline-offset: -6px; background: rgba(43,125,233,.04); }
.wd-table { width: 100%; border-collapse: collapse; }
.wd-thead {
  display: flex; align-items: center; height: 34px; padding: 0 10px; font-size: 12px;
  color: var(--text-3); border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--bg-white); z-index: 2;
}
.wd-row {
  display: flex; align-items: center; height: 44px; padding: 0 10px; border-bottom: 1px solid var(--bg-soft);
  cursor: default; border-radius: 4px; position: relative;
}
.wd-row:hover { background: var(--bg-hover-blue); }
.wd-row.sel { background: rgba(43,125,233,.08); box-shadow: inset 0 0 0 1px rgba(43,125,233,.45); }
.wd-row.reveal { animation: wdReveal 1.5s ease; }
@keyframes wdReveal { 0%,60% { background: rgba(43,125,233,.22); } 100% { background: transparent; } }
.wd-c-check { width: 34px; flex-shrink: 0; display: flex; align-items: center; }
.wd-c-check input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.wd-c-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.wd-c-name .wd-fico { width: 22px; height: 22px; flex-shrink: 0; display: inline-flex; }
.wd-c-name .wd-fname { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-c-name .wd-star { color: var(--star); font-size: 12px; flex-shrink: 0; }
.wd-c-size { width: 90px; flex-shrink: 0; font-size: 12px; color: var(--text-2); padding-left: 12px; }
.wd-c-time { width: 130px; flex-shrink: 0; font-size: 12px; color: var(--text-3); padding-left: 12px; }
.wd-c-owner { width: 90px; flex-shrink: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; }
.wd-c-act { width: 40px; flex-shrink: 0; display: flex; justify-content: flex-end; }
.wd-more {
  width: 26px; height: 26px; border: none; background: none; border-radius: 4px; cursor: pointer;
  color: var(--text-3); font-size: 15px; line-height: 1; opacity: 0; transition: opacity .1s;
}
.wd-row:hover .wd-more, .wd-row.sel .wd-more { opacity: 1; }
.wd-more:hover { background: rgba(43,125,233,.12); color: var(--brand); }
.wd-empty { padding: 60px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.wd-empty .wd-empty-ico { font-size: 40px; opacity: .35; display: block; margin-bottom: 10px; }

/* 右键/⋯ 菜单(企微式白底圆角阴影) */
.wd-menu {
  position: fixed; z-index: 900; min-width: 158px; background: var(--bg-white);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(25,31,37,.16);
  padding: 5px; animation: wdMenuIn .1s ease;
}
@keyframes wdMenuIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.wd-menu-item {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px;
  border-radius: 5px; font-size: 12.5px; color: var(--text-1); cursor: pointer;
}
.wd-menu-item:hover { background: var(--bg-hover); }
.wd-menu-item.danger { color: var(--danger); }
.wd-menu-item.danger:hover { background: rgba(230,69,69,.08); }
.wd-menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.wd-menu-item .wd-mi-ico { width: 15px; text-align: center; color: var(--text-2); font-size: 12px; }
.wd-menu-item.danger .wd-mi-ico { color: var(--danger); }

/* 文件夹选择 picker 树 */
.wd-picker-tree { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--bg-panel); }
.wd-picker-node {
  display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border-radius: 4px;
  font-size: 12.5px; cursor: pointer;
}
.wd-picker-node:hover { background: var(--bg-hover); }
.wd-picker-node.picked { background: rgba(43,125,233,.12); color: var(--brand); font-weight: 600; }
.wd-picker-node.disabled { opacity: .4; cursor: not-allowed; }

/* ============ T47:微盘统一预览器(viewer.js,参考 PilotDeck 内置预览) ============ */
.wdv-overlay {
  position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center;
  background: rgba(15,22,30,.45); backdrop-filter: blur(2px); animation: wdvFadeIn .12s ease;
}
@keyframes wdvFadeIn { from { opacity: 0; } to { opacity: 1; } }
.wdv-modal {
  width: min(1080px, 94vw); height: min(760px, 90vh); display: flex; flex-direction: column;
  background: var(--bg-white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 60px rgba(10,16,24,.28); overflow: hidden; animation: wdvPopIn .14s ease;
}
@keyframes wdvPopIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
.wdv-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--bg-white); flex-shrink: 0;
}
.wdv-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
  padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .3px;
}
.wdv-badge-w { background: #2B7DE9; }
.wdv-badge-x { background: #00B578; }
.wdv-badge-p { background: #E64545; }
.wdv-badge-m { background: #8A94A6; }
.wdv-badge-t { background: #8A94A6; }
.wdv-title {
  font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 320px;
}
.wdv-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.wdv-btn {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg-white);
  border-radius: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; transition: all .12s;
}
.wdv-btn:hover { border-color: var(--brand); color: var(--brand); }
.wdv-pageinfo { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.wdv-pageinfo input {
  width: 52px; height: 26px; border: 1px solid var(--line); border-radius: 5px;
  text-align: center; font-size: 12px; outline: none; background: var(--bg-white);
}
.wdv-pageinfo input:focus { border-color: var(--brand); }
.wdv-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; background: #F5F5F5; }
[data-theme="dark"] .wdv-body { background: #171717; }
.wdv-loading, .wdv-error, .wdv-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  flex: 1; font-size: 13px; color: var(--text-3); padding: 24px;
}
.wdv-error { color: #d54941; }
.wdv-error-ico { font-size: 26px; }

/* ---- docx:灰底 + 白色纸张卡片(docx-preview) ---- */
.wdv-docx-scroll { flex: 1; overflow: auto; }
.wdv-docx-wrap { padding: 28px; min-width: max-content; margin: 0 auto; }
.wdv-docx-wrap .docx-wrapper { background: transparent !important; padding: 0 !important; }
.wdv-docx-wrap section.wdv-docx {
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16);
  margin: 0 auto 24px; user-select: text;
}
.wdv-docx-wrap section.wdv-docx p { line-height: 1.8; }
.wdv-docx-wrap img { max-width: 100%; }

/* ---- pdf:页面画布 + 文本层(pdfjs) ---- */
.wdv-pdf-scroll { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; }
.wdv-pdf-page { position: relative; margin: 20px auto; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); }
.wdv-pdf-page canvas { display: block; }
.wdv-pdf-page .textLayer { position: absolute; inset: 0; line-height: 1; }
.wdv-pdf-scroll .wdv-loading, .wdv-pdf-scroll .wdv-error { flex: none; padding: 60px 24px; }

/* ---- xlsx:sheet 页签 + 冻结表头网格 ---- */
.wdv-sheet-tabs {
  display: flex; gap: 2px; padding: 8px 12px 0; overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: var(--bg-panel);
}
.wdv-sheet-tab {
  border: 1px solid var(--line); border-bottom: none; background: var(--bg-panel); color: var(--text-2);
  font-size: 12px; padding: 5px 14px; border-radius: 6px 6px 0 0; cursor: pointer; white-space: nowrap;
}
.wdv-sheet-tab:hover { color: var(--text-1); background: var(--bg-hover); }
.wdv-sheet-tab.active { background: var(--bg-white); color: var(--brand); font-weight: 600; }
.wdv-sheet-pane { flex: 1; overflow: auto; background: var(--bg-white); }
.wdv-sheet-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; user-select: text; }
.wdv-sheet-table th, .wdv-sheet-table td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 4px 8px; min-width: 44px; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: left; color: var(--text-1); background: var(--bg-white);
}
.wdv-sheet-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wdv-sheet-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg-panel); color: var(--text-3);
  font-weight: 500; text-align: center; min-width: 44px;
}
.wdv-sheet-table tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--bg-panel); color: var(--text-3);
  font-weight: 500; text-align: center; min-width: 36px; width: 36px;
}
.wdv-sheet-table thead th:first-child { z-index: 3; left: 0; min-width: 36px; width: 36px; }
.wdv-sheet-tip { padding: 8px 14px; font-size: 12px; color: var(--text-3); background: var(--bg-panel); border-top: 1px solid var(--line); }

/* ---- markdown:prose 白纸卡片 ---- */
.wdv-md {
  background: var(--bg-white); max-width: 800px; margin: 24px auto; padding: 36px 48px;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: 14px; line-height: 1.85; color: var(--text-1); user-select: text; word-break: break-word;
}
.wdv-md h1, .wdv-md h2 { font-size: 20px; margin: 18px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.wdv-md h3 { font-size: 16px; margin: 16px 0 8px; }
.wdv-md h4, .wdv-md h5, .wdv-md h6 { font-size: 14px; margin: 12px 0 6px; }
.wdv-md p { margin: 8px 0; }
.wdv-md ul, .wdv-md ol { margin: 8px 0; padding-left: 26px; }
.wdv-md li { margin: 3px 0; }
.wdv-md a { color: var(--brand); text-decoration: none; }
.wdv-md a:hover { text-decoration: underline; }
.wdv-md blockquote { margin: 10px 0; padding: 6px 14px; border-left: 3px solid var(--brand); background: var(--bg-panel); border-radius: 0 4px 4px 0; color: var(--text-2); }
.wdv-md table { border-collapse: collapse; margin: 12px 0; }
.wdv-md th, .wdv-md td { border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
.wdv-md th { background: var(--bg-panel); font-weight: 600; }
.wdv-md code { background: var(--bg-panel); border-radius: 3px; padding: 1px 5px; font-size: 12.5px; font-family: Consolas, monospace; }
.wdv-md pre.md-code {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 12px 14px; overflow-x: auto; margin: 10px 0;
}
.wdv-md pre.md-code code { background: none; padding: 0; font-size: 12.5px; line-height: 1.6; }
.wdv-md pre.md-code code[data-lang]::before {
  content: attr(data-lang); display: block; font-size: 10.5px; color: var(--text-3);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px;
}
.wdv-md img { max-width: 100%; }
.wdv-md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---- txt/json/log:等宽文本 ---- */
.wdv-text {
  flex: 1; overflow: auto; background: var(--bg-white); margin: 20px auto; padding: 20px 24px;
  max-width: 920px; width: calc(100% - 48px); border: 1px solid var(--line); border-radius: 6px;
  font-family: Consolas, "Microsoft YaHei", monospace; font-size: 12.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all; color: var(--text-1); user-select: text;
}

/* ============ 会话右键菜单(对标企微) ============ */
.conv-marks { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 6px; }
.conv-star { color: var(--star); font-size: 11px; }
.conv-mute { font-size: 11px; opacity: .8; }
.conv-tag {
  font-size: 10px; color: var(--brand); background: rgba(43,125,233,.08);
  border-radius: 4px; padding: 0 5px; line-height: 16px;
}
.conv-unread.dot { min-width: 8px; width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; }
.ctx-menu { min-width: 170px; }
.ctx-menu .wd-menu-item { height: 34px; }
.ctx-arrow { color: var(--text-3); font-size: 13px; margin-left: 6px; }
.ctx-check { color: var(--brand); margin-left: 6px; font-size: 12px; }
.conv-info-members {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px;
  margin-top: 14px; max-height: 220px; overflow-y: auto;
}
.conv-info-m { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); }
.conv-info-m .avatar { width: 36px; height: 36px; font-size: 13px; }



/* ============ 数字员工 ============ */
.empty { color: var(--text-3); font-size: 12.5px; padding: 10px 0; }

.staff-shell { display: flex; flex: 1; min-width: 0; }
#staffSide {
  width: 200px; background: var(--bg-panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; flex-shrink: 0; padding-bottom: 12px;
}
#staffSide .pane-title { padding: 14px 14px 10px; font-size: 15px; font-weight: 600; }
#staffSideNav { flex: 1; padding: 0 8px; display: flex; flex-direction: column; gap: 2px; }
.staff-nav-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px;
  border: none; background: transparent; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--text-1); text-align: left;
}
.staff-nav-btn:hover { background: var(--bg-hover); }
.staff-nav-btn.active { background: var(--bg-active); color: var(--brand); font-weight: 600; }
.staff-nav-count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(43,125,233,.12); color: var(--brand); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.staff-create-btn { margin: 10px 12px 0; width: calc(100% - 24px); }

/* ---------- 流程与工具:页签样式 ---------- */
.manage-tabs {
  display: flex; gap: 2px; margin: 10px 0 0; padding: 0 4px;
  border-bottom: 1px solid var(--border, var(--line-2));
}
.manage-tab {
  appearance: none; border: none; background: transparent; cursor: pointer;
  padding: 9px 14px 10px; font-size: 13px; color: var(--text-2, var(--text-2));
  border-radius: 6px 6px 0 0; position: relative; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  transition: color .15s, background .15s;
}
.manage-tab:hover { color: var(--text-1); background: var(--bg-hover); }
.manage-tab.active {
  color: var(--brand); font-weight: 600; background: transparent;
}
.manage-tab.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; background: var(--brand); border-radius: 2px;
}
.manage-tab-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: rgba(43,125,233,.1); color: var(--brand); font-size: 10.5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500;
}
.manage-tab.active .manage-tab-badge { background: rgba(43,125,233,.16); }
.manage-body { padding-top: 14px; }

#staffMain { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 26px 40px; background: var(--bg-white); }
.staff-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.staff-header h2 { font-size: 18px; }
.staff-header .panel-sub { margin-right: auto; }
.staff-header-actions { margin-left: auto; display: flex; gap: 8px; }
.profile-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.staff-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-top: 18px;
}
.staff-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  background: var(--bg-white); display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s;
}
.staff-card:hover { box-shadow: 0 4px 16px rgba(25,31,37,.08); transform: translateY(-1px); }
.staff-card-head { display: flex; gap: 10px; align-items: center; }
.staff-avatar {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; font-size: 24px;
  background: linear-gradient(135deg, rgba(43,125,233,.12), rgba(110,80,224,.12));
  display: flex; align-items: center; justify-content: center;
}
.staff-avatar.big { width: 56px; height: 56px; font-size: 30px; }

/* T36:数字员工品牌 SVG 图标 —— svg 自带深蓝圆角底,容器去背景/内边距 */
.staff-avatar.svgicon, .wiz-avatar.svgicon, .member-av.svgicon,
.avatar.staff.svgicon, .avatar.staffgroup.svgicon { background: none !important; padding: 0; overflow: hidden; }
.staff-avatar svg, .wiz-avatar svg, .member-av svg, .avatar.svgicon svg {
  display: block; width: 100%; height: 100%; border-radius: inherit;
}

/* ============ T38:StaffDeck 同构预置头像 ============ */
.staffdeck-avatar {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; overflow: hidden; border-radius: 10px; user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 4px 12px rgba(23,30,37,.10);
  background: linear-gradient(145deg, #43505a, #29323a 56%, #141b22);
  font-weight: 700; color: #fff;
}
.staffdeck-avatar.big { border-radius: 14px; }
.staffdeck-avatar.round { border-radius: 50%; }
.staffdeck-avatar img { width: 100%; height: 100%; display: block; pointer-events: none; }
.staffdeck-avatar::after {
  content: ''; position: absolute; inset: 7%; border-radius: inherit;
  border: 1px solid rgba(255,255,255,.18); pointer-events: none;
}
.staffdeck-avatar.text { font-size: 45%; }
.staffdeck-avatar.svg svg { width: 100%; height: 100%; border-radius: inherit; display: block; }
.staffdeck-avatar.tone-teal     { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.28), transparent 24%), linear-gradient(145deg, #11998e, #0f766e 54%, #075e59); }
.staffdeck-avatar.tone-copper   { background: radial-gradient(circle at 68% 22%, rgba(255,244,220,.32), transparent 25%), linear-gradient(145deg, #c77b43, #a85d32 56%, #734023); }
.staffdeck-avatar.tone-olive    { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.24), transparent 24%), linear-gradient(145deg, #8a9a5b, #65743a 56%, #465125); }
.staffdeck-avatar.tone-ink      { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.22), transparent 24%), linear-gradient(145deg, #43505a, #29323a 56%, #141b22); }
.staffdeck-avatar.tone-gold     { background: radial-gradient(circle at 72% 24%, rgba(255,255,255,.38), transparent 24%), linear-gradient(145deg, #f0cc74, #d6aa4f 56%, #a17423); }
.staffdeck-avatar.tone-blue     { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.26), transparent 24%), linear-gradient(145deg, #5b8def, #3562b8 56%, #1f3f84); }
.staffdeck-avatar.tone-cobalt   { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.26), transparent 24%), linear-gradient(145deg, #3f6fd8, #2a4fb0 56%, #1c3378); }
.staffdeck-avatar.tone-coral    { background: radial-gradient(circle at 68% 22%, rgba(255,235,225,.32), transparent 25%), linear-gradient(145deg, #e87a5a, #cf5a3c 56%, #93381f); }
.staffdeck-avatar.tone-forest   { background: radial-gradient(circle at 70% 22%, rgba(235,255,240,.26), transparent 24%), linear-gradient(145deg, #3d8a5f, #2c6b47 56%, #1a452d); }
.staffdeck-avatar.tone-charcoal { background: radial-gradient(circle at 70% 22%, rgba(255,255,255,.2), transparent 24%), linear-gradient(145deg, #4b4b52, #34343b 56%, #1f1f24); }
.staffdeck-avatar.tone-navy     { background: radial-gradient(circle at 70% 22%, rgba(230,240,255,.26), transparent 24%), linear-gradient(145deg, #2f4a7a, #22375e 56%, #14243e); }
.staffdeck-avatar.tone-overall  { background: radial-gradient(circle at 72% 24%, rgba(255,255,255,.24), transparent 24%), linear-gradient(145deg, #0f766e, #263238); }
.employee-meta-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 10px; }
.employee-meta-tags .tag-chip {
  font-size: 11px; padding: 2px 9px; border-radius: 9px; line-height: 1.6;
  background: rgba(43,125,233,.08); color: var(--brand); border: 1px solid rgba(43,125,233,.14);
}
.employee-meta-tags .tag-chip.mode { background: rgba(110,80,224,.08); color: #6e50e0; border-color: rgba(110,80,224,.14); }

.member-av {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.wiz-avatar { padding: 0; overflow: hidden; }
.wiz-avatar svg { border-radius: 6.5px; }
.staff-card-id { min-width: 0; }
.staff-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.staff-title { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.staff-chip {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 9px;
  background: rgba(43,125,233,.09); color: var(--brand); font-size: 11px; font-weight: 400;
}
.staff-chip.ok { background: rgba(62,181,117,.12); color: var(--green); }
.staff-chip.ghost { background: var(--bg-hover); color: var(--text-3); }
.staff-desc {
  font-size: 12.5px; color: var(--text-2); line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.staff-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.staff-card-actions { display: flex; gap: 8px; }
.staff-card-actions .primary-btn, .staff-card-actions .ghost-btn { flex: 1; padding: 7px 0; font-size: 13px; }
.staff-card.new { border-style: dashed; cursor: pointer; justify-content: center; min-height: 170px; }
.staff-card.new:hover { border-color: var(--brand); }
.staff-new-inner { text-align: center; color: var(--text-3); }
.staff-new-inner span { font-size: 30px; display: block; margin-bottom: 8px; color: var(--brand); }
.staff-new-inner p { font-size: 13px; }
.staff-empty { text-align: center; color: var(--text-3); padding: 60px 0; font-size: 13px; }
.staff-empty p { margin: 10px 0 16px; }

/* 档案页 */
.staff-tabs { display: flex; gap: 4px; margin: 14px 0 4px; border-bottom: 1px solid var(--line); }
.staff-tab {
  padding: 8px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.staff-tab:hover { color: var(--brand); }
.staff-tab.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.staff-profile-body { padding-top: 6px; }
.persona-preview {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap;
}
.kb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-row-actions { display: flex; align-items: center; gap: 6px; }
.kb-test-input {
  width: 180px; height: 26px; border: 1px solid var(--line); border-radius: 5px;
  padding: 0 8px; font-size: 12px; outline: none;
}
.kb-test-input:focus { border-color: var(--brand); }
.kb-test-result { padding: 0 8px; }
.kb-cite {
  border-left: 3px solid var(--brand); background: var(--bg-panel); border-radius: 0 6px 6px 0;
  padding: 7px 10px; margin: 6px 0; font-size: 12px; color: var(--text-2);
}
.kb-cite b { color: var(--text-1); font-size: 12px; }
.kb-cite div { margin-top: 3px; line-height: 1.5; }

/* 工作记录 */
.turn-row { display: flex; align-items: center; gap: 10px; }
.turn-status { font-size: 13px; flex-shrink: 0; }
.turn-status.failed { color: var(--danger); font-size: 12px; }
.turn-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.turn-meta { flex-shrink: 0; font-size: 11px; }
.turn-trace-btn { flex-shrink: 0; }

/* Trace 时间线(对话框 + 聊天卡片共用) */
.trace-dialog-body { max-height: 480px; overflow-y: auto; }
.trace-timeline { position: relative; padding-left: 6px; }
.trace-row { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.trace-row:not(:last-child)::before {
  content: ''; position: absolute; left: 12px; top: 30px; bottom: -7px; width: 2px; background: var(--line);
}
.trace-ico {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-panel); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  border: 1px solid var(--line); z-index: 1;
}
.trace-main { min-width: 0; flex: 1; }
.trace-label { font-size: 12.5px; font-weight: 600; }
.trace-detail { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.5; word-break: break-all; }

/* 会话列表:AI员工 标记 */
.conv-staff-tag {
  margin-left: 5px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 400;
  background: linear-gradient(135deg, rgba(43,125,233,.14), rgba(110,80,224,.14)); color: var(--brand);
  vertical-align: 1px;
}
.avatar.staff { border-radius: 8px; background: linear-gradient(135deg,var(--staff-tint-1),var(--staff-tint-2))!important; font-size: 20px; }

/* 聊天窗:引用 chips + 执行记录卡片 */
.staff-cites {
  margin-top: 5px; font-size: 11px; color: var(--text-3); max-width: 460px; line-height: 1.5;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}
.staff-cites b { color: var(--text-2); font-weight: 500; }
/* T37:可点击引用 chip */
.cite-chip {
  display: inline-flex; align-items: center; gap: 3px; max-width: 200px;
  border: 1px solid var(--line); background: var(--bg-white); color: var(--text-2);
  border-radius: 10px; padding: 1.5px 9px; font-size: 11px; cursor: pointer; line-height: 1.6;
  transition: border-color .1s, background .1s;
}
.cite-chip:hover { border-color: var(--brand); color: var(--brand); background: rgba(43,125,233,.06); }
.cite-chip i { font-style: normal; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cite-chip.visited { opacity: .72; }
.cite-chip.kb { border-color: rgba(43,125,233,.35); }
/* T37:引用详情卡 */
.cite-card { width: 560px; }
.cite-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cite-no {
  flex-shrink: 0; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px;
  background: rgba(43,125,233,.1); color: var(--brand); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.cite-title { font-size: 13.5px; word-break: break-all; }
.cite-title i { font-style: normal; color: var(--text-3); font-weight: 400; }
.cite-content {
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 12.5px; line-height: 1.8; color: var(--text-1);
  max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; user-select: text;
}
.cite-deleted-note { margin: 0 0 8px; font-size: 12px; color: #b7791f; background: rgba(236,178,46,.1); border-radius: 6px; padding: 6px 10px; }
.cite-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--text-3); }

/* T37:高危操作确认对话框(删除防呆) */
.danger-dialog { width: 480px; }
.danger-dialog > header b { color: #d54941; }
.dd-body { font-size: 13px; color: var(--text-1); margin-bottom: 10px; }
.dd-stats { margin: 0 0 10px; font-size: 12.5px; }
.dd-impact {
  font-size: 12px; color: var(--text-2); background: rgba(213,73,65,.07);
  border: 1px solid rgba(213,73,65,.18); border-radius: 8px; padding: 8px 12px; line-height: 1.7;
}
.danger-btn {
  border: none; border-radius: 6px; padding: 7px 16px; cursor: pointer; font-size: 13px;
  background: #d54941; color: #fff;
}
.danger-btn:hover { background: #c03a32; }
.danger-btn:disabled { opacity: .45; cursor: not-allowed; }
.trace-card {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel);
  max-width: 460px; overflow: hidden;
}
.trace-card-head {
  padding: 6px 10px; font-size: 11.5px; color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; gap: 4px; user-select: none;
}
.trace-card-head:hover { color: var(--brand); }
.trace-card-arrow { margin-left: auto; font-size: 10px; color: var(--text-3); }
.trace-card-body { padding: 4px 10px 10px; border-top: 1px solid var(--line); background: var(--bg-white); }
.trace-card-body.hidden { display: none; }

/* 运行中:流式气泡 + 实时执行记录 + 停止 */
.staff-running .staff-stream { white-space: pre-wrap; min-height: 24px; }
.staff-live-trace {
  margin-top: 5px; font-size: 11.5px; color: var(--brand);
  display: flex; align-items: center; gap: 5px;
}
.staff-live-text { color: var(--text-2); }
.staff-run-bar { margin-top: 6px; }
.staff-stop-btn { padding: 3px 12px; font-size: 12px; border-radius: 5px; }

/* AI 侧栏入口 */
.ai-staff-entry { border: 1px dashed var(--brand); color: var(--brand); }

/* 创建向导:头像选择 */
.wiz-avatars { display: flex; gap: 6px; flex-wrap: wrap; }
.wiz-avatar {
  width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--bg-white); font-size: 20px; cursor: pointer; transition: border-color .1s;
}
.wiz-avatar:hover { border-color: var(--brand); }
.wiz-avatar.sel { border-color: var(--brand); background: rgba(43,125,233,.08); }

/* ============ Phase 2: SOP / 工具 / 确认卡片 / 转人工 ============ */
.staff-chip.warn { background: rgba(255,143,31,.14); color: var(--warning-fg); }
.staff-live-slots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.slot-chip {
  padding: 1px 8px; border-radius: 9px; font-size: 11px;
  background: rgba(62,181,117,.1); color: var(--green); border: 1px solid rgba(62,181,117,.25);
}

/* 敏感工具确认卡片 */
.confirm-card-msg { align-items: flex-start; }
.confirm-card {
  border: 1.5px solid rgba(255,143,31,.5); border-radius: 10px; background: var(--warning-bg);
  padding: 12px 14px; max-width: 420px; box-shadow: 0 2px 10px rgba(255,143,31,.08);
}
.confirm-head { font-size: 13px; font-weight: 600; color: var(--warning-fg); margin-bottom: 6px; }
.confirm-tool { font-size: 14px; font-weight: 600; }
.confirm-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.confirm-args {
  margin: 8px 0; padding: 8px 10px; background: rgba(25,31,37,.05); border-radius: 6px;
  font-size: 11.5px; font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all;
  max-height: 140px; overflow-y: auto; user-select: text;
}
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions .primary-btn { background: var(--warning-fg); }
.confirm-actions .primary-btn:hover { background: var(--warning-fg-hover); }

/* 转人工卡片 */
.handoff-card {
  margin-top: 6px; border: 1px solid rgba(43,125,233,.35); border-radius: 10px;
  background: rgba(43,125,233,.04); padding: 10px 12px; max-width: 440px;
}
.handoff-card.resolved { opacity: .75; }
.handoff-head { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.handoff-reason { font-size: 12px; color: var(--text-2); margin: 5px 0; line-height: 1.5; }
.handoff-actions { display: flex; gap: 6px; margin-top: 6px; }
.handoff-input {
  flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 6px;
  padding: 0 10px; font-size: 12.5px; outline: none; background: var(--bg-white);
}
.handoff-input:focus { border-color: var(--brand); }
.handoff-send { padding: 5px 14px; font-size: 12.5px; }

/* 管理页:SOP 行 */
.sop-row { flex-wrap: wrap; }
.sop-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; font-weight: 500; }
.sop-triggers { font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sop-desc { margin: -4px 0 8px 24px; font-size: 11.5px; }
.panel-block h3 { display: flex; align-items: center; gap: 8px; }

/* SOP 编辑器 */
.sop-editor { width: 720px; max-width: 94vw; }
.sop-editor .dlg-body { max-height: 62vh; overflow-y: auto; }
.sop-sec-title {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line);
}
.sop-sec-title .ct-act-btn { margin-left: auto; }
.sop-node-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
  background: var(--bg-panel);
}
.sop-node-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sop-node-type { height: 28px; border: 1px solid var(--line); border-radius: 5px; font-size: 12.5px; padding: 0 6px; background: var(--bg-white); }
.sop-node-title { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; font-size: 12.5px; outline: none; }
.sop-node-title:focus { border-color: var(--brand); }
.sop-node-config {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  font-size: 11.5px; font-family: Consolas, monospace; resize: vertical; outline: none; background: var(--bg-white);
}
.sop-node-config:focus { border-color: var(--brand); }
.sop-edge-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sop-edge-row select { height: 28px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; padding: 0 4px; background: var(--bg-white); }
.sop-edge-row .edge-cond { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 8px; font-size: 12px; outline: none; }
.sop-edge-row .edge-cond:focus { border-color: var(--brand); }
.sop-cond-help { margin-top: 8px; line-height: 1.7; }
.sop-cond-help code {
  background: var(--bg-hover); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; font-family: Consolas, monospace; margin-right: 2px;
}

/* 校验结果 / 工具测试输出 */
.validate-row { padding: 5px 0; font-size: 12.5px; line-height: 1.5; }
.validate-row.err { color: var(--danger); }
.validate-row.warn { color: var(--warning-fg); }
.tool-result-pre {
  margin-top: 8px; padding: 8px 10px; background: var(--bg-panel); border-radius: 6px;
  font-size: 11.5px; font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all;
  max-height: 220px; overflow-y: auto; user-select: text;
}
#sopEntry, #htMethod, #htScope { height: 30px; border: 1px solid var(--line); border-radius: 5px; font-size: 12.5px; padding: 0 6px; background: var(--bg-white); }

/* ============ Phase 3: 反馈 / 记忆 / 定时任务 ============ */
.msg-feedback { display: flex; align-items: center; gap: 4px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-feedback, .msg-feedback.done { opacity: 1; }
.fb-btn {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 5px; filter: grayscale(1); opacity: .55;
}
.fb-btn:hover { background: var(--bg-hover); filter: none; opacity: 1; }
.fb-btn.sel { filter: none; opacity: 1; border-color: var(--line); background: var(--bg-white); }
.fb-done { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.mem-row { align-items: flex-start; }
.mem-main { flex: 1; min-width: 0; font-size: 13px; line-height: 1.55; }
.mem-main .panel-sub { display: block; margin-top: 2px; font-size: 11px; }
.task-row code, .sop-desc code { background: var(--bg-hover); padding: 0 4px; border-radius: 3px; font-size: 11px; font-family: Consolas, monospace; }
#tkAgent { border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; background: var(--bg-white); }

/* ============ Phase 4: 员工群聊 / 节点图 / 进化提案 / 开放 API ============ */
.avatar.staffgroup { border-radius: 8px; background: linear-gradient(135deg,var(--staffgroup-tint-1),var(--staffgroup-tint-2))!important; font-size: 18px; }
.sop-graph-box {
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-panel);
  padding: 8px; overflow: auto; max-height: 300px;
}
.sop-graph-box svg { display: block; }
.proposal-card {
  border: 1px solid rgba(138,92,246,.35); border-radius: 10px; background: var(--bg-tint-purple);
  padding: 10px 12px; margin-bottom: 10px;
}
.proposal-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; flex-wrap: wrap; }
.proposal-head .panel-sub { margin-left: auto; font-weight: 400; }
.proposal-why { font-size: 12.5px; color: var(--text-2); margin: 6px 0; line-height: 1.55; }
.proposal-diag { font-size: 12px; color: var(--text-2); margin: 3px 0; line-height: 1.5; }
.proposal-actions { display: flex; gap: 8px; margin-top: 8px; }
.panel-block code {
  background: var(--bg-hover); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; font-family: Consolas, monospace; word-break: break-all;
}
#akPlain { user-select: all; }

/* ==================================================================
   T13:深色模式 / 无障碍 / 响应式
   深色仅覆盖语义 token 层(T4 已 token 化),不改任何组件规则 → 零视觉回归风险
   index.html 内联脚本在文档解析前设置 data-theme,避免首屏白闪(FOUC)
   ================================================================== */
:root[data-theme="dark"] {
  --brand-dim: rgba(43, 125, 233, .32);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
  --brand: #3A8DF0;
  --brand-hover: #55A0F5;
  --bubble-me: #2B4A63;
  --bg-window: #1B1D21;
  --bg-panel: #212429;
  --bg-white: #262A30;
  --bg-hover: #2C3037;
  --bg-active: #333942;
  --text-1: #E6E8EB;
  --text-2: #A6ADB8;
  --text-3: #7C838D;
  --line: #34383F;
  --line-2: #3A3F47;
  --green: #46C183;
  --danger: #F05A5A;
  --on-brand: #FFFFFF;
  --purple: #8B6FF0;
  --warning-fg: #E8A33D;
  --warning-fg-hover: #F0B45C;
  --warning-bar: #E8892A;
  --warning-bg: #2B2418;
  --star: #FFC53D;
  --green-fg: #4FC489;
  --scrollbar: #3A3F47;
  --bg-input: #2A2E35;
  --bg-field: #2A2E35;
  --bg-field-hover: #333840;
  --divider-bg: #33383F;
  --bg-hover-blue: #23303F;
  --bg-minutes: #262A24;
  --bg-chat: #1F2226;
  --bg-soft: #2A2E35;
  --bg-tint-purple: #262233;
  --bot-bubble-bg: #2E2740;
  --bot-bubble-line: #463A63;
  --muted-1: #5A616B;
  --muted-2: #8B93A0;
  --muted-3: #6E7783;
  --dept-icon: #7B9AC4;
  --disabled-bg: #3A4250;
  --on-dark-text: #DDE2E8;
  --on-dark-text-2: #E8ECF0;
  --on-dark-muted: #AEB6C0;
  --staff-tint-1: #22303F;
  --staff-tint-2: #2A2740;
  --staffgroup-tint-1: #223040;
  --staffgroup-tint-2: #2A2640;
}
/* 深色下阴影需收敛(浅色阴影在深底上呈灰雾) */
:root[data-theme="dark"] #msgList .msg-bubble,
:root[data-theme="dark"] .panel-card { box-shadow: none; }

/* ---------- 无障碍:键盘可见焦点(token 化,深浅色自适应) ---------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}
/* 输入类元素自身已有 focus 环,避免双环 */
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* 仅供屏幕阅读器 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 跳转锚点(App 内首个可聚焦元素,键盘首个 Tab 即命中) */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 9999;
  background: var(--brand); color: var(--on-brand); padding: 8px 14px;
  border-radius: 6px; font-size: 13px; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 响应式:窄窗折叠(企微桌面端最小 900px,此处覆盖更窄布局) ---------- */
@media (max-width: 1180px) {
  #contactDetail, #memberPanel { display: none; }   /* 右侧详情/成员面板先折叠 */
  #convPane { width: 220px; }
  .page-wrap { padding: 16px 18px; }
}
@media (max-width: 960px) {
  #convPane { width: 68px; }
  #convPane .conv-search, #convPane .conv-title, .conv-item .ci-text { display: none; }
  #navRail { width: 56px; }
  .nav-btn .nav-text { display: none; }
  #chatInputBar { padding: 6px 8px 8px; }
  .wd-main { grid-template-columns: 1fr; }
  .wd-sider { display: none; }
}
@media (max-width: 760px) {
  #convPane { display: none; }                      /* 极窄:仅保留会话区 */
  #chatHeader .ch-actions .tool-btn span:not(.tb-k) { display: none; }
  .page-wrap { padding: 12px 12px; }
}

/* 触控/小屏:交互目标不小于 28px */
@media (pointer: coarse) {
  .nav-btn, .tb-btn, .tool-btn, .ta-ico { min-height: 30px; min-width: 30px; }
}
/* 高对比度偏好:强化分隔线可见度 */
@media (prefers-contrast: more) {
  :root { --line: #B9BDC4; }
  :root[data-theme="dark"] { --line: #5A6068; }
}

/* ============================================================
   T14:消息右键菜单 / 多选 / 引用
   ============================================================ */
/* 多选:行内勾选框 */
.msg-check {
  width: 18px; height: 18px; flex: 0 0 18px; align-self: center;
  border: 1.5px solid var(--line); border-radius: 50%;
  background: var(--bg-panel); position: relative; transition: var(--t-fast);
}
.msg-check.on { background: var(--brand); border-color: var(--brand); }
.msg-check.on::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 5px; height: 9px; border: 2px solid var(--on-brand); border-top: 0; border-left: 0;
  transform: rotate(45deg);
}
.msg.sel > .msg-bubble { box-shadow: 0 0 0 2px var(--brand-dim); }
.system-msg.sel { box-shadow: 0 0 0 2px var(--brand-dim); border-radius: 6px; }
.msg.recalled .msg-bubble { opacity: .5; font-style: italic; }

/* 引用块(气泡内展示被引用内容) */
.quote-ref {
  max-width: 100%; margin: 0 0 4px;
  padding: 5px 8px; font-size: 12px; line-height: 1.5;
  color: var(--text-2); background: var(--bg-hover);
  border-left: 3px solid var(--line); border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quote-ref b { color: var(--text-1); font-weight: 600; margin-right: 6px; }

/* 输入区引用条 */
.quote-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 6px; font-size: 12px;
  background: var(--bg-hover); border-left: 3px solid var(--brand);
  border-radius: 4px; color: var(--text-2);
}
.quote-bar .qb-ico { color: var(--brand); }
.quote-bar .qb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-bar .qb-text b { color: var(--text-1); margin-right: 6px; }
.quote-bar .qb-close {
  border: 0; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 3px;
}
.quote-bar .qb-close:hover { background: var(--bg-panel); color: var(--text-1); }

/* 多选工具条 */
.multi-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; margin-bottom: 6px;
  background: var(--bg-hover); border-radius: 6px; font-size: 13px;
}
.multi-bar .mb-count { flex: 1; color: var(--text-2); font-size: 12px; }
.multi-bar .mb-btn {
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--text-1);
  padding: 4px 12px; border-radius: 5px; cursor: pointer; font-size: 12px; transition: var(--t-fast);
}
.multi-bar .mb-btn:hover:not(:disabled) { background: var(--bg-active); }
.multi-bar .mb-btn:disabled { opacity: .45; cursor: not-allowed; }
.multi-bar .mb-btn.danger { color: var(--danger); border-color: var(--danger); }

/* 转发目标选择浮层 */
.pick-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .32);
}
.pick-box {
  width: 340px; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.pick-head { padding: 12px 14px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.pick-list { flex: 1; overflow-y: auto; padding: 6px; }
.pick-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; background: transparent; cursor: pointer;
  border-radius: 5px; text-align: left; font-size: 13px; color: var(--text-1);
}
.pick-item:hover, .pick-item:focus-visible { background: var(--bg-hover); }
.pick-item .pi-av {
  width: 26px; height: 26px; border-radius: 5px; flex: 0 0 26px;
  display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: 12px;
}
.pick-item .pi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item .pi-type { font-size: 11px; color: var(--text-3); }
.pick-foot { padding: 8px 12px; border-top: 1px solid var(--line); text-align: right; }
.pick-foot .ghost-btn {
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--text-1);
  padding: 5px 14px; border-radius: 5px; cursor: pointer; font-size: 12px;
}
.pick-foot .ghost-btn:hover { background: var(--bg-hover); }

/* ============================================================
   T19:工作台应用(日程 / 会议室 / 汇报 / TAPD)与 AI 问答历史
   ============================================================ */
.wb-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wb-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wb-form .dlg-field { margin: 0; }
.wb-form textarea {
  width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--bg-input, var(--bg-panel)); color: var(--text-1);
}
.wb-form input, .wb-form select { width: 100%; box-sizing: border-box; }
.wb-list { display: flex; flex-direction: column; }
.wb-sec-title { font-size: 12px; font-weight: 600; color: var(--text-3); margin: 12px 0 4px; }
.wb-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px dashed var(--line);
}
.wb-row-main { flex: 1; min-width: 0; }
.wb-row-title { font-size: 13px; color: var(--text-1); display: flex; align-items: center; gap: 6px; }
.wb-row-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.wb-row-sub.wb-pre { white-space: pre-wrap; word-break: break-word; }
.wb-tag {
  font-size: 10.5px; color: var(--text-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 5px; line-height: 15px; font-weight: 400;
}
.wb-row .ghost-btn { flex: 0 0 auto; }
.ai-qa-bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--text-3); padding: 2px 2px 8px; border-bottom: 1px dashed var(--line); margin-bottom: 8px;
}

/* ===== T21d:表情搜索框 + 结果区(静态外壳,重渲染只发生在 .emoji-body) ===== */
.emoji-head { padding: 8px 8px 6px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.emoji-search {
  width: 100%; box-sizing: border-box; height: 30px; padding: 0 12px; font-size: 12px;
  color: var(--text-1); background: var(--bg-hover); border: 1px solid transparent;
  border-radius: 15px; outline: none; transition: border-color .12s, background .12s;
}
.emoji-search::placeholder { color: var(--text-3); }
.emoji-search:focus { background: var(--bg-white); border-color: var(--brand); }
.emoji-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 8px 10px 10px; overflow-y: auto; }
.emoji-result-head { font-size: 11px; color: var(--text-3); padding: 0 2px 6px; }

/* ============ T48:在线编辑 + 知识库管理 ============ */
.wdv-editor {
  flex: 1; width: 100%; min-height: 0; border: none; outline: none; resize: none;
  padding: 24px 32px; margin: 0; background: var(--bg-white); color: var(--text-1);
  font-family: Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.8;
  box-sizing: border-box;
}
.wdv-sheet-table td.editable { background: #fffdf5; cursor: text; }
.wdv-sheet-table td.editable:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; }

/* 知识库管理面板 */
.kb-modal {
  width: min(1120px, 95vw); height: min(780px, 90vh); display: flex; flex-direction: column;
  background: var(--bg-white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 60px rgba(10,16,24,.28); overflow: hidden; animation: wdvPopIn .14s ease;
}
.kb-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.kb-head-ico { font-size: 20px; }
.kb-head-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.kb-head-title small { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-3); margin-top: 2px; }
.kb-head > .wdv-btn:first-of-type { margin-left: auto; }
.kb-body { flex: 1; min-height: 0; display: flex; }
.kb-side { width: 230px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg-panel); overflow-y: auto; padding: 8px; }
.kb-item { padding: 9px 10px; border-radius: 6px; cursor: pointer; margin-bottom: 4px; }
.kb-item:hover { background: var(--bg-hover); }
.kb-item.active { background: rgba(43,125,233,.1); }
.kb-item-name { font-size: 13px; font-weight: 500; color: var(--text-1); display: flex; align-items: center; gap: 6px; }
.kb-item-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.kb-tag { font-style: normal; font-size: 10px; color: var(--brand); background: rgba(43,125,233,.12); border-radius: 3px; padding: 0 4px; }
.kb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 18px; overflow-y: auto; }
.kb-main-head { display: flex; align-items: flex-start; gap: 16px; }
.kb-main-head h3 { margin: 0 0 4px; font-size: 16px; color: var(--text-1); }
.kb-sub { font-size: 12px; color: var(--text-3); }
.kb-stat { margin-left: auto; display: flex; gap: 14px; font-size: 11.5px; color: var(--text-3); }
.kb-stat b { display: block; font-size: 17px; color: var(--text-1); font-weight: 600; }
.kb-actions { display: flex; gap: 8px; margin: 14px 0 10px; }
.kb-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.kb-search-row input {
  flex: 1; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px;
  font-size: 13px; outline: none; background: var(--bg-white);
}
.kb-search-row input:focus { border-color: var(--brand); }
.kb-search-results { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.kb-cit { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.kb-cit-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-1); }
.kb-cit-score { color: #00A870; font-weight: 600; font-size: 11.5px; }
.kb-cit-bucket { color: var(--text-3); font-size: 11px; }
.kb-cit-body { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.kb-doc-list { display: flex; flex-direction: column; gap: 6px; }
.kb-doc { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.kb-doc:hover { border-color: rgba(43,125,233,.4); }
.kb-doc-main { min-width: 0; }
.kb-doc-title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.kb-doc-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-3); margin-top: 3px; flex-wrap: wrap; }
.kb-doc-actions { display: flex; gap: 6px; margin-top: 6px; }
.kb-doc-buckets { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.kb-bucket { background: var(--bg-panel); border-radius: 5px; padding: 6px 9px; }
.kb-bucket-head { font-size: 12px; color: var(--text-1); display: flex; justify-content: space-between; }
.kb-bucket-head span { color: var(--text-3); font-size: 11px; }
.kb-bucket-body { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.kb-empty { color: var(--text-3); font-size: 12.5px; padding: 28px 8px; text-align: center; line-height: 1.8; }
.kb-dialog-mask {
  position: absolute; inset: 0; background: rgba(15,22,30,.35); z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.kb-dialog {
  width: min(460px, 86vw); background: var(--bg-white); border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 16px 50px rgba(10,16,24,.3);
}
.kb-dialog h4 { margin: 0 0 12px; font-size: 14px; }
.kb-dialog input {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px;
  font-size: 13px; margin-bottom: 9px; outline: none; box-sizing: border-box;
}
.kb-dialog input:focus { border-color: var(--brand); }
.kb-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.kb-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.kb-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.kb-picker { width: min(560px, 90vw); }
.kb-picker-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin-bottom: 10px; }
.kb-picker-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 5px; cursor: pointer; font-size: 12.5px; }
.kb-picker-row:hover { background: var(--bg-hover); }
.kb-picker-row input { width: auto; height: auto; margin: 0; }
.kb-picker-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-picker-meta { color: var(--text-3); font-size: 11px; }
.kb-pick-list { display: flex; flex-direction: column; gap: 6px; }
.kb-pick-item { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.kb-pick-item:hover { border-color: var(--brand); background: rgba(43,125,233,.05); }
.kb-pick-item b { font-size: 13px; }
.kb-pick-item span { font-size: 11px; color: var(--text-3); }

/* 编辑器工具条 / 表格编辑条 */
.wdv-editor-bar, .wdv-sheet-editbar {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: var(--bg-panel);
}
.wdv-sheet-editbar { position: sticky; top: 0; z-index: 5; border-top: none; }
.wdv-editor-bar .wdv-btn, .wdv-sheet-editbar .wdv-btn { height: 24px; padding: 0 8px; font-size: 12px; }
.wdv-editor-hint { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* PDF 缩略图侧栏(对齐 PilotDeck PDF viewer) */
.wdv-pdf-wrap { flex: 1; min-height: 0; display: flex; }
.wdv-pdf-side { width: 138px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg-panel); overflow-y: auto; }
.wdv-pdf-thumbs { padding: 10px 8px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.wdv-pdf-thumb {
  position: relative; border: 2px solid transparent; border-radius: 4px; cursor: pointer;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.14); min-width: 96px; min-height: 64px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.wdv-pdf-thumb:hover { border-color: rgba(43,125,233,.5); }
.wdv-pdf-thumb.active { border-color: var(--brand); }
.wdv-pdf-thumb canvas { display: block; }
.wdv-pdf-thumb-no {
  position: absolute; bottom: 2px; right: 3px; font-size: 10px; line-height: 14px;
  color: var(--text-2); background: rgba(255,255,255,.88); border-radius: 3px; padding: 0 3px;
}
.wdv-pdf-page { margin: 20px auto; }
.wdv-pdf-scroll { flex: 1; }

/* PPTX(PilotDeck 同款 pptx-renderer) */
.wdv-badge-ppt { background: #E8730C; }
.wdv-pptx-stage { flex: 1; overflow: auto; background: #eef1f5; }
[data-theme="dark"] .wdv-pptx-stage { background: #171717; }
.wdv-pptx { padding: 18px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.wdv-pptx canvas, .wdv-pptx svg { max-width: 100%; }

/* Markdown 目录侧栏 + 代码复制 */
.wdv-md-wrap { flex: 1; min-height: 0; display: flex; }
.wdv-md-side {
  width: 200px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg-panel);
  overflow-y: auto; padding: 12px 8px;
}
.wdv-md-side[hidden] { display: none; }
.wdv-md-toc-title { font-size: 11px; color: var(--text-3); padding: 0 8px 6px; letter-spacing: .5px; }
.wdv-md-toc-item {
  display: block; padding: 5px 8px; border-radius: 4px; font-size: 12px; color: var(--text-2);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.wdv-md-toc-item:hover { background: var(--bg-hover); color: var(--brand); }
.wdv-md-toc-item.lv3 { padding-left: 18px; font-size: 11.5px; }
.wdv-md-toc-item.lv4 { padding-left: 30px; font-size: 11px; color: var(--text-3); }
.wdv-md-scroll { flex: 1; overflow: auto; }
.wdv-md h1, .wdv-md h2, .wdv-md h3, .wdv-md h4 { scroll-margin-top: 12px; }
.wdv-md .wdv-md-hit { animation: wdvHit 1.2s ease; }
@keyframes wdvHit { 0% { background: rgba(43,125,233,.18); } 100% { background: transparent; } }
.wdv-md pre.md-code { position: relative; }
.wdv-code-copy {
  position: absolute; top: 8px; right: 8px; height: 22px; padding: 0 8px; font-size: 11px;
  border: 1px solid var(--line); background: var(--bg-white); color: var(--text-2);
  border-radius: 4px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.wdv-md pre.md-code:hover .wdv-code-copy { opacity: 1; }
.wdv-code-copy:hover { color: var(--brand); border-color: var(--brand); }

/* Excel 页签置底 */
.wdv-sheet-tabs-bottom { border-top: 1px solid var(--line); border-bottom: none; padding: 6px 12px; }
.wdv-sheet-tabs-bottom .wdv-sheet-tab {
  border: 1px solid var(--line); border-radius: 4px; background: var(--bg-panel);
}
.wdv-sheet-tabs-bottom .wdv-sheet-tab.active { background: var(--bg-white); border-color: var(--brand); }

/* DOCX 大纲侧栏 */
.wdv-docx-layout { flex: 1; min-height: 0; display: flex; }
.wdv-docx-side {
  width: 200px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg-panel);
  overflow-y: auto; padding: 12px 8px;
}
.wdv-docx-side[hidden] { display: none; }

/* DOCX 轻量编辑 */
.wdv-docx-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wdv-docx-editor[hidden] { display: none; }
.wdv-docx-editor .wdv-editor { flex: 1; }

/* Markdown 双栏编辑 */
.wdv-md-split { flex: 1; min-height: 0; display: flex; }
.wdv-md-editorpane { flex: 1; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.wdv-md-previewpane { flex: 1; min-width: 0; overflow: auto; background: #f2f3f5; }
[data-theme="dark"] .wdv-md-previewpane { background: #171717; }
.wdv-md-live { margin: 16px; }

/* XLSX 公式栏 + 选中单元格 */
.wdv-sheet-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: var(--bg-panel);
}
.wdv-sheet-addr { min-width: 56px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.wdv-sheet-formula {
  flex: 1; height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px;
  font-size: 12.5px; font-family: Consolas, monospace; outline: none; background: var(--bg-white); color: var(--text-1);
}
.wdv-sheet-formula:focus { border-color: var(--brand); }
.wdv-sheet-table td.active { outline: 2px solid var(--brand); outline-offset: -2px; }

/* PPTX 文本编辑 */
.wdv-pptx-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wdv-pptx-editor[hidden] { display: none; }
.wdv-pptx-slides { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.wdv-pptx-slide-block { background: var(--bg-white); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.wdv-pptx-slide-block header { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.wdv-pptx-para { display: block; margin-bottom: 6px; }
.wdv-pptx-para textarea {
  width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--line); border-radius: 5px;
  padding: 6px 8px; font-size: 13px; line-height: 1.6; font-family: inherit; outline: none;
  background: var(--bg-white); color: var(--text-1);
}
.wdv-pptx-para textarea:focus { border-color: var(--brand); }

/* 预览器放大为工作台式 */
.wdv-modal { width: min(1180px, 96vw); height: min(820px, 92vh); }

/* DOCX 编辑双栏 */
.wdv-docx-edit-split { flex: 1; min-height: 0; display: flex; }
.wdv-docx-edit-split textarea { flex: 1; min-width: 0; border-right: 1px solid var(--line); }
.wdv-docx-livepane { flex: 1; min-width: 0; overflow: auto; background: #f2f3f5; }
[data-theme="dark"] .wdv-docx-livepane { background: #171717; }

/* ============ 群聊人数 / 真人+AI 协作 ============ */
.conv-count { font-weight: 400; color: var(--text-3); font-size: 11.5px; margin-left: 3px; }
.conv-staff-tag.mixed {
  background: linear-gradient(135deg, rgba(62,181,117,.16), rgba(43,125,233,.16));
  color: #2E9E6B;
}
.staff-chip.ai {
  background: linear-gradient(135deg, rgba(43,125,233,.14), rgba(110,80,224,.16));
  color: #5B4BD6; font-size: 10px; padding: 0 5px;
}
#groupModal .dialog { width: 520px; }
.dlg-staff-list { max-height: 156px; }
.dlg-hint-inline { color: var(--text-3); font-weight: 400; font-size: 11px; margin-left: 6px; }
.dlg-member.staff-pick { background: linear-gradient(90deg, rgba(43,125,233,.03), transparent); }
.dlg-member.staff-pick.sel { background: rgba(43,125,233,.09); }
.mention-item.staff { background: rgba(43,125,233,.05); }
.mention-empty { grid-column: 1 / -1; padding: 10px; color: var(--text-3); font-size: 12px; }

.conv-info-count { font-size: 15px; color: var(--brand); margin-right: 8px; }
.conv-info-split { margin-left: 2px; }
.conv-info-sec { margin-top: 14px; }
.conv-info-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding-bottom: 6px; border-bottom: 1px dashed var(--line); margin-bottom: 8px;
}
.conv-info-sec-head span { font-weight: 400; color: var(--text-3); font-size: 11px; }
.conv-info-members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; max-height: 190px; overflow-y: auto; }
.conv-info-m { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-2); }
.conv-info-m .avatar { width: 36px; height: 36px; font-size: 13px; }
.conv-info-name { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-info-del {
  position: absolute; top: -4px; right: 2px; width: 16px; height: 16px; line-height: 14px;
  border: none; border-radius: 50%; background: var(--bg-hover); color: var(--text-3);
  font-size: 11px; cursor: pointer; padding: 0; opacity: 0; transition: opacity .12s;
}
.conv-info-m:hover .conv-info-del { opacity: 1; }
.conv-info-del:hover { background: var(--danger); color: #fff; }
.conv-info-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.conv-info-none { margin: 4px 0 2px; }


/* ============ T53 群聊右侧成员栏(对标企微 face_chat_member_window) ============ */
#chatArea { position: relative; overflow: hidden; }
#chatArea.has-group-side #groupSide { display: flex; }
#chatArea.group-side-open #groupSide { transform: translateX(0); visibility: visible; pointer-events: auto; }
#chatArea.group-side-open #msgList,
#chatArea.group-side-open #chatInputBar { margin-right: 288px; }


#chatSub.group-sub { cursor: pointer; }
#chatSub.group-sub::after { content: " ›"; color: var(--brand); }
#chatSub.group-sub:hover { color: var(--brand); }
.group-toggle[hidden] { display: none !important; }
.group-toggle { display: inline-flex; align-items: center; gap: 4px; }
.group-toggle.active { background: rgba(43,125,233,.1); }

#groupSide {
  display: none; position: absolute; top: 50px; right: 0; bottom: 0; width: 288px;
  background: var(--bg-white); border-left: 1px solid var(--line);
  flex-direction: column; z-index: 6; visibility: hidden;
  transform: translateX(100%); transition: transform .18s ease;
  box-shadow: -8px 0 18px rgba(25,31,37,.04);
}
.gs-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.gs-title { font-size: 13.5px; font-weight: 600; }
.gs-title span { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.gs-head-actions { display: flex; gap: 2px; }
.gs-icon { border: none; background: transparent; cursor: pointer; font-size: 13px; color: var(--text-3); padding: 4px 6px; border-radius: 5px; }
.gs-icon:hover { background: var(--bg-hover); color: var(--text-1); }
.gs-search { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.gs-search input { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; outline: none; font-size: 12.5px; }
.gs-search input:focus { border-color: var(--brand); }
.gs-body { flex: 1; overflow-y: auto; padding: 10px 12px 14px; }
.gs-summary { font-size: 11.5px; color: var(--text-3); padding: 2px 2px 8px; }
.gs-sec { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin: 12px 2px 6px; }
.gs-sec:first-of-type { margin-top: 2px; }
.gs-sec em { font-style: normal; font-weight: 400; color: var(--text-3); }
.gs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gs-member { position: relative; border: none; background: transparent; cursor: pointer; padding: 7px 2px 6px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.gs-member:hover { background: var(--bg-hover); }
.gs-member .avatar { width: 40px; height: 40px; font-size: 14px; }
.gs-name { font-size: 11.5px; color: var(--text-1); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
.gs-sub { font-size: 10px; color: var(--text-3); max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-tag { font-style: normal; font-size: 9px; line-height: 13px; padding: 0 3px; border-radius: 3px; background: rgba(43,125,233,.1); color: var(--brand); flex-shrink: 0; }
.gs-tag.owner { background: rgba(255,143,31,.14); color: #B96A12; }
.gs-tag.ai { background: linear-gradient(135deg, rgba(43,125,233,.14), rgba(110,80,224,.16)); color: #5B4BD6; }
.gs-empty { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; text-align: center; padding: 18px 0; }
.gs-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); flex-shrink: 0; }
.gs-foot button { flex: 1; padding: 7px 0; font-size: 12px; }

.gs-profile-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 12px; }
.gs-profile-body .avatar { width: 64px; height: 64px; font-size: 22px; }
.gs-profile-name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.gs-profile-sub { color: var(--text-3); font-size: 12px; }
.gs-profile-grid { width: 100%; margin-top: 10px; display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; font-size: 12.5px; }
.gs-profile-grid dt { color: var(--text-3); }
.gs-profile-grid dd { margin: 0; color: var(--text-1); word-break: break-all; }

@media (max-width: 1100px) {
  #groupSide { width: 248px; }
  #chatArea.group-side-open #msgList,
  #chatArea.group-side-open #chatInputBar { margin-right: 248px; }
}
@media (max-width: 900px) {
  #groupSide { width: 260px; box-shadow: -12px 0 30px rgba(25,31,37,.16); }
  #chatArea.group-side-open #msgList,
  #chatArea.group-side-open #chatInputBar { margin-right: 0; }
}


/* ============ T54 群公告 / 群待办 / 群文件 / AI协作 ============ */
.gs-fold { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; overflow: hidden; background: var(--bg-white); }
.gs-fold-head { width: 100%; border: none; background: transparent; display: flex; align-items: center; gap: 6px; padding: 8px 9px; cursor: pointer; font-size: 11.5px; color: var(--text-1); text-align: left; }
.gs-fold-head:hover { background: var(--bg-hover); }
.gs-fold-title { font-weight: 600; }
.gs-fold-head em { margin-left: auto; font-style: normal; color: var(--text-3); font-size: 10.5px; }
.gs-fold-arrow { color: var(--text-3); font-size: 10px; transition: transform .15s; }
.gs-fold.open .gs-fold-arrow { transform: rotate(90deg); }
.gs-fold-body { padding: 0 9px 9px; }
.gs-notice-text { font-size: 12px; line-height: 1.55; color: var(--text-2); white-space: normal; word-break: break-word; max-height: 90px; overflow-y: auto; }
.gs-fold-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; color: var(--text-3); font-size: 10.5px; }
.gs-mini-btn { border: 1px solid var(--line); background: var(--bg-white); color: var(--brand); border-radius: 5px; padding: 2px 8px; font-size: 11px; cursor: pointer; }
.gs-mini-btn:hover { background: rgba(43,125,233,.07); }
.gs-muted { color: var(--text-3); }
.gs-todo-add { display: flex; gap: 5px; margin-bottom: 7px; }
.gs-todo-add input { flex: 1; min-width: 0; height: 27px; border: 1px solid var(--line); border-radius: 5px; padding: 0 7px; font-size: 11.5px; outline: none; }
.gs-todo-add button { border: none; background: var(--brand); color: #fff; border-radius: 5px; padding: 0 9px; font-size: 11px; cursor: pointer; }
.gs-todo { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 11.5px; }
.gs-check { width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-white); color: #fff; cursor: pointer; font-size: 10px; line-height: 14px; padding: 0; flex-shrink: 0; }
.gs-check.on { background: var(--brand); border-color: var(--brand); }
.gs-todo-text { flex: 1; min-width: 0; word-break: break-all; }
.gs-todo.done .gs-todo-text { text-decoration: line-through; color: var(--text-3); }
.gs-mini-x { border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: 12px; padding: 0 2px; }
.gs-mini-x:hover { color: var(--danger); }
.gs-empty-line { color: var(--text-3); font-size: 11px; text-align: center; padding: 6px 0; }
.gs-files { display: flex; flex-direction: column; gap: 2px; max-height: 150px; overflow-y: auto; }
.gs-file { display: flex; align-items: center; gap: 7px; border: none; background: transparent; padding: 4px 2px; border-radius: 5px; cursor: pointer; text-align: left; }
.gs-file:hover { background: var(--bg-hover); }
.gs-file-ico { font-size: 14px; }
.gs-file-main { min-width: 0; display: flex; flex-direction: column; }
.gs-file-main b { font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-file-main em { font-style: normal; color: var(--text-3); font-size: 10px; }
.gs-mode-row { display: flex; gap: 4px; }
.gs-mode { flex: 1; border: 1px solid var(--line); background: var(--bg-white); color: var(--text-2); border-radius: 5px; padding: 4px 0; font-size: 11px; cursor: pointer; }
.gs-mode.active { background: rgba(43,125,233,.1); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.gs-mode:disabled { opacity: .5; cursor: default; }
.gs-ai-hint { font-size: 10.5px; color: var(--text-3); line-height: 1.5; margin: 6px 0; }
.gs-ai-list { display: flex; flex-direction: column; gap: 3px; }
.gs-ai-row { display: flex; align-items: center; gap: 7px; border: none; background: transparent; padding: 4px 2px; border-radius: 5px; cursor: pointer; text-align: left; }
.gs-ai-row:hover { background: var(--bg-hover); }
.gs-ai-row .avatar { width: 26px; height: 26px; font-size: 11px; }
.gs-ai-row span { display: flex; flex-direction: column; min-width: 0; }
.gs-ai-row b { font-size: 11.5px; font-weight: 500; }
.gs-ai-row em { font-style: normal; font-size: 10px; color: var(--text-3); }
.gs-more { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--text-3); border-radius: 6px; padding: 5px 0; font-size: 11px; cursor: pointer; margin: 6px 0 2px; }
.gs-more:hover { color: var(--brand); border-color: var(--brand); }
.gs-tag.admin { background: rgba(110,80,224,.12); color: #5B4BD6; }
.gs-textarea { width: 100%; min-height: 120px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.6; outline: none; font-family: inherit; }
.gs-textarea:focus { border-color: var(--brand); }
.gs-owner-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }

/* ============================================================
   T59 登录门禁(未登录时覆盖工作台)
   ============================================================ */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(43, 125, 233, .18), transparent 60%),
    radial-gradient(900px 500px at 85% 85%, rgba(110, 80, 224, .14), transparent 55%),
    var(--bg-window);
}
.login-view.hidden { display: none; }
/* 登录页窗口控制(右上角) + 顶部可拖拽区(登录遮罩盖住了主标题栏) */
.login-view::before {
  content: ''; position: absolute; top: 0; left: 0; right: 96px; height: 36px;
  -webkit-app-region: drag;
}
.login-winctl {
  position: absolute; top: 0; right: 0; height: 36px; display: flex;
  -webkit-app-region: no-drag; z-index: 2;
}
.lw-btn {
  width: 44px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
}
.lw-btn:hover { background: rgba(0, 0, 0, .06); }
.lw-btn.close:hover { background: var(--danger); color: var(--on-brand); }
[data-theme="dark"] .lw-btn:hover { background: rgba(255, 255, 255, .08); }
.login-card {
  width: 360px;
  padding: 30px 28px 22px;
  border-radius: 14px;
  background: var(--bg-white);
  box-shadow: 0 18px 48px rgba(25, 31, 37, .18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo { width: 42px; height: 42px; }
.login-title { font-size: 19px; font-weight: 600; color: var(--text-1); letter-spacing: .5px; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.login-field input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43, 125, 233, .14); background: var(--bg-white); }
.login-error {
  font-size: 12px;
  color: var(--danger);
  background: rgba(230, 69, 69, .08);
  border-radius: 6px;
  padding: 7px 10px;
}
.login-btn {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.login-btn:hover { background: var(--brand-hover); }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-tip { font-size: 11px; line-height: 1.7; color: var(--text-3); text-align: center; }
.login-tip b { color: var(--text-2); font-weight: 600; }
