:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e3e8ef;
  --text: #1a2233;
  --text2: #5b6b82;
  --text3: #93a1b5;
  --primary: #1e6fd9;
  --primary-soft: #e8f1fd;
  --green: #0f9d58;
  --green-soft: #e6f6ee;
  --orange: #e8842a;
  --orange-soft: #fdf1e4;
  --red: #d93a3a;
  --red-soft: #fdecec;
  --gray: #8b98ab;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px rgba(16, 24, 40, 0.05);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: 14px; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }

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

.sidebar {
  width: 208px; flex: 0 0 208px;
  background: #0f1a2e;
  color: #c3cddb;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.logo {
  padding: 20px 18px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #2f86f6, #1e5fc0);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
  flex: 0 0 32px;
}
.logo-text { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.2; }
.logo-sub { font-size: 11px; color: #7488a3; margin-top: 2px; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #b6c2d2; font-size: 13.5px; cursor: pointer;
  margin-bottom: 2px; transition: all .12s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }

.nav-label {
  font-size: 11px; color: #5d7291; letter-spacing: .06em;
  padding: 14px 12px 6px; text-transform: uppercase;
}

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #5d7291; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 22px; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 16px; font-weight: 600; }
.page-sub { font-size: 12px; color: var(--text3); }
.spacer { flex: 1; }

.content { padding: 20px 22px 60px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ===== 通用组件 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font-size: 13.5px; font-weight: 500;
  transition: all .12s; white-space: nowrap;
}
.btn:hover { border-color: #c7d1de; background: #fafbfc; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1a63c2; border-color: #1a63c2; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #0c8a4c; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text2); }
.btn-ghost:hover { background: #eef1f5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-body { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-label { font-size: 12.5px; color: var(--text3); }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.stat-note { font-size: 11.5px; color: var(--text3); margin-top: 4px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.tag-new { background: var(--primary-soft); color: var(--primary); }
.tag-producing { background: var(--orange-soft); color: var(--orange); }
.tag-delivered { background: var(--green-soft); color: var(--green); }
.tag-pending { background: #f0f3f7; color: var(--gray); }
.tag-doing { background: var(--orange-soft); color: var(--orange); }
.tag-done { background: var(--green-soft); color: var(--green); }
.tag-cancelled { background: var(--red-soft); color: var(--red); }
.tag-urgent { background: var(--red-soft); color: var(--red); font-weight: 600; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: var(--text3); background: #fafbfc; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid #eef1f5; font-size: 13.5px; }
tbody tr:hover { background: #fafcff; }
tbody tr:last-child td { border-bottom: none; }
.mono { font-family: "SF Mono", Consolas, monospace; font-size: 12.5px; }

/* 进度条 */
.progress { height: 6px; background: #eef1f5; border-radius: 4px; overflow: hidden; min-width: 70px; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.progress-bar.done { background: var(--green); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); outline: none; transition: all .12s;
}
textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,111,217,.1); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* 上传区 */
.dropzone {
  border: 2px dashed #cfd8e3; border-radius: 12px;
  padding: 34px 20px; text-align: center; cursor: pointer;
  transition: all .15s; background: #fbfcfe;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dz-icon { font-size: 34px; margin-bottom: 8px; opacity: .8; }
.dz-title { font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.dz-sub { font-size: 12.5px; color: var(--text3); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,26,46,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 860px;
  box-shadow: 0 20px 60px rgba(16,24,40,.2);
  animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.modal.wide { max-width: 1080px; }
.modal-head {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.modal-title { font-size: 15.5px; font-weight: 600; flex: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fafbfc; border-radius: 0 0 14px 14px;
}
.close-x { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--text3); font-size: 18px; }
.close-x:hover { background: #eef1f5; color: var(--text); }

/* 工序链 */
.process-chain { display: flex; align-items: center; gap: 0; flex-wrap: wrap; padding: 4px 0; }
.step {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 7px; font-size: 12.5px;
  background: #f2f5f9; color: var(--text2); position: relative;
  cursor: pointer; transition: all .12s; border: 1px solid transparent;
}
.step:hover { border-color: var(--border); }
.step-num {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; background: #dde4ee; color: #6b7c94; flex: 0 0 17px;
}
.step.doing { background: var(--orange-soft); color: #b96a17; }
.step.doing .step-num { background: var(--orange); color: #fff; }
.step.done { background: var(--green-soft); color: #0a7a44; }
.step.done .step-num { background: var(--green); color: #fff; }
.step-arrow { color: #c3cddb; padding: 0 3px; font-size: 12px; }

/* 提示 */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 18px; border-radius: 9px; background: #1a2233; color: #fff;
  font-size: 13.5px; box-shadow: 0 8px 24px rgba(16,24,40,.22);
  animation: drop .18s ease-out;
}
.toast.err { background: #c93434; }
.toast.ok { background: #0f8a4e; }
.toast.warn { background: #c47b00; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

.empty { text-align: center; padding: 50px 20px; color: var(--text3); }
.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: .5; }

.hint {
  background: var(--primary-soft); border: 1px solid #cfe2fb; border-radius: 9px;
  padding: 11px 14px; font-size: 12.5px; color: #1a5aab; line-height: 1.6;
}
.hint-warn { background: var(--orange-soft); border-color: #f8dcbc; color: #96560f; }

.row-flex { display: flex; align-items: center; gap: 10px; }
.mt-16 { margin-top: 16px; }
.mt-10 { margin-top: 10px; }
.mb-14 { margin-bottom: 14px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* 识别预览 */
.preview-img { max-width: 100%; max-height: 300px; border-radius: 9px; border: 1px solid var(--border); }

/* 车间报工：现场照片 */
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.photo-del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 19px; text-align: center;
  cursor: pointer; user-select: none;
}
.photo-del:hover { background: #e5484d; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; }
.photo-viewer {
  display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.92);
  align-items: center; justify-content: center; padding: 16px; cursor: zoom-out;
}
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.step-photo { font-size: 11px; opacity: .75; cursor: zoom-in; padding: 0 2px; }
.step-photo:hover { opacity: 1; }

/* 录单：原图与识别结果左右对照 */
.intake-split { display: flex; align-items: stretch; border-top: 1px solid var(--border); }
.intake-src {
  flex: 0 0 44%; max-width: 44%; border-right: 1px solid var(--border);
  background: #f7f9fc; display: flex; flex-direction: column;
  position: sticky; top: 12px; align-self: flex-start; max-height: calc(100vh - 40px);
}
.intake-src-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); background: #fff; flex: 0 0 auto;
}
.intake-src-body { flex: 1; overflow: auto; padding: 10px; min-height: 260px; }
.intake-src-body img { width: 100%; border-radius: 7px; border: 1px solid var(--border); cursor: zoom-in; display: block; background: #fff; }
/* 框内放大态：超出部分可拖动，右下角还可以滚轮滚 */
.intake-src-body img.is-zoomed { position: relative; cursor: grab; max-width: none; box-shadow: 0 2px 10px rgba(16,24,40,.12); }
.intake-src-body img.is-zoomed.is-dragging { cursor: grabbing; }
/* 缩放工具条 */
.src-zoombar { display: inline-flex; align-items: center; gap: 3px; margin-right: 4px; }
.src-zoombar .btn { padding: 3px 9px; font-size: 13px; line-height: 1.4; }
.src-zoomval { font-size: 11.5px; color: var(--text3); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.intake-src-body iframe { width: 100%; height: 100%; min-height: 520px; border: 0; border-radius: 7px; background: #fff; }
.intake-src-tip { padding: 7px 12px; font-size: 11.5px; color: var(--text3); border-top: 1px solid var(--border); background: #fff; flex: 0 0 auto; }
.intake-form { flex: 1; min-width: 0; }
.intake-form .card-body { border-top: 0; }

@media (max-width: 900px) {
  .intake-split { flex-direction: column; }
  .intake-src { flex: none; max-width: none; border-right: 0; border-bottom: 1px solid var(--border); position: static; max-height: none; }
  .intake-src-body { min-height: 0; max-height: 46vh; }
  .intake-src-body iframe { min-height: 320px; }
}
.item-card { border: 1px solid var(--border); border-radius: 9px; padding: 12px; margin-bottom: 10px; background: #fcfdff; }
.item-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.item-idx { width: 20px; height: 20px; border-radius: 5px; background: var(--primary); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 600; }

/* 任务号：点一下就地改（2026.10.20 老板要求） */
.task-no {
  font-size: 12px; color: #6b7b8f; padding: 1px 6px; border-radius: 4px;
  border: 1px dashed transparent; cursor: pointer; white-space: nowrap;
}
.task-no:hover { border-color: #9bb8dd; background: #f2f7ff; color: #1a5aab; }
.task-no-edit { border-color: transparent !important; background: transparent !important; }

/* 零件卡片：料号双行对照区（客户行 ⇄ 本厂行） */
.pn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.pn-abbr {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px; background: #e8f0fe; color: #1a5aab;
  letter-spacing: .5px;
}
.pn-dual {
  display: grid; grid-template-columns: 1fr 22px 1fr; gap: 0;
  border: 1px solid #e3ecf7; border-radius: 9px; overflow: hidden; background: #fff;
  margin-bottom: 11px;
}
.pn-col { padding: 9px 11px 10px; min-width: 0; }
.pn-cust { background: #fffdf7; }
.pn-own { background: #f6fbff; }
.pn-arrow {
  display: grid; place-items: center; font-size: 13px; color: #9db4cc;
  background: #f4f8fd; border-left: 1px solid #e3ecf7; border-right: 1px solid #e3ecf7;
}
.pn-col-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 7px;
  font-size: 11.5px; font-weight: 600; color: #5b6b80;
}
.pn-tag {
  font-weight: 400; font-size: 10.5px; padding: 1px 6px; border-radius: 20px;
  background: #fdf0d5; color: #a5760a;
}
.pn-tag.auto { background: #e2f2fd; color: #1a6aab; }
.pn-line { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.pn-line:last-child { margin-bottom: 0; }
.pn-line > label { flex: 0 0 62px; font-size: 11.5px; color: #6b7c91; white-space: nowrap; }
.pn-line .tbl-input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.pn-inp-wrap { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.pn-refresh {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  border: 1px solid #cfe1f5; background: #fff; color: #1a5aab; font-size: 13px; line-height: 1;
}
.pn-refresh:hover { background: #eaf3ff; }
@media (max-width: 720px) {
  .pn-dual { grid-template-columns: 1fr; }
  .pn-arrow { border: 0; border-top: 1px solid #e3ecf7; border-bottom: 1px solid #e3ecf7; padding: 2px 0; transform: rotate(90deg); }
  .pn-line > label { flex-basis: 58px; }
}

/* 客户供料：整卡左侧加黄条 + 淡黄底，一眼看出不用买料 */
.item-card.is-cust-supplied { border-left: 3px solid #e8b923; background: #fffdf5; }
.item-card.is-cust-supplied .spec-box { background: linear-gradient(180deg, #fffdf3 0%, #fdf8e8 100%); border-color: #f0e2b8; }
.pn-supply { margin-top: 7px; padding-top: 7px; border-top: 1px dashed #eee1c0; }
.pn-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7a6520; cursor: pointer; }
.pn-check input { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; accent-color: #d9a400; }
.pn-check b { color: #b8860b; }

/* 料号对照表 */
.pm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-toolbar .search-box { flex: 1; min-width: 220px; max-width: 420px; }
.pm-hit { background: #fff4c2; border-radius: 2px; padding: 0 1px; }
.pm-pair { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.pm-pair .arr { color: #b3c2d4; font-size: 11px; }
.pm-custno { color: #a5760a; }
.pm-ownno { color: #1a5aab; font-weight: 600; }

.mini-input { height: 32px !important; font-size: 13px !important; padding: 0 8px !important; }

/* 送货单生成：没货 / 货不够的提示 */
.dn-warn {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #f3c9c4;
  background: #fdf2f0;
  color: #a3342a;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.55;
}
.dn-pick.dn-nostock { opacity: .72; background: #fafafa; }
.dn-pick.dn-nostock .dn-chk { color: #9aa1ab; }

/* 标签打印弹窗：外标签 / 内标签两个分区 */.lb-sec {
  border: 1px solid #e2e6ec;
  border-radius: 9px;
  padding: 10px 12px 4px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.lb-sec-hd { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.lb-sec-t { font-size: 12.5px; font-weight: 700; color: #1a1a1a; }

/* 标签弹窗：每个料号一块，填「数量 × 份数」 */
.lb-list { display: flex; flex-direction: column; gap: 10px; }
.lb-row { border: 1px solid #e2e6ec; border-radius: 9px; padding: 10px 12px; background: #fff; }
.lb-row-hd { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 3px; }
.lb-row-no { font-size: 12.5px; font-weight: 700; color: #1a5aab; }
.lb-row-name { font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row-tot { font-size: 12px; color: #5f6672; white-space: nowrap; }
.lb-row-tot b { color: #1a1a1a; }
.lb-row-meta { font-size: 11.5px; color: #8a929c; margin-bottom: 8px; }
.lb-row-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.lb-row-grid .field > label { font-size: 11.5px; color: #5f6672; margin-bottom: 3px; display: block; }
@media (max-width: 720px) {
  .lb-row-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 零件卡片：原材料规格区（按料型切换字段） */
.spec-box {
  margin: 11px 0;
  padding: 10px 12px 9px;
  background: linear-gradient(180deg, #f7fbff 0%, #f2f7fe 100%);
  border: 1px solid #dce9f8;
  border-radius: 9px;
}
.spec-box-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.spec-box-title { font-size: 12.5px; font-weight: 600; color: #1a5aab; }
.spec-grid { display: grid; gap: 9px; }
.spec-cell { min-width: 0; }
.spec-cell > label {
  display: block; font-size: 11.5px; color: #5b6b80; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.spec-inp { display: flex; align-items: center; gap: 3px; }
.spec-inp .mini-input { flex: 1; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.spec-prefix { font-size: 13px; color: #1a5aab; font-weight: 600; flex: 0 0 auto; }
.spec-unit { font-size: 11px; color: #93a1b5; flex: 0 0 auto; }
.spec-summary { margin-top: 8px; font-size: 12px; color: #5b6b80; }
.spec-summary b { color: #1a5aab; font-family: ui-monospace, monospace; }
.spec-tip {
  display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%;
  background: #c9d6e6; color: #fff; font-size: 10px; font-weight: 700; cursor: help;
  margin-left: 3px; vertical-align: 1px;
}
.spec-tip:hover { background: #1a5aab; }

@media (max-width: 640px) {
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.tbl-input { width: 100%; height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 13px; }
.tbl-input:hover { background: #f2f5f9; }
.tbl-input:focus { background: #fff; border-color: var(--primary); outline: none; }

@media (max-width: 820px) {
  .sidebar { width: 60px; flex: 0 0 60px; }
  .logo-text, .logo-sub, .nav-item span, .nav-label, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .content { padding: 14px; }
}

/* ===== 手机端优化（≤520px：手机竖屏） ===== */
@media (max-width: 520px) {
  .app { flex-direction: column; }
  /* 侧栏变成底部导航条 */
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    width: 100%; flex: none;
    display: flex; justify-content: space-around;
    background: #fff; border-top: 1px solid var(--border);
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(16,24,40,.06);
  }
  .sidebar .logo, .sidebar .nav-label, .sidebar .sidebar-foot { display: none; }
  .sidebar nav.nav { display: flex; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .nav-item { flex: 1 0 auto; flex-direction: column; gap: 2px; padding: 7px 10px; font-size: 10px; }
  .nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
  .nav-item span { display: block; } /* 手机上要显示文字标签 */
  .nav-item.active { background: transparent; color: var(--primary); }
  .content { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); } /* 给底部导航留位置 */

  .card-head { flex-wrap: wrap; gap: 8px; }
  .card-head .card-title { font-size: 15px; flex-basis: 100%; }
  .card-head .spacer { display: none; }

  /* 表格横向滚动，不挤压 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 560px; }

  /* 录单零件卡：一行一控件 */
  .item-card-head { flex-wrap: wrap; }
  .item-card-head .tbl-input { flex-basis: 100% !important; }
  .item-card-head .text-muted { flex-basis: auto; }

  /* 按钮：手机上好按 */
  .btn { padding: 10px 16px; font-size: 14px; }
  .btn-sm { padding: 8px 12px; }
  .mini-input, .tbl-input, select.mini-input { font-size: 16px; } /* ≥16px 防 iOS 聚焦自动放大 */

  /* 打印页 iframe 预览：占满宽度 */
  .doc-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 10px; }
}

/* ===== 车间报工：良品 / 不良品 分开报 ===== */
.rb-qty { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.rb-col { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fbfcfe; }
.rb-col label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; color: var(--text2); }
.rb-hint { font-weight: 400; color: var(--text3); font-size: 11.5px; margin-left: 3px; }
.rb-col input { width: 100%; height: 40px; font-size: 20px; font-weight: 600; text-align: center; border: 1px solid #dde3ec; border-radius: 8px; background: #fff; }
.rb-good { border-color: #b7e2c8; background: #f4fbf6; }
.rb-good label { color: #0f7a45; }
.rb-good input { color: #0f7a45; }
.rb-bad { border-color: #f6c9c9; background: #fff6f6; }
.rb-bad label { color: #c93434; }
.rb-bad input { color: #c93434; }
.rb-sum { display: flex; flex-direction: column; justify-content: center; background: #f7f9fc; }
.rb-total { font-size: 22px; font-weight: 700; }
.rb-total span { font-size: 12px; font-weight: 400; margin-left: 4px; }

.rb-badbox { border: 1px solid #f6c9c9; background: #fffafa; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.rb-badbox-title { font-size: 13px; font-weight: 600; color: #c93434; margin-bottom: 10px; }
.rb-repair { display: flex; gap: 8px; flex-wrap: wrap; }
.rb-radio {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid #dde3ec; border-radius: 8px; padding: 8px 13px; font-size: 13px; background: #fff;
}
.rb-radio input { width: 15px; height: 15px; margin: 0; accent-color: #1e6fd9; }
.rb-radio:has(input:checked) { border-color: #1e6fd9; background: #eef5ff; color: #1a5aab; font-weight: 600; }

.photo-thumb.is-bad { border-color: #f0a8a8; box-shadow: 0 0 0 2px #fff2f2; }

/* 工序链上直接标出不良数 */
.step-bad { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; background: #fdecec; color: #c93434; font-size: 10.5px; font-weight: 700; }

/* 品质页：返修判定标签 */
.qtag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; }
.qtag-repair { background: #e8f4fd; color: #1667b8; border: 1px solid #bfdcf7; }
.qtag-scrap { background: #fdecec; color: #c93434; border: 1px solid #f6c9c9; }
.qtag-none { background: #f2f4f7; color: #7b8794; border: 1px dashed #d8dee7; }

@media (max-width: 640px) {
  .rb-qty { grid-template-columns: 1fr 1fr; }
  .rb-sum { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; justify-content: flex-start; }
}

/* ===== 报工：已累计 / 本批 ===== */
.rb-done {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: #f4f8ff; border: 1px solid #d9e6fb; border-radius: 10px;
  padding: 10px 14px; margin: 4px 0 12px;
}
.rb-done-item { display: flex; align-items: baseline; gap: 5px; }
.rb-done-item span { font-size: 12px; color: #5b6b82; }
.rb-done-item b { font-size: 19px; font-weight: 700; color: #1667b8; font-variant-numeric: tabular-nums; }
.rb-done-item + .rb-done-item { padding-left: 12px; border-left: 1px solid #d9e6fb; }

.rb-batch-title { font-size: 13px; font-weight: 700; color: #1a2233; margin: 0 0 8px; }
.rb-quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px; }

/* 报工记录（分批列表） */
.rb-hist { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e3e8ef; }
.rb-hist-title { font-size: 12.5px; font-weight: 700; color: #1a2233; margin-bottom: 8px; }
.rb-hist-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: 12px; padding: 6px 10px; border-radius: 7px; background: #fafbfd; margin-bottom: 5px;
}
.rb-hist-n { font-weight: 600; color: #1a5aab; min-width: 46px; }
.rb-hist-d { color: #7b8794; font-variant-numeric: tabular-nums; min-width: 118px; }
.step-batch { display: inline-block; margin-left: 3px; padding: 0 4px; border-radius: 4px; background: #eef5ff; color: #1a5aab; font-size: 10.5px; font-weight: 700; }

/* ===== 录单：零件工序区 ===== */
.proc-box { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #e8edf3; }
.proc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.proc-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* 来源标签：一眼看出工序是哪来的 */
.proc-src { display: inline-flex; align-items: baseline; gap: 5px; font-size: 11px; padding: 1px 7px; border-radius: 20px; line-height: 1.6; }
.proc-src-sub { font-size: 10px; opacity: .72; }
.proc-src.is-arch { background: var(--primary-soft); color: #1a5aab; }
.proc-src.is-new { background: var(--green-soft); color: #0a7a44; }
.proc-src.is-dirty { background: var(--orange-soft); color: #a55a10; }
.proc-src.is-none { background: #f1f3f7; color: var(--text3); }

.proc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.proc-chip {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe;
  overflow: hidden; height: 30px; transition: border-color .12s, box-shadow .12s;
}
.proc-chip:hover { border-color: #b9d3f2; box-shadow: 0 1px 4px rgba(30, 111, 217, .08); }
.proc-seq {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 100%; background: #eef2f7; color: var(--text2);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.proc-name {
  border: none; outline: none; background: transparent; width: 76px;
  padding: 0 7px; height: 100%; font-size: 12.5px; font-weight: 600; color: var(--text);
}
.proc-name:focus { background: #fff; }
.proc-note {
  border: none; outline: none; background: transparent; width: 88px;
  padding: 0 6px 0 0; height: 100%; font-size: 11.5px; color: var(--text2);
  border-left: 1px dashed #e3e8ef; padding-left: 6px;
}
.proc-note.is-empty { color: #b9c2cf; }
.proc-note:focus { background: #fff; }
.proc-act { display: inline-flex; height: 100%; border-left: 1px solid var(--border); }
.proc-act > span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 100%; cursor: pointer; color: var(--text3);
  font-size: 13px; user-select: none;
}
.proc-act > span:hover { background: #eef2f7; color: var(--primary); }
.proc-act > span.is-off { opacity: .25; pointer-events: none; }
.proc-act > span.is-del:hover { background: var(--red-soft); color: var(--red); }

.proc-remember {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 8px;
  padding: 7px 10px; border-radius: 8px; background: var(--orange-soft);
  font-size: 12px; color: #8a4c0d; cursor: pointer; line-height: 1.5;
}
.proc-remember input { margin-top: 2px; flex: 0 0 auto; }

@media (max-width: 900px) {
  .proc-name { width: 66px; }
  .proc-note { width: 72px; }
}

/* ===== 订单详情：改工序弹窗 ===== */
.pe-list { display: flex; flex-direction: column; gap: 7px; }
.pe-row {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe;
}
.pe-seq {
  flex: 0 0 22px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text2); font-variant-numeric: tabular-nums;
}
.pe-name { flex: 0 0 128px; }
.pe-note { flex: 1; }
.pe-act { display: inline-flex; flex: 0 0 auto; }
.pe-act > span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 28px; cursor: pointer; color: var(--text3);
  font-size: 14px; border-radius: 5px; user-select: none;
}
.pe-act > span:hover { background: #eef2f7; color: var(--primary); }
.pe-act > span.is-off { opacity: .25; pointer-events: none; }
.pe-act > span.is-del:hover { background: var(--red-soft); color: var(--red); }

/* ===== 录单：自产 / 外购 ===== */
.mk-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: .04em;
}
.mk-tag.is-self { color: var(--primary); background: var(--primary-soft); border: 1px solid #cfe1f9; }
.mk-tag.is-out { color: #8a5a00; background: #fff4dd; border: 1px solid #f5dda8; }

.mk-bar {
  margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px;
  background: #f6f9fd; border: 1px solid #e2eaf5;
}
.mk-switch { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mk-switch-label { font-size: 12px; color: var(--text2); flex: 0 0 auto; }
.mk-seg {
  display: inline-flex; flex: 0 0 auto; padding: 2px; border-radius: 8px;
  background: #e6ecf5; gap: 2px;
}
.mk-seg-item {
  padding: 3px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--text2); cursor: pointer; user-select: none; transition: all .14s;
}
.mk-seg-item:hover { color: var(--primary); }
.mk-seg-item.is-on {
  background: #fff; color: var(--primary); box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.mk-seg-item.is-on.is-on-out { color: #8a5a00; }
.mk-hint { font-size: 11.5px; color: #8a5a00; flex: 1 1 auto; min-width: 160px; }
.mk-hint.is-self { color: var(--text3); }

.sup-line {
  display: flex; align-items: center; gap: 9px; margin-top: 8px;
  padding-top: 8px; border-top: 1px dashed #dde7f4; flex-wrap: wrap;
}
.sup-line-label { font-size: 12px; color: var(--text2); flex: 0 0 auto; }
.sup-warn { color: var(--orange); font-size: 11.5px; }
.sup-ok { color: var(--green); font-size: 11.5px; }
.sup-new { color: var(--orange); font-size: 11.5px; }

.item-card.is-outsourced { background: #fffdf7; border-color: #f0e3c4; }
.item-card.is-outsourced .spec-box { background: #fffbf2; }

.out-box { margin-top: 9px; }
.out-box-inner {
  border: 1px solid #f0e3c4; border-radius: 9px; background: #fffaf0; padding: 10px 12px;
}
.out-info { display: flex; gap: 10px; align-items: flex-start; }
.out-info-icon {
  flex: 0 0 26px; height: 26px; border-radius: 50%; background: #fff0cf; color: #8a5a00;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.out-info-title { font-size: 13px; font-weight: 600; color: #7a4f00; margin-bottom: 3px; }
.out-info-desc { font-size: 12px; color: var(--text2); line-height: 1.75; }
.out-info-desc b { color: #7a4f00; }
.out-info-meta { font-size: 11.5px; color: var(--text3); margin-top: 4px; }

/* ===== 采购页 ===== */
.po-tabs { display: inline-flex; gap: 2px; padding: 2px; background: #e6ecf5; border-radius: 8px; }
.po-tab { padding: 4px 13px; border-radius: 6px; font-size: 12.5px; cursor: pointer; color: var(--text2); user-select: none; }
.po-tab.is-on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.po-tab .n { font-size: 11px; opacity: .7; margin-left: 3px; }

.po-status { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; display: inline-block; }
.po-status.draft { color: var(--gray); background: #f0f3f7; border: 1px solid #e0e6ee; }
.po-status.sent { color: var(--primary); background: var(--primary-soft); border: 1px solid #cfe1f9; }
.po-status.done { color: var(--green); background: var(--green-soft); border: 1px solid #c6e9d6; }
.po-kind { font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-left: 5px; }
.po-kind.part { color: #8a5a00; background: #fff4dd; }
.po-kind.material { color: #0f6e5c; background: #e2f5f1; }
.po-kind.tool { color: #7a3f9d; background: #f3ecfb; }
.po-kind.other { color: #5b6472; background: #eef0f4; }

/* ===== 刀具 / 辅料申请单 ===== */
.tl-cat {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px;
  white-space: nowrap; font-weight: 600;
}
.tl-cat-tool { color: #7a3f9d; background: #f3ecfb; }
.tl-cat-gauge { color: #1a5aab; background: #e9f2fd; }
.tl-cat-fixture { color: #8a5a00; background: #fff4dd; }
.tl-cat-aux { color: #0f6e5c; background: #e2f5f1; }
.tl-cat-other { color: #5b6472; background: #eef0f4; }

/* 「用在哪」这条：成本能算到产品上全靠它 */
.tl-use {
  font-size: 12.5px; color: var(--text2); background: #f5f8fd;
  border-left: 3px solid #6ba4ea; border-radius: 0 7px 7px 0;
  padding: 7px 11px; margin-bottom: 12px; line-height: 1.7;
}
.tl-use b { color: var(--text); }
.tl-use-none { border-left-color: #e6a23c; background: #fdf8ef; color: #8a6a30; }

/* 成本统计的大数字 */
.tl-kpi {
  flex: 1; min-width: 150px; background: linear-gradient(160deg, #fff, #f7fafe);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px;
}
.tl-kpi-n { font-size: 21px; font-weight: 700; color: #b3541e; line-height: 1.25; }
.tl-kpi-l { font-size: 12px; color: var(--text3); margin-top: 3px; }

.po-text {
  white-space: pre-wrap; font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12.5px; line-height: 1.85; background: #f8fafd; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; color: var(--text); max-height: 320px; overflow: auto;
}
.po-row-in { width: 68px; text-align: center; }
.po-arrived { color: var(--green); font-weight: 600; }
.po-wait { color: var(--orange); }

/* 供应商页 */
.sup-card { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.sup-card + .sup-card { margin-top: 9px; }
.sup-card.is-off { opacity: .55; }
.sup-card-main { flex: 1; min-width: 0; }
.sup-card-name { font-size: 13.5px; font-weight: 600; }
.sup-card-name .k { font-size: 11px; font-weight: 400; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.sup-card-name .k.part { color: #8a5a00; background: #fff4dd; }
.sup-card-name .k.material { color: #0f6e5c; background: #e2f5f1; }
.sup-card-meta { font-size: 11.5px; color: var(--text3); margin-top: 3px; line-height: 1.8; }
.sup-card-parts { font-size: 11.5px; color: var(--text2); margin-top: 3px; }
.sup-card-act { flex: 0 0 auto; display: inline-flex; gap: 6px; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #f3a52a; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}

/* ===== 外购两种模式：整件外发 / 外发工序 ===== */
.mk-mode-seg { margin-left: 2px; background: #f3e8d0; }
.mk-mode-item {
  padding: 2px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  color: #a08040; cursor: pointer; user-select: none; transition: all .14s;
}
.mk-mode-item:hover { color: #7a4f00; }
.mk-mode-item.is-on { background: #fff; color: #8a5a00; box-shadow: 0 1px 2px rgba(16,24,40,.12); }

/* 工序芯片上的「外协」开关 */
.proc-outtag {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  color: #b9a16a; background: transparent; border: 1px dashed #dcc795; cursor: pointer; user-select: none;
}
.proc-outtag:hover { color: #8a5a00; border-color: #c9a85c; }
.proc-outtag.is-on { color: #fff; background: #e0a63a; border-color: #e0a63a; }
.proc-chip.is-out { background: #fff7e6; border-color: #ecd3a0; }

/* 【2026.10.21 新增】工序上选「哪台机做」——排产就按这个分活 */
.proc-mc {
  border: none; outline: none; height: 100%; font-size: 11.5px; cursor: pointer;
  background: #f2f6fc; color: #1a5aab; font-weight: 600;
  border-left: 1px dashed #e3e8ef; padding: 0 2px 0 3px; max-width: 74px;
}
.proc-mc.is-none { color: #9aa7b8; font-weight: 400; background: #f7f9fc; }
.proc-mc:focus { background: #fff; }
.proc-chip.t-auto { border-color: #c6e9d7; }
.proc-chip.t-auto .proc-mc { color: #0f7a45; background: #ecf8f1; }
.proc-chip.t-lathe { border-color: #cfe1fb; }
.proc-chip.t-lathe .proc-mc { color: #1a5aab; background: #eef5ff; }
.proc-chip.t-cnc { border-color: #ddd0f7; }
.proc-chip.t-cnc .proc-mc { color: #5b2fa8; background: #f4eeff; }
.proc-chip.t-washer { border-color: #f3ddba; }
.proc-chip.t-washer .proc-mc { color: #9a5400; background: #fdf6ea; }

/* 工序链上的外协徽标 */
.step-out {
  display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px;
  background: #fff2d6; color: #a4761d; font-size: 10.5px; font-weight: 700;
}

/* ===== 表格批量录入（客户 / 供应商共用，2026.10.20） ===== */
.bt-wrap { border: 1px solid #e3e8ef; border-radius: 8px; overflow: auto; max-height: 44vh; background: #fff; }
.bt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.bt th {
  position: sticky; top: 0; z-index: 2; background: #f6f8fb; color: #4a5a6a;
  font-weight: 600; font-size: 11.5px; padding: 6px 6px; border-bottom: 1px solid #e3e8ef;
  white-space: nowrap; text-align: left;
}
.bt th.req::after { content: ' *'; color: #d93f3f; }
.bt td { padding: 0; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
.bt td.c { text-align: center; color: #9aa8b8; font-size: 11.5px; width: 30px; }
.bt input {
  width: 100%; box-sizing: border-box; border: 0; background: transparent;
  padding: 6px 7px; font-size: 12.5px; font-family: inherit; color: #22303f; outline: none;
}
.bt input:focus { background: #f0f7ff; box-shadow: inset 0 0 0 1px #b9d7ff; border-radius: 3px; }
.bt input::placeholder { color: #c2ccd8; }
.bt tr:hover td { background: #fbfcfe; }
.bt tr.is-bad input { background: #fff4f4; }
.bt tr.is-bad td.c { color: #d93f3f; font-weight: 700; }
.bt .bt-del {
  border: 0; background: transparent; color: #c8d2de; cursor: pointer;
  font-size: 15px; line-height: 1; padding: 4px 8px; border-radius: 4px;
}
.bt .bt-del:hover { color: #d93f3f; background: #fff0f0; }
.bt-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bt-bar .bt-cnt { font-size: 12px; color: #6b7b8f; }
.bt-bar .bt-cnt b { color: #1a5aab; }
.bt-drop {
  margin-top: 10px; padding: 10px 12px; border: 1px dashed #cfdcff; border-radius: 8px;
  background: #f7faff; font-size: 12px; color: #5a6b80; transition: all .14s;
}
.bt-drop.is-over { border-color: #1a5aab; background: #edf4ff; }

/* ================= 机台排产（扫码报工） ================= */
.mc-bar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:14px; }
.mc-bar .seg { display:inline-flex; background:#eef2f8; border-radius:9px; padding:2px; gap:2px; }
.mc-bar .seg button {
  border:0; background:transparent; padding:6px 12px; border-radius:7px; font-size:12.5px;
  font-family:inherit; color:#5b6b82; cursor:pointer; font-weight:500;
}
.mc-bar .seg button.on { background:#fff; color:#1a5aab; box-shadow:0 1px 3px rgba(16,24,40,.1); font-weight:600; }

.mc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(178px,1fr)); gap:11px; }
.mc-card {
  background:#fff; border:1px solid #e3e8ef; border-radius:11px; padding:11px 12px 10px;
  cursor:pointer; transition:all .13s; position:relative; overflow:hidden;
}
.mc-card:hover { border-color:#b9d7ff; box-shadow:0 3px 12px rgba(16,24,40,.08); transform:translateY(-1px); }
.mc-card .h { display:flex; align-items:center; gap:6px; }
.mc-card .code { font-size:16px; font-weight:750; letter-spacing:.01em; font-family:ui-monospace,Consolas,monospace; }
.mc-card .ty { font-size:10px; padding:1px 6px; border-radius:5px; color:#fff; font-weight:600; }
.mc-card .st { margin-left:auto; font-size:10.5px; font-weight:600; display:flex; align-items:center; gap:3px; }
.mc-card .st i { width:6px; height:6px; border-radius:50%; display:inline-block; }
.mc-card .nt { font-size:11px; color:#93a1b5; margin-top:3px; }
.mc-card .jb { margin-top:8px; padding-top:8px; border-top:1px dashed #eef2f8; font-size:12px; line-height:1.55; color:#1a2233; }
.mc-card .jb .pn { font-weight:650; font-family:ui-monospace,Consolas,monospace; }
.mc-card .jb .sm { font-size:11px; color:#7b8794; }
.mc-card .mt { display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:11px; color:#93a1b5; margin-top:6px; }
.mc-card .mt .btn { flex:0 0 auto; }
.mc-card.idle .jb { color:#93a1b5; }
.mc-card.run { border-color:#bfe3cd; background:linear-gradient(180deg,#f7fdf9,#fff 55%); }
.mc-card.maint { border-color:#f6cfcf; background:#fffafa; }

.mc-sum { display:flex; gap:22px; flex-wrap:wrap; margin-bottom:14px; }
.mc-sum div { font-size:12px; color:#7b8794; }
.mc-sum b { display:block; font-size:21px; color:#1a2233; font-weight:700; margin-top:1px; }
.mc-sum b.run { color:#0f7a45; }
.mc-sum b.idle { color:#93a1b5; }

.mc-tbl { width:100%; border-collapse:collapse; font-size:12.5px; }
.mc-tbl th { text-align:left; font-size:11.5px; color:#6b7b8f; font-weight:600; padding:7px 8px; border-bottom:1px solid #e8edf4; background:#fafbfd; }
.mc-tbl td { padding:8px; border-bottom:1px solid #f2f5f9; vertical-align:middle; }
.mc-tbl tr:hover td { background:#fbfcfe; }
.mc-tbl .mono { font-family:ui-monospace,Consolas,monospace; font-weight:600; }
.mc-tbl .bar { height:5px; background:#eef2f8; border-radius:3px; overflow:hidden; min-width:60px; }
.mc-tbl .bar i { display:block; height:100%; background:#2f86f6; }

.mc-dot { display:inline-flex; align-items:center; gap:4px; font-size:11.5px; }
.mc-dot i { width:6px; height:6px; border-radius:50%; }
.mc-dot.run i { background:#18a05e; }
.mc-dot.idle i { background:#b3bfcd; }
.mc-dot.stop i { background:#e8890c; }
.mc-dot.maint i { background:#e5484d; }

/* 排产弹窗里的零件选择 */
.sc-pick { border:1px solid #e3e8ef; border-radius:9px; max-height:260px; overflow:auto; }
.sc-pick .r { display:flex; gap:9px; align-items:center; padding:8px 11px; border-bottom:1px solid #f4f6fa; cursor:pointer; font-size:12.5px; }
.sc-pick .r:last-child { border-bottom:0; }
.sc-pick .r:hover { background:#f7faff; }
.sc-pick .r.on { background:#edf4ff; }
.sc-pick .r .pn { font-family:ui-monospace,Consolas,monospace; font-weight:650; min-width:96px; }
.sc-pick .r .sp { flex:1; }
.mcq { display:flex; flex-wrap:wrap; gap:6px; }
.mcq label {
  display:flex; align-items:center; gap:5px; border:1px solid #e3e8ef; border-radius:7px;
  padding:5px 9px; font-size:12px; cursor:pointer; background:#fff;
}
.mcq label.on { border-color:#2f86f6; background:#eef5ff; color:#1a5aab; font-weight:600; }
.mcq input { margin:0; }

/* 【2026.10.21 新增】排产按机台类型分活：工序类型小标签 + 不匹配的行压暗 */
.sc-pick .r.dim { opacity:.5; }
.sc-pick .r .mtag {
  display:inline-block; font-size:10.5px; font-weight:700; padding:1px 5px; border-radius:5px;
  border:1px solid #e3e8ef; color:#5a6b80; background:#f7f9fc; letter-spacing:.3px;
}
.sc-pick .r .mtag.t-auto { color:#0f7a45; border-color:#c6e9d7; background:#ecf8f1; }
.sc-pick .r .mtag.t-lathe { color:#1a5aab; border-color:#cfe1fb; background:#eef5ff; }
.sc-pick .r .mtag.t-cnc { color:#5b2fa8; border-color:#ddd0f7; background:#f4eeff; }
.sc-pick .r .mtag.t-washer { color:#9a5400; border-color:#f3ddba; background:#fdf6ea; }
.sc-pick .r .mtag.t-no { color:#c93434; border-color:#f5cdcd; background:#fdf0f0; }
.sc-filter { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.sc-filter button {
  border:1px solid #e3e8ef; background:#fff; border-radius:7px; padding:4px 10px;
  font-size:12px; cursor:pointer; color:#5a6b80;
}
.sc-filter button.on { border-color:#2f86f6; background:#eef5ff; color:#1a5aab; font-weight:600; }
