/* ============================================================
   供应链管理画像原型 · 扩展组件
   ------------------------------------------------------------
   仅新增组件，沿用 style.css 中的 Design Token 与视觉语言，
   不覆盖既有样式。按能力域划分：
     口径配置 / 填报审批 / 看板导出 / 发布治理
   ============================================================ */

/* ============ 顶栏身份 / 角色切换 ============ */
.role-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
}
.role-switch__meta { display: flex; flex-direction: column; line-height: 1.25; }
.role-switch__name { font-size: 13px; color: #FFF; font-weight: 600; white-space: nowrap; }
.role-switch__org { font-size: 11px; color: rgba(255, 255, 255, 0.78); white-space: nowrap; }
.role-switch__select {
  height: 26px; max-width: 150px; font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95); color: #0A75D9;
  outline: none; cursor: pointer;
}

/* ============ 侧栏能力域分组 ============ */
.side-subgroup { margin-top: 4px; }
.side-subgroup.perm-hidden { display: none; }
.side-subgroup__title {
  display: block; padding: 8px 16px 4px;
  font-size: 11px; letter-spacing: 0.5px; font-weight: 600; color: var(--text-3);
}
.side-item.perm-hidden, .side-child.perm-hidden { display: none; }
.sidebar.collapsed .side-subgroup__title { display: none; }

/* ============ 视图进入动效 ============ */
.view-enter { animation: viewIn 0.18s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ============ 文本语义色 ============ */
.text-warn { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--success); }
.muted { color: var(--text-3); }
.th-sub { font-weight: 400; font-size: 11px; color: var(--text-3); }
.t-total { color: var(--danger); font-size: 15px; }
.arrow { color: var(--text-3); margin: 0 4px; }
.is-clickable { cursor: pointer; }

/* ============ 统计卡状态变体 ============ */
.stat-card--warn { border-left: 3px solid var(--warning); }
.stat-card--ok { border-left: 3px solid var(--success); }

/* ============ 空状态（含内联变体） ============ */
.empty-state__title { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); }
.empty-state__hint { display: block; margin-top: 6px; font-size: 12px; line-height: 1.7; color: var(--text-3); }
.empty-state--inline { padding: 28px 16px; }
.empty-state--ok .empty-state__title { color: var(--success); }

/* ============ 要点列表 / 说明块 ============ */
.brief-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; color: var(--text-2); }
.brief-list li.muted { color: var(--text-3); }
.callout {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.75; color: var(--text-1);
  background: var(--brand-light); border: 1px solid #91D5FF;
}
.callout--warn { background: #FFF7E6; border-color: #FFD591; }
.callout--danger { background: #FFF1F0; border-color: #FFA39E; }
.callout--muted { background: var(--bg-row); border-color: var(--border); color: var(--text-2); }
.callout .brief-list { margin-top: 6px; }

/* ============ 键值表 / 穿透表 / 直填表 / 配置表 ============ */
.table--kv th {
  width: 132px; background: var(--bg-row); font-weight: 600;
  color: var(--text-2); vertical-align: top;
}
.table--kv td { line-height: 1.7; }
.table--drill .drill-cat {
  background: var(--bg-row); font-weight: 600; color: var(--text-1);
  vertical-align: top; padding-top: 12px; white-space: nowrap;
}
.table--drill .drill-name { color: var(--text-1); }
.table--drill tr.row--display { background: #FCFCFC; }
.table--drill tr.row--display .drill-name { color: var(--text-2); }
.table--auth .input--mini { display: block; width: 84px; margin: 0 auto; text-align: center; }
.table--config .cell-formula {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px; color: var(--text-1); white-space: nowrap;
}
.table--config .cfg-weight { font-weight: 600; color: var(--brand); }

/* 单元格内的主 / 次信息 */
.cell-main { display: block; color: var(--text-1); }
.cell-sub { display: block; margin-top: 2px; font-size: 12px; line-height: 1.6; color: var(--text-3); }
.cell-sub-wrap { font-size: 12px; line-height: 1.7; color: var(--text-2); }
.cell-val { color: var(--text-1); }
.val-old { color: var(--text-3); text-decoration: line-through; }
.val-new { font-weight: 600; color: var(--success); }

/* ============ 弹窗补充 ============ */
.dialog--wide { width: 680px; }
.dialog-tip { margin-bottom: 14px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.confirm-text { font-size: 14px; line-height: 1.85; color: var(--text-1); }
.form-static { display: inline-block; font-size: 13px; line-height: 32px; color: var(--text-2); }
.form-ctl--inline { display: flex; align-items: center; gap: 8px; }
.form-ctl--inline .input { width: 140px; }
.form-ctl--inline .form-label { line-height: 32px; }

/* ============ 状态统计条 ============ */
.chip-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 13px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.chip b { color: var(--text-1); font-variant-numeric: tabular-nums; }
.chip--note { border-style: dashed; font-size: 12px; color: var(--text-3); }

/* ============ 指标来源分组 ============ */
.src-intro { margin-bottom: 12px; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.src-group { margin-bottom: 10px; }
.src-group__title {
  display: inline-block; margin-bottom: 4px; padding: 2px 8px;
  font-size: 12px; font-weight: 600; color: var(--brand);
  background: var(--brand-light); border-radius: 2px;
}
.src-group .src-list { line-height: 1.9; }

/* ============ 整体评价条 ============ */
.overall-body { flex: 1; min-width: 0; }

/* ============ 发布管理：状态流转 ============ */
.stage-flow { display: flex; align-items: stretch; flex-wrap: wrap; }
.stage-node {
  position: relative; flex: 1; min-width: 190px;
  padding: 14px 16px 14px 30px;
  background: var(--bg-row); border: 1px solid var(--border); border-right: none;
}
.stage-node:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stage-node:last-child { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.stage-node.is-active { background: var(--brand-light); border-color: #91D5FF; }
.stage-node.is-active + .stage-node { border-left-color: #91D5FF; }
.stage-node__dot {
  position: absolute; left: 12px; top: 18px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--text-4);
}
.stage-node.is-active .stage-node__dot { background: var(--brand); box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.18); }
.stage-node__name { display: block; font-size: 14px; font-weight: 600; color: var(--text-1); }
.stage-node.is-active .stage-node__name { color: var(--brand); }
.stage-node__desc { display: block; margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--text-3); }
.stage-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }

/* 复核清单 */
.check-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; font-size: 13px; border-bottom: 1px dashed var(--border);
}
.check-row:last-of-type { border-bottom: none; }
.check-row__icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
}
.check-row__icon.is-ok { background: var(--success); }
.check-row__icon.is-warn { background: var(--warning); }
.check-row__label { flex: 1; color: var(--text-1); }
.check-row__val { color: var(--text-2); font-variant-numeric: tabular-nums; }
.check-row__badge { min-width: 62px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.check-row__badge.is-ok { color: var(--success); }
.check-row__badge.is-warn { font-weight: 600; color: var(--warning); }
.review-verdict { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.7; }
.review-verdict--ok { background: #F6FFED; border: 1px solid #B7EB8F; color: #389E0D; }
.review-verdict--block { background: #FFF7E6; border: 1px solid #FFD591; color: #D46B08; }
.missing-group { margin-top: 12px; }
.missing-group__title { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ============ 口径配置：权重校验带 ============ */
.weight-band {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px;
  font-size: 13px; line-height: 1.7; border-radius: var(--radius);
}
.weight-band--ok { background: #F6FFED; border: 1px solid #B7EB8F; }
.weight-band--err { background: #FFF1F0; border: 1px solid #FFA39E; }
.weight-band__icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--success); color: #fff; font-size: 13px; font-weight: 700;
}
.weight-band--err .weight-band__icon { background: var(--danger); }
.weight-band__text { flex: 1; min-width: 260px; color: var(--text-1); }
.weight-band__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.weight-chip {
  padding: 2px 8px; font-size: 12px; color: var(--text-2);
  background: #fff; border: 1px solid var(--border); border-radius: 2px;
}
.weight-chip b { color: var(--brand); font-variant-numeric: tabular-nums; }

/* ============ 数据导入：上传区 ============ */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px; padding: 28px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-row); color: var(--text-3); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.dropzone__title { font-size: 13px; color: var(--text-2); }
.dropzone:hover .dropzone__title { color: var(--brand); }
.dropzone__title b { color: var(--brand); }
.dropzone__hint { font-size: 12px; color: var(--text-3); }

/* ============ 数据导入：校验规则 ============ */
.rule-list { list-style: none; margin: 0; }
.rule-list li {
  display: flex; gap: 12px; padding: 9px 0;
  font-size: 13px; line-height: 1.7; border-bottom: 1px dashed var(--border);
}
.rule-list li:last-child { border-bottom: none; }
.rule-list b { flex-shrink: 0; width: 84px; color: var(--text-1); }
.rule-list span { color: var(--text-2); }

/* ============ 页面级语义定位类（locator contract） ============ */
.overview-page,
.unit-portrait-page,
.data-fill-page,
.authoritative-page,
.data-import-page,
.publish-page,
.correction-page,
.config-page { display: block; }

.overview-page__summary-strip,
.data-fill-page__flow,
.authoritative-page__notice,
.correction-page__notice { margin-top: 16px; }

.publish-page__review .card,
.config-page__versions .card { margin-bottom: 16px; }
