:root {
  --bg: #fafaf5;
  --bg-strong: #f3f1e9;
  --surface: #fafaf5;
  --surface-soft: #f3f1e9;
  --surface-strong: #1f4b3c;
  --line: #e0dcce;
  --line-strong: #d4cfbe;
  --text: #1c1d1a;
  --text-muted: #4b4d47;
  --text-soft: #6b7a6f;
  --primary: #1f4b3c;
  --primary-strong: #14362a;
  --primary-soft: rgba(31, 75, 60, 0.1);
  --accent: #b8542e;
  --accent-soft: rgba(184, 84, 46, 0.12);
  --danger: #b8542e;
  --danger-soft: rgba(184, 84, 46, 0.12);
  --shadow-sm: none;
  --shadow-md: none;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; height: 100dvh; overflow: hidden; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

a { color: inherit; }
button, input, select { font: inherit; }
button { outline: none; }
canvas {
  width: 100%;
  height: 260px;
  display: block;
}

.app-body {
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
}

.system-root {
  width: min(100vw, 1600px);
  height: 100dvh;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-panel,
.scope-bar,
.log-workspace,
.system-topbar,
.system-command,
.system-tabs {
  padding: 12px 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 800;
}

.panel-note,
.placeholder-text,
.analysis-text,
.narrative,
.detail-meta,
.summary-card small,
.metric small,
.field span,
.status-chip,
.progress-text {
  color: var(--text-muted);
}

.system-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid var(--line);
}

.system-topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-right: 0;
}

.system-topbar-brand .eyebrow,
.system-topbar-brand h1,
.system-topbar-brand p {
  color: var(--text);
}

.system-topbar-brand .eyebrow {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.system-topbar-brand h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: 0.02em;
}

.system-topbar-brand p:last-child {
  display: none;
}

.system-topbar-meta {
  display: none;
}

.top-meta-card,
.compact-status {
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.top-meta-card span,
.top-meta-card small {
  display: block;
  color: var(--text-muted);
}

.top-meta-card span {
  font-size: 12px;
  font-weight: 700;
}

.top-meta-card strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}

.top-meta-card small {
  line-height: 1.4;
  font-size: 11px;
}

.status-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-card strong,
.status-card small {
  display: block;
}

.status-card strong {
  color: var(--text);
  font-size: 16px;
}

.status-card small {
  margin-top: 4px;
  color: var(--text-muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(183, 117, 33, 0.16);
}

.dot.ok {
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(30, 108, 73, 0.16);
}

.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(195, 87, 72, 0.16);
}

.system-command {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.system-command-copy h2 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.system-command-copy p:last-child {
  display: none;
}

.system-command-actions {
  display: flex;
  gap: 8px;
  justify-items: end;
  align-items: center;
  flex-wrap: wrap;
}

.system-command-actions .status-chip {
  display: none;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.header-actions,
.row.gap,
.toolbar-inline,
.recording-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions {
  justify-content: flex-end;
}

.btn {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.btn:hover { transform: none; }
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary,
.primary {
  background: var(--primary);
  color: #fafaf5;
  box-shadow: none;
}

.btn.ghost,
.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-muted);
}

.btn.download,
.download {
  background: var(--text);
  color: #fafaf5;
  box-shadow: none;
}

.system-tabs {
  grid-column: 1;
  grid-row: 2 / 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  align-items: start;
  min-height: 0;
  overflow: auto;
}

.tabs-head,
.tab-cluster {
  display: grid;
  gap: 8px;
}

.tabs-head {
  display: none;
}

.tabs-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.tabs-head .panel-note {
  margin: 0;
  line-height: 1.8;
}

.primary-tab-cluster,
.utility-tab-cluster {
  grid-template-columns: 1fr;
}

.side-tab {
  min-width: 0;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  gap: 4px;
  align-content: start;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.side-tab:hover {
  transform: none;
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.side-tab span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--line);
}

.side-tab strong {
  font-size: 15px;
  line-height: 1.35;
}

.side-tab small {
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 11px;
}

.side-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.side-tab.active span {
  background: rgba(250, 250, 245, 0.16);
  color: #fafaf5;
  box-shadow: inset 0 0 0 1px rgba(250, 250, 245, 0.16);
}

.side-tab.active strong,
.side-tab.active small {
  color: #fafaf5;
}

.scope-bar {
  grid-column: 2;
  grid-row: 3;
  display: grid;
  gap: 4px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.scope-bar-head {
  display: none;
}

.scope-bar-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.scope-grid,
.scope-dock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 4px;
}

.scope-grid .field span,
.scope-dock-grid .field span {
  color: var(--text-soft);
}

.scope-grid .field,
.scope-dock-grid .field {
  gap: 2px;
}

.field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.field span {
  font-size: 10px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: none;
}

.summary-strip {
  display: none;
}

.summary-card {
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.summary-card span,
.summary-card small,
.metric span,
.metric small,
.top-meta-card span,
.top-meta-card small,
.detail-kpi span,
.detail-kpi small,
.funnel-grid span,
.funnel-grid small,
.jump-card span {
  display: block;
}

.summary-card span,
.metric span,
.detail-kpi span,
.funnel-grid span {
  font-size: 12px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin: 4px 0 4px;
  font-size: 13px;
  line-height: 1.35;
}

.tab-page { display: none; }
.tab-page.active {
  grid-column: 2;
  grid-row: 4;
  display: block;
  min-height: 0;
  overflow: auto;
  padding-top: 2px;
  padding-right: 2px;
}

.system-root > .tab-page {
  min-width: 0;
}

.workspace-stage,
.system-home,
.people-stage {
  display: grid;
  gap: 12px;
  height: auto;
  min-height: 100%;
  overflow: visible;
  align-content: start;
}

.workspace-header,
.cockpit-banner,
.people-header-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--surface);
}

.cockpit-banner {
  border-bottom: 1px solid var(--line);
}

.cockpit-banner-copy h3,
.people-header-card h3 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.cockpit-banner-copy .eyebrow,
.cockpit-banner-copy h3,
.cockpit-banner-copy p {
  color: var(--text);
}

.cockpit-banner-copy p:last-child {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.people-header-card {
  display: none;
}

.stack-12,
.cockpit-quick-actions,
.people-header-aside,
.workspace-primary,
.workspace-inspector,
.detail-content,
.log-workspace,
.insight-list,
.narrative,
.analysis-text {
  display: grid;
  gap: 12px;
}

.jump-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.jump-card:hover {
  transform: none;
  border-color: var(--line-strong);
  box-shadow: none;
}

.jump-card span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.jump-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.workspace-layout,
.system-home-grid,
.people-stage-grid,
.workspace-shell,
.sop-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
  min-height: 0;
}

.architecture-panel,
.sop-flow-panel,
.sop-rhythm-panel,
.review-framework-panel,
.knowledge-panel {
  background: var(--surface);
}

.compact-knowledge-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1.15fr) 420px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.compact-knowledge-metrics {
  grid-column: 1 / -1;
}

.knowledge-roster-panel,
.knowledge-transcript-panel,
.compact-knowledge-qa-panel {
  min-height: 720px;
}

.knowledge-roster-panel,
.knowledge-transcript-panel {
  padding: 16px 16px 14px;
}

.compact-knowledge-qa-panel {
  padding: 16px;
}

.architecture-grid,
.sop-flow-grid,
.sop-rhythm-grid,
.review-framework-grid,
.checklist-grid,
.knowledge-grid {
  display: grid;
  gap: 12px;
}

.architecture-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.knowledge-grid {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.sop-flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sop-rhythm-grid,
.review-framework-grid,
.checklist-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.architecture-card,
.sop-flow-card,
.rhythm-card,
.review-framework-card,
.check-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.sop-flow-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sop-flow-card {
  padding: 10px 12px;
}

.sop-flow-card small {
  line-height: 1.45;
}

.architecture-card span,
.sop-flow-card span {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.architecture-card strong,
.sop-flow-card strong,
.rhythm-card strong,
.review-framework-card strong,
.check-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.4;
}

.architecture-card small,
.sop-flow-card small,
.rhythm-card small,
.review-framework-card small,
.check-card small {
  display: block;
  color: var(--text-muted);
  line-height: 1.75;
}

.architecture-points {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}

.knowledge-banner {
  background: linear-gradient(135deg, #102334 0%, #1e3d56 52%, #eef4f8 52%, #eef4f8 100%);
}

.knowledge-sidebar,
.knowledge-content-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
}

.knowledge-roster-shell,
.knowledge-transcript-panel,
.compact-knowledge-qa-panel {
  display: grid;
  min-height: 0;
}

.knowledge-roster-shell,
.compact-knowledge-transcript-list,
.compact-knowledge-qa-messages {
  overflow: auto;
}

.compact-knowledge-sidebar-head,
.compact-knowledge-transcript-head,
.compact-knowledge-qa-head {
  margin-bottom: 10px;
}

.knowledge-sidebar-head,
.knowledge-content-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.knowledge-sidebar-head strong,
.knowledge-content-head strong {
  font-size: 16px;
}

.knowledge-sidebar-head small,
.knowledge-content-head small {
  color: var(--text-muted);
  line-height: 1.5;
}

.knowledge-people-list,
.knowledge-transcript-list,
.knowledge-qa-messages {
  display: grid;
  gap: 8px;
}

.compact-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
}

.knowledge-desk-shell {
  display: grid;
  gap: 6px;
}

.knowledge-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  padding: 0;
}

.knowledge-page-kicker,
.knowledge-pane-kicker {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.knowledge-page-title {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.knowledge-page-sub {
  display: none;
}

.knowledge-page-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.compact-field span {
  font-size: 11px;
}

.toolbar-inline .compact-field {
  min-width: 170px;
}

.toolbar-inline .compact-field span {
  display: block;
  margin-bottom: 4px;
}

.compact-field select {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}

.knowledge-stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.knowledge-stat-cell {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.knowledge-stat-cell span,
.knowledge-stat-cell strong,
.knowledge-stat-cell small {
  display: block;
}

.knowledge-stat-cell span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.knowledge-stat-cell strong {
  margin: 2px 0 1px;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.knowledge-stat-cell small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
}

.knowledge-stat-cell.primary-stat {
  border-color: rgba(30, 108, 73, 0.24);
  background: linear-gradient(180deg, rgba(233,244,238,0.95) 0%, rgba(248,251,249,0.98) 100%);
}

.knowledge-workbench-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 10px;
  align-items: start;
  min-height: 0;
}

.knowledge-sidebar-panel,
.knowledge-records-panel,
.knowledge-qa-sidepanel {
  padding: 10px;
  display: grid;
  gap: 8px;
  min-height: 0;
  align-content: start;
  height: 100%;
}

.knowledge-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.knowledge-pane-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.knowledge-pane-head small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.knowledge-nav-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.knowledge-person-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.knowledge-nav-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.knowledge-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.knowledge-nav-main {
  min-width: 0;
}

.knowledge-nav-main strong,
.knowledge-nav-main small,
.knowledge-nav-count {
  display: block;
}

.knowledge-nav-main strong {
  font-size: 14px;
  line-height: 1.35;
}

.knowledge-nav-main small {
  margin-top: 3px;
  color: var(--text-muted);
  line-height: 1.4;
  font-size: 12px;
}

.knowledge-nav-count {
  color: var(--text-soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.knowledge-person-btn.active {
  border-color: rgba(30, 108, 73, 0.45);
  background: rgba(30, 108, 73, 0.08);
  box-shadow: inset 0 0 0 1px rgba(30, 108, 73, 0.08);
}

.knowledge-person-btn.active .knowledge-nav-badge {
  background: rgba(30, 108, 73, 0.14);
  color: var(--primary-strong);
}

.knowledge-person-btn.active .knowledge-nav-count {
  color: var(--primary-strong);
}

.knowledge-records-panel {
  overflow: hidden;
}

.knowledge-records-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 86px;
  gap: 10px;
  padding: 0 12px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-records-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.knowledge-entry {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.knowledge-entry.level-high {
  border-color: rgba(30, 108, 73, 0.26);
}

.knowledge-entry.level-mid {
  border-color: rgba(183, 117, 33, 0.24);
}

.knowledge-entry.level-low {
  border-color: rgba(98, 113, 129, 0.22);
}

.knowledge-entry-head {
  width: 100%;
  border: 0;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.knowledge-record-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 86px;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.knowledge-record-time,
.knowledge-record-contact,
.knowledge-record-level,
.knowledge-record-action {
  min-width: 0;
}

.knowledge-record-time strong,
.knowledge-record-time small,
.knowledge-record-contact strong,
.knowledge-record-contact small,
.knowledge-record-level small {
  display: block;
}

.knowledge-record-time strong,
.knowledge-record-contact strong {
  font-size: 13px;
  line-height: 1.35;
}

.knowledge-record-time small,
.knowledge-record-contact small,
.knowledge-record-level small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.knowledge-level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}

.knowledge-level-pill.level-high {
  background: rgba(30, 108, 73, 0.12);
  color: var(--primary-strong);
}

.knowledge-level-pill.level-mid {
  background: rgba(183, 117, 33, 0.12);
  color: #8a5918;
}

.knowledge-level-pill.level-low {
  background: rgba(98, 113, 129, 0.12);
  color: #506170;
}

.knowledge-entry-toggle {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.knowledge-record-action {
  display: flex;
  justify-content: flex-end;
}

.knowledge-entry-body {
  margin: 0;
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.72;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: #23323f;
  background: #fbfcfd;
  border-top: 1px solid #eef2f5;
}

.knowledge-entry.is-collapsed .knowledge-entry-body {
  display: none;
}

.knowledge-qa-sidepanel {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.knowledge-qa-scope,
.knowledge-qa-intro {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  line-height: 1.45;
  font-size: 11px;
}

.knowledge-side-messages,
.knowledge-qa-messages {
  min-height: 0;
  overflow: auto;
  padding: 2px;
}

.knowledge-qa-message {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.knowledge-qa-message.user {
  border-color: rgba(30, 108, 73, 0.3);
  background: rgba(30, 108, 73, 0.08);
}

.knowledge-qa-message.assistant {
  background: #fbfcfd;
}

.knowledge-qa-message strong,
.knowledge-qa-message small {
  display: block;
}

.knowledge-qa-message strong {
  margin-bottom: 6px;
  font-size: 13px;
}

.knowledge-qa-message small {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.knowledge-qa-answer {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 13px;
}

.knowledge-qa-composer {
  display: grid;
  gap: 8px;
}

.knowledge-side-composer,
.knowledge-qa-composer {
  display: grid;
  gap: 8px;
}

.knowledge-qa-input {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

.knowledge-qa-actions {
  justify-content: flex-end;
}

@media (max-width: 1500px) {
  .knowledge-workbench-grid {
    grid-template-columns: 240px minmax(0, 1fr) 320px;
  }

  .knowledge-records-header,
  .knowledge-record-head {
    grid-template-columns: 1.1fr 0.95fr 1.1fr 76px;
  }
}

@media (max-width: 1200px) {
  .knowledge-page-head {
    align-items: start;
    flex-direction: column;
  }

  .knowledge-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-workbench-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-records-header {
    display: none;
  }

  .knowledge-record-head {
    grid-template-columns: 1fr;
  }

  .knowledge-record-action {
    justify-content: flex-start;
  }
}

.data-banner,
.sop-hero,
.review-hero,
.topic-hero,
.log-hero,
.review-framework-panel,
.sop-rhythm-panel {
  display: none;
}

.recording-shell .workspace-primary {
  display: grid;
  grid-template-columns: minmax(300px, 0.66fr) minmax(0, 1.34fr);
  gap: 12px;
  min-height: 0;
}

.people-stage-grid,
.sop-stage-grid,
.workspace-shell {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.people-focus-inspector,
.workspace-inspector {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.pubsea-side-rail {
  grid-template-rows: minmax(0, 1fr);
}

.pubsea-narrative-panel {
  min-height: 0;
}

.trend-focus-panel,
.review-framework-panel,
.sop-rhythm-panel {
  display: none;
}

#pubseaNarrative p + p {
  margin-top: 10px;
}

.system-home-primary,
.people-stage-primary,
.workspace-primary {
  min-width: 0;
}

.section-title,
.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.workspace-toolbar {
  margin-bottom: 14px;
}

.stacked-toolbar {
  align-items: end;
}

.section-title {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.section-title span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 800;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
}

.compact-knowledge-metrics {
  gap: 10px;
}

.compact-knowledge-metrics .metric {
  padding: 12px 14px;
  border-radius: 16px;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(28px, 2vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.compact-knowledge-metrics .metric strong {
  margin: 4px 0 2px;
  font-size: clamp(22px, 1.5vw, 28px);
}

.compact-knowledge-metrics .metric small,
.compact-knowledge-metrics .metric span {
  font-size: 12px;
}

.emphasis-metric {
  background: linear-gradient(180deg, #173629 0%, #1d6d4a 100%);
  border-color: transparent;
  box-shadow: 0 18px 30px rgba(29, 109, 74, 0.18);
}

.emphasis-metric span,
.emphasis-metric strong,
.emphasis-metric small {
  color: #ffffff;
}

.cockpit-cluster-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.cockpit-cluster-card,
.detail-block,
.insight-item,
.detail-kpi,
.funnel-grid article,
.narrative p {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.cockpit-cluster-card,
.detail-block,
.insight-item,
.narrative p {
  padding: 16px;
}

.chart-wrap,
.person-chart-wrap,
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
}

.chart-wrap,
.person-chart-wrap {
  padding: 14px;
}

.command-chart {
  background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.cockpit-card-head,
.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.cockpit-card-head {
  margin-bottom: 10px;
}

.cockpit-card-head strong,
.detail-title strong {
  font-size: 16px;
}

.cockpit-card-head small,
.detail-title small,
.detail-list li,
.action-list li,
.insight-item p {
  color: var(--text-muted);
}

.cockpit-funnel,
.funnel-grid {
  display: grid;
  gap: 10px;
}

.funnel-grid strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.summary-priority-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
}

.warning-priority-panel {
  border-color: rgba(183, 117, 33, 0.28);
}

.danger-priority-panel {
  border-color: rgba(195, 87, 72, 0.28);
}

.people-header-note {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  line-height: 1.7;
}

.people-filter-toolbar {
  margin-bottom: 10px;
  align-items: center;
}

.people-toolbar-inline {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) repeat(5, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
}

.people-search-field {
  min-width: 0;
}

.people-search-field input,
.people-toolbar-inline .field,
.people-toolbar-inline .compact-field,
.people-toolbar-inline .compact-field select {
  width: 100%;
}

.people-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.people-filter-grid-secondary {
  display: none;
}

.people-filter-panel .workspace-toolbar {
  margin-bottom: 0;
}

.search-input {
  width: 100%;
  max-width: none;
}

.focus-person-panel {
  min-height: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fb 100%);
}

.placeholder-text,
.analysis-text,
.insight-item p,
.narrative,
#logBox {
  line-height: 1.8;
}

.insight-item strong {
  display: block;
  margin-bottom: 6px;
}

.insight-item.warning {
  border-color: rgba(183, 117, 33, 0.24);
  background: var(--accent-soft);
}

.insight-item.risk {
  border-color: rgba(195, 87, 72, 0.24);
  background: var(--danger-soft);
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-kpi {
  padding: 12px;
  background: #ffffff;
}

.detail-kpi strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
}

.detail-list,
.action-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.person-chart-wrap canvas {
  width: 100%;
  height: 240px;
}

.chart-meta {
  margin-top: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.sticky-panel {
  position: sticky;
  top: 0;
}

.table-wrap { min-width: 0; }

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  border-bottom: 1px solid #ebf0f4;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafc;
  color: var(--text-muted);
  font-size: 12px;
}

td {
  font-size: 13px;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
}

.selectable-table tbody tr {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.selectable-table tbody tr:hover td {
  background: #f6fbf8;
}

.selectable-table tbody tr.is-selected td {
  background: rgba(30, 108, 73, 0.08);
}

.compact-table table {
  min-width: 720px;
}

.sticky-actions {
  margin-top: 16px;
}

.recording-summary,
.pubsea-summary,
.log-summary {
  margin-top: 0;
  margin-bottom: 14px;
}

.pubsea-summary,
.log-summary {
  display: none;
}

.pubsea-status-line {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.pubsea-shell .workspace-primary,
.log-shell .workspace-primary,
.recording-shell .workspace-primary,
.sop-stage .workspace-primary,
.people-stage-primary {
  min-height: 0;
}

.progress-shell {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebf2;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4da673 0%, var(--primary) 100%);
}

.narrative p {
  margin: 0;
  color: #2d3b36;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.hero-metric {
  min-height: 0;
}

#pubseaKpis.dashboard-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.log-shell {
  grid-template-columns: minmax(0, 1fr);
}

#logBox {
  margin: 0;
  min-height: 220px;
  max-height: 100%;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px;
  background: #fbfcfd;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: #22313d;
}

@media (max-width: 1560px) {
  .system-topbar,
  .system-home-grid,
  .people-stage-grid,
  .workspace-shell,
  .recording-shell .workspace-primary,
  .cockpit-cluster-grid,
  .scope-grid,
  .scope-dock-grid,
  .summary-strip,
  .cards,
  .dashboard-kpi-grid,
  .cockpit-banner,
  .people-header-card,
  .system-command,
  .system-topbar-meta,
  .system-tabs,
  .primary-tab-cluster,
  .architecture-grid,
  .sop-flow-grid,
  .sop-rhythm-grid,
  .review-framework-grid,
  .checklist-grid,
  .sop-stage-grid {
    grid-template-columns: 1fr;
  }

  .system-command-actions,
  .header-actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 1080px) {
  .system-root {
    width: min(100% - 20px, 1860px);
    margin-top: 10px;
  }

  .workspace-panel,
  .scope-bar,
  .log-workspace,
  .system-topbar,
  .system-command,
  .system-tabs {
    padding: 18px;
  }

  .system-tabs,
  .people-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .scope-bar-head,
  .workspace-toolbar,
  .stacked-toolbar {
    display: grid;
    justify-content: stretch;
    align-items: start;
  }

  .toolbar-inline,
  .header-actions,
  .recording-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .search-input {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .system-tabs,
  .people-filter-grid,
  .detail-kpis {
    grid-template-columns: 1fr;
  }

  .summary-strip,
  .cards,
  .dashboard-kpi-grid,
  .scope-grid,
  .scope-dock-grid {
    grid-template-columns: 1fr;
  }

  .system-topbar-brand h1 {
    font-size: 30px;
  }

  .system-command-copy h2,
  .cockpit-banner-copy h3,
  .people-header-card h3 {
    font-size: 26px;
  }
}

/* =================================================
   知人式迁移层 · 保留口袋助理业务节点，只统一交互骨架和品牌视觉
   ================================================= */
:root {
  --paper: #fafaf5;
  --paper-2: #f3f1e9;
  --paper-3: #eae6da;
  --ink: #1c1d1a;
  --ink-2: #4b4d47;
  --ink-3: #6b7a6f;
  --border: #e0dcce;
  --border-2: #d4cfbe;
  --forest: #1f4b3c;
  --forest-2: #2d5e3f;
  --forest-dark: #14362a;
  --sage: #7a9b76;
  --sage-3: #e4ecdf;
  --rust: #b8542e;
  --rust-2: #f3ddd0;
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;
}

html,
body,
.app-body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

.system-root {
  width: 100vw;
  max-width: none;
  padding: 0;
  gap: 0;
  grid-template-columns: 196px minmax(0, 1fr);
  grid-template-rows: 73px auto auto minmax(0, 1fr);
  background: var(--paper);
}

.panel {
  background: var(--paper);
  border-color: var(--border);
  border-radius: 0;
}

.system-topbar {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 73px;
  padding: 18px 36px;
  border-width: 0 0 1px;
  border-color: var(--border);
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 5;
}

.logo,
.system-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 28px;
  border-right: 1px solid var(--border);
  flex: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border: 1.2px solid var(--forest);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--forest);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
}

.logo-text,
.system-topbar-brand h1.logo-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink);
  line-height: 1.05;
}

.logo-sub,
.system-topbar-brand .logo-sub {
  display: block;
  margin: 3px 0 0;
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.topnav {
  display: flex;
  gap: 28px;
  padding-left: 28px;
  flex: 1;
  min-width: 0;
}

.topnav a {
  color: var(--ink-3);
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.topnav a.on,
.topnav a:hover {
  color: var(--ink);
}

.topnav a.on {
  font-weight: 600;
  border-bottom-color: var(--forest);
}

.system-topbar-meta,
.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.top-meta-card,
.compact-status {
  min-height: 40px;
  padding: 0 0 0 14px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
}

.compact-scope-card {
  max-width: 260px;
}

.compact-cache-card {
  max-width: 168px;
}

.top-meta-card span,
.top-meta-card small {
  color: var(--ink-3);
}

.top-meta-card span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.top-meta-card strong {
  margin: 2px 0 1px;
  color: var(--ink);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-meta-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-card.compact-status {
  gap: 8px;
}

.status-card strong {
  font-size: 12px;
}

.status-card small {
  margin-top: 2px;
  font-size: 11px;
}

.status-card .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: none;
}

.system-tabs {
  grid-column: 1;
  grid-row: 2 / 5;
  padding: 28px 18px;
  border-width: 0 1px 0 0;
  border-color: var(--border);
  min-height: calc(100vh - 73px);
  align-content: start;
  gap: 0;
  background: var(--paper);
}

.side-group,
.tab-cluster {
  margin-bottom: 26px;
}

.tabs-head {
  display: block;
}

.side-title,
.utility-title {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding: 0 10px 8px;
  border-bottom: 1px dotted var(--border-2);
  margin: 0 0 6px;
}

.side-tab {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "num title" "num sub";
  column-gap: 10px;
  row-gap: 0;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-2);
}

.side-tab:hover {
  background: var(--paper-2);
  border-color: transparent;
}

.side-tab span {
  grid-area: num;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.side-tab strong {
  grid-area: title;
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}

.side-tab small {
  grid-area: sub;
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.35;
}

.side-tab.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
  font-weight: 500;
}

.side-tab.active span,
.side-tab.active strong,
.side-tab.active small {
  color: var(--paper);
}

.side-tab.active span {
  background: rgba(250, 250, 245, 0.14);
}

.system-command {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: 28px 44px 22px;
  border-width: 0 0 1px;
  border-color: var(--border);
}

.system-command-copy h2,
.knowledge-page-title,
.section-title h2,
.section-title h3,
.workspace-header h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.system-command-copy h2 {
  font-size: 30px;
}

.system-command-copy p:last-child {
  display: block;
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.eyebrow,
.knowledge-page-kicker,
.knowledge-pane-kicker {
  color: var(--forest);
  letter-spacing: 0.16em;
}

.system-command-actions .status-chip {
  display: inline-flex;
}

.scope-bar {
  grid-column: 2;
  grid-row: 3;
  display: grid;
  gap: 12px;
  padding: 18px 44px;
  border-width: 0 0 1px;
  border-color: var(--border);
  background: var(--paper-2);
}

.scope-grid,
.scope-dock-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.field span,
label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select,
textarea,
.knowledge-qa-input {
  min-height: 34px;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus,
.knowledge-qa-input:focus {
  border-color: var(--forest);
}

.tab-page.active {
  grid-column: 2;
  grid-row: 4;
  padding: 32px 44px 60px;
  background: var(--paper);
}

.workspace-stage,
.knowledge-desk-shell,
.people-stage {
  gap: 20px;
}

.knowledge-page-head,
.page-head {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.knowledge-page-title {
  font-size: 24px;
}

.knowledge-page-sub {
  display: block;
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 12px;
}

.btn {
  min-height: 34px;
  border-radius: 3px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.btn.primary,
.primary {
  background: var(--forest);
  color: var(--paper);
}

.btn.primary:hover,
.primary:hover {
  background: var(--forest-2);
}

.btn.ghost,
.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border-2);
}

.btn.ghost:hover,
.ghost:hover {
  color: var(--forest);
  border-color: var(--forest);
}

.btn.download,
.download {
  background: var(--rust);
  color: var(--paper);
}

.status-chip {
  min-height: 28px;
  border-radius: 999px;
  border-color: var(--border-2);
  background: var(--paper-2);
  color: var(--ink-3);
}

.workspace-panel,
.knowledge-sidebar-panel,
.knowledge-records-panel,
.knowledge-qa-sidepanel,
.inspector-panel,
.recording-config-panel,
.recording-result-panel,
.pubsea-panel,
.log-workspace {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}

.knowledge-stat-strip,
.dashboard-kpi-grid,
.cards {
  gap: 12px;
}

.knowledge-stat-cell,
.summary-card,
.metric,
.detail-kpi,
.funnel-grid article,
.sop-flow-card,
.rhythm-card,
.review-framework-card,
.check-card,
.insight-item,
.narrative p,
.people-header-note,
.knowledge-qa-message,
.knowledge-person-btn,
.knowledge-entry {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}

.knowledge-stat-cell {
  min-height: 76px;
  padding: 14px 16px;
}

.knowledge-stat-cell.primary-stat,
.emphasis-metric {
  border-color: var(--forest);
  background: var(--forest);
}

.knowledge-stat-cell.primary-stat span,
.knowledge-stat-cell.primary-stat strong,
.knowledge-stat-cell.primary-stat small,
.emphasis-metric span,
.emphasis-metric strong,
.emphasis-metric small {
  color: var(--paper);
}

.knowledge-stat-cell strong,
.metric strong,
.funnel-grid strong {
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.knowledge-stat-cell span,
.metric span,
.detail-kpi span,
.funnel-grid span,
.summary-card span {
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.knowledge-workbench-grid {
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 20px;
}

.knowledge-sidebar-panel,
.knowledge-records-panel,
.knowledge-qa-sidepanel {
  align-content: start;
}

.knowledge-person-btn {
  border-radius: 3px;
  background: transparent;
}

.knowledge-person-btn:hover {
  background: var(--paper-2);
}

.knowledge-person-btn.active {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--paper);
  box-shadow: none;
}

.knowledge-person-btn.active strong,
.knowledge-person-btn.active small,
.knowledge-person-btn.active .knowledge-nav-count,
.knowledge-person-btn.active .knowledge-nav-badge {
  color: var(--paper);
}

.knowledge-nav-badge,
.knowledge-level-pill,
.section-title span {
  background: var(--sage-3);
  color: var(--forest-dark);
  border-radius: 999px;
}

.knowledge-person-btn.active .knowledge-nav-badge {
  background: rgba(250, 250, 245, 0.14);
}

.knowledge-entry-head,
.knowledge-record-head {
  background: var(--paper);
}

.knowledge-entry-body,
#logBox {
  background: var(--paper-2);
  border-color: var(--border);
  color: var(--ink-2);
  font-family: var(--mono);
}

.knowledge-qa-scope,
.knowledge-qa-intro,
.detail-block,
.people-header-note {
  background: var(--paper-2);
  border-radius: 6px;
}

.knowledge-qa-message.user {
  border-color: var(--forest);
  background: var(--sage-3);
}

.workspace-layout,
.people-stage-grid,
.workspace-shell,
.sop-stage-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.people-toolbar-inline {
  grid-template-columns: minmax(180px, 1.1fr) repeat(5, minmax(118px, 1fr));
  gap: 10px;
}

.people-filter-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.section-title {
  margin-bottom: 16px;
}

.section-title h2,
.section-title h3 {
  font-size: 18px;
}

.section-title::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--forest);
  margin-right: -6px;
}

.section-title span {
  min-width: 24px;
  height: 24px;
  font-family: var(--mono);
}

.chart-wrap,
.person-chart-wrap,
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}

.table-wrap table {
  min-width: 920px;
}

table {
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

th {
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

th.sortable-head {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

th.sortable-head:hover,
th.sortable-head.active-sort {
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--paper-2));
  color: var(--primary);
}

.sort-indicator {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1;
  vertical-align: text-bottom;
}

th.active-sort .sort-indicator {
  background: var(--primary);
  color: #fff;
}

td {
  color: var(--ink-2);
}

.selectable-table tbody tr:hover td {
  background: var(--paper-2);
}

.selectable-table tbody tr.is-selected td {
  background: var(--sage-3);
}

.focus-person-panel,
.summary-priority-panel,
.command-chart {
  background: var(--paper);
}

.funnel-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recording-shell .workspace-primary {
  grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
  gap: 20px;
}

.progress-shell {
  height: 10px;
  background: var(--paper-3);
}

#progressBar {
  background: linear-gradient(90deg, var(--sage) 0%, var(--forest) 100%);
}

.log-summary,
.pubsea-summary,
.recording-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pubsea-summary,
.log-summary {
  margin-bottom: 16px;
}

.data-banner,
.sop-hero,
.review-hero,
.topic-hero,
.log-hero,
.review-framework-panel,
.sop-rhythm-panel,
.trend-focus-panel {
  display: grid;
}

.workspace-header {
  grid-template-columns: minmax(0, 1fr) 360px;
  background: var(--paper-2);
  border-radius: 6px;
}

.sop-flow-grid,
.sop-rhythm-grid,
.review-framework-grid,
.checklist-grid {
  gap: 12px;
}

.sop-flow-card strong,
.rhythm-card strong,
.review-framework-card strong,
.check-card strong {
  font-family: var(--serif);
  font-weight: 500;
}

.empty {
  color: var(--ink-3);
}

@media (max-width: 1280px) {
  .system-root {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .system-topbar {
    padding: 16px 24px;
  }

  .topnav {
    gap: 18px;
    padding-left: 20px;
  }

  .compact-cache-card {
    display: none;
  }

  .system-command,
  .scope-bar,
  .tab-page.active {
    padding-left: 28px;
    padding-right: 28px;
  }

  .knowledge-workbench-grid,
  .workspace-layout,
  .people-stage-grid,
  .workspace-shell,
  .sop-stage-grid,
  .recording-shell .workspace-primary {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  html,
  body,
  .app-body {
    height: auto;
    overflow: auto;
  }

  .system-root {
    height: auto;
    min-height: 100vh;
    display: block;
  }

  .system-topbar {
    position: static;
    flex-wrap: wrap;
    gap: 14px;
  }

  .topnav {
    order: 3;
    width: 100%;
    padding-left: 0;
    overflow-x: auto;
  }

  .system-topbar-meta {
    display: none;
  }

  .system-tabs {
    min-height: 0;
    border-width: 0 0 1px;
    padding: 14px 18px;
  }

  .primary-tab-cluster,
  .utility-tab-cluster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
  }

  .system-command,
  .scope-bar,
  .tab-page.active {
    padding: 18px;
  }

  .system-command {
    align-items: stretch;
    flex-direction: column;
  }

  .scope-grid,
  .scope-dock-grid,
  .knowledge-stat-strip,
  .dashboard-kpi-grid,
  .log-summary,
  .pubsea-summary,
  .recording-summary,
  .funnel-grid,
  .people-toolbar-inline,
  .people-filter-grid {
    grid-template-columns: 1fr;
  }

  #pubseaKpis.dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-actions,
  .toolbar-inline,
  .recording-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

/* 修正早期紧凑版规则对新品牌副标题的影响 */
.system-topbar-brand .logo-sub,
.logo-sub {
  display: block !important;
}

/* 顶部不再放模块菜单，避免和左侧主导航重复 */
.system-topbar .topnav {
  display: none !important;
}

.system-topbar {
  justify-content: space-between;
}

.system-topbar-meta,
.top-right {
  margin-left: auto;
}

/* 顶部简化：品牌 + 当前模块操作区，隐藏重复状态说明 */
.system-root {
  grid-template-rows: auto auto minmax(0, 1fr) !important;
}

.unified-topbar.system-topbar {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  padding: 18px 36px;
}

.system-state-hidden {
  display: none !important;
}

.system-topbar .topbar-command,
.system-topbar .system-command {
  grid-column: auto;
  grid-row: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.system-topbar .system-command-copy {
  min-width: 0;
}

.system-topbar .system-command-copy h2 {
  font-size: 28px;
}

.system-topbar .system-command-copy p:last-child {
  display: block;
  max-width: 620px;
}

.system-topbar .system-command-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-tabs {
  grid-row: 2 / 4 !important;
}

.scope-bar {
  grid-row: 2 !important;
}

.tab-page.active {
  grid-row: 3 !important;
}

@media (max-width: 1100px) {
  .unified-topbar.system-topbar {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .system-topbar .topbar-command,
  .system-topbar .system-command {
    align-items: stretch;
    flex-direction: column;
  }
  .system-topbar .system-command-actions,
  .system-topbar .header-actions {
    justify-content: flex-start;
  }
}

/* 完整知识库：原音频、摘要、时间线与统一评分 */
.knowledge-entry-rich {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
}

.knowledge-entry.is-collapsed .knowledge-entry-rich {
  display: none;
}

.knowledge-entry-rich .knowledge-entry-body {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
}

.knowledge-entry-audio-row {
  display: grid;
  gap: 6px;
}

.knowledge-audio {
  width: 100%;
  height: 34px;
}

.knowledge-audio-missing {
  padding: 8px 10px;
  border: 1px dashed var(--border-2);
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--paper);
  font-size: 12px;
}

.knowledge-entry-summary {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
}

.knowledge-entry-summary strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.knowledge-entry-summary p,
.knowledge-entry-summary ul {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.7;
}

.knowledge-entry-summary ul {
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

/* 知识沉淀简化：只保留人员、数量、逐字稿和问答 */
.knowledge-level-field {
  display: none !important;
}

.knowledge-record-level .knowledge-level-pill,
.knowledge-entry-rich,
.knowledge-entry-audio-row,
.knowledge-entry-summary,
.knowledge-audio,
.knowledge-audio-missing {
  display: none !important;
}

.knowledge-records-header {
  grid-template-columns: 1.2fr 1.1fr minmax(0, 1.3fr) 96px;
}

.knowledge-record-head {
  grid-template-columns: 1.2fr 1.1fr minmax(0, 1.3fr) 96px;
}

.knowledge-record-level small {
  display: block;
  color: var(--ink-3);
}

.knowledge-entry-body {
  background: var(--paper-2);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.8;
}

/* 简洁版知识卡：展开后只保留原音频 + 逐字稿 */
.knowledge-entry {
  border-radius: 4px;
  background: var(--paper);
}

.knowledge-entry-simple-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--paper-2);
}

.knowledge-entry.is-collapsed .knowledge-entry-simple-body {
  display: none;
}

.knowledge-simple-audio {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
}

.knowledge-simple-audio span {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-simple-audio audio {
  width: 100%;
  height: 32px;
}

.knowledge-simple-audio.muted small {
  color: var(--ink-3);
}

.knowledge-entry-simple-body .knowledge-entry-body {
  margin: 0;
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--paper);
}

.knowledge-table-controls {
  align-items: end;
}

.knowledge-record-level strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.knowledge-record-contact strong {
  white-space: normal;
}

/* 电话卡片最终版：一条电话 = 时间 + 音频 + 逐字稿开关 */
.knowledge-nav-item {
  grid-template-columns: minmax(0, 1fr) !important;
}

.knowledge-nav-badge,
.knowledge-nav-count {
  display: none !important;
}

.knowledge-call-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}

.knowledge-call-main {
  display: grid;
  grid-template-columns: minmax(160px, 0.95fr) minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.knowledge-call-info strong,
.knowledge-call-info small {
  display: block;
}

.knowledge-call-info strong {
  font-size: 14px;
  color: var(--ink);
}

.knowledge-call-info small,
.knowledge-card-muted {
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
}

.knowledge-call-audio audio {
  width: 100%;
  height: 32px;
  display: block;
}

.knowledge-transcript-toggle {
  white-space: nowrap;
}

.knowledge-call-card .knowledge-entry-body {
  margin: 0;
  max-height: 520px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.8;
}

.knowledge-call-card.is-collapsed .knowledge-entry-body {
  display: none;
}

.knowledge-records-header {
  display: none !important;
}

@media (max-width: 900px) {
  .knowledge-call-main {
    grid-template-columns: 1fr;
  }
}

.knowledge-quality-caution {
  display: block;
  margin-top: 3px;
  color: var(--rust);
  font-size: 12px;
}

.knowledge-audio-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.knowledge-audio-actions .compact-btn {
  min-height: 26px;
  padding: 4px 10px;
  font-size: 12px;
}

.knowledge-score-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.knowledge-score-row span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-2);
  font-size: 12px;
}

.knowledge-score-row b {
  color: var(--ink);
  font-size: 13px;
}

.knowledge-sales-tip {
  color: var(--ink-3);
}

.knowledge-call-main {
  padding: 10px 12px;
}

.knowledge-score-row {
  gap: 6px !important;
  margin-top: 6px !important;
}

.knowledge-score-row span,
.knowledge-score-row em {
  min-height: 22px;
  line-height: 1;
}

.knowledge-score-row span {
  padding: 3px 7px !important;
  font-size: 11px !important;
}

.knowledge-score-row b {
  font-size: 12px !important;
}

.knowledge-score-row em {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(148, 83, 42, 0.1);
  color: #8b4c27;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.knowledge-sales-tip,
.knowledge-quality-caution {
  display: none !important;
}

/* Knowledge workspace unified layout v3: single source of truth. */
.knowledge-workbench-grid {
  display: grid;
  grid-template-columns: 240px minmax(560px, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.knowledge-sidebar-panel,
.knowledge-records-panel,
.knowledge-qa-sidepanel {
  min-width: 0;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
}

.knowledge-records-panel {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  overflow: visible;
}

.records-pane-head {
  display: block;
  margin-bottom: 0;
}

.records-pane-head #knowledgePersonMeta {
  display: block;
  margin-top: 4px;
  text-align: left;
}

.record-sort-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 6px 0 10px;
}

.record-sort-actions .compact-btn {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  white-space: nowrap;
  text-align: center;
}

.record-sort-actions .compact-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pubsea-sort-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.pubsea-sort-actions .compact-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
}

.pubsea-sort-actions .compact-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.knowledge-records-header,
.knowledge-entry-head,
.knowledge-call-actions,
.knowledge-sales-tip,
.knowledge-quality-caution {
  display: none !important;
}

.knowledge-transcript-list,
.knowledge-records-list {
  display: grid;
  gap: 10px;
  min-height: 180px;
  overflow: visible;
  padding: 0;
}

.knowledge-call-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  overflow: visible;
}

.knowledge-call-main {
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(340px, 1.22fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
}

.knowledge-call-info,
.knowledge-call-audio {
  min-width: 0;
}

.knowledge-call-info strong,
.knowledge-call-info small {
  display: block;
}

.knowledge-call-info strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.28;
  white-space: normal;
  word-break: break-word;
}

.knowledge-call-info > small,
.knowledge-card-muted {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.25;
}

.knowledge-score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(94px, 1fr)) auto;
  gap: 6px;
  width: 100%;
  max-width: 250px;
  margin-top: 8px;
}

.knowledge-score-row .knowledge-score-pill,
.knowledge-score-row span {
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-sizing: border-box;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.knowledge-score-row i {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-style: normal;
  text-overflow: ellipsis;
}

.knowledge-score-row b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.knowledge-score-row em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(183, 117, 33, 0.12);
  color: #8a5918;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.knowledge-call-audio {
  display: grid;
  gap: 8px;
  overflow: visible;
}

.knowledge-call-audio audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 34px;
}

.knowledge-call-audio .knowledge-audio-actions {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(156px, 1.1fr);
  gap: 8px;
  width: 100%;
  margin: 0;
  overflow: visible;
}

.knowledge-call-audio .knowledge-audio-actions > .compact-btn,
.knowledge-call-audio .knowledge-audio-actions > button[data-entry-toggle],
.knowledge-call-audio .knowledge-audio-actions > button[data-audio-reveal] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  box-sizing: border-box;
  line-height: 1;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.knowledge-call-card .knowledge-entry-body {
  display: block;
  margin: 0;
  max-height: 520px;
  overflow: auto;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.knowledge-call-card.is-collapsed .knowledge-entry-body {
  display: none;
}

.knowledge-qa-sidepanel {
  display: grid;
  grid-template-rows: auto auto minmax(36px, auto) auto minmax(220px, 1fr);
  min-height: 560px;
  overflow: visible;
}

.knowledge-qa-intro {
  max-height: 76px;
  overflow: auto;
}

.knowledge-side-messages,
.knowledge-qa-messages {
  min-height: 160px;
  overflow: auto;
}

.knowledge-side-composer,
.knowledge-qa-composer {
  position: relative;
  bottom: auto;
  z-index: 2;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  background: var(--paper);
}

.knowledge-qa-input {
  display: block;
  width: 100%;
  min-height: 120px;
  max-height: 180px;
  resize: vertical;
}

@media (max-width: 1380px) {
  .knowledge-workbench-grid {
    grid-template-columns: 220px minmax(460px, 1fr) 320px;
  }
  .knowledge-call-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .knowledge-workbench-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .record-sort-actions,
  .knowledge-call-audio .knowledge-audio-actions,
  .knowledge-score-row {
    grid-template-columns: 1fr;
  }
}


/* Q&A chatbox layout: messages scroll, composer stays at the bottom. */
.knowledge-qa-sidepanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  height: min(760px, calc(100vh - 170px));
  min-height: 560px;
  overflow: hidden;
}

.knowledge-qa-intro {
  display: none;
}

.knowledge-side-messages,
.knowledge-qa-messages {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper-2);
}

.knowledge-qa-message {
  max-width: 92%;
  margin: 0 0 10px;
}

.knowledge-qa-message.user {
  margin-left: auto;
}

.knowledge-qa-message.assistant {
  margin-right: auto;
}

.knowledge-side-composer,
.knowledge-qa-composer {
  position: static;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 -8px 20px rgba(37, 45, 43, 0.06);
}

.knowledge-qa-input {
  display: block;
  width: 100%;
  min-height: 86px;
  max-height: 150px;
  resize: vertical;
}

.knowledge-qa-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.knowledge-qa-actions .compact-btn {
  flex: 1 1 0;
}

@media (max-width: 1120px) {
  .knowledge-qa-sidepanel {
    height: auto;
    min-height: 520px;
  }
}

/* Focused data dashboard: only overall and per-person trend curves. */
.focused-dashboard-body {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 84, 46, 0.09), transparent 28%),
    linear-gradient(135deg, #fafaf5 0%, #f0ede2 100%);
}

.focused-dashboard-shell {
  width: min(100vw, 1480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.focused-dashboard-hero,
.focused-filter-panel,
.focused-chart-card {
  padding: 18px 20px;
}

.focused-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: linear-gradient(120deg, rgba(31, 75, 60, 0.08), rgba(250, 250, 245, 0.96));
}

.focused-dashboard-hero h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", "STSong", serif;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.focused-dashboard-hero .page-subtitle {
  max-width: 720px;
}

.focused-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.month-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.month-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.month-chip input {
  width: auto;
  min-height: 0;
}

.focused-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.focused-kpi-grid .metric {
  border-radius: 6px;
  background: var(--surface);
}

.focused-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.focused-chart-card {
  min-width: 0;
}

.mini-tabs,
.person-control-row {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.section-title + .mini-tabs,
.person-control-row {
  margin: -4px 0 12px;
}

.person-control-row {
  justify-content: space-between;
}

.person-control-row .field {
  width: min(420px, 100%);
}

.mini-tabs button {
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.mini-tabs button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.dashboard-chart-wrap {
  height: 430px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafaf5;
  overflow: hidden;
}

.dashboard-chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.focused-chart-card .chart-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.bad-text {
  color: var(--danger) !important;
}

@media (max-width: 900px) {
  .focused-dashboard-shell {
    padding: 12px;
  }

  .focused-dashboard-hero,
  .focused-toolbar,
  .person-control-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .focused-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap {
    height: 360px;
  }
}

/* Integrated app data screen: tab 02 is intentionally reduced to two curve blocks. */
.focused-main-dashboard {
  display: grid;
  gap: 14px;
}

.integrated-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.focused-main-dashboard .focused-chart-card {
  min-width: 0;
  padding: 18px 20px;
}

.hidden-dashboard-compat {
  display: none !important;
}

.focused-main-dashboard .section-title + .mini-tabs,
.focused-main-dashboard .person-control-row {
  margin: -4px 0 12px;
}

.focused-main-dashboard .person-control-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.focused-main-dashboard .person-control-row .field {
  width: min(420px, 100%);
}

.focused-main-dashboard .mini-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.focused-main-dashboard .mini-tabs button {
  min-height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-strong, var(--border));
  border-radius: 999px;
  background: var(--surface, var(--paper));
  color: var(--text-muted, var(--ink-3));
  cursor: pointer;
}

.focused-main-dashboard .mini-tabs button.active {
  border-color: var(--primary, var(--forest));
  background: var(--primary, var(--forest));
  color: #fff;
}

.focused-main-dashboard .dashboard-chart-wrap {
  height: 430px;
  padding: 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: #fafaf5;
  overflow: hidden;
}

.focused-main-dashboard .dashboard-chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.focused-main-dashboard .chart-meta {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface-soft, var(--paper-2));
}

@media (max-width: 900px) {
  .focused-main-dashboard .dashboard-chart-wrap {
    height: 360px;
  }

  .focused-main-dashboard .person-control-row {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Readable trend mode: one metric per curve plus hover tooltip. */
.focused-main-dashboard .trend-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin: -4px 0 12px;
}

.focused-main-dashboard .compact-trend-controls {
  margin: 0;
}

.focused-main-dashboard .trend-metric-field {
  width: 180px;
}

.focused-main-dashboard .dashboard-chart-wrap {
  position: relative;
}

.focused-main-dashboard .chart-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 210px;
  max-width: 240px;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 75, 60, 0.24);
  border-radius: 8px;
  background: rgba(250, 250, 245, 0.96);
  box-shadow: 0 12px 28px rgba(28, 29, 26, 0.14);
  color: var(--text, var(--ink));
  pointer-events: none;
}

.focused-main-dashboard .chart-tooltip strong,
.focused-main-dashboard .chart-tooltip span {
  display: block;
}

.focused-main-dashboard .chart-tooltip strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.focused-main-dashboard .chart-tooltip span {
  color: var(--text-muted, var(--ink-3));
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .focused-main-dashboard .trend-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .focused-main-dashboard .trend-metric-field {
    width: 100%;
  }
}

/* Toggleable multi-line controls. */
.focused-main-dashboard .trend-line-toggles {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.focused-main-dashboard .trend-line-toggles label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong, var(--border));
  border-radius: 999px;
  background: var(--surface, var(--paper));
  color: var(--text-muted, var(--ink-3));
  cursor: pointer;
  user-select: none;
}

.focused-main-dashboard .trend-line-toggles label:has(input:checked) {
  border-color: var(--primary, var(--forest));
  background: var(--primary-soft, var(--sage-3));
  color: var(--primary-strong, var(--forest-dark));
}

.focused-main-dashboard .trend-line-toggles input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.focused-main-dashboard .chart-tooltip span i {
  display: inline-block;
  width: 10px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .focused-main-dashboard .trend-line-toggles {
    justify-content: flex-start;
  }
}

/* SOP sample library: stage-specific scripts with playable recordings. */
.sop-sample-toolbar {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.sop-sample-toolbar .field {
  min-width: 150px;
}

.sop-samples-note {
  margin: -4px 0 14px;
}

.sop-stage-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sop-stage-tabs button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong, var(--border));
  border-radius: 999px;
  background: var(--surface, var(--paper));
  color: var(--text-muted, var(--ink-3));
  cursor: pointer;
}

.sop-stage-tabs button.active {
  border-color: var(--primary, var(--forest));
  background: var(--primary, var(--forest));
  color: #fff;
}

.sop-samples-root {
  display: grid;
  gap: 12px;
}

.sop-stage-head,
.sop-sample-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface, var(--paper));
}

.sop-stage-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-soft, var(--paper-2));
}

.sop-stage-head strong,
.sop-stage-head small {
  display: block;
}

.sop-stage-head small {
  color: var(--text-muted, var(--ink-3));
  margin-top: 3px;
}

.sop-sample-list {
  display: grid;
  gap: 12px;
}

.sop-sample-card {
  grid-template-columns: 34px minmax(0, 1fr) 96px;
  padding: 14px;
}

.sop-sample-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft, var(--sage-3));
  color: var(--primary-strong, var(--forest-dark));
  font-weight: 800;
}

.sop-sample-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.sop-sample-title strong,
.sop-sample-title small {
  display: block;
}

.sop-sample-title small,
.sop-sample-reason,
.sop-script-label,
.sop-evidence-details {
  color: var(--text-muted, var(--ink-3));
}

.sop-sample-reason {
  margin: 0;
}

.sop-sample-card audio {
  width: 100%;
}

.sop-script-box {
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface-soft, var(--paper-2));
  padding: 12px;
}

.sop-script-label {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
}

.sop-script-box blockquote {
  margin: 0;
  color: var(--text, var(--ink));
  line-height: 1.75;
}

.sop-evidence-details summary {
  cursor: pointer;
}

.sop-evidence-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.sop-evidence-details b {
  display: inline-block;
  min-width: 92px;
  color: var(--primary, var(--forest));
}

.sop-sample-score {
  text-align: right;
}

.sop-sample-score span,
.sop-sample-score small {
  display: block;
  color: var(--text-muted, var(--ink-3));
}

.sop-sample-score strong {
  display: block;
  margin: 4px 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

@media (max-width: 900px) {
  .sop-stage-head,
  .sop-sample-card {
    grid-template-columns: 1fr;
  }

  .sop-sample-score {
    text-align: left;
  }
}

/* Clean SOP structure: overview first, then stage evidence. */
.clean-sop-stage {
  display: grid;
  gap: 14px;
}

.sop-path-overview-panel {
  padding: 18px 20px;
}

.sop-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sop-overview-card {
  padding: 16px;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface, var(--paper));
}

.sop-overview-card span,
.sop-overview-card strong {
  display: block;
}

.sop-overview-card span {
  color: var(--text-muted, var(--ink-3));
  font-size: 12px;
  font-weight: 700;
}

.sop-overview-card strong {
  margin: 6px 0 12px;
  font-size: 18px;
}

.sop-path-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sop-path-line i {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft, var(--sage-3));
  color: var(--primary-strong, var(--forest-dark));
  font-style: normal;
  font-weight: 700;
}

.sop-path-line.compact i {
  background: var(--surface-soft, var(--paper-2));
  color: var(--text-muted, var(--ink-3));
}

.clean-sop-stage .sop-samples-panel {
  padding: 18px 20px;
}

.clean-sop-stage .sop-samples-note {
  display: none;
}

@media (max-width: 900px) {
  .sop-overview-grid {
    grid-template-columns: 1fr;
  }
}

.people-leaderboard-panel {
  padding: 18px 20px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.leaderboard-grid section {
  min-width: 0;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface, var(--paper));
  padding: 12px;
}

.leaderboard-grid h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.leaderboard-item,
.rate-rank-item {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line, var(--border));
  border-radius: 6px;
  background: var(--surface-soft, var(--paper-2));
  text-align: left;
  cursor: pointer;
}

.leaderboard-item span,
.rate-rank-item span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft, var(--sage-3));
  color: var(--primary-strong, var(--forest-dark));
  font-size: 11px;
  font-weight: 800;
}

.leaderboard-item strong,
.rate-rank-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-item em,
.rate-rank-item em {
  color: var(--primary, var(--forest));
  font-style: normal;
  font-weight: 800;
}

.leaderboard-item small,
.rate-rank-item small {
  grid-column: 2 / -1;
  color: var(--text-muted, var(--ink-3));
}

.leaderboard-item.active,
.rate-rank-item.active {
  border-color: var(--primary, var(--forest));
  background: rgba(31, 75, 60, 0.08);
}

.section-help {
  margin: -4px 0 14px;
  color: var(--text-muted, var(--ink-3));
  font-size: 13px;
  line-height: 1.7;
}

.help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin-left: 4px;
  border: 1px solid var(--line, var(--border));
  border-radius: 999px;
  background: var(--surface-soft, var(--paper-2));
  color: var(--text-muted, var(--ink-3));
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  transform: translateY(-1px);
}
.floating-help-tip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(320px, 72vw);
  padding: 10px 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: 10px;
  background: var(--surface, var(--paper));
  box-shadow: 0 14px 34px rgba(20, 30, 24, 0.18);
  color: var(--text, var(--ink));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}

@media (max-width: 1200px) {
  .leaderboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}
.total-row td {
  background: rgba(31, 75, 60, 0.08);
  font-weight: 800;
}
.threshold-board {
  margin: 18px 0;
}
.threshold-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line, var(--border));
  border-radius: 14px;
  background: var(--surface, var(--paper));
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.threshold-toggle:hover {
  border-color: var(--primary, var(--forest));
  background: rgba(31, 75, 60, 0.06);
}
.threshold-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft, var(--sage-3));
  color: var(--primary-strong, var(--forest-dark));
  font-weight: 900;
}
.threshold-toggle strong {
  display: block;
  font-size: 18px;
}
.threshold-toggle small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted, var(--ink-3));
  line-height: 1.5;
}
.threshold-toggle em {
  font-style: normal;
  font-weight: 800;
  color: var(--primary, var(--forest));
}
.threshold-detail {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line, var(--border));
  border-radius: 14px;
  background: var(--surface-soft, var(--paper-2));
}
.threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.threshold-card {
  padding: 14px;
  border: 1px solid var(--line, var(--border));
  border-radius: 12px;
  background: var(--surface, var(--paper));
}
.threshold-card span {
  display: block;
  color: var(--text-muted, var(--ink-3));
  font-size: 12px;
  font-weight: 800;
}
.threshold-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}
.threshold-card small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted, var(--ink-3));
  line-height: 1.6;
}
@media (max-width: 900px) {
  .threshold-grid { grid-template-columns: 1fr; }
}
.target-execution-board {
  margin: 18px 0;
}
.target-input {
  width: 100%;
  min-width: 82px;
  border: 1px solid var(--line, var(--border));
  border-radius: 8px;
  background: var(--surface, var(--paper));
  color: var(--text, var(--ink));
  padding: 8px 9px;
  font: inherit;
}
.target-input:focus {
  outline: 2px solid rgba(31, 75, 60, 0.18);
  border-color: var(--primary, var(--forest));
}
.target-execution-board td small {
  display: block;
  min-width: 170px;
  line-height: 1.5;
}

/* 客户看板：二级菜单布局 */
.lead-board-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.lead-side-menu {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 10px;
  padding: 14px;
}
.lead-menu-title {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line, var(--border));
}
.lead-menu-title span {
  display: block;
  color: var(--text-muted, var(--ink-3));
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.lead-menu-title strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}
.lead-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line, var(--border));
  border-radius: 14px;
  background: var(--surface, var(--paper));
  color: var(--text, var(--ink));
  padding: 11px;
  text-align: left;
  cursor: pointer;
}
.lead-menu-item span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft, var(--paper-2));
  color: var(--primary, var(--forest));
  font-weight: 900;
}
.lead-menu-item strong,
.lead-menu-item small { display: block; }
.lead-menu-item small {
  margin-top: 3px;
  color: var(--text-muted, var(--ink-3));
  line-height: 1.4;
}
.lead-menu-item:hover,
.lead-menu-item.active {
  border-color: var(--primary, var(--forest));
  box-shadow: 0 10px 28px rgba(31, 75, 60, .10);
}
.lead-menu-item.active span {
  background: var(--primary, var(--forest));
  color: white;
}
.lead-board-content { min-width: 0; }
.lead-view-panel { display: none; }
.lead-view-panel.active { display: block; }
.lead-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.lead-overview-grid article {
  padding: 16px;
  border: 1px solid var(--line, var(--border));
  border-radius: 14px;
  background: var(--surface-soft, var(--paper-2));
}
.lead-overview-grid span,
.lead-overview-grid small { color: var(--text-muted, var(--ink-3)); }
.lead-overview-grid strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 20px;
}
.lead-customer-row { cursor: pointer; }
.lead-customer-row:hover td { background: rgba(31, 75, 60, .045); }
.lead-detail-row td {
  background: var(--surface-soft, var(--paper-2));
}
.lead-followup-detail {
  display: grid;
  gap: 10px;
  max-width: 980px;
}
@media (max-width: 1100px) {
  .lead-board-layout { grid-template-columns: 1fr; }
  .lead-side-menu { position: static; }
  .lead-menu-item { grid-template-columns: 36px minmax(0, 1fr); }
  .lead-menu-item span { width: 36px; height: 36px; }
  .lead-overview-grid { grid-template-columns: 1fr; }
}

/* 客户看板菜单按钮优化 */
.lead-side-menu {
  gap: 6px;
  padding: 12px;
}
.lead-menu-title {
  margin-bottom: 4px;
  padding: 8px 8px 12px;
}
.lead-menu-item {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.lead-menu-item span {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(31, 75, 60, .08);
  color: var(--primary, var(--forest));
  font-size: 13px;
}
.lead-menu-item strong {
  font-size: 14px;
  line-height: 1.25;
}
.lead-menu-item small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
}
.lead-menu-item:hover {
  border-color: rgba(31, 75, 60, .12);
  background: rgba(31, 75, 60, .055);
  box-shadow: none;
}
.lead-menu-item.active {
  border-color: rgba(31, 75, 60, .18);
  background: linear-gradient(90deg, rgba(31, 75, 60, .12), rgba(31, 75, 60, .045));
  box-shadow: inset 3px 0 0 var(--primary, var(--forest));
}
.lead-menu-item.active span {
  background: var(--primary, var(--forest));
  color: #fff;
}
.lead-menu-item.active strong {
  color: var(--primary-strong, var(--forest-dark));
}
.leads-stage .toolbar-inline .btn {
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 800;
}
.leads-stage .toolbar-inline .btn.primary {
  box-shadow: none;
}
.leads-stage .toolbar-inline .btn.ghost {
  background: var(--surface, var(--paper));
}

/* 客户看板菜单再次压缩：去掉说明字，回归普通导航 */
.lead-board-layout {
  grid-template-columns: 210px minmax(0, 1fr);
}
.lead-side-menu {
  padding: 10px;
  gap: 4px;
}
.lead-menu-title {
  padding: 6px 8px 10px;
}
.lead-menu-title span { display: none; }
.lead-menu-title strong {
  margin: 0;
  font-size: 15px;
}
.lead-menu-item {
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 9px;
  gap: 8px;
}
.lead-menu-item span {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
  background: transparent;
}
.lead-menu-item strong {
  font-size: 13px;
  font-weight: 800;
}
.lead-menu-item small {
  display: none;
}
.lead-menu-item:hover {
  background: rgba(31, 75, 60, .045);
  border-color: transparent;
}
.lead-menu-item.active {
  background: rgba(31, 75, 60, .08);
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--primary, var(--forest));
}
.lead-menu-item.active span {
  background: transparent;
  color: var(--primary, var(--forest));
}
.lead-view-panel {
  padding: 16px;
}
.leads-stage .topic-hero {
  padding: 18px 20px;
}
.leads-stage .topic-hero h3 {
  font-size: 22px;
}

/* 人维度下钻 */
.lead-owner-row { cursor: pointer; }
.lead-owner-row:hover td,
.lead-owner-row.selected-row td {
  background: rgba(31, 75, 60, .06);
}
.lead-drilldown {
  margin-top: 14px;
}
.lead-drill-card {
  padding: 14px;
  border: 1px solid var(--line, var(--border));
  border-radius: 14px;
  background: var(--surface-soft, var(--paper-2));
}
.lead-drill-card h4 {
  margin: 18px 0 10px;
  font-size: 15px;
}
.lead-drill-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.lead-drill-kpis article {
  padding: 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: 12px;
  background: var(--surface, var(--paper));
}
.lead-drill-kpis span,
.lead-drill-kpis small {
  display: block;
  color: var(--text-muted, var(--ink-3));
}
.lead-drill-kpis strong {
  display: block;
  margin: 6px 0 3px;
  font-size: 20px;
}
.lead-owner-customer-row { cursor: pointer; }
.lead-owner-customer-row:hover td { background: rgba(31, 75, 60, .045); }
.lead-owner-customer-row td small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted, var(--ink-3));
}
@media (max-width: 900px) {
  .lead-drill-kpis { grid-template-columns: 1fr; }
}

/* 人维度弹窗 */
body.modal-open { overflow: hidden; }
.lead-modal[hidden] { display: none; }
.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 22px;
}
.lead-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 27, 23, .42);
  backdrop-filter: blur(3px);
}
.lead-modal-card {
  position: relative;
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line, var(--border));
  border-radius: 18px;
  background: var(--surface, var(--paper));
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
  overflow: hidden;
}
.lead-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line, var(--border));
  background: linear-gradient(180deg, var(--surface, var(--paper)), var(--surface-soft, var(--paper-2)));
}
.lead-modal-head h3 {
  margin: 2px 0 4px;
  font-size: 22px;
}
.lead-modal-head small {
  color: var(--text-muted, var(--ink-3));
}
.lead-modal-body {
  padding: 18px 20px 22px;
  overflow: auto;
}
.lead-modal-section + .lead-modal-section {
  margin-top: 20px;
}
.lead-modal-section h4 {
  margin: 0 0 8px;
  font-size: 16px;
}
.lead-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.lead-channel-grid article {
  padding: 13px;
  border: 1px solid var(--line, var(--border));
  border-radius: 13px;
  background: var(--surface-soft, var(--paper-2));
}
.lead-channel-grid span,
.lead-channel-grid small {
  display: block;
  color: var(--text-muted, var(--ink-3));
}
.lead-channel-grid strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 22px;
}
@media (max-width: 900px) {
  .lead-modal { padding: 10px; }
  .lead-modal-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .lead-modal-head { align-items: flex-start; flex-direction: column; }
  .lead-channel-grid { grid-template-columns: 1fr; }
}

.lead-summary-panel {
  margin-bottom: 14px;
}
