/* 全站业务标题：复用 AI 画像的图标底块和标题层级。图标为本地 CSS 内嵌 SVG。 */
:root {
  --field-label-size: 14px;
  --field-label-weight: 600;
  --field-label-color: #344054;
  --heading-grid: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3C%2Fsvg%3E");
  --heading-people: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%237949d0%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M3%2021v-2a6%206%200%200%201%2012%200v2M16%204a3%203%200%200%201%200%206M18%2015a5%205%200%200%201%203%204v2%22%2F%3E%3C%2Fsvg%3E");
  --heading-building: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2021h16M6%2021V3h12v18M9%207h1M14%207h1M9%2011h1M14%2011h1M9%2015h1M14%2015h1M10%2021v-3h4v3%22%2F%3E%3C%2Fsvg%3E");
  --heading-folder: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206a2%202%200%200%201%202-2h5l2%203h7a2%202%200%200%201%202%202v10a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2V6Z%22%2F%3E%3C%2Fsvg%3E");
  --heading-file: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%223%22%20width%3D%2214%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%208h6M9%2012h6M9%2016h4%22%2F%3E%3C%2Fsvg%3E");
  --heading-chart: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2316825d%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%203v18h17M8%2017v-5M13%2017V8M18%2017V4%22%2F%3E%3C%2Fsvg%3E");
  --heading-check: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2316825d%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%208%203v6c0%205-8%209-8%209s-8-4-8-9V6l8-3Z%22%2F%3E%3Cpath%20d%3D%22m8%2012%203%203%205-6%22%2F%3E%3C%2Fsvg%3E");
  --heading-upload: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2016V3m-5%205%205-5%205%205M4%2015v5a1%201%200%200%200%201%201h14a1%201%200%200%200%201-1v-5%22%2F%3E%3C%2Fsvg%3E");
  --heading-book: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%231769d8%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%206c-3-2-6-2-9-1v15c3-1%206-1%209%201%203-2%206-2%209-1V5c-3-1-6-1-9%201Zm0%200v15%22%2F%3E%3C%2Fsvg%3E");
  --heading-org: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%237949d0%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%228%22%20y%3D%223%22%20width%3D%228%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%222%22%20y%3D%2216%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2215%22%20y%3D%2216%22%20width%3D%227%22%20height%3D%225%22%20rx%3D%221%22%2F%3E%3Cpath%20d%3D%22M12%208v4M5.5%2016v-4h13v4%22%2F%3E%3C%2Fsvg%3E");
  --heading-calendar: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23db692a%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%203v4M17%203v4M3%2011h18M8%2015h2M14%2015h2M8%2018h2%22%2F%3E%3C%2Fsvg%3E");
}
.page-view { --heading-icon: var(--heading-file); --heading-tint: var(--blue-soft); }
#dashboardView { --heading-icon: var(--heading-grid); }
#customersView, #customerDetailView { --heading-icon: var(--heading-people); --heading-tint: var(--purple-soft); }
#projectsView, #projectDetailView, #customerProjectsPanel { --heading-icon: var(--heading-folder); }
#reportsView { --heading-icon: var(--heading-chart); --heading-tint: var(--green-soft); }
#approvalView { --heading-icon: var(--heading-check); --heading-tint: var(--green-soft); }
#importsView { --heading-icon: var(--heading-upload); }
#knowledgeView { --heading-icon: var(--heading-book); }
#adminView { --heading-icon: var(--heading-org); --heading-tint: var(--purple-soft); }
#customerFollowPanel, .project-detail-note { --heading-icon: var(--heading-file); --heading-tint: var(--blue-soft); }
#customerProjectsPanel { --heading-tint: var(--blue-soft); }
/* 档案分区在现有渲染函数中固定为基础、商务、归属、进度四项。 */
:is(#customerDetail .customer-detail-group, .project-detail-page .project-detail-group):nth-child(1) { --heading-icon: var(--heading-building); --heading-tint: var(--blue-soft); }
:is(#customerDetail .customer-detail-group, .project-detail-page .project-detail-group):nth-child(2) { --heading-icon: var(--heading-chart); --heading-tint: var(--green-soft); }
:is(#customerDetail .customer-detail-group, .project-detail-page .project-detail-group):nth-child(3) { --heading-icon: var(--heading-org); --heading-tint: var(--purple-soft); }
:is(#customerDetail .customer-detail-group, .project-detail-page .project-detail-group):nth-child(4) { --heading-icon: var(--heading-calendar); --heading-tint: var(--orange-soft); }
#adminView .content-card:has(#userCreateForm), #adminView .admin-users-card { --heading-icon: var(--heading-people); }
#adminView .content-card:has(.admin-task-list) { --heading-icon: var(--heading-calendar); --heading-tint: var(--orange-soft); }
.project-detail-page .detail-section:has(.project-stage-catalog),
.project-detail-page .detail-section:has(.project-stage-timeline) { --heading-icon: var(--heading-calendar); --heading-tint: var(--orange-soft); }
.project-detail-page .detail-section:has(.approval-history-wrap) { --heading-icon: var(--heading-check); --heading-tint: var(--green-soft); }
#departmentReportCard { --heading-icon: var(--heading-org); --heading-tint: var(--purple-soft); }

/* 页面名称使用较大的图标；已经有独立图标的客户/跟进详情保留现有结构。 */
.page-view .page-heading > div:first-child { min-width: 0; }
:is(.page-view .page-heading h3, #dashboardView .workbench-heading h1) {
  align-items: center; display: flex; gap: 12px; font-weight: 600;
  color: var(--text-primary); line-height: 1.35; overflow-wrap: anywhere;
}
:is(.page-view .page-heading h3, #dashboardView .workbench-heading h1)::before {
  content: ""; display: block; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 10px; background: var(--heading-tint) var(--heading-icon) center / 24px 24px no-repeat;
}
.page-view .page-heading h3 + p { margin-left: 54px; }
#dashboardView .workbench-heading p { margin-left: 54px; }

/* 静态页面与接口加载后的详情分区使用同一标题规则。 */
:is(
  .page-view .section-title h4,
  #customerDetail .customer-detail-group h4,
  #customerDetailView .customer-detail-tab-panel > .section-title h4,
  .project-detail-page .project-detail-group h4,
  .project-detail-page .detail-section-head h4,
  .follow-detail-card > header h4,
  .follow-detail-section h4,
  .performance-panel-head h5,
  .approval-history-toolbar-title h5,
  .knowledge-detail-head h4
) {
  align-items: center; display: flex; gap: 11px; color: var(--text-primary);
  font-size: 16px; font-weight: 700; line-height: 24px; letter-spacing: 0;
  overflow-wrap: anywhere;
}
:is(
  .page-view .section-title h4,
  #customerDetail .customer-detail-group h4,
  #customerDetailView .customer-detail-tab-panel > .section-title h4,
  .project-detail-page .project-detail-group h4,
  .project-detail-page .detail-section-head h4,
  .follow-detail-card > header h4,
  .follow-detail-section h4,
  .performance-panel-head h5,
  .approval-history-toolbar-title h5,
  .knowledge-detail-head h4
)::before {
  content: ""; position: static; display: block; flex: 0 0 36px; width: 36px; height: 36px;
  margin: 0; border: 0; border-radius: 9px; box-shadow: none; transform: none;
  background: var(--heading-tint) var(--heading-icon) center / 21px 21px no-repeat;
}
#customerDetail .customer-detail-group h4 { background: #fff; min-height: 62px; }
.page-view .section-title, .project-detail-page .detail-section-head { gap: 12px; }
.page-view .section-title > div { min-width: 0; }
.page-view .section-title > div > h4 + span { display: block; margin: 4px 0 0 47px; }
.page-view .section-title > span, .project-detail-page .detail-section-head > small {
  color: var(--text-tertiary); font-size: 12px; flex-shrink: 0;
}

/* 已经存在图标的工作台和上传记录统一尺寸，避免双重装饰。 */
#dashboardView .panel-icon {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; box-shadow: none;
}
#dashboardView .panel-title > div { gap: 11px; }
#dashboardView .panel-title h4,
.page-view .import-history-intro h4 { color: var(--text-primary); font-size: 16px; font-weight: 700; line-height: 24px; }
.page-view .import-history-icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; font-size: 0;
  background: var(--heading-tint) var(--heading-icon) center / 24px 24px no-repeat;
}
.project-detail-page .project-detail-hero-icon {
  font-size: 0; background: var(--blue-soft) var(--heading-folder) center / 30px 30px no-repeat;
}
/* 字段名称也属于标题层级；只选标签容器，不把时间、说明等 small 一并加粗。 */
:is(
  #customerDetail .customer-detail-field,
  .project-detail-page .project-detail-field,
  .follow-detail-grid > div,
  #customerDetail .customer-profile-remark > div,
  .import-file-summary > div,
  .detail-field,
  .report-metric,
  .dashboard-metric-copy
) > small,
#dashboardSummary .dashboard-stat .stat-label,
.import-raw-payload dt,
.report-line > span {
  color: var(--field-label-color);
  font-size: var(--field-label-size);
  font-weight: var(--field-label-weight);
  line-height: 22px;
}
:is(#customerDetail .customer-detail-field, .project-detail-page .project-detail-field) {
  min-height: 78px; padding: 14px 16px;
}
:is(#customerDetail .customer-detail-field, .project-detail-page .project-detail-field) > small {
  display: block; margin: 0 0 5px;
}
:is(#customerDetail .customer-detail-field, .project-detail-page .project-detail-field, .follow-detail-grid > div) > strong,
.detail-field > span {
  color: var(--text-secondary); font-size: 14px; font-weight: 400; line-height: 22px;
}
.import-file-summary > div > strong {
  font-size: 14px; line-height: 22px;
}
.page-view thead th {
  color: var(--field-label-color); font-size: 13px; font-weight: 600; line-height: 22px;
}

/* 列表筛选、员工管理、业务弹窗、导入审核使用相同的表单标签。 */
:is(.page-view .filter-card, .modal-form, .review-grid) label,
.import-review-row-comment {
  color: var(--field-label-color); font-size: 13px; font-weight: 600; line-height: 22px;
}
.import-data-card .review-grid label {
  color: var(--field-label-color); font-size: 13px; font-weight: 600;
}
:is(.page-view .filter-card, .modal-form, .review-grid, .import-review-row-comment) :is(input, select, textarea) {
  font-size: 14px; font-weight: 400; line-height: 22px;
}
:is(.modal-form, .review-grid) label > small {
  font-size: 12px; font-weight: 400; line-height: 20px;
}
/* 错误标签继续使用错误色，避免统一文字颜色覆盖校验状态。 */
.review-grid label.field-invalid,
.import-data-card .review-grid label.field-invalid,
.review-grid .field-error-message { color: var(--danger); }

/* 导入明细、知识切片、审批记录中独立于通用卡片头的小标题。 */
.import-detail-item-head h5,
.import-data-card > h6,
.knowledge-chunk h5,
.approval-history > h4,
.project-detail-note > h4 {
  color: var(--text-primary); font-size: 15px; font-weight: 700; line-height: 24px;
}

@media (max-width: 640px) {
  :is(.page-view .page-heading h3, #dashboardView .workbench-heading h1) { gap: 10px; }
  :is(.page-view .page-heading h3, #dashboardView .workbench-heading h1)::before {
    flex-basis: 36px; width: 36px; height: 36px; background-size: 21px 21px;
  }
  .page-view .page-heading h3 + p, #dashboardView .workbench-heading p { margin-left: 0; }
  .page-view .section-title, .project-detail-page .detail-section-head { flex-wrap: wrap; }
  .page-view .section-title > span { flex-shrink: 1; }
  .follow-detail-card > header { flex-direction: column; align-items: stretch; }
  .follow-detail-card > header > div { min-width: 0; }
  .follow-detail-card > header .follow-detail-customer-button { width: 100%; }
}
