
:root{
  --bg:#f2f5fa; --card:#ffffff; --line:#e3e8f1; --text:#1e2939; --muted:#6b7280;
  --primary:#2563eb; --primary-d:#1d4ed8; --ok:#0f9d58; --warn:#d97706; --danger:#dc2626;
  --radius:12px; --shadow:0 1px 3px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.04);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"Microsoft YaHei","PingFang SC","Hiragino Sans GB","Helvetica Neue",Arial,sans-serif;
  background:var(--bg);color:var(--text);font-size:14px;line-height:1.55}
h1,h2,h3,h4{margin:0}
button{font-family:inherit}
.muted{color:var(--muted)}
.small{font-size:12px}
.mono{font-variant-numeric:tabular-nums;font-family:Consolas,Monaco,monospace}
.nowrap{white-space:nowrap}

.topbar{background:linear-gradient(120deg,#1e40af,#2563eb 55%,#3b82f6);color:#fff;padding:14px 20px;
  display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;
  position:sticky;top:0;z-index:30;box-shadow:0 2px 10px rgba(30,64,175,.25)}
.brand{display:flex;align-items:center;gap:12px}
.logo{width:38px;height:38px;border-radius:10px;background:rgba(255,255,255,.18);display:flex;
  align-items:center;justify-content:center;font-weight:700;font-size:17px;border:1px solid rgba(255,255,255,.35)}
.brand h1{font-size:18px;font-weight:600;letter-spacing:.5px}
.headright{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.identity{display:flex;align-items:center;gap:8px;background:rgba(255,255,255,.14);padding:6px 10px;
  border-radius:10px;border:1px solid rgba(255,255,255,.25)}
.identity label{font-size:12px;opacity:.9}
.identity select{border:0;border-radius:8px;padding:6px 8px;font-size:13px;background:#fff;color:#1e2939;
  min-width:170px;font-family:inherit}
.whoami{font-size:13px;font-weight:600}
.whoami em{font-style:normal;font-size:11px;opacity:.8;margin-left:4px}
.syncchip{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:6px 11px;border-radius:99px;
  background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.3);cursor:pointer;color:#fff}
.syncchip .d{width:8px;height:8px;border-radius:99px;background:#cbd5e1;display:inline-block}
.syncchip.ok .d{background:#4ade80}.syncchip.saving .d{background:#fbbf24}
.syncchip.err .d{background:#f87171}.syncchip.local .d{background:#94a3b8}
.logout{border:1px solid rgba(255,255,255,.4);background:rgba(255,255,255,.12);color:#fff;
  padding:6px 12px;border-radius:99px;font-size:12px;cursor:pointer}
.logout:hover{background:rgba(255,255,255,.24)}

/* 顶栏高度、页签高度由 JS 量出来写成变量（浏览器缩放/文字换行时高度会变），
   页签吸在顶栏下沿，不再被顶栏压掉一截 */
.tabs{display:flex;gap:6px;padding:10px 20px 0;background:var(--bg);overflow-x:auto;position:sticky;
  top:var(--topbar-h,72px);z-index:20}
/* 工时登记 / 月度表的工具条不再吸顶：吸顶会盖住表头（姓名/类别/工时）。
   电脑端这两页改成固定高度、只有表格内部滚动（见文件末尾 .fitview），
   窗口太矮时退回整页滚动，工具栏跟着滚走，也不会压住表头。 */
#markToolbar,#gridToolbar{position:relative;z-index:15;background:var(--card)}
.tab{border:1px solid transparent;background:#e8edf6;color:#475569;padding:8px 16px;border-radius:10px 10px 0 0;
  cursor:pointer;font-size:14px;white-space:nowrap;transition:.15s;position:relative}
.tab:hover{background:#dde5f2}
.tab.active{background:var(--card);color:var(--primary-d);font-weight:600;border-color:var(--line);
  border-bottom-color:var(--card);box-shadow:0 -2px 0 var(--primary) inset}
.tab .dotbadge{display:inline-block;min-width:17px;height:17px;line-height:17px;padding:0 5px;margin-left:6px;
  border-radius:99px;background:#dc2626;color:#fff;font-size:11px;font-weight:600;text-align:center}

main{padding:16px 20px 60px;max-width:1720px;margin:0 auto}
.view{display:none}.view.active{display:block;animation:fade .18s ease}
@keyframes fade{from{opacity:.4;transform:translateY(3px)}to{opacity:1;transform:none}}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:14px 16px;margin-bottom:14px}
.card-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:space-between;
  padding-bottom:10px;margin-bottom:12px;border-bottom:1px dashed var(--line)}
.card-head b{font-size:15px}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin-bottom:14px}
.stat{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--shadow)}
.stat .k{font-size:12px;color:var(--muted)}
.stat .v{font-size:24px;font-weight:700;margin-top:2px}
.stat .s{font-size:12px;color:var(--muted);margin-top:2px}
.stat.blue .v{color:#2563eb}.stat.green .v{color:#0f9d58}.stat.amber .v{color:#d97706}.stat.red .v{color:#dc2626}

.btn{border:1px solid var(--line);background:#fff;color:#334155;padding:7px 13px;border-radius:9px;cursor:pointer;
  font-size:13px;transition:.15s;white-space:nowrap}
.btn:hover{background:#f1f5fb;border-color:#c9d4e6}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.primary:hover{background:var(--primary-d)}
.btn.ok{background:#0f9d58;border-color:#0f9d58;color:#fff}
.btn.ok:hover{background:#0b7c45}
.btn.danger{background:#fff;border-color:#f2c3c3;color:var(--danger)}
.btn.danger:hover{background:#fef2f2}
.btn.lg{padding:9px 20px;font-size:14px;font-weight:600}
.btn.xs{padding:3px 9px;font-size:12px;border-radius:7px}
button:disabled{opacity:.5;cursor:not-allowed}
input,select,textarea{font-family:inherit;font-size:13px;color:var(--text);border:1px solid var(--line);
  background:#fff;border-radius:8px;padding:6px 9px;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
input:disabled{background:#f3f6fb;color:#64748b;cursor:not-allowed}
label{display:inline-flex;align-items:center;gap:6px}
.ck{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none;font-size:13px}
.ck input{width:15px;height:15px;accent-color:var(--primary);cursor:pointer}
.inp{width:100%;min-width:90px}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.grid3{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;align-items:end}
.grid4{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}
.field{display:flex;flex-direction:column;gap:5px}
.field>span{font-size:12px;color:var(--muted)}
.add-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px;padding-top:12px;border-top:1px dashed var(--line)}

.table-wrap{overflow:auto;max-height:560px;border:1px solid var(--line);border-radius:10px}
table.tbl{width:100%;border-collapse:collapse;font-size:13px;background:#fff}
table.tbl th,table.tbl td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
table.tbl thead th{position:sticky;top:0;background:#f7f9fd;z-index:2;font-weight:600;color:#475569;font-size:12px}
table.tbl tbody tr:hover{background:#fafcff}
table.tbl tr.off{opacity:.5;background:#fbfbfb}
table.tbl tr.done{background:#fbfdfb}
table.tbl td.num{text-align:right;font-variant-numeric:tabular-nums}
table.tbl td.wrap{white-space:normal;min-width:180px;max-width:420px}
.empty{padding:26px;text-align:center;color:var(--muted)}

.grid-wrap{overflow:auto;max-height:72vh;border:1px solid var(--line);border-radius:10px;background:#fff}
table.grid{border-collapse:separate;border-spacing:0;font-size:13px;width:100%}
table.grid th,table.grid td{padding:5px 8px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:center}
table.grid thead th{position:sticky;top:0;background:#f7f9fd;z-index:3;font-weight:600;color:#475569;font-size:12px}
table.grid td.sl,table.grid th.sl{position:sticky;left:0;background:#fff;z-index:2;text-align:left;box-shadow:1px 0 0 var(--line)}
table.grid thead th.sl{background:#f7f9fd;z-index:4}
table.grid tr.grp td{background:#eef4ff;color:#1e40af;font-weight:600;text-align:left;height:30px}
table.grid tr.grp:hover td{background:#e0ebff}
table.grid tr.grp .card-arrow{font-size:11px;color:#64748b}
table.grid tr.grp td.sl{background:#eef4ff}
table.grid tr.hasrec td.sl{box-shadow:inset 3px 0 0 #22c55e,1px 0 0 var(--line)}
table.grid tbody tr:hover td{background:#fafcff}
table.grid tbody tr:hover td.sl{background:#fafcff}
table.grid th.wk,table.grid td.wk{background:#f4f7fc}
table.grid thead th.wk{background:#eef2f8}
table.grid tbody tr:hover td.wk{background:#eef2f8}
table.grid td.sl.wk,table.grid th.sl.wk{background:#eef2f8}
table.grid th.corner,table.grid td.corner{position:sticky;right:0;background:#fbfdff;z-index:3;box-shadow:-1px 0 0 var(--line)}
table.grid thead th.corner{background:#f7f9fd;z-index:5}
input.hin{width:60px;text-align:center;padding:5px 2px;font-size:13px;border-radius:6px}
input.hin.mini{width:44px;padding:2px 1px;font-size:12px}
input.hin.filled{background:#f0fdf4;border-color:#bbf7d0;font-weight:600}
input.hin:disabled{background:#eef2f7;border-color:#e3e8f1;color:#475569;font-weight:600;cursor:not-allowed}
td.cell-tot{font-weight:700;color:#1e2939;font-variant-numeric:tabular-nums;background:#fbfdff}
/* 行锁：锁着的格子不生成输入框，只渲染纯文本——少几千个 input 元素，明显更轻更快 */
table.grid td.ro{color:#334155;font-variant-numeric:tabular-nums;padding:5px 8px}
table.grid td.ro.empty{color:#cbd5e1}
table.grid tr.rowlock td.sl{box-shadow:inset 3px 0 0 #cbd5e1,1px 0 0 var(--line)}
table.grid tr.rowopen td.sl{box-shadow:inset 3px 0 0 #f59e0b,1px 0 0 var(--line);background:#fffdf5}
table.grid tr.rowopen td{background:#fffdf8}
table.grid tr.rowopen td.wk{background:#fdf8ee}
.lockbtn{margin-left:6px;padding:1px 6px;font-size:11px}
/* 未确认：值已经填了，但服务器还没收下 —— 琥珀色标出来，确认后自动恢复 */
input.hin.unconf{border-color:#f59e0b;background:#fffbeb;box-shadow:0 0 0 2px #fef3c7}
table.grid td.unconf{background:#fffbeb;color:#b45309}
.unconfdot{color:#f59e0b;font-size:10px;vertical-align:middle}
tr.unconfrow{background:#fffbeb}
tr.unconfrow td{background:#fffbeb}
tr.unconfrow input,tr.unconfrow select{background:#fffdf5;border-color:#fcd34d}
.lockhint{font-size:11px;color:#94a3b8}
.progress{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.bar{flex:1;min-width:120px;height:8px;background:#e8edf6;border-radius:99px;overflow:hidden}
.bar>i{display:block;height:100%;background:linear-gradient(90deg,#22c55e,#0f9d58);border-radius:99px;transition:width .25s}
.badge{display:inline-block;padding:1px 8px;border-radius:99px;font-size:12px;line-height:19px}
.badge.plain{background:#f1f5f9;color:#64748b}
.badge.act{background:#eef2ff;color:#3730a3}
.badge.pending{background:#fef3c7;color:#92400e}
.badge.approved{background:#dcfce7;color:#166534}
.badge.rejected{background:#fee2e2;color:#991b1b}
.hintbar{background:#f0f7ff;border:1px solid #cfe2ff;border-radius:10px;padding:8px 12px;font-size:12.5px;color:#1e40af;margin-bottom:10px}
.warnbox{background:#fffaf0;border:1px solid #f6dfae;color:#92400e;border-radius:10px;padding:8px 12px;font-size:13px;margin-top:8px}
.lockbox{background:#f8fafc;border:1px solid #e2e8f0;color:#475569;border-radius:10px;padding:8px 12px;font-size:12.5px;margin-bottom:10px}

.filter-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.fg{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:#fbfcfe}
.fg-title{font-size:12px;font-weight:600;color:#475569;margin-bottom:8px}
.ck-list{display:flex;flex-wrap:wrap;gap:8px 16px;max-height:150px;overflow:auto}
.person-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:6px 14px;padding:4px 0}
.person-grid .ck{padding:3px 0}
.summary{background:#f0f7ff;border:1px solid #cfe2ff;border-radius:10px;padding:10px 12px;font-size:13px}
.summary b{color:var(--primary-d)}

.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip-edit{display:inline-flex;align-items:center;gap:6px;background:#f7f9fd;border:1px solid var(--line);
  border-radius:10px;padding:4px 6px 4px 10px}
.chip-edit input{border:1px solid transparent;background:transparent;padding:3px 4px;font-size:13px;border-radius:6px;width:96px}
.chip-edit input:hover{border-color:var(--line);background:#fff}
.chip-edit input:focus{background:#fff;border-color:var(--primary)}
.chip-edit .cnt{font-size:11px;color:var(--muted)}
.x{border:0;background:transparent;color:#c0392b;cursor:pointer;font-size:15px;line-height:1;padding:2px 5px;border-radius:99px}
.x:hover{background:#fee2e2}

.legend{display:flex;flex-wrap:wrap;gap:10px;align-items:center;font-size:12px;color:var(--muted)}
.hbar{display:flex;align-items:center;gap:8px;margin:6px 0;font-size:13px}
.hbar .lbl{width:110px;color:#475569;flex-shrink:0}
.hbar .track{flex:1;height:16px;background:#eef2f8;border-radius:6px;overflow:hidden;min-width:60px}
/* 少了 display:block，span 是行内元素，宽高会被忽略 → 蓝条根本不显示 */
.hbar .fill{display:block;height:100%;border-radius:6px;transform-origin:left;animation:hbarGrow .45s ease-out}
@keyframes hbarGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.hbar .val{width:92px;text-align:right;color:var(--muted);font-variant-numeric:tabular-nums;flex-shrink:0}

.toast{position:fixed;left:50%;bottom:34px;transform:translate(-50%,20px);background:#111827;color:#fff;
  padding:10px 20px;border-radius:10px;font-size:13px;opacity:0;pointer-events:none;transition:.22s;z-index:99;
  max-width:88vw;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.ok{background:#0f9d58}.toast.warn{background:#d97706}.toast.err{background:#dc2626}

.banner{display:none;background:#fffbeb;border:1px solid #fcd34d;color:#92400e;border-radius:10px;
  padding:10px 14px;margin-bottom:14px;font-size:13px;align-items:center;gap:12px;justify-content:space-between}
.banner.show{display:flex}

.logmask{position:fixed;inset:0;background:linear-gradient(150deg,#1e3a8a,#2563eb);display:flex;
  align-items:center;justify-content:center;z-index:200;padding:20px}
.logbox{background:#fff;border-radius:16px;padding:26px 24px;width:100%;max-width:370px;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.logbox h2{font-size:19px;margin-bottom:16px}
.logbox input{width:100%;padding:10px 12px;font-size:15px;margin-bottom:10px}
.logbox .btn{width:100%;padding:10px;font-size:15px;margin-top:4px}
.logerr{color:var(--danger);font-size:12.5px;min-height:18px;margin:8px 0 0}
.logtip{color:var(--muted);font-size:12px;margin:10px 0 0;line-height:1.7}
/* 卡片收纳：点标题行任意位置即可收起/展开，右侧有明确的提示按钮 */
.card-head{cursor:pointer;border-radius:8px}
.card-head:hover{background:#f8fafc}
.card-toggle-hint{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:#64748b;
  border:1px solid var(--line);border-radius:8px;padding:3px 9px;background:#fff;white-space:nowrap;flex-shrink:0}
.card-head:hover .card-toggle-hint{color:#1e40af;border-color:#bfdbfe;background:#f0f7ff}
.card-arrow{font-size:10px;line-height:1}
.card.collapsed > *:not(.card-head){display:none}
.card.collapsed > .card-head{margin-bottom:0;padding-bottom:0;border-bottom:0}
.card.collapsed > .card-head > b{color:#334155}
.rowbar{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-bottom:10px;flex-wrap:wrap}
@media (max-width:760px){
  /* 手机上把人员名单变成"一人一张卡"：表格里全是输入框，
     手指拖在输入框上是不会滚动的，卡片式排版留出大片可拖动区域 */
  .table-wrap{max-height:none}
  table.tbl.stack,table.tbl.stack thead,table.tbl.stack tbody,table.tbl.stack tr,table.tbl.stack td{display:block;width:auto}
  table.tbl.stack thead{display:none}
  table.tbl.stack tr{border-bottom:1px solid var(--line);padding:10px 12px}
  table.tbl.stack tbody tr:hover{background:transparent}
  table.tbl.stack td{border:0;padding:4px 0;display:flex;align-items:center;gap:8px;white-space:normal}
  table.tbl.stack td:before{content:attr(data-l);color:var(--muted);font-size:12px;min-width:56px;flex:none}
  table.tbl.stack td:not([data-l]):before{content:none}
  table.tbl.stack .inp,table.tbl.stack select{flex:1;min-width:0 !important;width:auto}
  table.tbl.stack td.empty{display:block}
}

@media (max-width:640px){
  main{padding:12px 10px 50px}
  .tabs{padding:8px 10px 0;top:auto;position:static}
  .topbar{position:static}
  #markToolbar,#gridToolbar{position:static}
  .identity select{min-width:130px}
  .brand h1{font-size:16px}
}

/* =========================================================
   2026-10 UI 打磨：工时登记 / 月度表 / 批量 / 备份 / 打印
   ========================================================= */
/* 去掉数字输入框的上下小箭头，工时格更干净 */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield}

/* 工时登记：两行工具栏 + 分段状态 */
.mark-top .mark-extra{display:contents}
.mark-more-field{display:none}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:9px;overflow:hidden;background:#fff}
.seg button{border:0;border-right:1px solid var(--line);background:#fff;color:#475569;
  padding:6px 12px;font-size:12px;font-family:inherit;cursor:pointer;white-space:nowrap}
.seg button:last-child{border-right:0}
.seg button.active{background:var(--primary);color:#fff;font-weight:600}
.mark-bottom{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px;margin-top:12px;
  padding-top:12px;border-top:1px dashed var(--line)}
.mark-bottom .field{margin:0}
.mark-bottom .mark-danger{margin-left:auto}

/* 工时登记：三列表 + 行内清除；表格铺满卡片宽度，右侧用「本月合计」把空白填上 */
.mark-grid{table-layout:fixed;width:100%}
.mark-grid tr.grp td.sl{white-space:normal;line-height:1.5}
.mark-grid th:nth-child(1){width:22%}
.mark-grid th:nth-child(2){width:10%}
.mark-grid th:nth-child(3){width:68%}
.mark-grid th.hours-th{text-align:left}
.mark-grid th.hours-th .th-month{float:right;font-weight:400;font-size:12px;color:#94a3b8}
.mark-grid td.hours{text-align:left}
.hours-line{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hours-main{display:inline-flex;align-items:center;gap:8px;min-width:0}
.hours-main .lockhint,.hours-main .unconfhint{display:inline-block;margin:0;white-space:nowrap}
.hour-month{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.hour-wrap{display:inline-flex;align-items:center;gap:8px}
.hour-wrap .hin{width:84px;text-align:center}
.clearh{padding:2px 8px;color:var(--danger);border-color:#f2c3c3;background:#fff}
.clearh:hover{background:#fef2f2}
.lockhint,.unconfhint{display:block;font-size:11px;margin-top:3px}
.unconfhint{color:var(--warn)}

/* 月度表：日期 + 星期两行表头，单元格更紧凑 */
.month-grid th .dnum{display:block;font-size:12px;line-height:1.2}
.month-grid th .dwd{display:block;font-size:10px;font-weight:400;color:#94a3b8;line-height:1.2}
.month-grid td,.month-grid th{padding:6px 4px}

/* 批量登记：底部固定提交条 */
#view-batch.active{padding-bottom:72px}
#view-batch.active .batch-fixedbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:25;
  width:100vw;max-width:100vw;box-sizing:border-box;
  background:#fff;border-top:1px solid var(--line);padding:10px 16px;align-items:center;
  justify-content:space-between;gap:12px;box-shadow:0 -6px 18px rgba(16,24,40,.08)}
.batch-fixedbar{display:none}
.bfb-sum{font-size:13px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}
.bfb-short{display:none}
.batch-fixedbar .btn{flex:none;max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 备份类型徽标 */
.badge.blue{background:#dbeafe;color:#1e40af}
.badge.ok{background:#dcfce7;color:#166534}
.badge.gray{background:#f1f5f9;color:#475569}

/* 人员与设置：别让输入框铺满整行 */
#view-admin .grp-name{max-width:280px}
#view-admin .grp-leader{max-width:180px}

@media (max-width:760px){
  /* 手机上把搜索/组别/类别收进“展开筛选” */
  .mark-top .mark-extra{display:none}
  #markToolbar.more .mark-extra{display:contents}
  .mark-more-field{display:flex}
  .mark-grid{max-width:none;table-layout:auto;width:100%}
  .mark-grid th:nth-child(1),.mark-grid th:nth-child(2),.mark-grid th:nth-child(3){width:auto}
  .hour-month,.mark-grid th.hours-th .th-month{display:none}
  .mark-bottom{gap:10px}
  .mark-bottom{display:grid;grid-template-columns:1fr 1fr;align-items:end}
  .mark-bottom .field{min-width:0}
  .mark-bottom .mark-danger{grid-column:1/-1}
  .mark-bottom .btn{width:100%}
  .mark-bottom .seg{width:100%}
  .mark-bottom .seg button{flex:1}
  #gridToolbar .card-head{flex-wrap:wrap;gap:8px}
  #gridToolbar .grid-export{width:100%}
  #gridToolbar .grid-export .btn{width:100%;white-space:normal;line-height:1.35}
  .bfb-sum{font-size:12px}
  .bfb-long{display:none}
  .bfb-short{display:inline}
  .batch-fixedbar .btn{order:-1;max-width:32vw}
  .batch-fixedbar{padding:8px 10px}
  .btn.xs{padding:6px 10px;font-size:12px;min-height:32px}
  .hin{height:34px;font-size:14px}
}

@media (max-width:640px){
  .topbar{padding:10px 12px;gap:8px}
  .headright{gap:6px}
  .identity label{display:none}
  .identity select{min-width:118px;max-width:170px}
  .logout{padding:5px 10px}
  .mark-grid th:nth-child(1),.mark-grid th:nth-child(2),.mark-grid th:nth-child(3){width:auto}
  .mark-grid th,.mark-grid td{white-space:normal}
  .mark-grid .grp-meta{display:none}
  .mark-bottom .mark-danger{margin-left:0;width:100%}
  .mark-bottom .mark-danger .btn{width:100%}
  .hour-wrap .hin{width:72px}
  .clearh{padding:2px 6px}
}

/* =========================================================
   电脑端：工时登记 / 月度工时表 = 固定高度（只有表格滚，页面不滚）
   以前整页跟着滚，吸顶的工具栏会盖住表头（姓名/类别/工时）和前几行，
   页签也被顶栏压掉一点。这里把两页锁成屏幕高度，表头永远露在上面。
   手机上仍是卡片布局，不加 .fitview。
   ========================================================= */
@media (min-width:761px){
  body.fitview{height:100vh;height:100dvh;overflow:hidden;display:flex;flex-direction:column}
  body.fitview>header.topbar,
  body.fitview>.tabs{flex:0 0 auto}
  body.fitview>.tabs{position:static}
  body.fitview>main{flex:1 1 auto;min-height:0;width:100%;display:flex;flex-direction:column;padding-bottom:14px}
  body.fitview main>.banner{flex:0 0 auto}
  body.fitview #view-mark.active,
  body.fitview #view-grid.active{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;animation:none}
  body.fitview #markToolbar,
  body.fitview #gridToolbar{position:static;flex:0 0 auto;margin-bottom:14px}
  body.fitview #markBody,
  body.fitview #gridBody{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
  body.fitview #markBody>.grid-wrap,
  body.fitview #gridBody>.grid-wrap{flex:1 1 auto;min-height:0;max-height:none;height:auto}
  body.fitview #markBody>.card.empty,
  body.fitview #gridBody>.card.empty{flex:0 0 auto}
}

/* 打印 / 另存 PDF：只保留当前页的数据表 */
@media print{
  .topbar,.tabs,.banner,.toast,.card-toggle-hint,.rowbar,.batch-fixedbar,.btn,.no-print{display:none!important}
  body,body.fitview{background:#fff;color:#111;height:auto!important;overflow:visible!important;display:block!important}
  body.fitview main,body.fitview #markBody,body.fitview #gridBody{display:block!important;height:auto!important;overflow:visible!important}
  main{padding:0;max-width:none}
  .view{display:none!important}
  .view.active{display:block!important}
  .card{box-shadow:none;border:0;padding:0;margin:0 0 12px}
  .card-head{border-bottom:1px solid #ddd;margin-bottom:8px}
  .table-wrap{max-height:none!important;overflow:visible!important}
  table.tbl thead th,table.grid thead th{position:static;background:#fff}
  table.grid tr.grp td{background:#f3f6fa!important}
  @page{margin:12mm}
}
