/* EvoQi 公域客服：石墨灰 / 琥珀橙。独立产品主题，所有新增色值集中定义。 */
:root {
  --bg: #f5f5f6; --surface: #fff; --surface-soft: #f8f8f9;
  --sidebar: #fafafa; --sidebar-soft: #f1f1f3; --sidebar-hover: #ebebee;
  --border: #e6e6e9; --border-strong: #d1d1d8; --text: #23242b;
  --text-soft: #484952; --muted-text: #686974; --weak-text: #777984;
  --primary: #ad4c08; --primary-hover: #8d3d06; --primary-soft: #fff2e3;
  --success: #157446; --success-soft: #e7f5ed; --warning: #90600d; --warning-soft: #fff7dc;
  --danger: #bd3535; --danger-soft: #fff0ef;
  --graphite: #25262b; --graphite-soft: #32343b; --header-text: #f8f8fa; --header-muted: #c1c2cc;
  --header-line: #53545d; --accent: #f1ac59; --focus-ring: #e4a766;
  --avatar-bg: #efedf4; --avatar-text: #636078;
  --shadow-sm: 0 2px 5px rgb(30 30 40 / 3%); --shadow-md: 0 16px 50px rgb(30 30 40 / 14%);
  --overlay: rgb(30 30 40 / 30%); --header-h: 64px; --radius: 10px; --radius-sm: 7px;
}
body { letter-spacing: .1px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(button, input, textarea, select, summary, [tabindex="0"]):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
#header { background: var(--graphite); color: var(--header-text); border: 0; padding: 0 24px; box-shadow: none; position: relative; z-index: 45; }
#header .brand-title { color: var(--header-text); font-size: 16px; font-weight: 600; }
.app-wordmark { font-size: 27px; letter-spacing: -1.3px; margin-right: 9px; font-weight: 650; }
#header .brand-badge { border-color: var(--header-line); color: var(--header-muted); background: var(--graphite-soft); height: 30px; padding: 0 12px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
#header .sidebar-toggle { color: var(--header-muted); }
#header .sidebar-toggle:hover, #header .logout-btn:hover { background: var(--graphite-soft); color: var(--header-text); }
#header .status-chip { background: transparent; border-color: var(--header-line); color: var(--header-muted); font-size: 12px; }
#header .status-chip strong { color: var(--header-text); }
#header .user-chip { border: 0; color: var(--header-text); }
#header .user-role { color: var(--header-muted); }
#header .logout-btn { border-color: var(--header-line); color: var(--header-muted); }
.app-layout { height: calc(100dvh - var(--header-h)); }
.nav-sidebar, .nav-sidebar:not(.collapsed) { width: 220px; background: var(--sidebar); padding: 18px 12px 10px; border-right: 1px solid var(--border); gap: 4px; }
.nav-sidebar .nav-label, .nav-sidebar .nav-section-label, .nav-sidebar .nav-footer { display: block; }
.nav-sidebar.collapsed { width: 62px; padding: 16px 7px; }
.nav-sidebar.collapsed .nav-label, .nav-sidebar.collapsed .nav-section-label, .nav-sidebar.collapsed .nav-footer { display: none; }
.nav-section-label { color: var(--muted-text); font-weight: 500; font-size: 11px; letter-spacing: .5px; padding: 6px 10px 12px; }
.nav-section-label:not(:first-child) { border-top: 1px solid var(--border); margin-top: 13px; padding-top: 19px; }
.nav-position-group { margin-bottom: 10px; }
.nav-position-header { background: transparent; color: var(--text-soft); padding: 12px 10px; font-size: 13px; gap: 9px; }
.nav-position-header .icon { width: 18px; height: 18px; }
.nav-position-header.active { background: transparent; color: var(--text); }
.nav-position-header.active .icon { color: var(--primary); }
.nav-position-header:hover { background: var(--sidebar-soft); color: var(--text); }
.nav-position-items { margin: 0; padding: 0; border: 0; }
.nav-position-items .nav-item { padding: 10px 10px 10px 28px; font-size: 12px; }
.nav-item { position: relative; color: var(--text-soft); font-size: 12px; padding: 11px 10px; }
.nav-item:hover { color: var(--text); background: var(--sidebar-soft); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 4px; background: var(--primary); }
.nav-footer { color: var(--muted-text); border-color: var(--border); font-size: 10px; }
#mainArea { padding: 20px 24px 24px; gap: 0; overflow: hidden; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 12px; color: var(--muted-text); font-size: 11px; min-height: 20px; margin-bottom: 17px; flex-shrink: 0; }
.workspace-breadcrumb strong { color: var(--text-soft); font-weight: 500; }
.workbench-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-shrink: 0; }
.workbench-heading h1, .view-title h2 { font-size: 25px; font-weight: 650; letter-spacing: -.6px; margin: 0; }
.workbench-heading p, .page-description { margin-top: 6px; font-size: 12px; color: var(--muted-text); font-weight: 400; }
.workbench-heading-actions, .page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.view { padding: 0 2px 0 0; height: auto; min-height: 0; }
.view-inner { max-width: 1520px; margin: 0 auto; }
.view-title { margin-bottom: 22px; align-items: center; flex-wrap: wrap; }
.btn, .select, .input { min-height: 36px; font-size: 12px; border-color: var(--border-strong); }
.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn-primary { color: var(--surface); border-color: var(--primary); }
.btn-danger { border-color: var(--danger); }
.select:focus, .input:focus, .field input:focus, .field select:focus, .field textarea:focus { box-shadow: none; }
.field input:not([type="checkbox"]), .field select { min-height: 38px; }
.field input[type="checkbox"] { width: auto; accent-color: var(--primary); }
.field label { font-size: 12px; line-height: 1.7; margin-bottom: 7px; }
.form-grid { gap: 16px; }
.config-card, .dash-card { padding: 22px; box-shadow: var(--shadow-sm); }
.config-card h3, .dash-card h3 { font-size: 15px; font-weight: 600; }
.stat-grid { gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; }
.data-table th { background: var(--surface-soft); font-weight: 500; color: var(--muted-text); font-size: 12px; white-space: nowrap; padding: 14px 16px; }
.data-table td { padding: 15px 16px; font-size: 12px; border-color: var(--border); }
.data-table tr:hover td { background: var(--surface-soft); }
.modal, .workbench-dialog { border-radius: 14px; }
.modal-head { background: var(--surface-soft); }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 5px; }
.empty-state { color: var(--muted-text); padding: 30px 18px; text-align: center; gap: 14px; }
.empty-state .icon { color: var(--primary); }
/* The account selector keeps account-specific APIs and unread signals intact. */
.channel-picker, .action-menu { position: relative; }
.channel-picker summary { list-style: none; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface); cursor: pointer; font-size: 12px; }
.channel-picker summary::-webkit-details-marker, .action-menu summary::-webkit-details-marker { display: none; }
#channelPickerLabel { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-picker .account-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 330px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); }
.account-header { color: var(--muted-text); border-color: var(--border); font-size: 12px; }
.account-list-scroll { max-height: 340px; }
.account-card .name { color: var(--text); }
.account-card .meta { color: var(--muted-text); }
.account-card:hover { background: var(--surface-soft); }
.account-card.active { background: var(--primary-soft); border-color: var(--primary); }
.action-menu summary { list-style: none; cursor: pointer; }
.action-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; min-width: 155px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
.action-menu-panel .btn { border-color: transparent; justify-content: flex-start; }
/* Three-pane conversation workspace. */
#container-workbench { gap: 12px; background: transparent; }
.contact-panel { width: 280px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.contact-panel .header { color: var(--text); font-size: 14px; padding: 16px; min-height: 54px; }
.contact-panel .header .icon { display: none; }
.list-load-state { font-size: 11px; color: var(--muted-text); }
.contact-tools { padding: 12px; gap: 12px; }
.contact-search { min-height: 36px; font-size: 12px; background: var(--surface-soft); }
.contact-filters { gap: 5px; }
.filter-btn { border: 0; border-radius: 5px; font-size: 11px; padding: 5px 8px; background: var(--surface-soft); }
.filter-btn.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.contact-list { padding: 0; }
.contact-item { border-radius: 0; padding: 16px 12px; margin: 0; min-height: 94px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; gap: 10px; }
.contact-item.active { border-left-color: var(--primary); background: var(--primary-soft); }
.contact-item .avatar { width: 36px; height: 36px; background: var(--avatar-bg); color: var(--avatar-text); }
.contact-item .avatar.takeover-avatar { background: var(--danger-soft); color: var(--danger); }
.contact-name-text { font-weight: 600; }
.contact-status { font-size: 10px; }
.contact-status.auto { color: var(--success); background: var(--success-soft); }
.contact-status.assist { color: var(--primary); background: var(--primary-soft); }
.contact-status.manual { color: var(--text-soft); background: var(--sidebar-soft); }
.contact-item .preview { margin-top: 5px; font-size: 12px; }
#container-workbench > .main { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); min-width: 0; }
.chat-header { padding: 15px 18px 0; gap: 10px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface); }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--avatar-text); background: var(--avatar-bg); font-size: 18px; }
.chat-header .who { min-width: 80px; }
.chat-header .who .name { font-size: 15px; font-weight: 600; }
.chat-header .who .meta { font-size: 11px; color: var(--muted-text); margin-top: 3px; max-width: none; }
.chat-header .controls { flex-basis: 100%; justify-content: flex-end; padding-top: 6px; gap: 8px; }
.mode-group { order: -1; margin-right: auto; border: 0; border-radius: 0; background: transparent; }
.mode-btn { background: transparent; border: 0; border-radius: 0; padding: 11px 12px; color: var(--muted-text); font-size: 12px; border-bottom: 2px solid transparent; }
.mode-btn.active, .mode-btn:disabled { background: transparent; color: var(--primary); border-bottom-color: var(--primary); opacity: 1; font-weight: 600; }
.icon-btn { color: var(--muted-text); border-color: var(--border); font-size: 11px; }
.messages { padding: 24px; gap: 18px; background: var(--surface-soft); }
.msg { max-width: 82%; font-size: 13px; line-height: 1.8; box-shadow: none; animation: none; padding: 10px 14px; }
.msg.send { background: var(--primary-soft); color: var(--text-soft); border: 1px solid var(--border); }
.msg.send .talker { color: var(--primary); }
.msg.send .meta, .msg.send .appmsg-kicker, .msg.send .appmsg-desc { color: var(--muted-text); }
.msg.send .appmsg-title { color: var(--text); }
.msg.send .appmsg-card { background: var(--surface); border-color: var(--border); }
.composer { padding: 12px 16px 14px; border-top: 1px solid var(--border); }
.composer textarea { min-height: 60px; background: var(--surface-soft); }
.composer .hint { color: var(--muted-text); font-size: 11px; }
.composer-tools .btn { min-height: 28px; padding: 3px 7px; }
.send-btn { background: var(--primary); color: var(--surface); padding: 8px 20px; border-radius: var(--radius-sm); }
.task-sidebar { width: 270px; border: 1px solid var(--border); border-radius: var(--radius); }
.task-header { padding: 19px 7px; margin: 0 14px; }
.task-kicker { color: var(--muted-text); font-size: 11px; margin-bottom: 12px; }
.task-title { font-size: 17px; }
.task-section { padding: 20px 7px; margin: 0 14px; }
.task-section h3 { color: var(--text); font-size: 13px; font-weight: 600; }
.task-profile-tag { background: var(--surface-soft); border: 1px solid var(--border); font-size: 11px; line-height: 1.6; }
.task-summary-text { font-size: 12px; padding: 12px; }
.task-advice-title { font-size: 12px; }
.task-advice-reason { font-size: 12px; }
.task-context { display: grid; gap: 8px; font-size: 11px; }
.task-context div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.task-context dt { color: var(--muted-text); }
.task-context dd { margin: 0; overflow-wrap: anywhere; }
.task-ai-note { font-size: 10px; color: var(--muted-text); line-height: 1.7; margin-top: 10px; }
.conversation-back { display: none; }
/* Content libraries: compact summary and rows, with content preview / editing. */
.library-overview { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 6px; gap: 0; margin-bottom: 22px; }
.library-overview:empty { display: none; }
.library-overview > div { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 0 22px; border: 0; border-right: 1px solid var(--border); border-radius: 0; background: transparent; }
.library-overview > div:last-child { border: 0; }
.library-overview strong { font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.library-shell, .library-shell.product-shell { grid-template-columns: minmax(0, 1.18fr) minmax(330px, 1fr); gap: 16px; align-items: start; }
.library-main, .library-editor { padding: 20px; border-radius: var(--radius); min-width: 0; box-shadow: var(--shadow-sm); }
.library-editor { position: sticky; top: 0; max-height: calc(100dvh - 170px); overflow-y: auto; }
.library-toolbar { gap: 8px; }
.library-toolbar input { min-width: 100px; padding: 9px 12px; }
.library-toolbar select { padding: 9px 10px; }
.library-toolbar input, .library-toolbar select { font-size: 12px; }
.library-list { gap: 0; }
.library-item { border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 0; padding: 15px 12px; margin: 0; }
.library-item.active { background: var(--primary-soft); border-left-color: var(--primary); }
.library-item-title .name { font-size: 13px; font-weight: 600; }
.library-item-title { gap: 8px; flex-wrap: wrap; }
.library-item-meta { font-size: 11px; }
.library-item-preview, #knowledgeList .library-item-preview { font-size: 12px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 16px; font-size: 12px; border: 0; background: var(--surface-soft); border-radius: var(--radius); color: var(--muted-text); }
.library-empty .icon { color: var(--primary); width: 30px; height: 30px; }
.library-empty strong { color: var(--text); font-size: 14px; font-weight: 500; }
.library-result-count { font-size: 11px; }
.library-categories .btn { min-height: 30px; font-size: 11px; }
.library-pagination { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 0; }
.library-editor-actions { position: sticky; bottom: -20px; background: var(--surface); padding: 16px 0; border-top: 1px solid var(--border); }
.preview-kicker { font-size: 12px; color: var(--muted-text); margin-bottom: 18px; }
.knowledge-preview h3 { font-size: 18px; line-height: 1.6; }
.preview-tags { display: flex; gap: 8px; margin: 12px 0; }
.preview-scope { font-size: 12px; color: var(--muted-text); padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.knowledge-preview dl { margin: 20px 0; }
.knowledge-preview dl > div { margin-bottom: 18px; }
.knowledge-preview dt { font-size: 11px; color: var(--muted-text); margin-bottom: 7px; }
.knowledge-preview dd { font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.scope-notice { font-size: 12px; color: var(--text-soft); background: var(--primary-soft); padding: 12px; border-radius: var(--radius-sm); }
.preview-actions { display: flex; gap: 8px; margin-top: 22px; }
.content-tool { height: auto; min-height: 480px; align-items: start; }
.tool-left { width: 260px; max-height: calc(100dvh - 215px); }
.tool-right { min-width: 0; }
.strategy-item.active { border-color: var(--primary); }
/* Login belongs to the same product, not a second visual identity. */
.login-screen { --entry-ink: var(--graphite); --entry-panel: var(--graphite-soft); --entry-line: var(--header-line); --entry-muted: var(--header-muted); --entry-accent: var(--accent); }
.entry-message p { background: var(--graphite); }
.entry-message.ai p { color: var(--text); }
.entry-brand-name { color: var(--header-muted); }
.entry-demo-note { color: var(--header-muted); }
@media (min-width: 1450px) { .contact-panel { width: 300px; } .task-sidebar { width: 295px; } }
@media (min-width: 1271px) { .task-sidebar { display: block; } #taskToggleBtn { display: none; } }
@media (max-width: 1270px) {
  #header .status-chip:not(.user-chip), #header .user-role { display: none; }
  .nav-sidebar:not(.collapsed) { width: 190px; }
  #mainArea { padding: 18px; }
  .contact-panel { width: 260px; }
  .task-sidebar { display: none; }
  .task-sidebar.expanded { display: block; width: 310px; max-width: 100%; position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; background: var(--surface); box-shadow: var(--shadow-md); }
  #taskToggleBtn { display: inline-flex; }
  .library-shell, .library-shell.product-shell { grid-template-columns: minmax(0, 1fr) minmax(290px, .85fr); }
}
@media (max-width: 900px) {
  #header { padding: 0 14px; gap: 8px; }
  #header .brand-badge { max-width: 180px; font-size: 11px; }
  #header .brand-title { font-size: 13px; } .app-wordmark { font-size: 23px; }
  #header .header-status { gap: 6px; } #header .user-chip { display: none; }
  .nav-sidebar, .nav-sidebar:not(.collapsed), .nav-sidebar.collapsed { display: none; }
  .nav-sidebar.mobile-open { display: flex; position: fixed; top: var(--header-h); bottom: 0; left: 0; width: 240px; z-index: 40; box-shadow: var(--shadow-md); }
  .nav-sidebar.mobile-open .nav-label, .nav-sidebar.mobile-open .nav-section-label, .nav-sidebar.mobile-open .nav-footer, .nav-sidebar.mobile-open .nav-chevron { display: block; }
  .nav-sidebar.mobile-open .nav-position-items:not([hidden]) { display: block; }
  .nav-sidebar.mobile-open .nav-position-header, .nav-sidebar.mobile-open .nav-item { justify-content: flex-start; }
  .contact-panel { width: 255px; }
  .library-shell, .library-shell.product-shell { grid-template-columns: 1fr; }
  .library-editor { position: static; max-height: none; }
  .content-tool { flex-direction: column; height: auto; }
  .tool-left, .tool-right { width: 100%; }
  .tool-left { max-height: 240px; }
}
@media (max-width: 600px) {
  :root { --header-h: 58px; }
  #header { padding: 0 10px; } #header .brand { gap: 6px; } #header .brand-badge { display: none; }
  #header .brand-title { font-size: 12px; } .app-wordmark { font-size: 21px; margin-right: 4px; }
  #header .logout-btn { font-size: 10px; padding: 0 6px; }
  #mainArea { padding: 12px 10px; }
  .workspace-breadcrumb { margin-bottom: 9px; font-size: 10px; overflow-wrap: anywhere; }
  .workbench-heading { align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  .workbench-heading h1, .view-title h2 { font-size: 22px; }
  .workbench-heading p { display: none; }
  .workbench-heading-actions { gap: 6px; width: 100%; }
  .channel-picker { flex: 1; min-width: 0; }
  .channel-picker summary { padding: 7px 10px; }
  #channelPickerLabel { max-width: none; flex: 1; min-width: 0; }
  .channel-picker .account-list { left: 0; right: auto; }
  #container-workbench > .main { display: none; }
  .contact-panel { width: 100%; }
  #container-workbench.has-conversation > .main { display: flex; }
  #container-workbench.has-conversation .contact-panel { display: none; }
  .conversation-back { display: inline-flex; }
  .chat-header { padding: 10px 10px 0; }
  .chat-header .who .name { font-size: 14px; }
  .chat-header .controls { gap: 3px; }
  .mode-btn { padding: 9px 7px; font-size: 11px; }
  .messages { padding: 16px 12px; gap: 12px; }
  .composer { padding: 8px 10px; }
  .composer-tools { gap: 3px; flex-wrap: wrap; }
  .composer-tools span { display: none; }
  .send-btn { padding: 7px 12px; }
  .view-title { gap: 12px; margin-bottom: 16px; }
  .page-description { line-height: 1.6; }
  .library-overview { flex-wrap: wrap; gap: 16px 0; padding: 15px 0; }
  .library-overview > div { flex: 0 0 33%; padding: 0 12px; }
  .library-overview strong { font-size: 19px; }
  .library-main, .library-editor, .config-card { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .library-pagination { gap: 8px; }
  .stat-grid, #modelKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { padding: 14px; }
  .view-title > div[style] { flex-wrap: wrap; }
  .library-toolbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Consistent legacy component states and accessible low-contrast message cards. */
.stat-card.clickable:hover { border-color: var(--focus-ring); }
.lead-strip { border-color: var(--border); }
.msg.recv .scene, .msg.send .scene { background: var(--surface); color: var(--text-soft); }
.msg.send .msg-media { color: var(--primary); }
.strategy-empty { flex: 1; background: var(--surface); border: 1px solid var(--border); min-height: 240px; }
.content-tool:has(#strategiesEditor:not([hidden])) .strategy-empty { display: none; }
#strategyContent { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); }
body:not([data-view="workbench"]) #header .status-chip:not(.user-chip) { display: none; }
@media (max-width: 900px) { .strategy-empty { width: 100%; } }

/* Conversation-first density: retain readable messages, reclaim repeated heading space. */
#mainArea[data-view="workbench"] { padding: 12px 16px 16px; }
#mainArea[data-view="workbench"] > .workspace-breadcrumb { display: none; }
.workbench-heading { min-height: 36px; margin-bottom: 12px; gap: 12px; }
.workbench-heading h1 { font-size: 18px; letter-spacing: 0; }
.workbench-heading p { display: none; }
#container-workbench > .main { container-type: inline-size; }
#container-workbench .chat-header { min-height: 0; padding: 8px 12px 0; gap: 7px; flex-shrink: 0; }
#container-workbench .chat-avatar { width: 32px; height: 32px; font-size: 16px; }
#container-workbench .chat-header .who .meta { margin-top: 0; }
#container-workbench .chat-header .controls { padding-top: 0; gap: 6px; }
#container-workbench .mode-btn { padding: 7px 9px; }
#container-workbench .messages { padding: 16px 20px; gap: 14px; }
#container-workbench .composer { padding: 8px 12px; flex-shrink: 0; }
#container-workbench .composer-tools { margin-bottom: 6px; }
#container-workbench .composer textarea { min-height: 44px; height: 44px; }
#container-workbench .composer .hint { margin-top: 5px; line-height: 1.5; }
@container (min-width: 500px) {
  #container-workbench .chat-header { flex-wrap: nowrap; min-height: 56px; padding: 8px 12px; }
  #container-workbench .chat-header .controls { flex-basis: auto; flex-shrink: 0; margin-left: auto; }
  #container-workbench .mode-group { margin-right: 0; }
  #container-workbench .mode-btn { border-bottom: 0; border-radius: 5px; }
  #container-workbench .mode-btn.active { background: var(--primary-soft); }
}
@media (max-width: 600px) {
  #mainArea[data-view="workbench"] { padding: 8px 10px 10px; }
  #mainArea[data-view="workbench"] > .workspace-breadcrumb { display: flex; min-height: 16px; margin-bottom: 5px; }
  .workbench-heading { min-height: 32px; margin-bottom: 8px; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .workbench-heading h1 { font-size: 16px; white-space: nowrap; }
  .workbench-heading-actions { width: auto; flex: 1; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; }
  .workbench-heading-actions .channel-picker { flex: 0 1 150px; }
  .workbench-heading-actions .channel-picker summary { padding: 6px 8px; }
  .workbench-heading-actions .channel-picker summary > .icon { display: none; }
  #workbenchRefresh { font-size: 0; gap: 0; padding: 7px; min-height: 32px; }
  #container-workbench .messages { padding: 12px; gap: 12px; }
}

/* Operational statistics: one aligned overview, bounded charts, quiet detail. */
#view-stats .view-inner { max-width: 1520px; width: 100%; }
#view-stats .view-title { margin-bottom: 20px; }
#view-stats .stats-filters { display: flex; gap: 16px; align-items: flex-end; padding: 16px 20px; margin-bottom: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stats-filter-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.stats-filter-field > span { font-size: 11px; color: var(--muted-text); }
#view-stats .stats-filters select, #view-stats .stats-filters input { height: 36px; min-width: 0; font-size: 12px; border-radius: var(--radius-sm); }
#statsPreset { width: 130px; }
.stats-date-range { display: flex; align-items: center; gap: 8px; }
.stats-date-range > span { color: var(--weak-text); }
#view-stats .stats-date-range input { width: 142px; }
.stats-account-field { flex: 1; }
#view-stats #statsAccount { width: 100%; }
#view-stats #statsRefresh { flex-shrink: 0; gap: 6px; }
.stats-context { display: flex; align-items: flex-start; gap: 16px; margin: 12px 2px 20px; color: var(--muted-text); font-size: 11px; line-height: 1.7; }
.stats-context > p { margin: 0; flex: 1; }
.stats-method { max-width: 420px; }
.stats-method summary { cursor: pointer; white-space: nowrap; text-align: right; color: var(--primary); }
.stats-method p { margin: 8px 0 0; }
#view-stats #kpiGrid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
#view-stats .stat-card { min-width: 0; padding: 18px 20px; text-align: left; box-shadow: none; }
#view-stats .stat-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 0; color: var(--text-soft); font-size: 12px; }
.stats-kpi-mark { font-size: 10px; color: var(--weak-text); font-variant-numeric: tabular-nums; }
#view-stats .stat-num { margin: 14px 0 9px; font-size: clamp(26px,2.4vw,36px); font-weight: 600; letter-spacing: -1px; }
#view-stats .stat-card .sub { font-size: 10px; line-height: 1.6; }
#view-stats .stats-kpi-highlight { background: var(--primary-soft); border-color: var(--primary-soft); }
#view-stats .stats-kpi-highlight .stat-num, #view-stats .stats-kpi-highlight .stats-kpi-mark { color: var(--primary); }
#view-stats .stats-chart-grid { gap: 16px; margin-bottom: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); }
#view-stats .dash-card { padding: 20px; box-shadow: none; }
#view-stats .dash-card h3 { font-size: 14px; margin-bottom: 0; }
#view-stats .dash-card > .stats-note { margin: 6px 0 14px; font-size: 11px; min-height: 38px; }
#view-stats .stats-legend { gap: 8px 14px; margin: 0 0 12px; min-height: 20px; font-size: 11px; }
#view-stats .stats-legend span { white-space: nowrap; }
#view-stats .stats-svg { height: 220px; }
#view-stats .stats-svg text { font-size: 11px; }
#view-stats .stats-data { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 11px; }
#view-stats .stats-data summary { cursor: pointer; width: fit-content; }
#view-stats .stats-data .table-wrap { margin-top: 12px; }
#view-stats .stats-bars { padding: 0; }
#view-stats .stats-bar-track { height: 7px; border-radius: 8px; }
#view-stats .stats-bar-track > div { border-radius: 8px; }
#view-stats .stats-empty { min-height: 220px; }
@media(max-width:1200px) {
  #view-stats .stats-filters { gap: 12px; }
  #view-stats .stat-card { padding: 16px 12px; }
  .stats-kpi-mark { display: none; }
}
@media(max-width:1050px) {
  #view-stats #kpiGrid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stats-account-field { min-width: 180px; }
}
@media(max-width:700px) {
  #view-stats .stats-filters { padding: 14px; gap: 12px; }
  #view-stats .stats-filter-field { width: 100%; }
  #view-stats #statsPreset { width: 100%; }
  #view-stats .stats-date-range input { width: 0; flex: 1; }
  #view-stats .stats-account-field { flex: 1; min-width: 110px; }
  #view-stats #statsRefresh { padding-inline: 10px; }
  .stats-context { flex-wrap: wrap; gap: 6px; }
  .stats-context > p { flex-basis: 100%; }
  .stats-method summary { text-align: left; }
  #view-stats #kpiGrid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  #view-stats .stats-kpi-highlight { grid-column: 1 / -1; }
  #view-stats .stats-chart-grid { grid-template-columns: 1fr; }
  #view-stats .dash-card { padding: 16px; }
  #view-stats .stats-svg { height: auto; min-height: 140px; }
}

/* 标注复盘：概览筛选 + 对话案例 */
#view-annotations .view-title > div { flex-wrap: wrap; }
#view-annotations #annoStats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
#annoStats .stat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 20px 24px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font: inherit; color: var(--text); }
#annoStats .stat-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
#annoStats .stat-num { font-size: 30px; line-height: 1.2; }
.anno-muted { color: var(--muted-text); font-size: 12px; }
.anno-toolbar, .anno-controls, .anno-case-head, .anno-pagination { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.anno-toolbar { justify-content: space-between; margin-bottom: 16px; }
.anno-toolbar h3 { margin: 0 0 5px; font-size: 16px; }
.anno-case { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 16px; overflow: hidden; }
.anno-case-head { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.anno-case-head strong { overflow-wrap: anywhere; }
.anno-case-head time { margin-left: auto; }
.anno-case-body { display: grid; grid-template-columns: minmax(0, 1fr) 185px; }
.anno-context { padding: 18px 20px; min-width: 0; }
.anno-feedback { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 16px; background: var(--warning-soft); border-radius: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.anno-feedback b { flex-shrink: 0; color: var(--warning); }
.anno-context .case-msg { max-width: 100%; margin-bottom: 8px; }
.anno-context .case-msg-body { overflow-wrap: anywhere; }
.anno-actions { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-left: 1px solid var(--border); }
.anno-actions .anno-muted { line-height: 1.9; margin-bottom: 6px; overflow-wrap: anywhere; }
.anno-missing { color: var(--muted-text); padding: 14px 0; font-size: 13px; }
.anno-analysis { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; }
.anno-analysis summary { cursor: pointer; color: var(--primary); }
.anno-analysis p { white-space: pre-wrap; overflow-wrap: anywhere; }
.anno-pagination { justify-content: center; padding: 12px; font-size: 13px; color: var(--muted-text); }
#annoCases[aria-busy="true"] { opacity: .6; pointer-events: none; }
@media (max-width: 900px) { #view-annotations #annoStats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .anno-case-body { grid-template-columns: 1fr; } .anno-actions { flex-direction: row; flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--border); } .anno-actions .anno-muted { width: 100%; } .anno-case-head time { margin-left: 0; } }

/* 当前账号跟进待办提醒，独立于客户新消息未读标记。 */
#statusTabs [data-status="followup"], #statusTabs [data-status="pending"] { display: inline-flex; align-items: center; gap: 5px; }
.followup-tab-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
.followup-tab-dot[hidden] { display: none; }
.followup-tab-count { min-width: 16px; padding: 0 4px; border-radius: 9px; font-size: 10px; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.has-followup .followup-tab-count { color: var(--surface); background: var(--danger); font-weight: 600; }

/* 运营标注备注：与发给客户的消息正文分区展示。 */
.msg .flag-note { margin-top: 10px; padding: 10px 12px; border-top: 1px dashed var(--border-strong); border-left: 3px solid var(--border-strong); border-radius: 0 6px 6px 0; background: var(--surface); color: var(--muted-text); font-size: 12px; line-height: 1.6; white-space: normal; }
.flag-note-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; font-size: 11px; }
.flag-note-heading strong { color: var(--text-soft); font-weight: 600; }
.flag-note-heading span { padding: 1px 5px; border-radius: 4px; background: var(--surface-soft); color: var(--muted-text); font-size: 10px; }
.flag-note-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.anno-history-item { padding-top: 12px; }
.anno-history-item + .anno-history-item { border-top: 1px solid var(--border); }
.anno-history-item p { margin: 6px 0 12px; color: var(--text-soft); }
.anno-process-error { color: var(--danger); font-size: 12px; }
