.sales-ai-shell {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.sales-ai-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow-x: auto;
  padding: 0 20px;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
}

.sales-ai-tab {
  position: relative;
  display: flex;
  min-width: 150px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
}

.sales-ai-tab.active {
  border-bottom-color: #0052d9;
  color: #0052d9;
  font-weight: 600;
}

.sales-ai-tab:hover { background: #f7f8fa; }
.sales-ai-tab-label { font-size: 14px; white-space: nowrap; }
.sales-ai-tab-hint { color: #86909c; font-size: 12px; font-weight: 400; white-space: nowrap; }
.sales-ai-tab.active .sales-ai-tab-hint { color: #5b8ff9; }

.sales-ai-subnav {
  padding: 12px 20px 0;
  background: #f7f8fa;
}

.sales-ai-operation-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}

.sales-ai-operation-tab {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.sales-ai-operation-tab:hover { background: #f2f3f5; }
.sales-ai-operation-tab.active { background: #e8f0fe; color: #0052d9; font-weight: 600; }

.sales-ai-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 20px;
  border-bottom: 1px solid #e7e9ec;
  background: #fff;
}

.sales-ai-filters,
.sales-ai-row-actions,
.sales-ai-reply-actions,
.sales-ai-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sales-ai-status {
  min-height: 32px;
  padding: 8px 20px 4px;
  color: #667085;
  font-size: 13px;
}

.sales-ai-status.is-error,
.sales-ai-error {
  color: #b42318;
}

.sales-ai-status.is-success {
  color: #087443;
}

.sales-ai-content {
  padding: 12px 20px 24px;
}

.sales-ai-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sales-ai-metric {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}

.sales-ai-metric-title {
  color: #667085;
  font-size: 13px;
}

.sales-ai-metric strong {
  display: block;
  margin: 6px 0;
  color: #1d2939;
  font-size: 26px;
}

.sales-ai-metric > small { display: block; margin-bottom: 10px; color: #86909c; font-size: 12px; }

.sales-ai-metric-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #667085;
  font-size: 12px;
}

.sales-ai-title-row { display: flex; align-items: center; gap: 10px; }
.sales-ai-title-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #b8d0ff;
  border-radius: 4px;
  background: #e8f0fe;
  color: #0052d9;
  font-size: 12px;
  font-weight: 500;
}

/* 企微数据智能：隐藏页顶「企业微信数据智能专区」标题区（Tab / 看板保留） */
#view-sales-ai > .page-header {
  display: none !important;
}
.sales-ai-corp-field { display: flex; align-items: center; gap: 8px; color: #86909c; font-size: 12px; }
.sales-ai-corp-field .search-input { min-width: 104px; }

.sales-ai-source-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1d2129;
  font-weight: 500;
}
.sales-ai-source-dot { width: 7px; height: 7px; border-radius: 50%; background: #00b42a; box-shadow: 0 0 0 3px #e8ffea; }
.sales-ai-source-note { color: #86909c; font-size: 12px; }

.sales-ai-zone-hero {
  display: flex;
  min-height: 156px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: 28px 32px;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  background: linear-gradient(120deg, #f3f7ff 0%, #fff 58%, #eef7ff 100%);
}
.sales-ai-zone-eyebrow { color: #2e6be6; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; }
.sales-ai-zone-hero h2 { margin: 8px 0; color: #1d2129; font-size: 24px; line-height: 1.35; }
.sales-ai-zone-hero p { margin: 0; color: #4e5969; font-size: 14px; }
.sales-ai-zone-source {
  display: flex;
  min-width: 220px;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid rgba(46, 107, 230, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
}
.sales-ai-zone-source span, .sales-ai-zone-source small { color: #86909c; font-size: 12px; }
.sales-ai-zone-source strong { color: #1d2129; font-size: 16px; }

.sales-ai-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.sales-ai-flow-step { position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; padding: 16px; }
.sales-ai-flow-step > span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: #0052d9;
  font-size: 12px;
  font-weight: 600;
}
.sales-ai-flow-step div { display: flex; min-width: 0; flex-direction: column; }
.sales-ai-flow-step strong { color: #1d2129; font-size: 13px; }
.sales-ai-flow-step small { overflow: hidden; color: #86909c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sales-ai-flow-step i { position: absolute; right: -5px; color: #c9cdd4; font-style: normal; }

.sales-ai-entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.sales-ai-entry-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  color: #1d2129;
  cursor: pointer;
  text-align: left;
}
.sales-ai-entry-card:hover { border-color: #b8d0ff; background: #f7faff; box-shadow: 0 4px 12px rgba(46, 107, 230, 0.08); }
.sales-ai-entry-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 6px; background: #e8f0fe; color: #0052d9; font-weight: 600; }
.sales-ai-entry-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.sales-ai-entry-card strong { font-size: 14px; }
.sales-ai-entry-card small { color: #86909c; font-size: 12px; line-height: 1.5; }
.sales-ai-entry-card i { color: #0052d9; font-size: 12px; font-style: normal; white-space: nowrap; }

.sales-ai-filter-field { display: flex; flex-direction: column; gap: 5px; color: #86909c; font-size: 11px; }
.sales-ai-filter-field .search-input { min-height: 32px; }
.sales-ai-filter-search .search-input { min-width: 220px; }

.sales-ai-audit-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sales-ai-audit-kpis > div { padding: 16px 18px; border: 1px solid #e5e6eb; border-radius: 6px; border-top: 3px solid #2e6be6; background: #fff; }
.sales-ai-audit-kpis > div.is-warning { border-top-color: #ff7d00; }
.sales-ai-audit-kpis > div.is-success { border-top-color: #00b42a; }
.sales-ai-audit-kpis span { color: #4e5969; font-size: 13px; }
.sales-ai-audit-kpis strong { display: block; margin: 4px 0; color: #1d2129; font-size: 24px; }
.sales-ai-audit-kpis small { color: #86909c; font-size: 11px; }
.sales-ai-audit-list-card { padding: 0; border: 1px solid #e5e6eb; border-radius: 6px; background: #fff; }
.sales-ai-audit-list-card .sales-ai-table-wrap {
  border: 0;
  border-top: 1px solid #e5e6eb;
  border-radius: 0;
  max-height: min(70vh, 720px);
  /* 底部原生横滑轨：列过多时可左右拖动；加粗便于点按 */
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: #94a3b8 #e2e8f0;
}
.sales-ai-audit-list-card .sales-ai-table-wrap::-webkit-scrollbar {
  height: 14px;
  width: 10px;
}
.sales-ai-audit-list-card .sales-ai-table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
}
.sales-ai-audit-list-card .sales-ai-table-wrap::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 8px;
}
.sales-ai-audit-list-card .sales-ai-table-wrap::-webkit-scrollbar:horizontal {
  height: 14px;
}
.sales-ai-audit-employee-table {
  min-width: 1280px;
}

/* 左右滑动时冻结「员工」姓名列 */
.sales-ai-audit-employee-table th.is-sticky-name,
.sales-ai-audit-employee-table td.is-sticky-name {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 108px;
  max-width: 168px;
  background: #fff;
  box-shadow: 4px 0 8px rgba(31, 35, 41, 0.06);
}
.sales-ai-audit-employee-table th.is-sticky-name {
  z-index: 5;
  background: #f7f8fa;
}
.sales-ai-audit-employee-table tbody tr:hover td.is-sticky-name {
  background: #f7f8fa;
}
.sales-ai-audit-employee-table tbody tr.is-unbound-group td.is-sticky-name {
  background: #fffaf5;
}
.sales-ai-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.sales-ai-section-head h3 { margin: 0 0 4px; color: #1d2129; font-size: 15px; }
.sales-ai-section-head p { margin: 0; color: #86909c; font-size: 12px; }
.sales-ai-section-count { color: #4e5969; font-size: 12px; white-space: nowrap; }

.sales-ai-knowledge-host { padding: 20px; background: #f7f8fa; }
.sales-ai-knowledge-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #d6e4ff;
  border-radius: 6px;
  background: #f3f7ff;
}
.sales-ai-knowledge-intro span:first-child { color: #2e6be6; font-size: 12px; font-weight: 600; }
.sales-ai-knowledge-intro h3 { margin: 4px 0; color: #1d2129; font-size: 17px; }
.sales-ai-knowledge-intro p { margin: 0; color: #4e5969; font-size: 12px; }
.sales-ai-knowledge-path { color: #2e6be6; font-size: 12px; white-space: nowrap; }
.sales-ai-legacy-header { display: none !important; }
.sales-ai-embedded-knowledge { display: block; width: 100%; }
.sales-ai-embedded-knowledge .knowledge-page-main { padding: 0; }
.sales-ai-embedded-knowledge #knowledge-tabs { margin: 0 0 16px; padding: 0 8px; border: 1px solid #e5e6eb; border-radius: 6px; background: #fff; }
.sales-ai-embedded-knowledge [id^="knowledge-panel-"] { padding: 18px; border: 1px solid #e5e6eb; border-radius: 6px; background: #fff; }

.sales-ai-table-wrap {
  overflow: auto;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
}

.sales-ai-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}

.sales-ai-table th,
.sales-ai-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e7e9ec;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.sales-ai-table th {
  position: sticky;
  top: 0;
  background: #f7f8fa;
  color: #475467;
  font-weight: 600;
}

.sales-ai-audit-employee-table th.is-sortable {
  cursor: pointer;
  user-select: none;
}
.sales-ai-audit-employee-table th.is-sortable:hover {
  color: #1d2129;
  background: #eef3ff;
}
.sales-ai-audit-employee-table th.is-sorted-desc,
.sales-ai-audit-employee-table th.is-sorted-asc {
  color: #0052d9;
  background: #e8f3ff;
}

.sales-ai-audit-employee-table th.is-filterable {
  position: relative;
  vertical-align: middle;
  white-space: nowrap;
}
.sales-ai-audit-employee-table th.is-filterable.is-filtered,
.sales-ai-audit-employee-table th.is-filterable.is-open {
  color: #0052d9;
  background: #e8f3ff;
}
.sales-ai-th-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sales-ai-th-filter-trigger em {
  max-width: 72px;
  overflow: hidden;
  color: #0052d9;
  font-style: normal;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sales-ai-th-filter-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}
.sales-ai-th-filter-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(280px, 50vh);
  padding: 6px;
  overflow: auto;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.sales-ai-th-filter-menu[hidden] {
  display: none !important;
}
.sales-ai-th-filter-option {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1d2129;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.sales-ai-th-filter-option:hover {
  background: #f2f3f5;
}
.sales-ai-th-filter-option.is-active {
  background: #e8f3ff;
  color: #0052d9;
  font-weight: 600;
}

.sales-ai-table tr:last-child td {
  border-bottom: 0;
}

.sales-ai-link {
  max-width: 280px;
  overflow: hidden;
  border: 0;
  background: none;
  color: #0052d9;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-ai-audit-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.sales-ai-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f7f8fa;
  color: #1d2129;
  font-size: 12px;
  cursor: pointer;
}

.sales-ai-filter-chip:hover {
  border-color: #0052d9;
  color: #0052d9;
  background: #e8f3ff;
}

.sales-ai-audit-employee-table tr.is-unbound-group td {
  background: #fff7e8;
}

.sales-ai-unbound-guide p {
  margin: 8px 0 0;
  color: #4e5969;
  line-height: 1.6;
}

.sales-ai-unbound-guide .hint {
  color: #86909c;
  font-size: 12px;
}

.sales-ai-unbound-name-missing {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #fff7e8;
  color: #b54708;
  font-size: 12px;
  font-weight: 600;
}

.sales-ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  background: #eef0f3;
  color: #4e5969;
  font-size: 12px;
}

.sales-ai-badge.is-success {
  background: #e7f8f0;
  color: #087443;
}

.sales-ai-badge.is-warning {
  background: #fff5e5;
  color: #ad6800;
}

.sales-ai-badge.is-danger {
  background: #feeceb;
  color: #b42318;
}

.sales-ai-empty,
.sales-ai-error,
.sales-ai-loading {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px dashed #c9ced6;
  color: #667085;
}

.sales-ai-detail {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  width: min(620px, 82vw);
  height: 100%;
  overflow: auto;
  border-left: 1px solid #c9ced6;
  background: #fff;
  box-shadow: -8px 0 20px rgb(31 35 41 / 10%);
}

.sales-ai-detail-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e7e9ec;
  background: #fff;
}

.sales-ai-detail pre {
  margin: 0;
  padding: 16px;
  overflow-wrap: anywhere;
  color: #344054;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.sales-ai-detail-body {
  padding: 0 16px 24px;
}

.sales-ai-detail-section {
  padding: 16px 0;
  border-bottom: 1px solid #e7e9ec;
}

.sales-ai-detail-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.sales-ai-detail-section pre {
  max-height: 300px;
  padding: 10px;
  background: #f7f8fa;
}

.sales-ai-kv {
  display: flex;
  gap: 8px 14px;
  align-items: center;
  flex-wrap: wrap;
  color: #475467;
  font-size: 13px;
}

.sales-ai-copy {
  margin-top: 12px;
  padding: 12px;
  border-left: 3px solid #0052d9;
  background: #f7f8fa;
  color: #1d2939;
  line-height: 1.65;
  white-space: pre-wrap;
}

.sales-ai-wrap-cell {
  min-width: 180px;
  max-width: 360px;
  white-space: normal !important;
}

.sales-ai-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  max-width: 920px;
  padding: 18px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
}

.sales-ai-form label {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 13px;
}

.sales-ai-form-wide,
.sales-ai-form-actions {
  grid-column: 1 / -1;
}

.sales-ai-form-actions {
  display: flex;
  gap: 8px;
}

.sales-ai-form-actions > [hidden] {
  display: none !important;
}

.sales-ai-save-status {
  margin: 14px 0 12px;
  padding: 14px 16px;
  border: 1px solid #c6d9ff;
  border-radius: 8px;
  background: #f5f8ff;
  color: #344054;
}

.sales-ai-save-status[hidden] {
  display: none;
}

.sales-ai-save-status-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1d4fba;
}

.sales-ai-save-status-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #b9d0ff;
  border-top-color: #2e6be6;
  border-radius: 50%;
  animation: sales-ai-save-spin .8s linear infinite;
}

.sales-ai-save-progress {
  height: 8px;
  margin: 11px 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfeaff;
}

.sales-ai-save-progress > i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: #2e6be6;
  animation: sales-ai-save-moving 1.35s ease-in-out infinite;
}

.sales-ai-save-status p {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.sales-ai-save-status.is-success {
  border-color: #b7ebc6;
  background: #f2fbf5;
}

.sales-ai-save-status.is-success .sales-ai-save-status-head {
  color: #087a3e;
}

.sales-ai-save-status.is-success .sales-ai-save-status-icon,
.sales-ai-save-status.is-warning .sales-ai-save-status-icon,
.sales-ai-save-status.is-error .sales-ai-save-status-icon {
  border: 0;
  animation: none;
}

.sales-ai-save-status.is-success .sales-ai-save-status-icon::after,
.sales-ai-save-status.is-warning .sales-ai-save-status-icon::after,
.sales-ai-save-status.is-error .sales-ai-save-status-icon::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sales-ai-save-status.is-success .sales-ai-save-status-icon::after {
  content: '\2713';
  background: #00a870;
}

.sales-ai-save-status.is-success .sales-ai-save-progress > i {
  width: 100%;
  background: #00a870;
  animation: none;
}

.sales-ai-save-status.is-warning {
  border-color: #f2d394;
  background: #fffaf0;
}

.sales-ai-save-status.is-warning .sales-ai-save-status-head {
  color: #9a6700;
}

.sales-ai-save-status.is-warning .sales-ai-save-status-icon::after {
  content: '!';
  background: #d89614;
}

.sales-ai-save-status.is-warning .sales-ai-save-progress > i {
  width: 100%;
  background: #d89614;
  animation: none;
}

.sales-ai-save-status.is-error {
  border-color: #f3b8b8;
  background: #fff5f5;
}

.sales-ai-save-status.is-error .sales-ai-save-status-head {
  color: #b42318;
}

.sales-ai-save-status.is-error .sales-ai-save-status-icon::after {
  content: '!';
  background: #d92d20;
}

.sales-ai-save-status.is-error .sales-ai-save-progress > i {
  width: 100%;
  background: #d92d20;
  animation: none;
}

@keyframes sales-ai-save-spin {
  to { transform: rotate(360deg); }
}

@keyframes sales-ai-save-moving {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(115%); }
  100% { transform: translateX(270%); }
}

.sales-ai-band {
  margin-bottom: 20px;
}

.sales-ai-band h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.sales-ai-muted {
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
}

.sales-ai-table [data-field] {
  width: 112px;
  min-width: 84px;
}

.sales-ai-table [data-field="applicable_stages"],
.sales-ai-table [data-field="holiday_dates"] {
  width: 150px;
}

.sales-ai-policy {
  max-width: 620px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
}

.sales-ai-policy label {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #e7e9ec;
}

.sales-ai-policy button {
  margin: 14px 16px;
}

@media (max-width: 980px) {
  .sales-ai-tab-hint { display: none; }
  .sales-ai-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-ai-flow-step:nth-child(2) i { display: none; }
  .sales-ai-entry-grid { grid-template-columns: 1fr; }
  .sales-ai-audit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-ai-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-ai-metric {
    border-bottom: 1px solid #e7e9ec;
  }
}

@media (max-width: 640px) {
  .sales-ai-tabs { grid-template-columns: repeat(4, minmax(130px, 1fr)); padding: 0 12px; }
  .sales-ai-tab { min-height: 48px; padding: 0 10px; }
  .sales-ai-zone-hero { align-items: stretch; flex-direction: column; padding: 20px; }
  .sales-ai-zone-source { min-width: 0; }
  .sales-ai-flow,
  .sales-ai-audit-kpis { grid-template-columns: 1fr; }
  .sales-ai-flow-step i { display: none; }
  .sales-ai-knowledge-intro { align-items: flex-start; flex-direction: column; }
  .sales-ai-knowledge-path { white-space: normal; }
  .sales-ai-toolbar,
  .sales-ai-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-ai-metric-grid,
  .sales-ai-form {
    grid-template-columns: 1fr;
  }

  .sales-ai-form-wide,
  .sales-ai-form-actions {
    grid-column: auto;
  }
}


/* Online conversation timeline (audit viewer) */
.sales-ai-chat-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(70vh, 720px);
  overflow: auto;
  padding: 8px 2px 16px;
}
.sales-ai-chat-bubble {
  max-width: min(720px, 92%);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
}
.sales-ai-chat-bubble.is-staff {
  align-self: flex-end;
  margin-left: auto;
  background: rgba(37, 99, 235, 0.08);
}
.sales-ai-chat-bubble.is-customer {
  align-self: flex-start;
  margin-right: auto;
}
.sales-ai-chat-bubble.is-staff .sales-ai-chat-meta {
  justify-content: flex-end;
}
.sales-ai-chat-bubble.is-unavailable {
  opacity: 0.75;
}
.sales-ai-chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 4px;
}
.sales-ai-chat-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}
.sales-ai-chat-secure {
  min-height: 28px;
}
.sales-ai-chat-secure ww-open-message {
  display: block;
  width: 100%;
}

/* 专区会话：浏览器内嵌企微扫码授权（对齐探马聊天区体验） */
.sales-ai-audit-wework-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 18px 16px 16px;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7f8fa 0%, #fff 56%);
  text-align: center;
}
.sales-ai-audit-wework-gate.is-ready {
  display: none;
}
.sales-ai-audit-wework-gate-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1d2129;
}
.sales-ai-audit-wework-gate-desc {
  margin: 0;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.5;
  color: #86909c;
}
.sales-ai-audit-wework-qr {
  width: min(100%, 320px);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sales-ai-audit-wework-qr iframe,
.sales-ai-audit-wework-qr .wwLogin_qrcode_head,
.sales-ai-audit-wework-qr canvas {
  max-width: 100%;
}
.sales-ai-audit-wework-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* 探马风格：会话审计三栏工作台 */
body.sales-ai-audit-modal-open {
  overflow: hidden;
}

.audit-ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
}

.audit-ws-modal {
  display: flex;
  flex-direction: column;
  width: min(1440px, calc(100vw - 48px));
  height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  color: #1d2129;
  font-size: 13px;
}

.audit-ws-head {
  flex: 0 0 auto;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
}

.audit-ws-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
}

.audit-ws-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1d2129;
}

.audit-ws-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #86909c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.audit-ws-close:hover {
  background: #f2f3f5;
  color: #1d2129;
}

.audit-ws-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
  padding: 8px 16px 12px;
}

.audit-ws-presets {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.audit-ws-preset {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid #d0d5dd;
  background: #fff;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
}

.audit-ws-preset:last-child {
  border-right: 0;
}

.audit-ws-preset.is-active {
  background: #1890ff;
  color: #fff;
}

.audit-ws-daterange {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
}

.audit-ws-date {
  width: 132px;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #1d2129;
  font: inherit;
}

.audit-ws-date-sep {
  color: #86909c;
}

.audit-ws-body {
  display: grid;
  grid-template-columns: 156px 250px minmax(360px, 1fr) 300px;
  flex: 1 1 auto;
  min-height: 0;
}

.audit-ws-ai {
  min-width: 0;
  overflow: auto;
  border-left: 1px solid #e5e6eb;
  background: #f7f8fa;
  padding: 12px;
}

.audit-ws-ai-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #1d2129;
  font-weight: 600;
  margin-bottom: 10px;
}

.audit-ws-ai-head span {
  color: #1677ff;
  font-size: 12px;
  font-weight: 400;
}

.audit-ws-ai-section {
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
}

.audit-ws-ai-section h4 {
  margin: 0 0 6px;
  color: #4e5969;
  font-size: 12px;
}

.audit-ws-ai-section p {
  margin: 0 0 8px;
  color: #1d2129;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.audit-ws-ai-section small { color: #86909c; display: block; margin-bottom: 8px; }
.audit-ws-ai-empty { color: #86909c; font-size: 13px; line-height: 1.6; padding: 8px; }

@media (max-width: 1280px) {
  .audit-ws-body { grid-template-columns: 140px 220px minmax(320px, 1fr); }
  .audit-ws-ai { display: none; }
}

.audit-ws-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow: auto;
  padding: 10px 8px;
  border-right: 1px solid #e5e6eb;
  background: #f7f8fa;
}

.audit-ws-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #4e5969;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.audit-ws-nav-item span {
  color: #86909c;
}

.audit-ws-nav-item:hover {
  background: #eef2f8;
}

.audit-ws-nav-item.is-active {
  background: #e6f4ff;
  color: #1890ff;
  font-weight: 600;
}

.audit-ws-nav-item.is-active span {
  color: #1890ff;
}

.audit-ws-nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 10px;
  padding-left: 8px;
  border-left: 2px solid #d6e4ff;
}

.audit-ws-nav-sub-item {
  min-height: 32px;
  padding-left: 8px;
  font-size: 13px;
}

.audit-ws-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #e5e6eb;
  background: #fff;
}

.audit-ws-list-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 0;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
}

.audit-ws-list-tab {
  flex: 1 1 0;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.audit-ws-list-tab.is-active {
  border-bottom-color: #1890ff;
  color: #1890ff;
  font-weight: 600;
}

.audit-ws-list-tab:disabled {
  color: #c0c4cc;
  cursor: not-allowed;
}

.audit-ws-list-search {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.audit-ws-search {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #1d2129;
  font: inherit;
}

.audit-ws-search:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
}

.audit-ws-contact-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.audit-ws-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #f2f3f5;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}

.audit-ws-contact:hover,
.audit-ws-contact:hover .audit-ws-contact-identity,
.audit-ws-contact:hover .audit-ws-contact-open {
  background: #f7f8fa;
}

.audit-ws-contact.is-active,
.audit-ws-contact.is-active .audit-ws-contact-identity,
.audit-ws-contact.is-active .audit-ws-contact-open {
  background: #e6f4ff;
}

.audit-ws-contact-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 4px 8px 12px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.audit-ws-contact-open {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 8px 12px 8px 4px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.audit-ws-contact-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e6eb;
  color: #4e5969;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audit-ws-contact-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.audit-ws-contact-avatar.is-fallback {
  background: linear-gradient(145deg, #d6e4ff, #f0f5ff);
  color: #1d39c4;
}

.audit-ws-contact-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1d2129;
}

.audit-ws-contact-time {
  flex: 0 0 auto;
  color: #86909c;
  font-size: 12px;
}

.audit-ws-avatar-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
}

.audit-ws-avatar-lightbox-card {
  position: relative;
  width: min(360px, calc(100vw - 48px));
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.audit-ws-avatar-lightbox-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #86909c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.audit-ws-avatar-lightbox-stage {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audit-ws-avatar-lightbox-img {
  width: min(240px, 70vw);
  height: min(240px, 70vw);
  border-radius: 50%;
  object-fit: cover;
  background: #f2f3f5;
}

.audit-ws-avatar-lightbox-empty {
  color: #86909c;
  font-size: 14px;
}

.audit-ws-avatar-lightbox-name {
  margin-top: 12px;
  color: #1d2129;
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
}

.audit-ws-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 10px;
  border-top: 1px solid #e5e6eb;
  color: #86909c;
  background: #fff;
}

.audit-ws-page-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
}

.audit-ws-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.audit-ws-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.audit-ws-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid #e5e6eb;
}

.audit-ws-chat-head-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.audit-ws-chat-head-tab {
  min-height: 40px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid #1890ff;
  background: transparent;
  color: #1890ff;
  cursor: default;
  font: inherit;
  font-weight: 600;
}

.audit-ws-chat-meta-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #86909c;
}

.audit-ws-chat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-ws-chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid #f0f0f0;
}

.audit-ws-chat-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.audit-ws-chat-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
}

.audit-ws-chat-tab.is-active {
  border-bottom-color: #1890ff;
  color: #1890ff;
  font-weight: 600;
}

.audit-ws-chat-notice {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 14px;
  color: #86909c;
  font-size: 12px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
}

.audit-ws-chat .sales-ai-audit-wework-gate {
  margin: 16px 14px 8px;
  border-color: #e5e6eb;
  background: #fff;
}

.audit-ws-timeline {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  padding: 12px 14px 20px;
  background: #f7f8fa;
}

.audit-ws-hits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow: auto;
  padding: 14px;
  background: #f7f8fa;
}

.audit-ws-hit-row {
  display: grid;
  grid-template-columns: 160px 140px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  color: #4e5969;
}

@media (max-width: 1100px) {
  .audit-ws-overlay {
    padding: 12px;
  }

  .audit-ws-modal {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }

  .audit-ws-body {
    grid-template-columns: 150px 220px minmax(0, 1fr);
  }

  /* 窄屏隐藏 AI，避免第 4 格掉到底部形成大白版 */
  .audit-ws-ai { display: none; }
}

@media (max-width: 860px) {
  .audit-ws-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(180px, 28%) minmax(0, 1fr);
  }

  .audit-ws-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid #e5e6eb;
  }

  .audit-ws-nav-item {
    width: auto;
  }

  .audit-ws-list {
    border-right: 0;
    border-bottom: 1px solid #e5e6eb;
  }

  .audit-ws-hit-row {
    grid-template-columns: 1fr;
  }
}

/* 普通浏览器：企微 Web 登录组件扫码面板（独立容器，不被聊天气泡重绘清掉） */
.sales-ai-audit-login-host {
  flex: 0 0 auto;
  padding: 12px 14px 0;
  background: #f7f8fa;
}
.sales-ai-audit-login-host[hidden] {
  display: none !important;
}
.sales-ai-audit-login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 auto 12px;
  max-width: 380px;
  padding: 18px 16px 20px;
  border: 1px solid #e5e6eb;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7f8fa 0%, #fff 56%);
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.sales-ai-audit-login-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1d2129;
}
.sales-ai-audit-login-desc {
  margin: 0;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.5;
  color: #86909c;
}
.sales-ai-audit-login-panel {
  width: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 企微专区上下文工具栏：主体选择与筛选条件保持同一操作层级 */
.sales-ai-toolbar-main {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: flex-end;
  gap: 22px;
}
.sales-ai-context-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  padding-left: 22px;
  border-left: 1px solid #e5e6eb;
}
.sales-ai-corp-field {
  display: flex;
  min-width: 188px;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  color: #86909c;
  font-size: 11px;
}
.sales-ai-corp-field .search-input {
  width: 100%;
  min-width: 188px;
  color: #1d2129;
}
.sales-ai-audit-cascade-field {
  min-width: 148px;
}
.sales-ai-audit-cascade-field .search-input {
  min-width: 148px;
}
.sales-ai-audit-cascade-field[hidden] {
  display: none !important;
}
#sales-ai-actions { margin-left: auto; }
.sales-ai-toolbar.is-context-only {
  min-height: 58px;
  justify-content: flex-start;
}
.sales-ai-toolbar.is-context-only .sales-ai-toolbar-main { flex: 0 1 auto; }
.sales-ai-toolbar.is-context-only .sales-ai-context-controls {
  padding-left: 0;
  border-left: 0;
}

/* 会话工作台：按消息类型收紧安全组件容器，避免短文本产生大块留白。
   宽屏保留 AI 侧栏 4 列；勿再写成 3 列却仍渲染 AI，否则 AI 掉到下一整行成大白版。 */
.audit-ws-modal { width: min(1440px, calc(100vw - 48px)); }
.audit-ws-body { grid-template-columns: 156px 260px minmax(0, 1fr) 280px; }
.audit-ws-ai {
  max-width: 280px;
  align-self: stretch;
}
.audit-ws-timeline {
  gap: 8px;
  padding: 10px 12px 18px;
  background: #f5f7fa;
}
.audit-ws-timeline .sales-ai-chat-bubble {
  width: fit-content;
  min-width: 132px;
  max-width: min(560px, 74%);
  padding: 8px 10px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.audit-ws-timeline .sales-ai-chat-bubble.is-staff {
  align-self: flex-end;
  margin-left: auto;
  border-color: #c7dcff;
  background: #edf4ff;
}
.audit-ws-timeline .sales-ai-chat-bubble.is-customer {
  align-self: flex-start;
  margin-right: auto;
}
.audit-ws-timeline .sales-ai-chat-meta {
  gap: 6px;
  margin-bottom: 3px;
  color: #86909c;
  font-size: 11px;
  opacity: 1;
}
.audit-ws-timeline .sales-ai-chat-bubble.is-staff .sales-ai-chat-meta {
  justify-content: flex-end;
}
.audit-ws-timeline .sales-ai-chat-text { line-height: 1.45; }
.audit-ws-timeline .sales-ai-chat-bubble:has(.sales-ai-chat-secure) {
  width: min(520px, 72%);
}
.audit-ws-timeline .sales-ai-chat-secure {
  width: 100%;
  min-height: 0;
  overflow: hidden;
}
.audit-ws-timeline .is-compact-message .sales-ai-chat-secure,
.audit-ws-timeline .is-compact-message .sales-ai-chat-secure ww-open-message,
.audit-ws-timeline .is-compact-message .sales-ai-chat-secure iframe {
  height: 54px !important;
  min-height: 0 !important;
  max-height: 54px !important;
  overflow: hidden !important;
}
.audit-ws-timeline .is-media-message {
  max-width: min(660px, 82%);
}
.audit-ws-timeline .is-media-message .sales-ai-chat-secure,
.audit-ws-timeline .is-media-message .sales-ai-chat-secure ww-open-message,
.audit-ws-timeline .is-media-message .sales-ai-chat-secure iframe {
  height: 136px !important;
  min-height: 92px !important;
  max-height: 136px !important;
  overflow: hidden !important;
}
.audit-ws-timeline .is-attachment-message .sales-ai-chat-secure,
.audit-ws-timeline .is-attachment-message .sales-ai-chat-secure ww-open-message,
.audit-ws-timeline .is-attachment-message .sales-ai-chat-secure iframe {
  height: 76px !important;
  min-height: 0 !important;
  max-height: 76px !important;
  overflow: hidden !important;
}
.audit-ws-loading {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #86909c;
  background: #f7f8fa;
  font-size: 13px;
}
.audit-ws-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0052d9;
  box-shadow: 0 0 0 4px rgba(0, 82, 217, 0.12);
  animation: audit-ws-dot-pulse 1s ease-in-out infinite;
}
@keyframes audit-ws-dot-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

.audit-ws-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafbfc;
}
.audit-ws-progress[hidden] {
  display: none !important;
}
.audit-ws-progress-bar {
  flex: 1;
  min-width: 0;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f3;
}
.audit-ws-progress-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #1677ff;
  transition: width 0.28s ease;
}
.audit-ws-progress.is-indeterminate .audit-ws-progress-bar > i {
  width: 36% !important;
  animation: audit-ws-progress-slide 1.2s ease-in-out infinite;
}
.audit-ws-progress-text {
  flex: 0 0 auto;
  max-width: 46%;
  color: #667085;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes audit-ws-progress-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.sales-ai-audit-loading {
  padding: 28px 8px 40px;
}
.sales-ai-audit-progress {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}
.sales-ai-audit-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #596579;
  font-size: 13px;
}
.sales-ai-audit-progress-head strong {
  color: #1677ff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.sales-ai-audit-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f3;
}
.sales-ai-audit-progress-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #1677ff;
  transition: width 0.22s ease;
}
.sales-ai-audit-progress-bar.is-indeterminate > i {
  width: 36% !important;
  animation: audit-ws-progress-slide 1.2s ease-in-out infinite;
}

/* 知识中心：腾讯后台式信息层级 */
.sales-ai-embedded-knowledge #knowledge-panel-templates,
.sales-ai-embedded-knowledge #knowledge-panel-cases,
.sales-ai-embedded-knowledge #knowledge-panel-uploads {
  overflow: hidden;
  padding: 0;
  border-color: #e5e6eb;
  background: #fff;
}
.kc-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
}
.kc-panel-heading-main,
.kc-panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kc-panel-heading-main { min-width: 0; }
.kc-panel-heading h3,
.kc-library-toolbar h3 {
  margin: 0;
  color: #1d2129;
  font-size: 17px;
  line-height: 1.45;
}
.kc-panel-heading p {
  margin: 3px 0 0;
  color: #86909c;
  font-size: 12px;
  line-height: 1.5;
}
.kc-panel-icon {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e8f0fe;
  color: #0052d9;
  font-size: 15px;
  font-weight: 600;
}
.kc-panel-icon.is-green { background: #e8ffea; color: #087443; }
.kc-panel-icon.is-purple { background: #f3efff; color: #6b4eff; }

.kc-template-summary,
.kc-case-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 0;
}
.kc-template-summary > div,
.kc-case-stat,
.kc-case-scope {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #f9fafb;
}
.kc-template-summary span,
.kc-case-stat > span,
.kc-case-scope > span { color: #86909c; font-size: 12px; }
.kc-template-summary strong,
.kc-case-stat strong {
  margin: 5px 0 2px;
  color: #1d2129;
  font-size: 22px;
  line-height: 1.25;
}
.kc-template-summary small,
.kc-case-stat small { color: #a4abb6; font-size: 11px; }

.kc-template-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 18px 22px 0;
  padding: 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #f7f8fa;
}
.kc-template-search {
  display: flex;
  width: 260px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  color: #86909c;
  font-size: 11px;
}
.kc-template-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #1d2129;
  font: inherit;
  font-size: 13px;
}
.kc-template-search input:focus {
  outline: none;
  border-color: #0052d9;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}
.kc-template-categories {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-top: 18px;
}
.kc-template-categories .filter-btn,
.kc-segmented-filter .filter-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #4e5969;
}
.kc-template-categories .filter-btn:hover,
.kc-segmented-filter .filter-btn:hover { background: #eef2f7; }
.kc-template-categories .filter-btn.active,
.kc-segmented-filter .filter-btn.active {
  border-color: #b8d0ff;
  background: #e8f0fe;
  color: #0052d9;
  font-weight: 600;
}
.kc-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 22px 22px;
}
.kc-template-card {
  display: flex;
  min-width: 0;
  min-height: 224px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.kc-template-card:hover {
  border-color: #b8d0ff;
  box-shadow: 0 5px 14px rgba(31, 35, 41, 0.06);
}
.kc-template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid #f0f1f3;
}
.kc-template-card-head > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.kc-template-card-title {
  overflow: hidden;
  color: #1d2129;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-template-card-head small { color: #86909c; font-size: 11px; }
.kc-template-badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.kc-template-card-body {
  flex: 1 1 auto;
  padding: 14px 16px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.7;
}
.business-truth-card .kc-template-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.business-truth-card .kc-field-help {
  display: block;
  margin: 0;
}
.business-truth-card textarea.business-truth-rule-input,
.business-truth-card textarea.business-truth-reply-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  background: #fff;
  color: #1d2129;
  font: inherit;
  line-height: 1.65;
}
.business-truth-card textarea.business-truth-rule-input { min-height: 96px; }
.business-truth-card textarea.business-truth-reply-input { min-height: 168px; }
.business-truth-card textarea.business-truth-rule-input:focus,
.business-truth-card textarea.business-truth-reply-input:focus {
  border-color: #3370ff;
  outline: 2px solid rgba(51, 112, 255, 0.12);
}
.business-truth-source-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid #dbe7ff;
  border-radius: 6px;
  background: #f7faff;
}
.business-truth-source-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.business-truth-source-select {
  min-width: 0;
  flex: 1 1 auto;
}
.business-truth-source-preview {
  max-height: 144px;
  overflow: auto;
  padding: 9px 10px;
  border-radius: 5px;
  background: #fff;
  color: #4e5969;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.kc-template-content {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}
.kc-template-card .tpl-structured-preview { max-height: 220px; overflow: auto; }
.kc-template-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #f0f1f3;
  background: #fafbfc;
}
.kc-template-card-actions .is-danger { margin-left: auto; color: #d54941; }

.kc-case-scope-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.kc-case-scope-controls label { display: none; }
.kc-case-scope-controls .search-input { min-width: 170px; }
.kc-info-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 22px 0;
  padding: 10px 12px;
  border: 1px solid #c7dcff;
  border-radius: 5px;
  background: #f2f7ff;
  color: #4e5969;
  font-size: 12px;
}
.kc-info-strip-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #0052d9;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.kc-deal-case-list {
  display: block;
  padding: 12px 22px 22px;
}
.kc-deal-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.kc-deal-case-table {
  width: 100%;
  margin: 0;
}
.kc-deal-case-table th,
.kc-deal-case-table td {
  white-space: nowrap;
}
.kc-deal-case-table td.kc-deal-cell-clip {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-deal-case-row:hover {
  background: #f7faff;
}
.kc-deal-wechat-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1456f0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.kc-deal-wechat-link:hover {
  text-decoration: underline;
}
.kc-deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}
.deal-chat-panel {
  max-width: 640px;
  width: 94vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.deal-chat-panel .payments-confirm-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: calc(86vh - 64px);
}
.deal-chat-timeline {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f0f2f5;
  border-radius: 8px;
}
.deal-chat-row {
  display: flex;
  width: 100%;
}
.deal-chat-row.is-customer {
  justify-content: flex-start;
}
.deal-chat-row.is-sales {
  justify-content: flex-end;
}
.deal-chat-row.is-unknown {
  justify-content: center;
}
.deal-chat-bubble {
  max-width: 78%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e6eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow-wrap: anywhere;
}
.deal-chat-row.is-sales .deal-chat-bubble {
  margin-left: auto;
}
.deal-chat-row.is-customer .deal-chat-bubble {
  margin-right: auto;
}
.deal-chat-bubble.is-customer {
  background: #fff;
  border-top-left-radius: 4px;
}
.deal-chat-bubble.is-sales {
  background: #edf4ff;
  border-color: #c7dcff;
  border-top-right-radius: 4px;
}
.deal-chat-bubble.is-unknown {
  background: #fafbfc;
}
.deal-chat-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  color: #86909c;
  font-size: 11px;
}
.deal-chat-row.is-sales .deal-chat-meta {
  justify-content: flex-end;
}
.deal-chat-text {
  color: #1d2129;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.deal-chat-empty,
.deal-chat-footer {
  padding: 12px 4px;
  color: #86909c;
  font-size: 12px;
  text-align: center;
}
.deal-contact-panel {
  max-width: 420px;
  width: 92vw;
}
.deal-contact-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deal-contact-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #e5e6eb;
  border-radius: 10px;
  background: #fff;
}
.deal-contact-channel {
  color: #07c160;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.deal-contact-name {
  color: #1d2129;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}
.deal-contact-sub {
  margin-top: 4px;
  color: #86909c;
  font-size: 12px;
}
.deal-contact-avatar {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: linear-gradient(145deg, #dce9ff, #f2f6ff);
  color: #1456f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex: 0 0 auto;
}
.deal-contact-block {
  border: 1px solid #e5e6eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.deal-contact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid #f0f1f3;
}
.deal-contact-row:first-child { border-top: 0; }
.deal-contact-row > span {
  color: #86909c;
  font-size: 13px;
  flex: 0 0 auto;
  min-width: 64px;
}
.deal-contact-row > strong {
  color: #1d2129;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}
.deal-contact-mono {
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px !important;
}
.deal-contact-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.deal-contact-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f2f3f5;
  color: #4e5969;
  font-size: 12px;
}
.kc-deal-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.kc-deal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
}
.kc-deal-card-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kc-deal-card-head strong { overflow: hidden; color: #1d2129; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.kc-deal-card-head time { flex: 0 0 auto; color: #86909c; font-size: 11px; }
.kc-deal-meta,
.kc-deal-tags,
.kc-deal-profile { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; color: #86909c; font-size: 11px; }
.kc-deal-content { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #f0f1f3; }
.kc-deal-content > section { min-width: 0; padding: 14px 16px; }
.kc-deal-content > section + section { border-left: 1px solid #f0f1f3; background: #fafbfc; }
.kc-deal-section-label { display: block; margin-bottom: 8px; color: #4e5969; font-size: 12px; font-weight: 600; }
.kc-deal-content ul { margin: 0; padding-left: 18px; color: #4e5969; font-size: 12px; line-height: 1.65; }
.kc-deal-recommendations { display: flex; flex-direction: column; gap: 8px; }
.kc-copy-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px; }
.kc-copy-block p { margin: 0; color: #4e5969; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }

.kc-upload-details {
  margin: 18px 22px 0;
  padding: 0;
  border-color: #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.kc-upload-details[open] { padding-bottom: 0; }
.kc-upload-summary {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid transparent;
}
.kc-upload-details[open] .kc-upload-summary { border-bottom-color: #e5e6eb; }
.kc-upload-summary > span { display: flex; flex-direction: column; gap: 3px; }
.kc-upload-summary strong { color: #1d2129; font-size: 14px; }
.kc-upload-summary small { color: #86909c; font-size: 11px; font-weight: 400; }
.kc-upload-summary i { color: #86909c; font-size: 18px; font-style: normal; transition: transform 0.16s ease; }
.kc-upload-details[open] .kc-upload-summary i { transform: rotate(180deg); }
.kc-upload-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr); }
.kc-upload-details .upload-case-box { padding: 16px 18px 18px; border: 0; border-radius: 0; }
.kc-upload-details .upload-case-box textarea { min-height: 156px; resize: vertical; }
.kc-field-help { margin: 0 0 7px; color: #86909c; font-size: 11px; }
.kc-outcome-options { display: flex; gap: 18px; }
.kc-learning-guide {
  padding: 20px;
  border-left: 1px solid #e5e6eb;
  background: #f7f8fa;
}
.kc-guide-eyebrow { color: #6b4eff; font-size: 11px; font-weight: 600; }
.kc-learning-guide ol { display: flex; flex-direction: column; gap: 18px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: guide; }
.kc-learning-guide li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-left: 34px; counter-increment: guide; }
.kc-learning-guide li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ebe7ff;
  color: #6b4eff;
  content: counter(guide);
  font-size: 11px;
  font-weight: 600;
}
.kc-learning-guide strong { color: #1d2129; font-size: 12px; }
.kc-learning-guide li span { color: #86909c; font-size: 11px; line-height: 1.5; }
.kc-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 22px;
  border-top: 1px solid #e5e6eb;
  border-bottom: 1px solid #e5e6eb;
  background: #fafbfc;
}
.kc-segmented-filter { display: flex; align-items: center; gap: 4px; }
.sales-ai-embedded-knowledge .kc-tag-panel { margin: 14px 22px 0; border-radius: 6px; background: #f7f8fa; }
.sales-ai-embedded-knowledge .knowledge-case-list-scroll { max-height: none; margin: 0; padding: 18px 22px 22px; }
.sales-ai-embedded-knowledge .kc-tag-section-head { border-bottom-color: #e5e6eb; }
.sales-ai-embedded-knowledge .kc-card {
  overflow: hidden;
  border-color: #e5e6eb;
  border-radius: 6px;
  box-shadow: none;
}
.sales-ai-embedded-knowledge .kc-card:hover { border-color: #b8d0ff; }
.sales-ai-embedded-knowledge .kc-card .card-header { padding: 14px 16px; background: #fff; }
.sales-ai-embedded-knowledge .kc-card-preview { margin: 0; padding: 0 16px 14px; }
.sales-ai-embedded-knowledge .kc-card-body { padding: 0 4px 12px; }
.sales-ai-embedded-knowledge .kc-card .card-actions { padding: 10px 16px; border-top: 1px solid #f0f1f3; background: #fafbfc; }
.kc-empty-card {
  display: flex;
  min-height: 180px;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #c9cdd4;
  border-radius: 6px;
  color: #86909c;
  text-align: center;
}

@media (max-width: 1100px) {
  .sales-ai-toolbar-main { flex-wrap: wrap; gap: 12px; }
  .sales-ai-context-controls { padding-left: 0; border-left: 0; }
  .kc-template-grid { grid-template-columns: 1fr; }
  .kc-upload-grid { grid-template-columns: 1fr; }
  .kc-learning-guide { border-top: 1px solid #e5e6eb; border-left: 0; }
}

@media (max-width: 760px) {
  .sales-ai-toolbar-main,
  .sales-ai-context-controls { width: 100%; align-items: stretch; flex-direction: column; }
  .sales-ai-corp-field { width: 100%; }
  .kc-panel-heading,
  .kc-library-toolbar,
  .kc-template-toolbar { align-items: stretch; flex-direction: column; }
  .kc-panel-actions { flex-wrap: wrap; }
  .kc-template-summary,
  .kc-case-overview { grid-template-columns: 1fr; }
  .kc-template-search { width: 100%; }
  .kc-template-categories { padding-top: 0; }
  .kc-deal-content { grid-template-columns: 1fr; }
  .kc-deal-content > section + section { border-top: 1px solid #f0f1f3; border-left: 0; }
  .business-truth-card textarea.business-truth-rule-input { min-height: 112px; }
  .business-truth-card textarea.business-truth-reply-input { min-height: 192px; }
  .business-truth-source-controls { align-items: stretch; flex-direction: column; }
  .business-truth-source-controls .btn { width: 100%; }
}

/* 企业微信数据智能专区 · 数据看板 */
.sales-ai-overview-filters {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-ai-overview-presets {
  display: inline-flex;
  overflow: hidden;
  align-items: center;
  border: 1px solid #d9dde5;
  border-radius: 4px;
  background: #fff;
}

.sales-ai-overview-preset {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid #d9dde5;
  background: #fff;
  color: #4e5969;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
}

.sales-ai-overview-preset:last-child { border-right: 0; }
.sales-ai-overview-preset:hover { background: #f5f7fa; color: #0052d9; }
.sales-ai-overview-preset.active {
  background: #0052d9;
  color: #fff;
  font-weight: 500;
}

.sales-ai-overview-custom-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #86909c;
}

.sales-ai-overview-custom-dates .search-input { width: 142px; }
.sales-ai-overview-department-field {
  display: flex;
  min-width: 168px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: #86909c;
  font-size: 11px;
}
.sales-ai-overview-department-field .search-input { width: 100%; min-width: 168px; }

.sales-ai-overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border: 1px solid #dce8ff;
  border-radius: 6px;
  background: #f2f7ff;
}

.sales-ai-overview-heading h2 {
  margin: 3px 0 5px;
  color: #1d2129;
  font-size: 20px;
  line-height: 1.35;
}

.sales-ai-overview-heading p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.sales-ai-overview-eyebrow {
  color: #0052d9;
  font-size: 12px;
  font-weight: 600;
}

.sales-ai-overview-heading-meta {
  display: flex;
  min-width: 230px;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: #4e5969;
  font-size: 12px;
}

.sales-ai-overview-heading-meta small { color: #86909c; }

.sales-ai-overview-coverage {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #dce8ff;
  border-radius: 4px;
  background: #f7faff;
  color: #4e5969;
  font-size: 12px;
}
.sales-ai-overview-coverage strong { flex: 0 0 auto; color: #0052d9; }
.sales-ai-overview-coverage.is-warning { border-color: #f3d19e; background: #fffaf0; }
.sales-ai-overview-coverage.is-warning strong { color: #ad6800; }

.sales-ai-overview-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.sales-ai-overview-metric-card {
  position: relative;
  min-width: 0;
  min-height: 108px;
  padding: 14px 15px 12px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 3%);
}

.sales-ai-overview-metric-card.is-draggable {
  cursor: grab;
}

.sales-ai-overview-metric-card.is-draggable:active {
  cursor: grabbing;
}

.sales-ai-overview-metric-card.is-dragging {
  opacity: 0.45;
}

.sales-ai-overview-metric-card.is-drop-target {
  border-color: #0052d9;
  box-shadow: inset 0 0 0 2px #0052d9, 0 3px 10px rgb(0 82 217 / 12%);
}

.sales-ai-overview-metric-card:hover {
  border-color: #b8d0ff;
  box-shadow: 0 3px 10px rgb(0 82 217 / 8%);
}

.sales-ai-overview-metric-card.is-drop-target:hover {
  border-color: #0052d9;
  box-shadow: inset 0 0 0 2px #0052d9, 0 3px 10px rgb(0 82 217 / 12%);
}

.sales-ai-overview-metric-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #667085;
  font-size: 13px;
}

.sales-ai-overview-metric-card > div i {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9ced6;
  border-radius: 50%;
  color: #86909c;
  font-size: 10px;
  font-style: normal;
}

.sales-ai-overview-metric-card strong {
  display: block;
  overflow: hidden;
  margin-top: 9px;
  color: #1d2129;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-ai-overview-metric-card small {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: #86909c;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-ai-overview-metric-card.is-unavailable {
  border-style: dashed;
  background: #fafbfc;
}
.sales-ai-overview-metric-card.is-unavailable strong { color: #86909c; font-size: 20px; }
.sales-ai-overview-metric-card.is-approximate::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 6px 0 0 6px;
  background: #7aa7f8;
  content: '';
}

.sales-ai-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.sales-ai-overview-panel {
  min-width: 0;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}

.sales-ai-overview-panel-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e6eb;
}

.sales-ai-overview-panel-head h3 { margin: 0; color: #1d2129; font-size: 15px; }
.sales-ai-overview-panel-head p { margin: 4px 0 0; color: #86909c; font-size: 12px; }
.sales-ai-overview-panel-head > span { color: #667085; font-size: 12px; white-space: nowrap; }

.sales-ai-overview-chart {
  padding: 12px 16px 14px;
}

.sales-ai-overview-chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  color: #667085;
  font-size: 11px;
}

.sales-ai-overview-chart-legend span::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 2px;
  background: #0052d9;
  content: '';
}
.sales-ai-overview-chart-legend .is-received::before { background: #77a8f7; }
.sales-ai-overview-chart-legend .is-effective::before { background: #b7cdf4; }

.sales-ai-overview-chart-scroll { overflow-x: auto; }
.sales-ai-overview-chart-columns {
  display: flex;
  min-width: 560px;
  height: 208px;
  align-items: stretch;
  gap: 8px;
  padding: 12px 4px 0;
  border-bottom: 1px solid #e5e6eb;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 49px, #f0f2f5 50px);
}

.sales-ai-overview-chart-column {
  display: flex;
  min-width: 28px;
  flex: 1 0 28px;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}

.sales-ai-overview-chart-bars {
  display: flex;
  height: 166px;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.sales-ai-overview-chart-bars i {
  display: block;
  width: min(8px, 28%);
  min-height: 0;
  border-radius: 2px 2px 0 0;
  background: #0052d9;
}
.sales-ai-overview-chart-bars i.is-received { background: #77a8f7; }
.sales-ai-overview-chart-bars i.is-effective { background: #b7cdf4; }
.sales-ai-overview-chart-column > span {
  overflow: hidden;
  height: 25px;
  padding-top: 7px;
  color: #86909c;
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-ai-overview-reminders {
  display: grid;
  margin: 0;
  padding: 4px 16px 8px;
  list-style: none;
}

.sales-ai-overview-reminders li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #f0f1f3;
}
.sales-ai-overview-reminders li:last-child { border-bottom: 0; }
.sales-ai-overview-reminder-dot {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #0052d9;
}
.sales-ai-overview-reminders li.is-warning .sales-ai-overview-reminder-dot { background: #d46b08; }
.sales-ai-overview-reminders li.is-danger .sales-ai-overview-reminder-dot { background: #d4380d; }
.sales-ai-overview-reminders li.is-neutral .sales-ai-overview-reminder-dot { background: #86909c; }
.sales-ai-overview-reminders li.is-unavailable .sales-ai-overview-reminder-dot { background: #c9ced6; }
.sales-ai-overview-reminders strong { display: block; color: #344054; font-size: 13px; font-weight: 500; }
.sales-ai-overview-reminders strong b { margin-left: 5px; color: #1d2129; font-size: 15px; }
.sales-ai-overview-reminders small { display: block; margin-top: 3px; color: #86909c; font-size: 11px; line-height: 1.45; }

.sales-ai-overview-departments { margin-top: 12px; }
.sales-ai-overview-departments.is-drilling .sales-ai-overview-panel-head {
  align-items: flex-start;
}
.sales-ai-overview-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0052d9;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.sales-ai-overview-back:hover { text-decoration: underline; }
.sales-ai-overview-drill-summary { margin: 0 16px 12px; }
.sales-ai-overview-inline-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: #86909c;
  font-size: 13px;
}
.sales-ai-overview-inline-loading span {
  width: 28px;
  height: 28px;
  border: 2px solid #d0d5dd;
  border-top-color: #0052d9;
  border-radius: 50%;
  animation: sales-ai-spin 0.8s linear infinite;
}
.sales-ai-overview-table-wrap {
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.sales-ai-overview-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #4e5969;
  font-size: 11px;
  white-space: nowrap;
}

.sales-ai-overview-table th,
.sales-ai-overview-table td {
  height: 36px;
  padding: 0 6px;
  border-bottom: 1px solid #f0f1f3;
  text-align: right;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sales-ai-overview-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f7fa;
  color: #667085;
  font-weight: 500;
}
.sales-ai-overview-table th.is-sortable {
  cursor: pointer;
  user-select: none;
}
.sales-ai-overview-table th.is-sortable:hover {
  color: #1d2129;
  background: #eef3ff;
}
.sales-ai-overview-table th.is-draggable,
.sales-ai-audit-employee-table th.is-draggable {
  cursor: grab;
}
.sales-ai-overview-table th.is-draggable:active,
.sales-ai-audit-employee-table th.is-draggable:active {
  cursor: grabbing;
}
.sales-ai-overview-table th.is-sorted-desc,
.sales-ai-overview-table th.is-sorted-asc {
  color: #0052d9;
  background: #e8f3ff;
}
.sales-ai-overview-table th.is-dragging,
.sales-ai-audit-employee-table th.is-dragging {
  opacity: 0.45;
}
.sales-ai-overview-table th.is-drop-target,
.sales-ai-audit-employee-table th.is-drop-target {
  box-shadow: inset 2px 0 0 #0052d9;
  background: #d6e4ff;
}
.sales-ai-overview-table tbody tr:hover td { background: #f7faff; }
.sales-ai-overview-table th:first-child,
.sales-ai-overview-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  background: #fff;
  text-align: left;
}
.sales-ai-overview-table thead th:first-child { z-index: 5; background: #f5f7fa; }
.sales-ai-overview-table th:nth-child(2),
.sales-ai-overview-table td:nth-child(2) { width: 52px; min-width: 52px; text-align: center; }
.sales-ai-overview-table th:nth-child(n+3),
.sales-ai-overview-table td:nth-child(n+3) { width: 68px; min-width: 68px; max-width: 68px; }
.sales-ai-overview-table tbody tr:hover td:first-child { background: #f7faff; }
.sales-ai-overview-table-value.is-unavailable { color: #86909c; }
.sales-ai-overview-table-value.is-approximate { border-bottom: 1px dashed #7aa7f8; }
.sales-ai-overview-sync-count {
  display: block;
  margin-top: 3px;
  color: #8a94a6;
  font-size: 11px;
  white-space: nowrap;
}
.sales-ai-overview-unbound-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid #f3d19e;
  border-radius: 6px;
  background: #fff7e8;
  color: #ad6800;
  font-size: 12px;
  white-space: nowrap;
}
.sales-ai-overview-table-value.is-unbound { color: #ad6800; }
.sales-ai-overview-employee-table tr.is-unbound-row td { background: #fffdf8; }

.sales-ai-overview-department-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0052d9;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.sales-ai-overview-department-link span { color: #86909c; font-size: 11px; font-weight: 400; }
.sales-ai-overview-department-link:hover { text-decoration: underline; }

.sales-ai-overview-member-link {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0052d9;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-align: left;
}
.sales-ai-overview-member-link:hover { text-decoration: underline; }

.sales-ai-overview-empty {
  display: flex;
  min-height: 164px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #86909c;
  font-size: 13px;
}

.sales-ai-overview-loading { padding: 6px 0 24px; }
.sales-ai-overview-loading-head,
.sales-ai-overview-loading-cards i {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f2f5 25%, #f7f8fa 37%, #f0f2f5 63%);
  background-size: 400% 100%;
  animation: sales-ai-overview-shimmer 1.3s ease infinite;
}
.sales-ai-overview-loading-head { height: 86px; }
.sales-ai-overview-loading-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.sales-ai-overview-loading-cards i { height: 104px; }
.sales-ai-overview-loading p { margin: 18px 0 0; color: #86909c; font-size: 13px; text-align: center; }
@keyframes sales-ai-overview-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.sales-ai-detail.sales-ai-detail--wide { width: min(1260px, 96vw); }
.sales-ai-overview-drawer-loading {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #86909c;
}
.sales-ai-overview-drawer-loading span {
  width: 28px;
  height: 28px;
  border: 3px solid #dce8ff;
  border-top-color: #0052d9;
  border-radius: 50%;
  animation: sales-ai-overview-spin .8s linear infinite;
}
@keyframes sales-ai-overview-spin { to { transform: rotate(360deg); } }

.sales-ai-overview-drawer-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 0;
}
.sales-ai-overview-drawer-summary > div {
  padding: 12px 14px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #f7f8fa;
}
.sales-ai-overview-drawer-summary span { display: block; color: #86909c; font-size: 11px; }
.sales-ai-overview-drawer-summary strong { display: block; margin-top: 5px; color: #1d2129; font-size: 15px; }
.sales-ai-overview-employee-table {
  min-width: 0;
  font-size: 10px;
}
.sales-ai-overview-employee-table th,
.sales-ai-overview-employee-table td {
  height: 32px;
  padding: 0 4px;
}
.sales-ai-overview-employee-table th:first-child,
.sales-ai-overview-employee-table td:first-child {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}
.sales-ai-overview-employee-table th:nth-child(2),
.sales-ai-overview-employee-table td:nth-child(2) {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  text-align: left;
}
.sales-ai-overview-employee-table th:nth-child(n+3),
.sales-ai-overview-employee-table td:nth-child(n+3) {
  width: 54px;
  min-width: 54px;
  max-width: 54px;
}

.sales-ai-overview-methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.sales-ai-overview-methodology-grid article {
  padding: 13px 14px;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  background: #fff;
}
.sales-ai-overview-methodology-grid article > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-ai-overview-methodology-grid article > div span {
  padding: 2px 7px;
  border-radius: 3px;
  background: #e8f0fe;
  color: #0052d9;
  font-size: 11px;
}
.sales-ai-overview-methodology-grid article > div span.is-pending { background: #f2f3f5; color: #86909c; }
.sales-ai-overview-methodology-grid p { margin: 8px 0 0; color: #4e5969; font-size: 12px; line-height: 1.6; }
.sales-ai-overview-methodology-grid small { display: block; margin-top: 6px; color: #86909c; font-size: 11px; }

@media (max-width: 1500px) {
  .sales-ai-overview-metrics { grid-template-columns: repeat(4, minmax(145px, 1fr)); }
}

@media (max-width: 1050px) {
  .sales-ai-overview-metrics { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .sales-ai-overview-layout { grid-template-columns: 1fr; }
  .sales-ai-overview-heading { align-items: flex-start; flex-direction: column; }
  .sales-ai-overview-heading-meta { min-width: 0; align-items: flex-start; }
}

@media (max-width: 760px) {
  .sales-ai-overview-presets { width: 100%; overflow-x: auto; }
  .sales-ai-overview-preset { flex: 1 0 auto; }
  .sales-ai-overview-custom-dates { width: 100%; }
  .sales-ai-overview-custom-dates .search-input { min-width: 0; flex: 1; width: auto; }
  .sales-ai-overview-department-field { width: 100%; }
  .sales-ai-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-ai-overview-metric-card strong { font-size: 21px; }
  .sales-ai-overview-loading-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-ai-overview-drawer-summary,
  .sales-ai-overview-methodology-grid { grid-template-columns: 1fr; }
}

.kc-panel-icon.is-blue { background: #e8f3ff; color: #3370ff; }
