/* Compact desktop workspace. Colors remain shared with the existing light/dark themes. */
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.shell { grid-template-columns:var(--menu-w) 4px minmax(0,1fr) 4px var(--vm-width); grid-template-rows:46px minmax(0,1fr); }
.col-menu { grid-column:1; grid-row:1/-1; padding:12px 8px 8px; border:0; background:var(--bg); }
.workspace-brand { gap:9px; padding:0 8px 16px; justify-content:flex-start; }
.brand-mini { width:28px; height:28px; flex:0 0 28px; border-radius:9px; }
.brand-mini svg { width:20px; height:20px; }
.brand-name { display:block; font-size:15px; white-space:nowrap; }
.brand-name small { display:none; }
.menu { gap:2px; }
.menu-group { display:block; padding:16px 10px 5px; margin:0; font-size:10px; }
.menu-group:first-child { padding-top:4px; }
.menu .m-item { justify-content:flex-start; min-height:34px; padding:7px 10px; gap:10px; border-radius:7px; font-size:12px; }
.m-item .m-txt { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.m-item i .ui-icon { width:17px; height:17px; }
.menu .m-item.active { background:var(--panel); border-color:var(--line); color:var(--text); box-shadow:0 1px 3px var(--line-soft); }
.m-badge { position:static; margin-left:auto; min-width:16px; height:16px; font-size:10px; }
.menu-foot { padding:10px 5px 0; background:transparent; }
.menu-foot .mf-row { display:flex; flex-direction:row; gap:6px; }
.menu-foot .who { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.menu-foot .mf-cap { display:none; }
.menu-foot .mini-btn,.menu-foot .bell { border:0; background:transparent; }
.sidebar-resizer { grid-column:2; grid-row:1/-1; cursor:col-resize; touch-action:none; z-index:30; position:relative; }
.sidebar-resizer::after,.vm-resizer::after { content:''; position:absolute; inset:0; background:var(--line); width:1px; left:1px; }
.sidebar-resizer:hover::after,.sidebar-resizer.dragging::after,.vm-resizer:hover::after,.vm-resizer.dragging::after { background:var(--accent); width:3px; left:0; }
.sidebar-resizer:focus-visible,.vm-resizer:focus-visible { outline:2px solid var(--accent); outline-offset:-1px; }
.sidebar-collapsed .col-menu { padding:12px 6px 8px; }
.sidebar-collapsed .workspace-brand { padding:0 8px 16px; }
.sidebar-collapsed .brand-name,.sidebar-collapsed .menu-group,.sidebar-collapsed .m-txt,.sidebar-collapsed .who { display:none; }
.sidebar-collapsed .m-item { justify-content:center; position:relative; min-height:38px; padding:9px; }
.sidebar-collapsed .m-badge { position:absolute; top:1px; right:0; min-width:12px; height:13px; font-size:8px; }
.sidebar-collapsed .mf-row { flex-direction:column; }
.sidebar-collapsed .bell { font-size:9px; padding:4px 1px; }
.workspace-topbar { grid-column:3/-1; grid-row:1; min-width:0; padding:0 10px 0 6px; gap:6px; background:var(--bg); }
.workspace-tabs { display:flex; flex:1; min-width:0; align-self:stretch; gap:4px; padding:6px 0; overflow-x:auto; scrollbar-width:none; }
.workspace-tab { display:flex; flex:0 0 auto; align-items:center; max-width:200px; border:1px solid transparent; border-radius:7px; color:var(--text-dim); }
.workspace-tab.active { background:var(--panel); border-color:var(--line); color:var(--text); }
.workspace-tab-label { display:flex; align-items:center; gap:7px; min-width:0; padding:6px 11px; font-size:12px; border:0; background:transparent; color:inherit; }
.workspace-tab-label span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspace-tab-label .ui-icon { width:15px; height:15px; flex-shrink:0; }
.workspace-tab-close { display:flex; align-items:center; padding:4px; margin-right:5px; border:0; border-radius:4px; background:transparent; color:var(--text-dim); }
.workspace-tab-close .ui-icon { width:12px; height:12px; }
.workspace-tab-close:hover { background:var(--panel-2); color:var(--text); }
.workspace-top-actions { flex-shrink:0; gap:3px; }
.chrome-btn { display:inline-flex; align-items:center; justify-content:center; flex:0 0 28px; width:28px; height:28px; border:0; border-radius:6px; background:transparent; color:var(--text-dim); cursor:pointer; padding:5px; }
.chrome-btn .ui-icon { width:17px; height:17px; }
.chrome-btn:hover,.chrome-btn[aria-pressed="true"],.chrome-menu[open]>summary { background:var(--panel-2); color:var(--text); }
.chrome-btn:disabled { opacity:.35; cursor:default; }
.chrome-btn:focus-visible,.workspace-tab-label:focus-visible,.workspace-tab-close:focus-visible { outline:2px solid var(--accent); outline-offset:-1px; }
.assistant-toggle { border:0; background:transparent; padding:6px 8px; font-size:11px; gap:5px; color:var(--text); white-space:nowrap; }
.assistant-toggle .ui-icon { width:15px; height:15px; color:var(--info); }
.chrome-menu { position:relative; }
.chrome-menu>summary { list-style:none; }
.chrome-menu>summary::-webkit-details-marker { display:none; }
.chrome-popover { position:absolute; right:0; top:calc(100% + 8px); width:190px; padding:7px; border:1px solid var(--line); border-radius:10px; background:var(--panel); box-shadow:var(--shadow-pop); z-index:80; }
.chrome-popover>button { display:flex; gap:9px; align-items:center; width:100%; padding:9px; border:0; border-radius:5px; color:var(--text); background:transparent; font-size:12px; text-align:left; }
.chrome-popover>button:hover,.chrome-popover>button[aria-pressed="true"] { background:var(--panel-2); }
.chrome-popover>button[aria-pressed="true"]::after { content:'✓'; margin-left:auto; color:var(--accent); }
.chrome-popover>button .ui-icon { width:16px; height:16px; }
.chrome-popover>button:disabled { opacity:.4; }
.col-func { grid-column:3; grid-row:2; min-width:0; background:var(--panel); }
.func-head { padding:15px 20px 10px; gap:8px; background:transparent; border-bottom:0; }
.func-title { font-size:18px; }
.page-heading p { margin-top:3px; font-size:11px; }
.func-tabs:empty,.func-actions:has(#func-count:empty) { display:none; }
.col-func[data-view="todo"] .func-head { display:none; }
.func-body { padding:16px 20px 24px; }
.func-body.flush { padding:0; margin:8px 12px 12px; border-radius:7px; }
.overview-welcome { padding:0 0 18px; }
.overview-welcome .eyebrow { display:none; }
.overview-welcome h2 { font-size:22px; margin:0 0 6px; }
.overview-welcome p { font-size:11px; }
.overview-date { border:0; padding:0; background:transparent; font-size:11px; }
.daily-digest { padding:16px; margin-bottom:20px; border-color:var(--line); border-radius:10px; background:var(--bg-soft); }
.daily-digest::after { display:none; }
.daily-digest-head h3 { font-size:16px; margin-top:6px; }
.daily-digest-sections { gap:9px; margin-top:14px; }
.digest-block { padding:12px; border-radius:7px; }
.section-caption { margin-bottom:12px; }
.section-caption h3 { font-size:16px; }
.stat-row { gap:9px; }
.stat { padding:14px; border-radius:9px; }
.col-vm { grid-column:5; grid-row:2; position:relative; top:auto; right:auto; bottom:auto; width:auto; min-width:0; border:0; background:var(--vm-bg); box-shadow:none; z-index:20; }
.vm-resizer { display:block; grid-column:4; grid-row:2; width:4px; position:relative; z-index:21; cursor:col-resize; touch-action:none; background:transparent; }
.vm-head { flex:0 0 42px; flex-wrap:nowrap; min-width:0; gap:6px; padding:0 12px; border-bottom:1px solid var(--line-soft); }
.vm-id { gap:8px; min-width:0; flex:1; }
#vm-persona { font-size:12px; white-space:nowrap; font-weight:600; }
.current-conversation { font-size:10px; margin-left:0; overflow:hidden; text-overflow:ellipsis; }
.vm-tools { flex:0 0 auto; width:auto; gap:1px; border:0; padding:0; }
.vm-tools .chrome-btn { width:25px; flex-basis:25px; }
.vm-scroll { padding:0 22px; background:var(--vm-bg); scroll-behavior:auto; }
.vm-greet { margin:12px 0 4px; padding:0; border:0; border-radius:0; background:transparent; }
.vm-greet>summary { display:flex; gap:6px; align-items:center; list-style:none; color:var(--text-dim); font-size:11px; cursor:pointer; width:fit-content; }
.vm-greet>summary::-webkit-details-marker { display:none; }
.vm-greet>summary::after { content:'⌄'; margin-left:3px; }
.vm-greet>summary .ui-icon { width:13px; height:13px; }
.vm-greet[open] { padding-bottom:12px; border-bottom:1px solid var(--line-soft); }
.greet-text { margin-top:10px; }
.vm-messages { gap:24px; padding:20px 0 28px; }
.msg { gap:0; width:100%; }
.msg .ava { display:none; }
.msg .msg-body,.shell.workspace-hidden .msg .msg-body { max-width:100%; width:100%; }
.msg .bubble::after { display:none; }
.msg.bot .bubble { border:0; border-radius:0; background:transparent; padding:0; box-shadow:none; }
.msg .bubble,.msg .stream-text { font-size:14px!important; line-height:1.8; }
.msg.bot .md p { margin:0 0 12px; }
.msg.bot .md ul,.msg.bot .md ol { padding-left:22px; margin:10px 0 14px; }
.msg.bot .md li { margin:5px 0; }
.msg.user .msg-body { align-items:flex-end; }
.msg.user .bubble { max-width:92%; padding:10px 14px; background:var(--panel-2); border:0; border-radius:13px; }
.msg-details { margin-top:8px; color:var(--text-dim); font-size:10px; }
.msg-details summary { cursor:pointer; width:fit-content; opacity:.7; }
.msg-meta { font-size:10px; padding:5px 0; }
.msg .cite-fold { border-top:1px solid var(--line-soft); }
.vm-composer { flex:0 0 auto; padding:10px 16px 16px; border:0; background:var(--vm-bg); }
.composer-box { padding:10px 12px 8px; border:1px solid var(--line); border-radius:18px; background:var(--bg-soft); box-shadow:0 3px 15px var(--line-soft); }
.composer-box:focus-within { border-color:var(--accent-line); }
#chat-input.chat-input { min-height:52px; max-height:180px; padding:3px 2px; border:0; background:transparent; font-size:13px; line-height:1.6; box-shadow:none; }
.composer-bar { border:0; padding:4px 0 0; min-height:28px; gap:6px; }
.composer-tip { color:var(--text-dim); font-size:10px; }
#chat-send { width:28px; height:28px; border-radius:50%; background:var(--text); border-color:var(--text); color:var(--panel); }
#chat-send .ui-icon { width:17px; height:17px; }
.chat-options-body { width:230px; max-height:60vh; overflow:auto; }
.chat-options-body .switch { padding:9px; font-size:12px; }
.chat-options-body .scope-chips { padding:6px; }
.chat-options-body #vm-engine { display:block; padding:6px 9px; max-width:none; }
.chat-options-body .vm-pipeline { padding:8px; border:0; margin:0; max-height:240px; overflow:auto; }
.conversation-panel { top:47px; max-height:calc(100% - 64px); border-radius:10px; }
.shell.panes-swapped { grid-template-columns:var(--menu-w) 4px var(--vm-width) 4px minmax(0,1fr); }
.shell.panes-swapped .col-vm { grid-column:3; }
.shell.panes-swapped .col-func { grid-column:5; }
.shell.vm-collapsed,.shell.workspace-hidden { grid-template-columns:var(--menu-w) 4px minmax(0,1fr); }
.shell.vm-collapsed .col-func { grid-column:3; }
.shell.workspace-hidden .col-vm { grid-column:3; grid-row:2; width:auto; position:relative; display:grid; grid-template-columns:230px minmax(0,1fr); grid-template-rows:42px minmax(0,1fr) auto; }
.shell.workspace-hidden .vm-head { grid-column:1/-1; grid-row:1; }
.shell.workspace-hidden .conversation-panel { grid-column:1; grid-row:2/4; padding:16px 10px; background:var(--bg-soft); }
.shell.workspace-hidden .vm-scroll { grid-column:2; grid-row:2; padding:0 max(24px, calc((100% - 800px)/2)); }
.shell.workspace-hidden .vm-composer { grid-column:2; grid-row:3; padding:12px max(24px, calc((100% - 800px)/2)) 20px; }
.shell.workspace-hidden.history-hidden .col-vm { grid-template-columns:minmax(0,1fr); }
.shell.workspace-hidden.history-hidden .vm-scroll,.shell.workspace-hidden.history-hidden .vm-composer { grid-column:1; }
.shell.workspace-hidden #workspace-focus { border:0; background:var(--panel-2); color:var(--text); }
@media(max-width:1100px) {
  .workspace-topbar,.shell.workspace-hidden .workspace-topbar { grid-column:3/-1; padding:0 8px 0 4px; }
  .shell.workspace-hidden .col-vm { grid-template-columns:200px minmax(0,1fr); }
  .shell.workspace-hidden.history-hidden .col-vm { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:899px) {
  .shell:not(.vm-collapsed),.shell.workspace-hidden { grid-template-columns:var(--menu-w) 4px minmax(0,1fr); }
  .shell:not(.vm-collapsed) .col-func { display:none; }
  .shell .col-vm,.shell.workspace-hidden .col-vm { grid-column:3; display:flex; flex-direction:column; }
  .shell .vm-resizer { display:none; }
  .shell.workspace-hidden .conversation-panel { position:absolute; top:46px; left:10px; right:10px; border:1px solid var(--line); box-shadow:var(--shadow-pop); max-height:calc(100% - 64px); }
  .shell.workspace-hidden .conversation-panel-head #conversation-close { display:block; }
  .shell.workspace-hidden .vm-scroll { padding:0 20px; }
  .shell.workspace-hidden .vm-composer { padding:10px 16px 16px; }
  .shell.workspace-hidden #vm-collapse { display:inline-flex; }
  #pane-swap { display:none; }
}
@media(max-width:639px) {
  .workspace-topbar { gap:2px; }
  .workspace-tab-label { padding:6px; font-size:11px; }
  .workspace-tab-label .ui-icon { display:none; }
  #sidebar-toggle,#sidebar-resizer { visibility:hidden; }
  .assistant-toggle { width:28px; padding:6px; overflow:hidden; font-size:0; gap:0; }
  .assistant-toggle .ui-icon { flex-shrink:0; }
  .workspace-top-actions { gap:1px; }
  .func-body { padding:14px 12px; }
  .vm-head { padding:0 7px; }
  .current-conversation { display:none; }
  .vm-scroll { padding:0 15px; }
  .daily-digest { padding:12px; }
  .daily-digest-head { flex-direction:column; gap:6px; }
}

@container(max-width:880px) { .daily-digest-sections { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@container(max-width:440px) { .daily-digest-sections { grid-template-columns:minmax(0,1fr); } }

.sidebar-resizer::before,.vm-resizer::before { content:""; position:absolute; inset:0 -3px; }

/* ============================================================
   对话框（呼唤美维斯）打开时：功能区只能"压缩 + 换行"，不许溢出盖住右侧面板。
   11-03 用户反馈：团队知识库顶栏被右侧对话面板盖住。
   ============================================================ */
.col-func { min-width: 0; }
.func-head { min-width: 0; }
.func-head > * { min-width: 0; }
.kb-head-tools { min-width: 0; }
.kbht-row { flex-wrap: wrap; max-width: 100%; }
.kbht-tail { flex-wrap: wrap; row-gap: 5px; max-width: 100%; margin-left: auto; }
.kbht-tail select { max-width: 132px; }
.kbht-search { flex-wrap: wrap; row-gap: 6px; }
.kbht-search input { flex: 1 1 180px; min-width: 120px; }
.kbf-chips { flex-wrap: wrap; }
/* 其它页面的工具条同样允许换行（全站统一口径） */
.col-func .toolbar,
.col-func .table-tools,
.col-func .filters,
.col-func .page-tools { flex-wrap: wrap; min-width: 0; }

/* ===== 窗口级「呼唤美维斯」：浮在当前工作页右侧，不挤压工作区、不带对话菜单 ===== */
.shell.vm-window { grid-template-columns: var(--menu-w) 4px minmax(0, 1fr); }
.shell.vm-window .col-func { grid-column: 3; }
.shell.vm-window .workspace-topbar { grid-column: 3 / -1; }
.shell.vm-window .vm-resizer { display: none; }
.shell.vm-window .col-vm {
  position: absolute; top: 56px; right: 14px; bottom: 14px;
  width: clamp(380px, 30vw, 540px); max-width: calc(100vw - 120px);
  grid-column: auto; grid-row: auto; margin: 0; z-index: 75;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); box-shadow: var(--shadow-pop); overflow: hidden;
}
.shell.vm-window .vm-head { grid-column: auto; grid-row: auto; border-radius: 14px 14px 0 0; }
.shell.vm-window .vm-scroll { flex: 1 1 auto; min-height: 0; }
.shell.vm-window .vm-composer { grid-column: auto; grid-row: auto; }
.shell.vm-window #conversation-panel { display: none !important; }
.shell.vm-window #chat-history { display: none; }
