/* =========================================================
   工地用工工资核算与个税计算管理系统
   样式表：企业后台风格，克制、密集、可打印、自适应移动端
   ========================================================= */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #e3e6eb;
  --border-strong: #d5d9e0;
  --text: #1f2430;
  --text-2: #4b5563;
  --muted: #7a828f;
  --brand: #1b5fa8;
  --brand-dark: #174e8b;
  --brand-weak: #eaf1fa;
  --ok: #1f7a3d;
  --ok-weak: #eef7f0;
  --warn: #a86a12;
  --warn-weak: #fdf6e9;
  --danger: #b0342a;
  --danger-weak: #fdf2f2;
  --radius: 4px;
  --sidebar-w: 208px;
  --topbar-h: 52px;
  --shadow: 0 1px 2px rgba(31, 36, 48, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

svg { display: block; }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-lg { width: 20px; height: 20px; }

/* ---------------- 登录 ---------------- */
.login-page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f7;
  background-image: linear-gradient(180deg, #eef1f5 0%, #f7f8fa 55%);
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px 28px 28px;
  box-shadow: 0 4px 18px rgba(31, 36, 48, .06);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-logo {
  width: 38px; height: 38px; border-radius: 6px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; letter-spacing: 1px;
}
.login-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.login-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-box .field { margin-bottom: 16px; }
.login-box .btn { width: 100%; height: 38px; font-size: 14px; }
.login-foot { margin-top: 20px; font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; }
.login-alert {
  background: var(--danger-weak); border: 1px solid #f0c9c5; color: #a12020;
  font-size: 12px; line-height: 1.7; padding: 9px 11px; border-radius: 3px; margin-bottom: 16px;
  overflow-wrap: anywhere;
}

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100%; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
}
.side-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.side-brand .mark {
  width: 26px; height: 26px; border-radius: 4px; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: none;
}
.side-brand .txt { font-size: 13px; font-weight: 600; line-height: 1.25; }
.side-brand .txt small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

.nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.nav-group { padding: 14px 16px 6px; font-size: 11px; color: #9aa1ac; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 16px;
  color: var(--text-2); font-size: 13px;
  cursor: pointer; position: relative;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: #fafbfc; color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--brand-weak); color: var(--brand); border-left-color: var(--brand); font-weight: 500; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 16px; min-width: 16px; height: 16px;
  padding: 0 5px; border-radius: 8px; text-align: center;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 18px;
  gap: 12px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 15px; font-weight: 600; margin: 0; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.topbar .who .role { font-size: 11px; color: var(--muted); background: #f2f4f7; border-radius: 3px; padding: 1px 6px; }
.icon-btn {
  width: 32px; height: 32px; border: 1px solid transparent; background: transparent;
  border-radius: 4px; display: none; align-items: center; justify-content: center;
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: #f2f4f7; }

.content { padding: 18px 20px 40px; flex: 1; min-width: 0; }

/* 工作台两栏布局 */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-grid > div { min-width: 0; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border-strong);
  background: #fff; color: var(--text);
  border-radius: 3px; font-size: 13px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b9c0cb; background: #fafbfc; text-decoration: none; }
.btn:active { background: #f2f4f7; }
.btn:disabled, .btn.disabled { color: #a8aeb9; background: #f7f8fa; cursor: not-allowed; border-color: var(--border); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--danger); border-color: #e6c3bf; }
.btn-danger:hover { background: var(--danger-weak); border-color: #d9a49e; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-link { border: none; background: none; color: var(--brand); padding: 0 4px; height: auto; cursor: pointer; font-size: 13px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  height: 32px; border: 1px solid var(--border-strong); border-radius: 3px;
  padding: 0 9px; font-size: 13px; font-family: inherit; color: var(--text);
  background: #fff; width: 100%;
}
.textarea { height: auto; min-height: 72px; padding: 8px 9px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(27, 95, 168, .1); }
.input[readonly] { background: #f7f8fa; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.toolbar .field { min-width: 132px; }
.toolbar .grow { flex: 1; }
.toolbar .actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td {
  padding: 8px 10px; border-bottom: 1px solid #eef0f3; text-align: left; white-space: nowrap;
}
table.grid th {
  background: #fafbfc; font-size: 12px; font-weight: 500; color: var(--muted);
  position: sticky; top: 0; z-index: 2;
}
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td.center, table.grid th.center { text-align: center; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid tfoot td { background: #fafbfc; font-weight: 600; border-top: 1px solid var(--border-strong); }
table.grid.compact th, table.grid.compact td { padding: 6px 8px; }
.row-warn { background: var(--warn-weak); }
.row-err { background: var(--danger-weak); }
.row-dim { color: #a8aeb9; }

td.cell-edit { cursor: pointer; border-bottom: 1px dashed #b9cfe8; }
td.cell-edit:hover { background: var(--brand-weak); }

.tag {
  display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; line-height: 18px;
  background: #f2f4f7; color: var(--text-2); white-space: nowrap;
}
.tag-ok { background: var(--ok-weak); color: var(--ok); }
.tag-warn { background: var(--warn-weak); color: var(--warn); }
.tag-danger { background: var(--danger-weak); color: var(--danger); }
.tag-brand { background: var(--brand-weak); color: var(--brand); }

.empty { padding: 44px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .ico { width: 28px; height: 28px; margin: 0 auto 10px; color: #c3c9d2; }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 13px; color: var(--text-2); }
.pager .spacer { flex: 1; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; min-width: 0;
}
.stat .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.stat .value { font-size: 22px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 待办 */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid #f2f4f7; cursor: pointer;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fafbfc; }
.todo-item .ic { width: 30px; height: 30px; border-radius: 4px; background: #f4f6f9; display: flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.todo-item .tx { flex: 1; min-width: 0; }
.todo-item .tx b { display: block; font-size: 13px; font-weight: 500; }
.todo-item .tx span { font-size: 12px; color: var(--muted); display: block; overflow-wrap: anywhere; }
.todo-item .n { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 简单柱状趋势 */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 148px; padding: 8px 4px 0; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart .bar { width: 100%; max-width: 46px; background: #cddcee; border-radius: 2px 2px 0 0; position: relative; min-height: 2px; }
.chart .bar.hi { background: var(--brand); }
.chart .bar span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text-2); white-space: nowrap; }
.chart .x { font-size: 11px; color: var(--muted); }

/* ---------------- 抽屉 / 弹窗 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(20, 24, 32, .38); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 6px; width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(16, 20, 28, .18);
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* 提示条 */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #2b3240; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 4px;
  box-shadow: 0 4px 16px rgba(16, 20, 28, .2); max-width: 520px;
}
.toast.ok { background: #24663c; }
.toast.err { background: #8d2f26; }

/* 加载 */
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border: 2px solid #d8dde5; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 上传区 */
.dropzone {
  border: 1px dashed #c8cfd9; border-radius: 4px; background: #fbfcfd;
  padding: 30px 20px; text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-weak); }
.dropzone.has-file { border-style: solid; border-color: #b9cfe8; background: #f7fafd; }
.dropzone.has-file b { color: var(--brand); }
.dropzone .ico { width: 26px; height: 26px; margin: 0 auto 8px; color: #98a1ae; }
.dropzone b { display: block; font-size: 13px; font-weight: 500; }
.dropzone span { font-size: 12px; color: var(--muted); }

.steps-bar { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.steps-bar .s { flex: 1; padding: 10px 14px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--border); display: flex; align-items: center; gap: 7px; }
.steps-bar .s:last-child { border-right: none; }
.steps-bar .s b { width: 18px; height: 18px; border-radius: 50%; background: #eef0f3; color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 500; }
.steps-bar .s.on { color: var(--brand); background: var(--brand-weak); }
.steps-bar .s.on b { background: var(--brand); color: #fff; }
.steps-bar .s.done { color: var(--ok); }
.steps-bar .s.done b { background: var(--ok); color: #fff; }

/* 汇总条 */
.summary-bar { display: flex; flex-wrap: wrap; gap: 22px; padding: 12px 16px; background: #fafbfc; border-bottom: 1px solid var(--border); }
.summary-bar .item { font-size: 12px; color: var(--muted); }
.summary-bar .item b { display: block; font-size: 15px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.summary-bar .item b.danger { color: var(--danger); }
.summary-bar .item b.warn { color: var(--warn); }

/* 考勤格子 */
table.att th, table.att td { padding: 4px 3px; font-size: 12px; text-align: center; }
table.att th.day, table.att td.day { width: 26px; min-width: 26px; padding: 4px 0; }
table.att td.day { cursor: pointer; user-select: none; }
table.att td.day:hover { background: #eef3f9; }
table.att td.day.on { color: var(--ok); font-weight: 600; }
table.att td.day.off { color: #b6bdc7; }
table.att td.day.locked { color: #d5d9e0; cursor: not-allowed; background: #fafbfc; }
table.att .sticky-l { position: sticky; left: 0; background: #fff; z-index: 1; }
table.att .sticky-l2 { position: sticky; left: 44px; background: #fff; z-index: 1; }
table.att th.sticky-l, table.att th.sticky-l2 { background: #fafbfc; z-index: 3; }

/* ---------------- 记录详情弹窗 ---------------- */
.modal { animation: modalIn .16s ease-out; }
.overlay { animation: overlayIn .16s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.rec-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.rec-name { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.rec-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.rec-tags { margin-left: auto; display: flex; gap: 6px; flex: none; }

.kv-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.kv { background: #fff; padding: 10px 12px; min-width: 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.kv b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv b.warn { color: var(--danger); }

.formula {
  margin-top: 12px; padding: 9px 12px; background: #fafbfc; border: 1px solid var(--border);
  border-radius: 3px; font-size: 12px; color: var(--text-2); line-height: 1.7; font-variant-numeric: tabular-nums;
}

.sec-title {
  margin: 20px 0 10px; font-size: 13px; font-weight: 600; color: var(--text);
  padding-left: 8px; border-left: 3px solid var(--brand); line-height: 1.2;
}
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; color: var(--text-2); line-height: 1.9; }

.hist { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.hist-item { padding: 10px 12px; border-bottom: 1px solid #f1f3f6; }
.hist-item:last-child { border-bottom: none; }
.hist-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hist-head b { font-size: 12px; font-weight: 600; color: var(--warn); }
.hist-head span { font-size: 12px; color: var(--muted); }
.hist-body { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; line-height: 1.8; }

.link-name { color: var(--brand); cursor: pointer; border-bottom: 1px dashed transparent; }
.link-name:hover { border-bottom-color: currentColor; text-decoration: none; }

/* ---------------- 细节打磨 ---------------- */
.card-head { min-height: 46px; }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible,
.nav-item:focus-visible, .link-name:focus-visible {
  outline: 2px solid rgba(27, 95, 168, .35); outline-offset: 1px;
}
.table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid th:first-child, table.grid td:first-child { padding-left: 14px; }
.grow { flex: 1; }
.summary-bar .item b { letter-spacing: -.2px; }
.empty .ico { opacity: .9; }
.toolbar .actions .btn { height: 32px; }
.modal-foot { background: #fafbfc; border-radius: 0 0 6px 6px; }

/* 横向滚动时首列固定，便于对照姓名 */
.table-wrap.sticky-first th:first-child,
.table-wrap.sticky-first td:first-child {
  position: sticky; left: 0; background: #fff; z-index: 1;
  box-shadow: 1px 0 0 var(--border);
}
.table-wrap.sticky-first th:first-child { background: #fafbfc; z-index: 3; }

/* 登录状态下的打印 */
.print-only { display: none; }

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toolbar, .pager, .toasts, .no-print, .steps-bar, .summary-bar .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { border: none; margin: 0; }
  .card-head { display: none; }
  .card-body { padding: 0; }
  .print-only { display: block; }
  .table-wrap { overflow: visible; }
  table.grid th { position: static; }
  table.grid th, table.grid td { border: 1px solid #999; padding: 4px 5px; font-size: 11px; }
  table.grid { border-collapse: collapse; }
  table.att th, table.att td { padding: 2px 1px; font-size: 10px; }
  table.att th.day, table.att td.day { width: auto; min-width: 0; }
  .print-title { text-align: center; font-size: 16px; font-weight: 600; padding: 4px 0 10px; }
  .print-meta { display: flex; justify-content: space-between; font-size: 11px; padding: 0 0 6px; color: #333; }
  .print-sign { margin-top: 16px; font-size: 12px; display: flex; justify-content: space-between; }
  .row-warn, .row-err { background: #fff !important; }
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 24px rgba(16,20,28,.18); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .icon-btn { display: flex; }
  .topbar h2 { font-size: 14px; }
  .topbar .who .name, .topbar .who .role { display: none; }
  .content { padding: 12px 12px 32px; }
  .toolbar { padding: 12px; gap: 8px; }
  .toolbar .field { flex: 1 1 46%; min-width: 0; }
  .toolbar .actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .toolbar .actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .summary-bar { gap: 14px; padding: 10px 12px; }
  .summary-bar .item b { font-size: 14px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat .value { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
  .rec-name { flex-wrap: wrap; }
  .rec-tags { margin-left: 0; }
  .modal { max-height: calc(100vh - 24px); }
  .overlay { padding: 12px; }
  .login-box { padding: 26px 20px 22px; }
  .steps-bar { flex-wrap: wrap; }
  .steps-bar .s { flex: 1 1 50%; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .card-head { flex-wrap: wrap; }
  table.grid { font-size: 12px; }
  table.grid th, table.grid td { padding: 7px 8px; }
}

/* ---------------- 发放方式选择 / 本月发放状态 ---------------- */
.run-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 2; }
.run-list li::marker { color: var(--muted); }
.run-list b { color: var(--text); font-variant-numeric: tabular-nums; }

.mode-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 2px; }
.mode-opt {
  position: relative; display: block; padding: 11px 13px 11px 34px; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: 5px; background: #fff;
  cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode-opt input { position: absolute; left: 11px; top: 13px; margin: 0; }
.mode-opt:hover { border-color: #b9cfe8; background: #fbfcfe; }
.mode-opt.on { border-color: var(--brand); background: var(--brand-weak); box-shadow: inset 0 0 0 1px var(--brand); }
.mode-opt.off { opacity: .55; cursor: not-allowed; background: #fafbfc; }
.mode-opt.off:hover { border-color: var(--border-strong); background: #fafbfc; }
.mode-t { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.mode-d { font-size: 12px; color: var(--text-2); line-height: 1.65; }
.mode-h { font-size: 12px; color: var(--brand); margin-top: 5px; min-height: 16px; line-height: 1.5; }
.mode-opt.off .mode-h, .mode-opt.off .mode-d { color: var(--danger); }

.mode-banner {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2); padding-bottom: 10px;
}
.mode-banner b { color: var(--text); }
.mode-banner .tag { flex: none; }

.sum-strip {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.sum-strip b { color: var(--text); }
.sum-strip .grow { flex: 1; }

.alert-warn-box {
  background: var(--warn-weak); border: 1px solid #eddfae; color: #7d4e0c;
  border-radius: 5px; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12.5px; line-height: 1.8;
}
.alert-warn-box b { color: var(--warn); }

/* 倒算小工具结果 */
.calc-out { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-top: 14px; }
.calc-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 12px; border-bottom: 1px solid #f1f3f6; font-size: 13px; color: var(--text-2);
}
.calc-row:last-child { border-bottom: none; }
.calc-row b { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.calc-row b.ok { color: var(--ok); }
.calc-meta {
  padding: 9px 12px; background: #fafbfc; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); line-height: 1.8;
}
.calc-empty { font-size: 12.5px; color: var(--muted); padding: 14px 2px; }

@media (max-width: 900px) {
  .mode-pick { grid-template-columns: 1fr; }
  .mode-opt { padding-left: 32px; }
}
