/* 页面级样式：结果区、表格、审批页、映射配置 */
.result-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
/* 两卡布局（删除「合同额合计」卡片后使用） */
.result-summary.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) { .result-summary { grid-template-columns: minmax(0, 1fr); } }

.kv-list { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.kv { display: flex; align-items: baseline; gap: 6px; font-size: var(--text-body-sm); }
.kv-label { color: var(--color-text-muted); }
.kv-value { font-weight: var(--font-weight-medium); }

/* 项目名称：过长时最多折成两行；行间距（单元格 padding）保持不变 */
.contract-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  max-width: 320px;
  line-height: 1.45;
  word-break: break-word;
}

/* 签订时间、行业：强制单行不换行 */
td.nowrap, th.nowrap { white-space: nowrap; }
/* 时间紧凑格式仅在窄屏启用（见 mobile.css） */
.t-short { display: none; }
/* 通知状态短文案仅在窄屏启用 */
.badge-label-short { display: none; }
.contract-no { font-size: var(--text-label); color: var(--color-text-faint); }

.amount-cell { font-weight: var(--font-weight-semibold); font-variant-numeric: tabular-nums; }

/* 审批等待中的遮罩提示 */
.approval-pending {
  position: relative;
}
.approval-pending .table-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  opacity: 0.55;
  pointer-events: none;
}

.decision-box {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  padding: var(--spacing-16);
}
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-body-sm);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-buttons);
  transition: border-color var(--transition), background-color var(--transition);
}
.radio:hover { border-color: var(--color-primary); }
.radio input { accent-color: var(--color-primary); margin: 0; }
.radio.selected { border-color: var(--color-primary); background: var(--color-primary-soft); }

.mapping-row {
  display: grid;
  grid-template-columns: 132px 1fr 96px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.mapping-row:last-child { border-bottom: none; }
.mapping-row label { font-size: var(--text-body-sm); font-weight: var(--font-weight-medium); }
.mapping-row select, .mapping-row input { font-size: var(--text-body-sm); padding: 6px 10px; }
@media (max-width: 640px) {
  .mapping-row { grid-template-columns: minmax(0, 1fr); }
}

.dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-cards);
  padding: 28px 20px;
  text-align: center;
  color: var(--color-text-muted);
  transition: border-color var(--transition), background-color var(--transition);
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.dropzone-icon { font-size: 26px; margin-bottom: 8px; }

.preview-table { max-height: 260px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-buttons); }

.list-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  padding: 14px 16px;
  background: var(--color-surface);
  margin-bottom: 12px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.list-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.list-item.active { border-color: var(--color-primary); }
/* 生效中的配置：左侧强调条 + 浅色底，一眼区分 */
.list-item-primary {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  box-shadow: inset 3px 0 0 var(--color-primary);
}
html[data-theme='dark'] .list-item-primary { background: var(--color-surface-alt); }
.list-item-title { font-weight: var(--font-weight-semibold); font-size: var(--text-body-sm); }

.approval-hero {
  text-align: center;
  padding: var(--spacing-32) 0 var(--spacing-24);
}
.approval-hero .empty-icon { width: 56px; height: 56px; font-size: 26px; }

.result-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-body-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

/* 顶部导航的当前用户信息 */
.user-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-buttons);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.user-name { font-size: var(--text-body-sm); font-weight: var(--font-weight-medium); color: var(--color-text); }
.user-role { font-size: var(--text-label); color: var(--color-text-muted); }

/* 登录页身份选择分组 */
optgroup { font-weight: var(--font-weight-semibold); color: var(--color-text-muted); }

/* ---------- 我的查询记录表：表头与内容对齐 ---------- */
.table-history { table-layout: fixed; }
.table-history th,
.table-history td { padding: 12px 14px; vertical-align: middle; }
.table-history th:nth-child(1),
.table-history td:nth-child(1) { width: 56px; text-align: right; }
.table-history th:nth-child(2),
.table-history td:nth-child(2) { width: auto; }
.table-history th:nth-child(3),
.table-history td:nth-child(3) { width: 88px; text-align: right; }
.table-history th:nth-child(4),
.table-history td:nth-child(4) { width: 132px; text-align: right; }
.table-history th:nth-child(5),
.table-history td:nth-child(5) { width: 96px; text-align: center; }
.table-history th:nth-child(6),
.table-history td:nth-child(6) { width: 150px; text-align: left; }
.table-history th:nth-child(7),
.table-history td:nth-child(7) { width: 76px; text-align: center; }

.filter-desc {
  font-size: var(--text-body-sm);
  color: var(--color-text);
  line-height: 1.55;
  word-break: break-word;
}
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }

/* ---------- 审批中心表：增加筛选行 ---------- */
.filter-bar {
  display: flex;
  gap: var(--spacing-12);
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: var(--spacing-16);
  padding: var(--spacing-16);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
}
.filter-bar .field { min-width: 160px; }
.filter-bar .field label { font-size: var(--text-label); color: var(--color-text-muted); }
.filter-bar select { padding: 6px 10px; font-size: var(--text-body-sm); }

/* ---------- 审批中心表列宽 ---------- */
.table-approvals { table-layout: fixed; }
.table-approvals th:nth-child(1), .table-approvals td:nth-child(1) { width: 56px; text-align: right; }
.table-approvals th:nth-child(2), .table-approvals td:nth-child(2) { width: 96px; }
.table-approvals th:nth-child(3), .table-approvals td:nth-child(3) { width: auto; }
.table-approvals th:nth-child(4), .table-approvals td:nth-child(4) { width: 76px; text-align: right; }
.table-approvals th:nth-child(5), .table-approvals td:nth-child(5) { width: 120px; text-align: right; }
.table-approvals th:nth-child(6), .table-approvals td:nth-child(6) { width: 92px; text-align: center; }
.table-approvals th:nth-child(7), .table-approvals td:nth-child(7) { width: 150px; }
.table-approvals th:nth-child(8), .table-approvals td:nth-child(8) { width: 140px; }
.table-approvals th:nth-child(9), .table-approvals td:nth-child(9) { width: 92px; text-align: center; }
.table-approvals th:nth-child(9) .btn,
.table-approvals td:nth-child(9) .btn { white-space: nowrap; }

/* ---------- 多选下拉组件 ---------- */
.multiselect { position: relative; width: 100%; }

.multiselect-trigger {
  width: 100%;
  font-family: inherit;
  font-size: var(--text-body-sm);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-inputs);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.multiselect-trigger:hover { border-color: var(--color-primary); }
.multiselect-trigger:focus-visible { outline: none; border-color: var(--color-primary); box-shadow: var(--color-ring); }
.multiselect-trigger .multiselect-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multiselect-trigger .multiselect-arrow { color: var(--color-text-muted); font-size: 11px; flex: none; }

.multiselect-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-cards);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.multiselect-panel.hidden { display: none; }

.multiselect-actions {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: none; box-shadow: var(--color-ring); border-radius: 4px; }

.multiselect-options { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: var(--text-body-sm);
  cursor: pointer;
  transition: background-color var(--transition);
}
.multiselect-option:hover { background: var(--color-surface-alt); }
.multiselect-option input { accent-color: var(--color-primary); margin: 0; flex: none; }
.ms-opt-name { flex: 1; color: var(--color-text); }
.ms-opt-count {
  font-size: var(--text-label);
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
