/* 科室绩效核算系统 · 视图层组件样式（在 app.css 的设计令牌之上扩展） */

/* ------------------------------------------------------------ 期间选择 */
.period-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-3);
}

.period-picker select {
  height: 26px;
  border: 0;
  padding: 0 2px;
  background: transparent;
  font-weight: 600;
  color: var(--ink);
  max-width: 190px;
}

.period-picker select:focus { outline: none; }

/* ------------------------------------------------------------ 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 0 4px;
}

.empty-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.empty-desc { font-size: 12px; color: var(--ink-3); max-width: 62ch; line-height: 1.6; }
.empty-state .btn { margin-top: 6px; }

.panel-note {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

.panel-note code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--accent-ink);
}

/* ------------------------------------------------------------ 表单 */
.amount-input { height: 30px; font-size: 13px; font-weight: 600; }

.static-value {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.formula-view {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-ink);
  background: var(--accent-weak);
  border-radius: 4px;
  padding: 5px 8px;
  max-width: 460px;
  overflow-wrap: anywhere;
}

.cell-formula { min-width: 190px; font-family: var(--mono); font-size: 11.5px; }
.cell-qty { min-width: 58px; }

/* ------------------------------------------------------------ 说明文字 */
.hint {
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

.hint.danger { color: var(--danger); }

/* 表格单元格内的行内说明，紧跟输入框 */
.hint-inline {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hint-inline.warn { color: var(--warn); }

/* ------------------------------------------------------------ 工作量登记矩阵 */

/* 项目列表头：项目名 + 自动读取的单次绩效 */
.col-head {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.35;
}

.col-title { font-weight: 600; }

.col-sub {
  font-weight: 400;
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 自动汇总出来的数字（不可编辑） */
.qty-auto {
  display: inline-block;
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

/* 可点击的姓名：打开个人登记明细 */
.link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--accent-ink);
  cursor: pointer;
  text-align: left;
}

.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent-weak); border-radius: 3px; }

/* 面板内的次级标题 */
.sub-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 16px 0 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sub-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* 大号只读金额 */
.static-value.big {
  height: auto;
  padding: 2px 0 4px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

/* 自动算出的总额：一行读完，不占纵向空间 */
.total-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 2px 0 4px;
}

.total-inline-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.total-inline-label { font-size: 12.5px; color: var(--ink-3); }

.total-inline-value {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.total-inline-note { font-size: 11.5px; color: var(--ink-3); }

/* 次要读数（如「所有项目合计系数」）：跟随主金额，但降低字号避免抢主信息 */
.total-inline-sub .total-inline-value { font-size: 15px; color: var(--ink-2); }

/* 工作量矩阵：列宽固定，避免项目多时挤压姓名列 */
.workload-table th, .workload-table td { padding-left: 10px; padding-right: 10px; }
/* 粘性首列要保留左内边距：清零会让姓名与「合计」贴住表格左边框 */
.workload-table td.sticky-col, .workload-table th.sticky-col { padding-left: 10px; }
.workload-table .cell-qty { min-width: 62px; }

/* 岗位人数单元格：输入框 + 在岗人数提示（同行，避免把行撑高） */
.headcount-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 92px;
}

.headcount-cell input { width: 88px; flex: none; }

.headcount-cell .hint-inline {
  margin-top: 0;
  white-space: nowrap;
}

/* ------------------------------------------------------------ 岗位绩效分配表 */
/* 固定列宽比例：输入型列给足空间，计算型列按数字长度分配，操作列收窄 */
.post-alloc-table { table-layout: fixed; }
.post-alloc-table th:nth-child(1), .post-alloc-table td:nth-child(1) { width: 22%; }
.post-alloc-table th:nth-child(2), .post-alloc-table td:nth-child(2) { width: 10%; }
.post-alloc-table th:nth-child(3), .post-alloc-table td:nth-child(3) { width: 18%; }
.post-alloc-table th:nth-child(4), .post-alloc-table td:nth-child(4) { width: 12%; }
.post-alloc-table th:nth-child(5), .post-alloc-table td:nth-child(5) { width: 12%; }
.post-alloc-table th:nth-child(6), .post-alloc-table td:nth-child(6) { width: 19%; }
.post-alloc-table th:nth-child(7), .post-alloc-table td:nth-child(7) { width: 7%; }

/* 所有行等高，合计行与数据行的横线连成一条 */
.post-alloc-table tbody tr { height: 46px; }
.post-alloc-table td { vertical-align: middle; }

/* 输入框不再撑满整列 */
.post-alloc-table td:nth-child(1) input { width: 100%; max-width: 220px; }
.post-alloc-table td:nth-child(2) input { width: 92px; }
.post-alloc-table td:nth-child(3) input { width: 92px; }

/* 窄屏：改回自动列宽并给每列最小宽度，让表格整体横向滚动而不是挤成一团 */
@media (max-width: 1080px) {
  .post-alloc-table { table-layout: auto; }
  .post-alloc-table th:nth-child(1), .post-alloc-table td:nth-child(1) { min-width: 190px; }
  .post-alloc-table th:nth-child(2), .post-alloc-table td:nth-child(2) { min-width: 118px; }
  .post-alloc-table th:nth-child(3), .post-alloc-table td:nth-child(3) { min-width: 196px; }
  .post-alloc-table th:nth-child(4), .post-alloc-table td:nth-child(4) { min-width: 108px; }
  .post-alloc-table th:nth-child(5), .post-alloc-table td:nth-child(5) { min-width: 100px; }
  .post-alloc-table th:nth-child(6), .post-alloc-table td:nth-child(6) { min-width: 132px; }
  .post-alloc-table th:nth-child(7), .post-alloc-table td:nth-child(7) { min-width: 76px; }
}

/* 检查项目表：10 列，按内容给最小宽度，窄屏时表格内部横向滚动 */
.exam-table td:nth-child(1) { min-width: 140px; }   /* 检查项目名称 */
.exam-table td:nth-child(2) { min-width: 120px; }   /* 检查类型 */
.exam-table td:nth-child(3) { min-width: 130px; }   /* 所属岗位 */
.exam-table td:nth-child(5) { min-width: 120px; }   /* 单次检查绩效 */
.exam-table td:nth-child(6) { min-width: 120px; }   /* 医院单次收费 */
.exam-table td:nth-child(9) { min-width: 120px; }   /* 当月医院收入 */
.post-select { min-width: 118px; }

.form-col { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 11.5px; color: var(--ink-3); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}

.batch-input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
  resize: vertical;
}

.batch-input:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }

/* ------------------------------------------------------------ 弹层 */
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-text { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* ------------------------------------------------------------ 公式管理 */
.formula-switch { flex-wrap: wrap; }

.formula-level { margin-right: 6px; }
.formula-level button { font-size: 12px; }

.formula-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.formula-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.formula-side { min-width: 0; }

.formula-input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 9px 11px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}

.formula-input:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }

.op-bar { display: flex; flex-wrap: wrap; gap: 3px; }

.op-btn {
  min-width: 26px;
  height: 24px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

.op-btn:hover { border-color: var(--accent); color: var(--accent); }

.formula-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }

.check-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.check-status { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.check-status.ok { color: var(--ok); }
.check-status.danger { color: var(--danger); }

.error-list { margin: 0; padding-left: 16px; font-size: 11.5px; line-height: 1.7; }
.error-list li.danger { color: var(--danger); }
.error-list li.warn { color: var(--warn); }

.test-box { display: flex; flex-direction: column; gap: 10px; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }

.test-result {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  background: var(--surface-3);
  font-size: 12.5px;
}

.test-result.ok strong { color: var(--ok); font-variant-numeric: tabular-nums; }
.test-result.danger strong { color: var(--danger); }
.test-result-label { color: var(--ink-3); font-size: 11.5px; }

.var-groups { display: flex; flex-direction: column; gap: 10px; }
.var-group { display: flex; flex-direction: column; gap: 5px; }
.var-group-title { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

.var-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.var-chip {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.var-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); }
.var-chip.fn { font-family: var(--mono); }

.formula-cell {
  max-width: 340px;
  white-space: normal;
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.row-actions { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------------ 检查块 */
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 2px 20px; }

.check-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.check-label { font-size: 12.5px; font-weight: 600; }
.check-values { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.check-values strong { font-variant-numeric: tabular-nums; }
.check-diff { font-size: 11.5px; }
.check-diff.ok { color: var(--ok); }
.check-diff.warn { color: var(--warn); }

/* ------------------------------------------------------------ 设置 */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2px 24px; }

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

/* 系统设置页的分区切换条 */
.subnav {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.settings-card.wide { grid-column: 1 / -1; }
.settings-card h4 { margin: 0; font-size: 12.5px; font-weight: 600; }
.settings-card p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.settings-card .hint { color: var(--ink-3); font-size: 11.5px; }
.settings-card .btn { margin-top: 4px; }

/* ------------------------------------------------------------ 表格微调 */
.people-table td { vertical-align: middle; }
.people-table input.cell-input { min-width: 74px; }
.people-table select.cell-input { min-width: 96px; }

td .row-actions .btn { height: 22px; font-size: 11.5px; }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1080px) {
  .formula-editor { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .period-picker select { max-width: 120px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  /* 窄屏下板块标题与操作区分行堆叠，避免标题被挤压换行 */
  .panel-head { flex-direction: column; align-items: stretch; gap: 8px; }
  /* 竖排时 flex-basis 作用于高度，必须清零，否则标题块会被撑成 240px 高 */
  .panel-title { flex: 0 0 auto; flex-wrap: wrap; }
  .panel-title > span { white-space: normal; }
  .panel-title small { flex: 1 1 100%; }
  .panel-actions { justify-content: flex-start; }
  .formula-switch { width: 100%; }
  .formula-switch button { flex: 1 1 40%; }
  .formula-actions .btn { flex: 1 1 auto; justify-content: center; }
}


/* ------------------------------------------------------------ 岗位配色 */
/* 总览页按岗位顺序取色，超过 8 个岗位时循环使用 */
:root {
  --b-p1: #0f6157;
  --b-p2: #3b4f86;
  --b-p3: #8a5a2b;
  --b-p4: #4a7a3a;
  --b-p5: #7a4a6b;
  --b-p6: #2f6f7a;
  --b-p7: #8a4a4a;
  --b-p8: #5a5f3a;
}

/* ------------------------------------------------------------ 岗位绩效统计卡片 */
.post-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.post-stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px 14px 14px;
  min-width: 0;
}

.post-stat-card.muted-card { background: var(--surface); }

.post-stat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  margin-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.post-stat-name { font-size: 13.5px; font-weight: 600; }

.post-stat-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.post-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.post-stat-label { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

.post-stat-item strong {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .post-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
}

/* 窄屏：面板标题与副标题各占一行，避免副标题被挤成细长的一列 */
@media (max-width: 820px) {
  .panel-title { flex-wrap: wrap; }
  .panel-title small { flex: 1 1 100%; }
}

/* ------------------------------------------------------------ 折叠区 */
.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.fold > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
}

.fold > summary::-webkit-details-marker { display: none; }
.fold-chevron {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--ink-3);
  transition: transform .15s ease;
}
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold[open] > summary .fold-chevron { transform: rotate(90deg); }
.fold > summary .muted { font-weight: 400; font-size: 11.5px; }
.fold > .params, .fold > .grid-2 { padding: 14px; }
.fold > .grid-2 > * { min-width: 0; }

/* ------------------------------------------------------------ 绩效设置 */
.setup-total {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: flex-end;
}

.setup-total-main { flex: 1 1 240px; min-width: 0; }
.setup-total-main label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.setup-total-main .amount-input-lg {
  width: 100%;
  max-width: 260px;
  height: 40px;
  font-size: 21px;
  font-weight: 600;
  padding: 0 12px;
}
@media (max-width: 900px) {
  .legend { grid-template-columns: minmax(0, 1fr); }
}
/* ------------------------------------------------------------ 分配比例条 */
.stack-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-3);
}
.stack-seg { height: 100%; }

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 24px;
  margin-top: 12px;
}
.legend-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.legend-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}
.legend-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-left: 15px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.legend-name { font-weight: 600; }
.legend-ratio { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.legend-amount { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.legend-note { color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.legend-note.warn { color: var(--warn); }

/* ------------------------------------------------------------ 结果速览 */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 24px;
}
.quick-stat { display: flex; flex-direction: column; gap: 2px; }
.quick-stat-label { font-size: 11px; color: var(--ink-3); }
.quick-stat strong {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.quick-stat-sub { font-size: 11px; color: var(--ink-3); }

/* ------------------------------------------------------------ 步骤条 */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.step:hover { border-color: var(--accent); background: var(--accent-weak); }
.step-index {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ink-3);
  flex: none;
}
.step.done { color: var(--ink); }
.step.done .step-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------ 类别速览 */
.cat-strip { display: flex; flex-direction: column; gap: 9px; }
.cat-summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.cat-summary-label {
  font-size: 11.5px;
  color: var(--ink-3);
  min-width: 60px;
  flex: none;
}
.cat-summary-text { font-size: 12.5px; }
.cat-summary-text.muted { color: var(--ink-3); }

/* ------------------------------------------------------------ 搜索 */
.search-input {
  height: 30px;
  width: 200px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
}
.search-input:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }

tr.row-clickable { cursor: pointer; }
tr.row-clickable:hover td { background: var(--accent-weak); }

/* ------------------------------------------------------------ 个人明细 */
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-head strong { font-size: 15px; }
.detail-head .muted { font-size: 12px; }
.detail-block { border-top: 1px solid var(--line); padding-top: 10px; }
.detail-title { font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.detail-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-2);
  padding-top: 11px;
  font-size: 13px;
}
.detail-total strong { font-size: 19px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ 按钮状态 */
.btn.btn-on {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-weak);
}

/* ------------------------------------------------------------ 响应式补充 */
@media (max-width: 900px) {
  .legend { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .step { flex: 1 1 100%; }
  .setup-total-main .amount-input-lg { max-width: none; }
  .search-input { width: 100%; }
}

/* ------------------------------------------------------------ 触摸设备可点尺寸 */
/* 放在最后加载的一层，确保能覆盖 app.css 里的表格输入框与按钮尺寸 */
@media (max-width: 820px) {
  input[type="text"], input[type="number"], select { height: 36px; }
  input.cell-input, select.cell-input { height: 36px; padding: 0 8px; }
  .btn-sm { height: 32px; padding: 0 11px; }
  .btn-icon { width: 32px; height: 32px; }
  .seg button { height: 32px; padding: 0 14px; }
  .period-picker { height: 36px; }
  .period-picker select { height: 32px; }
  /* 表格里的姓名链接也要够大好点 */
  .link-btn { min-height: 32px; display: inline-flex; align-items: center; }
  .search-input { height: 36px; }
  /* 表格操作列里的小按钮同样放大 */
  td .row-actions .btn { height: 32px; font-size: 12px; }
}
