/* =========================================================
   业务组件补充层（表格 / 表单 / 分页 / 空状态 / 权限页 …）
   style.css 提供设计变量与骨架，这里只补业务组件
   ========================================================= */

/* ---------- 页面标题（与 style.css 统一，收紧间距） ---------- */
.page-head{margin-bottom:18px}
.page-head h2{font-size:19px;font-weight:650;letter-spacing:-.2px}
.page-head .desc{font-size:12.5px;color:var(--muted);margin-top:3px;line-height:1.65}
.page-head .acts{display:flex;gap:8px;flex-wrap:wrap}

/* ---------- 表格 ---------- */
.tw{overflow-x:auto;border-radius:12px}
table.tb{width:100%;border-collapse:separate;border-spacing:0;font-size:13px;min-width:100%}
table.tb thead th{position:sticky;top:0;z-index:2;background:#f8fafc;text-align:left;font-weight:600;
  font-size:11.5px;color:var(--muted);letter-spacing:.3px;padding:11px 14px;
  border-bottom:1px solid var(--border);white-space:nowrap}
table.tb tbody td{padding:12px 14px;border-bottom:1px solid var(--border-2);vertical-align:middle}
table.tb tbody tr:last-child td{border-bottom:none}
table.tb tbody tr{transition:background .12s}
table.tb tbody tr:hover td{background:#f9fbfe}
table.tb td.num,table.tb th.num{text-align:right;font-variant-numeric:tabular-nums}
table.tb td.mid,table.tb th.mid{text-align:center}
table.tb .strong{font-weight:600;color:var(--text)}
table.tb .sub{font-size:11.5px;color:var(--faint);margin-top:2px}
table.tb .ops{display:flex;gap:6px;white-space:nowrap;justify-content:flex-end}
.tb-link{color:var(--brand);font-weight:500;cursor:pointer}
.tb-link:hover{text-decoration:underline}
.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}

/* ---------- 表单 ---------- */
.fgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px}
.fgrid.one{grid-template-columns:1fr}
.fgrid .full{grid-column:1 / -1}
.fitem{min-width:0}
.fitem > label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px;font-weight:500}
.fitem > label .req{color:var(--red);margin-left:2px}
.fitem .inp{width:100%}
.fitem .tip{font-size:11.5px;color:var(--faint);margin-top:5px;line-height:1.6}
.fitem .tip.warn{color:var(--amber)}
textarea.inp{min-height:96px;padding:10px 12px;line-height:1.75;resize:vertical}
select.inp{cursor:pointer;background-image:none}
.inp-err{border-color:var(--red) !important;background:#fffafa}

/* 复选组 */
.chk-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.chk{display:flex;align-items:center;gap:8px;padding:9px 11px;border:1px solid var(--border);border-radius:8px;
  cursor:pointer;font-size:12.5px;transition:.15s;background:#fff;user-select:none}
.chk:hover{border-color:#cfd9ea;background:#fafcff}
.chk.on{border-color:#bfd4fb;background:var(--brand-l);color:var(--brand-d);font-weight:500}
.chk input{display:none}
.chk .box{width:15px;height:15px;border-radius:4px;border:1.5px solid #c6cede;flex-shrink:0;position:relative;background:#fff}
.chk.on .box{background:var(--brand);border-color:var(--brand)}
.chk.on .box::after{content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}

/* ---------- 分段 / 筛选 ---------- */
.seg{display:inline-flex;background:#eef1f6;border-radius:9px;padding:3px;gap:2px}
.seg button{padding:6px 14px;border-radius:7px;font-size:12.5px;color:var(--muted);transition:.15s;white-space:nowrap}
.seg button.on{background:#fff;color:var(--brand-d);font-weight:600;box-shadow:0 1px 2px rgba(16,24,40,.08)}
.seg-sm{padding:2px}
.seg-sm button{padding:4px 9px;font-size:11.5px;border-radius:6px}
.filters .inp{height:35px;border-radius:8px}

/* ---------- 首页工时排名 ---------- */
.rk-body{padding:6px 4px 10px}
.rk-list{display:flex;flex-direction:column}
.rk-row{display:flex;align-items:flex-start;gap:9px;padding:7px 10px;border-radius:8px;transition:background .15s}
.rk-row:hover{background:#f7f9fd}
.rk-row.me{background:var(--brand-l)}
.rk-no{flex:0 0 20px;height:20px;line-height:20px;text-align:center;border-radius:6px;
  font-size:11.5px;font-weight:700;color:var(--faint);background:#f1f3f8;margin-top:1px}
.rk-no.n1{background:#fff3d6;color:#b8860b}
.rk-no.n2{background:#eef1f6;color:#6b7585}
.rk-no.n3{background:#fbeade;color:#a9663a}
.rk-main{flex:1;min-width:0}
.rk-line{display:flex;align-items:baseline;gap:6px}
.rk-name{font-size:13px;font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rk-me{font-style:normal;font-size:10px;font-weight:600;color:#fff;background:var(--brand);
  border-radius:4px;padding:1px 4px;margin-left:4px;vertical-align:1px}
.rk-h{margin-left:auto;font-size:12.5px;font-weight:700;color:var(--brand-d);font-variant-numeric:tabular-nums}
.rk-bar{height:4px;border-radius:3px;background:#eef1f6;overflow:hidden;margin-top:5px}
.rk-bar i{display:block;height:100%;border-radius:3px;background:var(--brand)}
.rk-row.me .rk-bar i{background:#f0a020}
.rk-pos{font-size:11px;color:var(--faint);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rk-foot{padding:9px 12px 2px;font-size:11.5px;color:var(--muted);border-top:1px solid var(--border-2);margin-top:6px}

/* ---------- 空状态 / 加载 ---------- */
.empty-state{padding:56px 20px;text-align:center;color:var(--faint)}
.empty-state .ico{font-size:30px;opacity:.5;margin-bottom:10px}
.empty-state .t{font-size:13.5px;color:var(--muted);font-weight:500}
.empty-state .s{font-size:12px;margin-top:5px}
.loading{padding:60px 0;display:flex;flex-direction:column;align-items:center;gap:12px;color:var(--faint);font-size:12.5px}
.spin{width:24px;height:24px;border:2.5px solid #e4e9f2;border-top-color:var(--brand);border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.skel{background:linear-gradient(90deg,#f1f4f9 25%,#f7f9fc 37%,#f1f4f9 63%);background-size:400% 100%;
  animation:sk 1.3s ease infinite;border-radius:8px}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}

/* ---------- 分页 ---------- */
.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;
  font-size:12.5px;color:var(--muted);flex-wrap:wrap}
.pager .pgs{display:flex;gap:5px;align-items:center}
.pager .pgs button{min-width:31px;height:31px;padding:0 9px;border-radius:7px;border:1px solid var(--border);
  background:#fff;font-size:12.5px;color:var(--muted);transition:.14s}
.pager .pgs button:hover:not(:disabled){border-color:#c8d6ea;color:var(--brand-d)}
.pager .pgs button.on{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.pager .pgs button:disabled{opacity:.4;cursor:not-allowed}

/* ---------- 标签 ---------- */
.tg{display:inline-flex;align-items:center;gap:4px;padding:2px 9px;border-radius:6px;font-size:11.5px;
  font-weight:500;line-height:1.7;white-space:nowrap}
.tg-gray{background:#f1f4f8;color:#5c6879}
.tg-blue{background:var(--brand-l);color:var(--brand-d)}
.tg-green{background:var(--green-l);color:#0b7f59}
.tg-red{background:var(--red-l);color:#c33b40}
.tg-amber{background:var(--amber-l);color:#a8700f}
.tg-purple{background:var(--purple-l);color:#6244db}

/* ---------- 进度条 ---------- */
.pbar{height:6px;border-radius:4px;background:#eef1f6;overflow:hidden;min-width:60px}
.pbar > i{display:block;height:100%;border-radius:4px;background:var(--brand);transition:width .3s}
.pbar.done > i{background:var(--green)}

/* ---------- 提示条 ---------- */
.note-banner{display:flex;gap:10px;padding:12px 14px;border-radius:9px;font-size:12.5px;line-height:1.7;
  margin-bottom:16px;align-items:flex-start}
.note-banner.info{background:var(--brand-l);color:#1e40af}
.note-banner.warn{background:var(--amber-l);color:#8f6009}
.note-banner.danger{background:var(--red-l);color:#a02c26}

/* ---------- 详情描述表 ---------- */
.dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1px;background:var(--border-2);
  border-radius:10px;overflow:hidden;border:1px solid var(--border-2)}
.dl > div{background:#fff;padding:13px 15px}
.dl .k{font-size:11.5px;color:var(--faint);margin-bottom:4px}
.dl .v{font-size:13.5px;font-weight:500;word-break:break-all}

/* ---------- 日常计时：快捷选项 ---------- */
.tl-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.tl-chips .btn{padding:5px 11px;font-size:12px;border-radius:999px;line-height:1.5}
.tl-chips .btn:hover{border-color:#c7d9fb;color:var(--brand);background:var(--brand-l)}

/* ---------- 岗位工艺：列表预览 ---------- */
.craft-row{padding:14px 16px;border-top:1px solid var(--border-2);cursor:pointer;transition:background .16s}
.craft-row:hover{background:var(--brand-l)}
.craft-row:hover .craft-more{color:var(--brand-d);text-decoration:underline}
.craft-more{margin-left:auto;font-size:12.5px;color:var(--brand);white-space:nowrap;transition:color .16s}
.craft-brief{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  margin-top:8px;font-size:13px;line-height:1.9;color:#4b5563}
.craft-thumb{position:relative;width:64px;height:54px;border-radius:8px;overflow:hidden;
  border:1px solid var(--border-2);background:#f6f8fb;flex:0 0 auto}
.craft-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.craft-thumb-n{display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:54px;
  border-radius:8px;border:1px dashed var(--border-2);background:#fafbfd;font-size:12px;color:var(--muted)}
.craft-dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:12px 14px;
  background:#f7f9fc;border-radius:10px;margin-bottom:16px}
.craft-dl .k{font-size:11.5px;color:var(--faint);margin-bottom:3px}
.craft-dl .v{font-size:13.5px;font-weight:600;color:var(--text)}
.craft-sop{font-size:13.5px;line-height:2;white-space:pre-wrap;color:#374151;background:#fff;
  border:1px solid var(--border-2);border-radius:10px;padding:13px 15px}
.craft-figs{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}
.craft-figs img{width:150px;height:126px;object-fit:cover;border-radius:9px;border:1px solid var(--border-2);cursor:zoom-in}

/* ---------- 移动端 ---------- */
@media (max-width:820px){
  .lg-card{min-height:auto;max-width:460px}
  .lg-left{display:none}
  .lg-right{padding:36px 26px}
  .fgrid{grid-template-columns:1fr}
  .page-head h2{font-size:17px}
  table.tb{font-size:12.5px}
  table.tb thead th,table.tb tbody td{padding:10px 11px}
}

/* ============ 建单弹窗：工序勾选 ============ */
.proc-pick{max-height:174px;overflow:auto;border:1px solid var(--border);border-radius:9px;padding:6px;background:#fbfcfe}
.proc-pick::-webkit-scrollbar{width:6px}
.proc-pick::-webkit-scrollbar-thumb{background:#d7dee8;border-radius:3px}
.proc-load{padding:12px 10px;font-size:12.5px;color:var(--faint);text-align:center}
.proc-load.warn{color:var(--red)}
.proc-item{display:flex;align-items:center;gap:8px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:12.5px}
.proc-item:hover{background:#eef3fb}
.proc-item input[type=checkbox]{width:15px;height:15px;margin:0;accent-color:var(--brand);cursor:pointer;flex:0 0 auto}
.proc-seq{flex:0 0 20px;height:20px;line-height:20px;text-align:center;border-radius:6px;background:#eef1f6;
  color:var(--faint);font-size:11px;font-weight:600}
.proc-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.proc-pos{flex:0 0 auto;font-size:11px;color:var(--faint);background:#f1f4f9;border-radius:5px;padding:1px 6px}
.proc-std{flex:0 0 34px;text-align:right;font-size:11px;color:var(--faint);font-variant-numeric:tabular-nums}
.proc-cnt{margin-left:8px;font-size:11.5px;font-weight:400;color:var(--muted)}
.proc-cnt.part{color:var(--amber)}
.proc-cnt.bad{color:var(--red)}
.proc-all{margin-left:auto;font-size:11.5px;font-weight:400;color:var(--brand);cursor:pointer}
.proc-all:hover{text-decoration:underline}

/* ---------- 权限管理：按页面授权 + 查看范围 ---------- */
.pm-pick{display:flex;gap:18px;align-items:flex-end;flex-wrap:wrap}
.pm-pick .fitem{max-width:340px;margin:0;flex:1 1 260px}
.pm-empinfo{display:flex;gap:6px;flex-wrap:wrap;padding-bottom:9px}
.pm-pill{font-size:11.5px;color:var(--muted);background:#f3f5f9;border-radius:20px;padding:4px 11px;white-space:nowrap}
.pm-pill.warn{background:var(--amber-l);color:#a1680a}
.pm-chk{padding:10px 12px;gap:9px}
.pm-chk-t{flex:1;min-width:0;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pm-scope{border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:10px;transition:.15s}
.pm-scope:last-child{margin-bottom:0}
.pm-scope.off{background:#fbfcfd}
.pm-scope.off .pm-scope-name{color:var(--muted)}
.pm-scope.off .seg{opacity:.55}
.pm-scope-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.pm-scope-name{font-size:13px;font-weight:600;display:flex;align-items:center;gap:8px}
.pm-tag{font-size:10.5px;font-weight:500;color:var(--faint);background:#f1f3f8;border-radius:6px;padding:2px 7px}
.pm-pos{margin-top:11px}
.pm-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}

/* ---------- 工单操作日志 ---------- */
.log-list{display:flex;flex-direction:column}
.log-row{display:grid;grid-template-columns:132px 84px 1fr 84px;gap:12px;align-items:baseline;
  padding:9px 16px;font-size:12.5px;border-top:1px solid var(--border-2)}
.log-row:first-child{border-top:none}
.log-t{color:var(--faint);white-space:nowrap;font-variant-numeric:tabular-nums}
.log-a{color:var(--text);font-weight:600;white-space:nowrap}
.log-d{color:var(--muted);line-height:1.6;word-break:break-word}
.log-o{color:var(--faint);text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- 权限管理：分组行 ---------- */
.pm-grp{display:grid;grid-template-columns:104px 1fr;gap:14px;align-items:start;
  padding:13px 0;border-top:1px solid var(--border-2)}
.pm-grp:first-child{border-top:none;padding-top:2px}
.pm-grp-t{font-size:12.5px;font-weight:600;color:var(--text);padding-top:9px;display:flex;align-items:center;gap:6px}
.pm-grp-n{font-size:10.5px;font-weight:500;color:var(--faint);background:#f1f3f8;border-radius:20px;padding:1px 7px}
.pm-grp .chk-grid{grid-template-columns:repeat(auto-fill,minmax(158px,1fr))}
.pm-scope-b{font-size:10.5px;font-weight:500;color:var(--brand-d);background:#eaf1ff;
  border-radius:20px;padding:1px 7px;white-space:nowrap;flex-shrink:0}
.pm-scope-b.self{background:#f1f3f8;color:var(--muted)}

/* 上线日志：5 个 KPI */
.kpi-row.k5{grid-template-columns:repeat(5,1fr)}
@media (max-width:1400px){ .kpi-row.k5{grid-template-columns:repeat(3,1fr)} }
@media (max-width:900px){ .kpi-row.k5{grid-template-columns:repeat(2,1fr)} }

/* 异常 IP / 黑名单 */
.bl-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bl-head .inp{height:34px}
.bl-ip{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12.5px}
.bl-muted{color:var(--faint);font-size:11.5px}

/* ---------- 表格里的输入控件：定高后文字不再被切一半 ---------- */
/* 之前在表格里写 style="height:32px"，但 .inp 上下各有 9px padding，
   内容区只剩 12px，中文字会被裁掉上下两部分。这里统一压掉上下留白。 */
.inp[style*="height:32px"],
.inp[style*="height:34px"],
.inp[style*="height:36px"]{
  padding-top:0;
  padding-bottom:0;
  line-height:1.5;
}
table.tb .inp{padding-left:9px;padding-right:9px}
table.tb select.inp{padding-right:24px;background-position:right 8px center}

/* 表单型表格：列多、控件多，收密一点才塞得进弹窗 */
table.tb.tb-form thead th{padding:9px 8px;font-size:11px;letter-spacing:0}
table.tb.tb-form tbody td{padding:6px 8px}
table.tb.tb-form .inp{height:32px;padding:0 9px;font-size:12.5px;border-radius:7px}
table.tb.tb-form select.inp{padding-right:22px;background-position:right 7px center}
table.tb.tb-form .btn-sm{padding:4px 8px;line-height:1.4}
table.tb.tb-form td .tag{transform:translateY(1px)}

/* ---------- 我的任务：日常计时（常驻任务） ---------- */
/* 没有工单的活（保养/等料/5S/培训）也是「今天的任务」，
   做成任务列表顶上的一件常驻任务，点「报工」直接填时间。 */
.daily-card{
  display:flex;
  align-items:center;
  gap:16px;
  padding:15px 18px;
  margin-bottom:16px;
  border-color:#dbe6fb;
  background:linear-gradient(180deg,#f7faff,#fff 62%);
}
.dc-ico{
  width:44px;height:44px;flex-shrink:0;
  border-radius:12px;
  background:var(--brand-l);
  color:var(--brand);
  display:flex;align-items:center;justify-content:center;
}
.dc-ico svg{
  width:22px;height:22px;
  fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
}
.dc-main{flex:1;min-width:0}
.dc-t{
  display:flex;align-items:center;gap:8px;
  font-size:14.5px;font-weight:600;color:var(--text);
  line-height:1.4;
}
.dc-s{font-size:12.5px;color:var(--muted);margin-top:3px;line-height:1.55}
.dc-num{text-align:right;min-width:66px;flex-shrink:0}
.dc-num b{
  display:block;
  font-size:19px;font-weight:650;color:var(--text);
  line-height:1.25;
  font-variant-numeric:tabular-nums;
}
.dc-num span{font-size:11.5px;color:var(--faint)}
.dc-acts{display:flex;align-items:center;gap:8px;flex-shrink:0}

@media (max-width:820px){
  .daily-card{flex-wrap:wrap;gap:12px}
  .dc-num{text-align:left;min-width:56px}
  .dc-acts{width:100%;justify-content:flex-end}
}

/* ---------- 可搜索下拉（输入名称 + 滚动点选） ---------- */
/* 浮层挂在 body 上，fixed 定位，弹窗里滚表单也不会被裁 */
.cbx{position:relative}
.cbx-box{position:relative}
.cbx-inp{padding-right:34px}
.cbx-mag{
  position:absolute;right:11px;top:50%;transform:translateY(-50%);
  width:14px;height:14px;pointer-events:none;
  fill:none;stroke:var(--faint);stroke-width:1.9;stroke-linecap:round;
}
.cbx-inp:focus ~ .cbx-mag{stroke:var(--brand)}
.cbx-pop{
  position:fixed;z-index:400;
  background:#fff;border:1px solid var(--border);border-radius:10px;
  box-shadow:var(--sh-pop);overflow:hidden;
  display:flex;flex-direction:column;
  animation:cbxIn .12s ease-out;
}
@keyframes cbxIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.cbx-list{
  max-height:252px;overflow-y:auto;
  padding:5px;display:flex;flex-direction:column;gap:2px;
  -webkit-overflow-scrolling:touch;
}
.cbx-item{
  display:flex;flex-direction:column;align-items:flex-start;gap:1px;
  width:100%;text-align:left;padding:8px 10px;border-radius:7px;
  border:1px solid transparent;background:transparent;
  font-family:inherit;transition:background .12s,border-color .12s;
}
.cbx-item:hover{background:var(--brand-l)}
.cbx-item.on{background:var(--brand-l);border-color:#c7d7f5}
.cbx-t{font-size:13px;font-weight:600;color:var(--text);line-height:1.4}
.cbx-s{font-size:11.5px;color:var(--muted);line-height:1.4;
  font-variant-numeric:tabular-nums}
.cbx-item.warn .cbx-s{color:var(--amber)}
.cbx-item.warn .cbx-t{color:var(--text)}
.cbx-tip{padding:14px 12px;text-align:center;font-size:12.5px;color:var(--faint)}
.cbx-tip.err{color:var(--red)}
.cbx-hint{
  border-top:1px solid var(--border-2);background:#fafbfd;
  padding:6px 10px;font-size:11px;color:var(--faint);line-height:1.5;
}

/* ---------- 常驻任务：无工单报工 ---------- */
/* 和「日常计时」并排的另一张常驻卡：开不出工单的活按产品+岗位工序记件数。
   用琥珀色区分——蓝卡是工时，黄卡是件数，扫一眼就知道点哪张。 */
.dc-free{
  border-color:#f2e3c4;
  background:linear-gradient(180deg,#fffdf7,#fff 62%);
}
.dc-ico.free{
  background:#fdf3e0;
  color:#b7791f;
}

/* 选产品：搜索框下面直接列卡片，点一下就选中 */
.fr-plist{
  margin-top:9px;
  max-height:232px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:2px;
}
.fr-pitem{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  width:100%;
  text-align:left;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:9px;
  background:#fff;
  cursor:pointer;
  font-family:inherit;
  transition:border-color .15s,background .15s;
}
.fr-pitem:hover{border-color:var(--brand);background:var(--brand-l)}
.fr-pn{font-size:13.5px;font-weight:600;color:var(--text);line-height:1.4}
.fr-pm{font-size:11.5px;color:var(--muted);line-height:1.4}
.fr-no{color:var(--amber);font-weight:600}

/* 已选产品：chip + 换一个 */
.fr-picked{
  margin-top:10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:9px 12px;
  border-radius:9px;
  background:var(--brand-l);
  border:1px solid #d7e3fb;
}
.fr-pk{font-size:13.5px;font-weight:600;color:var(--brand-d)}

/* 工序：一行一道，带标准工时与单价 */
.fr-procs{display:flex;flex-direction:column;gap:7px}
.fr-proc{
  display:flex;align-items:center;gap:10px;
  width:100%;text-align:left;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:9px;
  background:#fff;
  cursor:pointer;
  font-family:inherit;
  transition:border-color .15s,background .15s;
}
.fr-proc:hover{border-color:#c7d7f5}
.fr-proc.on{border-color:var(--brand);background:var(--brand-l);box-shadow:0 0 0 1px var(--brand) inset}
.fr-seq{
  flex-shrink:0;
  width:22px;height:22px;
  display:flex;align-items:center;justify-content:center;
  border-radius:6px;
  background:#f1f4f9;
  font-size:11.5px;font-weight:650;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.fr-proc.on .fr-seq{background:var(--brand);color:#fff}
.fr-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.fr-info b{font-size:13.5px;font-weight:600;color:var(--text);line-height:1.35}
.fr-meta{font-size:11.5px;color:var(--muted);line-height:1.4}

/* 边填边算 */
.fr-calc{
  display:flex;align-items:center;flex-wrap:wrap;gap:14px;
  padding:10px 13px;
  border-radius:9px;
  background:#f8fafc;
  border:1px solid var(--border-2);
}
.fr-ci{font-size:12.5px;color:var(--muted)}
.fr-ci b{font-size:15px;font-weight:650;color:var(--text);font-variant-numeric:tabular-nums;margin-left:2px}
.fr-calc-n{flex-basis:100%;font-size:11.5px;color:var(--faint)}

@media (max-width:820px){
  .fr-plist{max-height:200px}
  .fr-calc{gap:10px}
}

/* v44：开单弹窗「完工自动入库」勾选项 */
.ck-line{display:inline-flex;align-items:center;gap:9px;padding:9px 12px;border-radius:9px;
  background:#f4f7fc;border:1px solid #e6ecf6;cursor:pointer;font-size:13px;color:var(--text)}
.ck-line:hover{background:#eef3fb}
.ck-line input[type=checkbox]{width:16px;height:16px;margin:0;accent-color:var(--brand);cursor:pointer}

/* =========================================================
   v45 · 手机端（H5）重做 —— 与小程序同一套「车间深蓝」语言
   ---------------------------------------------------------
   1. 先修「卡文字」：.note-banner 原来是 display:flex，里面却是
      纯文本 + <b>，浏览器会把每段文本当成独立的 flex item，
      手机上就被挤成「两字一列」。改成 block，桌面端也一起修好。
   2. 顶栏 / 底部导航 / 卡片 / KPI / 筛选条统一重排
   3. 只在 <=820px 生效，桌面端一律不动
   ========================================================= */

/* ---- 修卡文字：flex 容器里的裸文本会被拆成多个 item ---- */
.note-banner {
  display: block;
  word-break: normal;
  overflow-wrap: break-word;
}
.note-banner b { font-weight: 600; }

@media (max-width: 820px) {
  /* ---------- 页面底 ---------- */
  body {
    background: #f4f6fb;
  }
  .content {
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom));
    background:
      radial-gradient(120% 46% at 50% 0%, rgba(37, 99, 235, 0.08) 0%, rgba(244, 246, 251, 0) 62%),
      #f4f6fb;
  }

  /* ---------- 顶栏：深海军蓝 ---------- */
  .topbar {
    height: 56px;
    padding: 0 12px;
    background: linear-gradient(150deg, #0d1936 0%, #1b3a86 62%, #2a5be0 100%);
    border-bottom: none;
    box-shadow: 0 8px 22px rgba(16, 32, 84, 0.22);
  }
  .topbar .brand-mark {
    width: 30px; height: 30px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    border-radius: 9px;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
  }
  .tb-title { color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px; }
  .tb-user .avatar {
    width: 28px; height: 28px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.26);
  }
  .tb-logout {
    color: rgba(255, 255, 255, 0.94);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    font-size: 12px;
    padding: 6px 9px;
  }
  .tb-logout:active { background: rgba(255, 255, 255, 0.22); }

  /* ---------- 页头 ---------- */
  .page-head { margin-bottom: 12px; }
  .page-head .acts, .page-head .head-actions { justify-content: flex-end; }
  .page-head .acts .btn, .page-head .head-actions .btn { flex: 0 0 auto; min-width: 92px; }
  .page-head h2 { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
  .page-head .desc { font-size: 12px; color: #6b7690; line-height: 1.55; }

  /* ---------- 卡片 ---------- */
  .card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(16, 26, 51, 0.06);
    margin-bottom: 12px;
  }
  .card-head { padding: 13px 14px; border-bottom: 1px solid #f1f4f9; }
  .card-head h3 { font-size: 14px; font-weight: 700; }

  /* ---------- KPI ---------- */
  .kpi-row { gap: 8px; }
  .kpi {
    padding: 13px 13px 11px;
    border-radius: 13px;
    border: none;
    box-shadow: 0 6px 18px rgba(16, 26, 51, 0.05);
  }
  .kpi .lab { font-size: 11.5px; color: #6b7690; }
  .kpi .val { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .kpi .note { font-size: 10.5px; color: #98a2b3; }

  /* ---------- 筛选条：两列网格，不许再把控件挤成一条缝 ---------- */
  .filters {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
  }
  .filters .inp,
  .filters select,
  .filters input {
    width: 100% !important;
    min-width: 0;
    max-width: none;
    height: 40px;
    background: #fff;
    border: 1px solid #e7ebf1;
    border-radius: 11px;
    font-size: 13px;
    padding: 0 12px;
    box-shadow: 0 2px 8px rgba(16, 26, 51, 0.04);
  }
  /* 文本类筛选（搜索框）独占一行，别只占半格留个空洞 */
  .filters .inp:not([type="date"]):not(select) { grid-column: 1 / -1; }
  /* 「至」这类分隔文字在窄屏上是噪音，日期并排已经能看懂 */
  .filters > span:not([id]) { display: none; }
  .filters .seg,
  .filters .tabs {
    grid-column: 1 / -1;
    display: flex;
  }
  .filters .seg button { flex: 1; }
  .filters > .btn { grid-column: 1 / -1; width: 100%; }
  .filters > span[id] { display: contents; }

  /* ---------- 表格：卡内横滑，别撑破卡片 ---------- */
  .card-body { padding: 12px; }
  table { font-size: 12.5px; }
  thead th { background: #f7f9fd; }

  /* ---------- 底部导航：悬浮胶囊 ---------- */
  .mtab {
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(16, 26, 51, 0.14);
    padding-bottom: 0;
    backdrop-filter: blur(12px);
  }
  .mtab-in { height: 58px; }
  .mtab-item { font-size: 10px; color: #8a94a8; gap: 3px; }
  .mtab-item .mi {
    width: 34px; height: 26px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
  }
  .mtab-item svg { width: 19px; height: 19px; }
  .mtab-item.on { color: #2563eb; font-weight: 700; }
  .mtab-item.on .mi {
    background: linear-gradient(160deg, #e9f0ff, #d8e5ff);
  }
  .mtab-item.on::after { display: none; }

  /* ---------- 弹层 ---------- */
  .modal { border-radius: 18px 18px 0 0; }
  .m-head { border-bottom: 1px solid #f1f4f9; }

  /* ---------- 按钮 ---------- */
  .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #4f86f7 100%);
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    border-radius: 11px;
  }

  /* ---------- 提示条 ---------- */
  .note-banner {
    font-size: 12.5px;
    line-height: 1.65;
    padding: 11px 13px;
    border-radius: 11px;
  }
}

/* =========================================================
   v50 · 手机端（H5）版式重排 —— 解决"不协调"
   ---------------------------------------------------------
   截图里三个硬伤：
   1. 顶栏叠了两层（浏览器标题 + 平台名），高度吃掉一截
   2. 页头说明文字换行成两行，右边的按钮被挤到下一行右边，左右不对齐
   3. 常驻任务卡：左图标 + 中间三段字换行 + 右边两个大数字 + 底下一排按钮，
      四个区块挤在一格里，视线没有落点
   改法：顶栏只留一行；页头标题与按钮同一行、说明压成一行省略；
   常驻卡改成"图标 + 标题/说明 → 小数字条 → 按钮行"的三段式，间距统一 10px
   ========================================================= */
@media (max-width: 820px) {

  /* ---------- 顶栏：一行，去掉和浏览器标题重复的平台名 ---------- */
  .topbar { height: 50px; padding: 0 10px; }
  .tb-left { gap: 8px; }
  .tb-title { display: none; }
  .topbar .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
  .tb-user .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
  .tb-logout { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; }
  #pwdBtn { display: none; }        /* 改密码在「我的」里也能改，手机上不占位 */

  /* ---------- 页头：标题 + 按钮同行，说明一行省略 ---------- */
  .page-head {
    display: flex; align-items: center; flex-wrap: nowrap;
    gap: 10px; margin-bottom: 10px;
  }
  .page-head > div:first-child { flex: 1; min-width: 0; }
  .page-head h2 { font-size: 17px; font-weight: 700; line-height: 1.3; }
  .page-head .desc {
    font-size: 11px; color: #93a1b1; margin-top: 2px; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .page-head .acts, .page-head .head-actions {
    width: auto; flex: 0 0 auto; justify-content: flex-end; flex-wrap: nowrap;
  }
  .page-head .acts .btn, .page-head .head-actions .btn {
    min-width: 0; height: 30px; padding: 0 12px; font-size: 12px; border-radius: 9px;
  }

  /* ---------- 分段控件：整行三等分，选中实心 ---------- */
  .filters .seg {
    display: flex; width: 100%; gap: 3px;
    background: #e8f4fd; border-radius: 11px; padding: 3px;
  }
  .seg button, .filters .seg button {
    flex: 1; text-align: center; padding: 8px 0; font-size: 12.5px;
    border-radius: 9px; color: #5c7d90;
  }
  .seg button.on {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: #fff; font-weight: 600;
    box-shadow: 0 6px 14px rgba(14, 165, 233, 0.26);
  }
  /* 筛选里的提示小字独占一行，不要和分段挤在一排 */
  .filters > span[id] { grid-column: 1 / -1; font-size: 11.5px; }

  /* ---------- 常驻任务卡：三段式 ---------- */
  .daily-card {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 10px;
    padding: 12px 12px 10px;
    margin-bottom: 10px;
    border-radius: 14px;
    border-color: #dceefb;
    background: linear-gradient(180deg, #f6fbff, #fff 60%);
  }
  .dc-ico {
    width: 36px; height: 36px; border-radius: 11px;
    background: #e0f2fe; color: #0284c7;
  }
  .dc-ico svg { width: 18px; height: 18px; }
  .dc-main { flex: 1 1 auto; min-width: 0; }
  .dc-t { font-size: 14px; gap: 6px; }
  .dc-t .tg { font-size: 9.5px; padding: 1px 5px; }
  .dc-s {
    font-size: 11.5px; line-height: 1.5; margin-top: 2px; color: #7b8a99;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }

  /* 数字：从右侧两大块改成一行小标签，视线有落点 */
  .dc-num {
    flex: 0 0 auto; min-width: 0;
    display: inline-flex; align-items: baseline; gap: 3px;
    background: #f2f9ff; border-radius: 8px; padding: 4px 8px;
    text-align: left;
  }
  .dc-num b { font-size: 15px; display: inline; line-height: 1; }
  .dc-num span { font-size: 10.5px; color: #8fa3b3; }

  .dc-acts {
    flex: 1 0 100%; width: 100%;
    justify-content: flex-end; gap: 6px; margin-top: 2px;
  }
  .dc-acts .btn { height: 30px; padding: 0 13px; font-size: 12px; border-radius: 9px; }

  /* ---------- 卡片与留白统一 ---------- */
  .card { border-radius: 14px; margin-bottom: 10px; }
  .card-body { padding: 12px; }
  .content { padding: 10px 10px calc(96px + env(safe-area-inset-bottom)); }
  .load-more, .pager { font-size: 11.5px; }
}

/* v50.1 手机上页头必须一行：前面的规则里有 width:100%，这里用 !important 压掉 */
@media (max-width: 820px) {
  .page-head { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; }
  .page-head > div:first-child { flex: 1 1 auto !important; min-width: 0 !important; }
  .page-head .acts, .page-head .head-actions {
    width: auto !important; flex: 0 0 auto !important; flex-wrap: nowrap !important;
    margin-left: auto;
  }
  .page-head .desc { max-width: 100%; }

  /* 常驻卡底部收紧，别留一大块空 */
  .daily-card { padding: 12px 12px 8px; }
  .dc-acts { margin-top: 0; padding-top: 2px; }
  .dc-num { padding: 3px 7px; }
}

/* v50.2 页头用 grid 兜底：flex 在"说明很长 + 按钮"时仍可能换行，grid 1fr auto 一定一行 */
@media (max-width: 820px) {
  .page-head {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
  }
  .page-head > div:first-child { min-width: 0; overflow: hidden; }
  .page-head .acts, .page-head .head-actions { margin: 0; }
  /* 空状态别撑太高，手机上一屏只有 2~3 张卡 */
  .empty-state { min-height: 132px; padding: 22px 12px; }
}

/* v50.3 常驻卡收成两行：第一行 图标+标题说明，第二行 数字（左）+ 按钮（右） */
@media (max-width: 820px) {
  .dc-acts {
    flex: 0 0 auto; width: auto; margin-left: auto; padding-top: 0;
  }
  .daily-card { padding: 11px 12px 10px; }
  .dc-num { background: #f4faff; }
}

/* =========================================================
   v50.4 · 手机端底部导航自适应
   ---------------------------------------------------------
   两个问题：
   1. .mtab-in 是 repeat(5,1fr) 的网格，但底部项是按权限动态显示的
      （普通员工只有 概览/任务/更多 3 项）→ 3 项挤在前 3 列，右边空两格，
      整条看起来偏左、重心不对
   2. 平板/折叠屏上通栏铺满不好看，宽度要收住并居中
   改法：flex 等分（显示几项就分几份）+ 最大宽度 + 安全区
   ========================================================= */
@media (max-width: 820px) {
  .mtab {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 460px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding-bottom: 0;
  }
  .mtab-in {
    display: flex;
    grid-template-columns: none;
    height: 56px;
  }
  .mtab-item {
    flex: 1 1 0;
    min-width: 0;
    padding-bottom: 2px;
  }
  .mtab-item.on::after { display: none; }
  /* 内容底部留白跟着底栏实际高度（56 + 8 + 安全区）走 */
  .content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* 底部弹层：安全区留白（有的页面写死了 40rpx，这里统一兜底） */
@media (max-width: 820px) {
  .sheet { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sheet-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* =========================================================
   强制修改初始密码（PC + 手机浏览器同一套）
   没有关闭按钮：改完才放行，或者自己退出登录
   ========================================================= */
.fpwd {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(9, 20, 38, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.fpwd-card {
  width: 100%; max-width: 360px;
  background: #fff; border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(9, 20, 38, 0.32);
}
.fpwd-card h3 { font-size: 16.5px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.fpwd-tip { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.fpwd-tip b { color: #b7791f; }
.fpwd-inp {
  width: 100%; height: 40px; margin-bottom: 10px;
  padding: 0 12px; font-size: 14px;
  border: 1px solid #dfe7f1; border-radius: 10px; background: #f8fbff;
  box-sizing: border-box;
}
.fpwd-inp:focus { outline: none; border-color: var(--brand); background: #fff; }
.fpwd-err { min-height: 16px; font-size: 12px; color: #c0392b; margin-bottom: 6px; }
.fpwd-btn { width: 100%; height: 40px; border-radius: 10px; }
.fpwd-out {
  display: block; width: 100%; margin-top: 10px;
  background: none; border: none; cursor: pointer;
  font-size: 12.5px; color: #8d97a6;
}
.fpwd-out:hover { color: #5c6879; }

/* =========================================================
   v50.5 · 手机端「报工记录」可用性
   ---------------------------------------------------------
   入口已经放开给所有人（后端自动降成只看自己），
   但 9 列表格在 390px 上要横着拖很难用：把「岗位」「备注」两列收起来，
   时间/工单/工序/良品/不良/工时 六列刚好一屏放下
   ========================================================= */
@media (max-width: 820px) {
  .rep-tw { -webkit-overflow-scrolling: touch; }
  .rep-tw table.tb { font-size: 11px; }
  .rep-tw thead th { font-size: 10.5px; padding: 8px 5px; }
  .rep-tw tbody td { padding: 9px 4px; }
  /* 岗位（第 4 列）：「工序」已经能定位到工位，手机上不重复 */
  .rep-tw thead th:nth-child(4),
  .rep-tw tbody td:nth-child(4) { display: none; }
  /* 备注（最后一列） */
  .rep-tw thead th:last-child,
  .rep-tw tbody td.remark { display: none; }
  /* 工单号允许省略，不然一列吃掉 100px */
  /* 时间、工单号都允许折成两行：宁可行高一点，也不要把「10-28 09:12」「SO20261028001」截成省略号 */
  /* 时间两段各自一行：10-28 / 09:12，永远不会把时刻从中间折断 */
  .rep-tw tbody td.rtime { max-width: 62px; font-size: 10.5px; line-height: 1.35; }
  .rep-tw tbody td.rtime .rt-d,
  .rep-tw tbody td.rtime .rt-t { display: block; }
  .rep-tw tbody td.mono {
    max-width: 74px;
    white-space: normal !important;
    word-break: break-all;
    line-height: 1.3;
    font-size: 10.5px;
  }
  /* 返工小按钮：跟在不良数后面，别撑宽 */
  .rep-tw .rw-link { height: 22px; padding: 0 6px; font-size: 10px; margin-left: 4px; vertical-align: 1px; }
}
