:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e6ebf2;
  --text: #1b2432;
  --text-2: #5c6b80;
  --muted: #8a97a8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8efff;
  --red: #d92d20;
  --red-soft: #fee4e2;
  --green: #12805c;
  --green-soft: #dcf5ec;
  --orange: #c2410c;
  --orange-soft: #ffedd5;
  --gray-soft: #eef2f7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; min-height: 64px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }

/* ---------------- 布局 ---------------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 208px; flex: 0 0 208px; background: #101828; color: #cdd6e4;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 18px 14px; display: flex; gap: 10px; align-items: center; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.brand b { color: #fff; font-size: 15px; letter-spacing: .3px; }
.brand small { display: block; color: #7c8ba3; font-size: 11px; font-weight: 400; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  color: #c2ccdc; font-size: 14px; margin-bottom: 2px;
}
.nav a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav a:hover { background: #1b2537; color: #fff; }
.nav a.on { background: var(--primary); color: #fff; }
.nav a .badge {
  margin-left: auto; background: var(--red); color: #fff; font-size: 11px;
  border-radius: 20px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 17px;
}
.side-foot { padding: 10px 14px 16px; border-top: 1px solid #1d2739; font-size: 12px; color: #8b9ab1; }
.side-foot .who { color: #e6ebf3; font-size: 13px; margin-bottom: 2px; }
.side-foot button {
  margin-top: 8px; width: 100%; background: #1b2537; color: #c2ccdc; border: 0;
  padding: 7px; border-radius: 7px; cursor: pointer;
}
.side-foot button:hover { background: #24314a; color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.topbar .sub { color: var(--muted); font-size: 12px; margin-left: 10px; font-weight: 400; }
.content { padding: 20px 22px 40px; max-width: 1280px; width: 100%; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfd; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--red); border-color: #f3c9c4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
/* 备份状态提示：异地副本配没配、通不通，直接影响数据能不能救回来，所以要看得见 */
.bk-note { font-size: 12.5px; line-height: 1.7; padding: 8px 11px; border-radius: 8px; }
.bk-note.ok { background: var(--green-soft); color: var(--green); }
.bk-note.ok b { font-weight: 600; }
.bk-note.bad { background: var(--orange-soft); color: var(--orange); }
.bk-note.bad b { font-weight: 600; }
.pad { padding: 16px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 8px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.stat:hover { border-color: #c3d1e4; box-shadow: var(--shadow); }
.stat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stat.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: #fbfdff; }
.stat .k { display: block; font-size: 12px; color: var(--text-2); }
.stat.on .k { color: var(--primary); font-weight: 600; }
.stat .v { display: block; font-size: 26px; font-weight: 650; line-height: 1.3; letter-spacing: -.5px; }
.stat.red .v { color: var(--red); }
.stat.green .v { color: var(--green); }
.stat.blue .v { color: var(--primary); }
.stat.orange .v { color: var(--orange); }
.stat.cyan .v { color: #0f766e; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.stat-tip { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.head-acts { display: flex; gap: 8px; align-items: center; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.section-head h2 { font-size: 14px; margin: 0; font-weight: 600; }
/* 标题后面那句「共 N 张」整体换行，别只把「张」甩到下一行 */
.section-head h2 .muted { white-space: nowrap; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.loading { padding: 50px; text-align: center; color: var(--muted); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }
.toolbar .grow { flex: 1; }
/* 「我的工序」筛选结果那行小字：筛的哪一档、多少张单多少道 */
.list-sum { color: var(--muted); font-size: 12.5px; margin: -6px 0 10px 2px; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
table.grid th { background: #fafbfd; color: var(--text-2); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: #fbfcfe; }
table.card { overflow: hidden; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; line-height: 20px; white-space: nowrap;
}
.chip.s0 { background: var(--gray-soft); color: #5b6b81; }
.chip.s1 { background: var(--primary-soft); color: var(--primary-dark); }
.chip.s2 { background: var(--green-soft); color: var(--green); }
.chip.s3 { background: var(--orange-soft); color: var(--orange); }
.chip.s4 { background: var(--red-soft); color: var(--red); }
.chip.gray { background: var(--gray-soft); color: #5b6b81; }
.chip.blue { background: var(--primary-soft); color: var(--primary-dark); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.orange { background: var(--orange-soft); color: var(--orange); }
/* 设备已完成、等售后：蓝绿之间的青色，跟「在制蓝」「完工绿」都分得开 */
.chip.cyan { background: #e0f5f3; color: #0f766e; }
.chip.line { background: #fff; border: 1px solid var(--line); color: var(--text-2); }

/* ---------------- 我的工序：订单折叠 ---------------- */
.ogrp {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden;
}
.ogrp-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  width: 100%; padding: 12px 16px; margin: 0;
  background: none; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer;
}
.ogrp-head:hover { background: #fafbfd; }
.ogrp-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ogrp.on .ogrp-head { background: #f7faff; border-bottom: 1px solid var(--line); }
.ogrp-caret {
  flex: none; width: 0; height: 0; margin-left: 2px;
  border-left: 6px solid var(--muted); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: transform .15s ease; transform-origin: 3px 50%;
}
.ogrp.on .ogrp-caret { transform: rotate(90deg); border-left-color: var(--primary); }
.ogrp-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ogrp-title b { font-size: 14px; letter-spacing: .2px; }
.ogrp-cust { color: var(--text); font-size: 13px; }
.ogrp-meta { color: var(--text-2); font-size: 12.5px; }
.ogrp-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ogrp-prog { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ogrp-body { display: none; }
.ogrp.on .ogrp-body { display: block; }
.ogrp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--line); background: #fff;
  font-size: 12.5px;
}
.ogrp-body table.grid th:first-child, .ogrp-body table.grid td:first-child { padding-left: 18px; }

/* 勾选框一列：桌面上窄窄一条，手机上进卡片第一格 */
table.proc-grid th.p-check, table.proc-grid td.p-check { width: 38px; padding-right: 0 !important; }
table.proc-grid td.p-check input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--primary); }
table.proc-grid tr.picked td { background: var(--primary-soft); }
/* 整条工序链里不属于本部门的行：能看进度，但不能报工 —— 整行压暗，别再抢注意力 */
table.proc-grid tr.p-other td { opacity: .62; }
table.proc-grid tr.p-other:hover td { opacity: .85; }
.fp-tag.other { background: #eef1f6; color: var(--muted); }
/* 外发采购行上的到货进度：到齐了灰、缺件橙、逾期红 */
.p-buy { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.p-buy.late { color: var(--red); font-weight: 600; }
.ogrp-bar-acts { display: inline-flex; gap: 8px; }
.ogrp.flash { animation: ogrpFlash 1.3s ease-out; }
@keyframes ogrpFlash {
  0% { box-shadow: 0 0 0 3px rgba(37, 99, 235, .5); border-color: var(--primary); }
  100% { box-shadow: var(--shadow); }
}

/* 批量报工条：勾了工序才出现，贴着内容底部（sticky 不会盖住最后一行） */
.batch-bar {
  position: sticky; bottom: 10px; z-index: 5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(16, 24, 40, .16);
}
.batch-bar[hidden] { display: none; }
.batch-bar .bb-text { font-size: 13px; color: var(--text-2); }
.batch-bar .bb-text b { color: var(--primary); font-size: 15px; }
.batch-bar .grow { flex: 1; }

@media (max-width: 640px) {
  /* 手机上按钮要大，拇指才按得准；四个按钮一行放不下就换行 */
  .batch-bar { gap: 6px; padding: 9px 10px; bottom: 6px; }
  .batch-bar .bb-text { width: 100%; }
  .batch-bar .btn { flex: 1; min-height: 40px; font-size: 13.5px; }
  .batch-bar .btn[data-batch-clear] { flex: 0 0 24%; }
}


/* ---------------- 看板 ---------------- */
.board { display: grid; gap: 12px; }
.ocard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.ocard.overdue { border-color: #f5c2bd; }
.ocard.overdue::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.ocard .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ocard .no { font-weight: 650; font-size: 15px; letter-spacing: .2px; }
.ocard .meta { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.ocard .meta i { color: var(--muted); font-style: normal; }
.ocard .right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ocard .stage { margin-top: 12px; color: var(--text-2); font-size: 12.5px; }
.ocard .stage b { color: var(--text); font-weight: 600; }
.steps { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; }
.step { flex: 1 0 74px; min-width: 74px; }
.step .bar { height: 6px; border-radius: 3px; background: var(--gray-soft); }
.step .nm { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.s1 .bar { background: var(--primary); }
.step.s2 .bar { background: #16a34a; }
.step.s3 .bar { background: #f59e0b; }
.step.s4 .bar { background: var(--red); }
.step.s2 .nm { color: #166534; }
.step.s1 .nm { color: var(--primary-dark); }
.step.s4 .nm { color: var(--red); font-weight: 600; }
.ocard .tips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 阶段超时：哪道工序超了几天 */
.late-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.late-lead {
  font-size: 12px; color: var(--red); background: var(--red-soft);
  border-radius: 6px; padding: 1px 7px; line-height: 20px; font-weight: 600;
}
.late-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 20px;
  padding: 1px 8px; border-radius: 20px; white-space: nowrap;
  background: #fff7ed; color: var(--orange); border: 1px solid #fed7aa; cursor: help;
}
.late-chip b { color: var(--red); font-weight: 650; }
.late-chip.bad { background: var(--red-soft); border-color: #f7c9c4; color: var(--red); }
.late-more { font-size: 12px; color: var(--muted); }
.ocard .stage .stay { color: var(--orange); font-weight: 600; }
.step.late .bar { box-shadow: 0 0 0 1.5px rgba(217, 45, 32, .45); }
.step.late .nm { color: var(--red); font-weight: 600; }

/* ---------------- 交期日历 ---------------- */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-week div { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 104px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 5px;
}
.cal-cell.out { background: #fafbfd; border-style: dashed; }
.cal-cell.we:not(.out) { background: #fcfdff; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); background: #fbfdff; }
.cal-d { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; }
.cal-cell.today .cal-d { color: var(--primary); }
.cal-n { font-size: 11px; font-weight: 500; color: var(--muted); background: var(--gray-soft); border-radius: 10px; padding: 0 6px; }
.cal-ev { display: grid; gap: 4px; }
.cal-item {
  display: block; width: 100%; text-align: left; font: inherit; line-height: 1.35; color: var(--text);
  border: 1px solid transparent; border-left: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 6px; padding: 4px 6px; cursor: pointer;
}
.cal-item b { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item i { display: block; font-style: normal; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-item em { display: block; font-style: normal; font-size: 10.5px; color: var(--primary-dark); margin-top: 1px; }
.cal-item:hover { filter: brightness(.97); }
.cal-item.overdue { background: var(--red-soft); border-left-color: var(--red); }
.cal-item.overdue em { color: var(--red); }
.cal-item.soon { background: var(--orange-soft); border-left-color: var(--orange); }
.cal-item.soon em { color: var(--orange); }
.cal-item.done { background: var(--green-soft); border-left-color: var(--green); }
.cal-item.done em { color: var(--green); }
.cal-item.after { background: #e0f5f3; border-left-color: #0f766e; }
.cal-item.after em { color: #0f766e; }
/* 一天要交的太多：每条只写公司名，一条压到一行，靠左边条颜色区分超期/临近/完工 */
.cal-ev.dense { gap: 3px; }
.cal-item.compact { padding: 2px 5px; }
.cal-item.compact b { font-size: 11px; line-height: 1.3; }
.cal-more {
  background: none; border: 0; padding: 1px 2px; text-align: left; cursor: pointer;
  font: inherit; font-size: 10.5px; color: var(--primary); line-height: 1.3;
}
.cal-more:hover { text-decoration: underline; }
/* 手机格子只有 40 多像素宽，「还有 1 张，看清单」会折成三行，窄屏只留「+1」 */
.cal-more .cm-short { display: none; }
@media (max-width: 640px) {
  .cal-more .cm-long { display: none; }
  .cal-more .cm-short { display: inline; }
  .cal-item.compact b { font-size: 10.5px; }
}
/* 从「还有 N 张」跳过来的那一行，闪一下让人看见 */
.cal-row.flash td { background: var(--primary-soft, #e8efff); transition: background .3s; }
.cal-sum { margin: 12px 2px 0; font-size: 12.5px; color: var(--text-2); }
.cal-sum b { color: var(--text); }

/* ---------------- 设备：类型（大类）+ 名称（小类） ---------------- */
.dev-wrap { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 14px; align-items: start; }
.dev-main { min-width: 0; }
.dt-panel { padding: 12px 10px 10px; position: sticky; top: 72px; }
.dt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 4px 9px; border-bottom: 1px solid var(--line); margin-bottom: 7px;
}
.dt-head b { font-size: 13.5px; }
.dt-head .muted { margin-left: 6px; }
.dt-item-wrap { position: relative; display: flex; align-items: center; border-radius: 8px; }
.dt-item-wrap:hover { background: #f6f9fe; }
.dt-item {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.dt-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-item em {
  flex: none; font-style: normal; font-size: 12px; color: var(--muted);
  background: var(--gray-soft); border-radius: 10px; padding: 0 7px; line-height: 18px;
}
.dt-item.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.dt-item.on em { background: #fff; color: var(--primary); }
.dt-acts { display: none; gap: 2px; padding-right: 6px; }
.dt-item-wrap:hover .dt-acts { display: flex; }
.dt-acts .btn { padding: 1px 6px; font-size: 11px; border-color: transparent; background: transparent; }
.dt-acts .btn:hover { background: #e8eef8; }
.dt-foot { padding: 9px 4px 2px; border-top: 1px solid var(--line); margin-top: 8px; line-height: 1.65; }
.dt-empty { padding: 12px 6px; line-height: 1.75; }

/* ---------------- 抽屉 ---------------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { width: 720px; max-width: 96vw; background: #f8fafc; height: 100%; overflow-y: auto; box-shadow: -8px 0 30px rgba(16,24,40,.12); }
.drawer .dhead { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.drawer .dhead h3 { margin: 0; font-size: 15px; }
.drawer .dbody { padding: 16px 20px 60px; }
.close-x { border: 0; background: #f1f5f9; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 16px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 20px 50px rgba(16,24,40,.2); }
.modal.wide { width: 820px; }
.modal .mhead { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .mhead h3 { margin: 0; font-size: 15px; }
.modal .mbody { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal .mfoot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* 工序编辑行 */
.prow { display: grid; grid-template-columns: 26px 1fr 116px 72px 44px 44px 76px; gap: 8px; align-items: center; margin-bottom: 8px; }
.prow .seq { text-align: center; color: var(--muted); font-size: 12px; }
/* 并行勾选：勾上表示和上一道同时开工，这组按最长的那道算天数 */
.prow .par-c { display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.prow .par-c input { width: 16px; height: 16px; padding: 0; cursor: pointer; }
.prow .par-c .par-t { display: none; }
.prow .par-c .par-none { color: var(--muted); font-size: 12px; }
/* 售后勾选：只有最后一道能勾，前面做完算设备完成，这道做完整单才闭环 */
.prow .after-c { display: flex; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.prow .after-c input { width: 16px; height: 16px; padding: 0; cursor: pointer; }
.prow .after-c .after-t { display: none; }
.prow .acts { display: flex; gap: 2px; }
.prow .acts button { border: 0; background: #eef2f7; border-radius: 6px; width: 22px; height: 22px; cursor: pointer; color: var(--text-2); font-size: 12px; line-height: 1; }
.prow .acts button:hover { background: #e2e8f0; }
.prow input, .prow select { padding: 6px 8px; font-size: 13px; }

/* 新建订单：选了流程后逐道改工期 */
.fp-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: #f8fafc; }
.fp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fp-head b { font-size: 13px; }
.fp-head .muted { font-size: 12px; }
.fp-rows { display: flex; flex-direction: column; gap: 2px; }
.fp-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 88px; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 7px; }
.fp-row.chg { background: rgba(37, 99, 235, .07); }
.fp-seq { text-align: center; color: var(--muted); font-size: 12px; }
.fp-name { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.fp-name b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-name em { font-size: 11.5px; color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「∥ 并行」小标：提醒这一道和上一道同时干，合计天数不是简单相加 */
.fp-name b .fp-par { font-style: normal; font-weight: 500; font-size: 11px; color: var(--primary); background: var(--primary-soft, #e8efff); border-radius: 20px; padding: 1px 6px; margin-left: 6px; }
.fp-name b .fp-after { font-style: normal; font-weight: 500; font-size: 11px; color: #0f766e; background: #e0f5f3; border-radius: 20px; padding: 1px 6px; margin-left: 6px; }
.fp-row.chg .fp-name em { color: var(--primary); }
.fp-days { display: flex; align-items: center; gap: 4px; }
.fp-days input { width: 100%; min-width: 0; padding: 5px 6px; font-size: 13px; text-align: right; }
.fp-row.chg .fp-days input { border-color: var(--primary); background: #fff; font-weight: 600; }
.fp-days i { font-style: normal; font-size: 12px; color: var(--muted); }
.fp-foot { margin-top: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.fp-foot b { color: var(--text); white-space: nowrap; }
.fp-late { color: var(--red); font-style: normal; font-weight: 600; }
.fp-ok { color: var(--green); font-style: normal; font-weight: 600; }
/* 订单详情里标一下这道工序的工期是这一单单独定的 */
.fp-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 20px; font-size: 11px; background: var(--primary-soft, #e8efff); color: var(--primary); vertical-align: 1px; }
.fp-tag.after { background: #e0f5f3; color: #0f766e; }
/* 「我的工序」里被退回重做过的工序，说明列下面挂一行原因 */
.p-reopen { display: block; margin-top: 3px; font-size: 12px; color: #b45309; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(140deg, #101828 0%, #1e293b 55%, #24406b 100%); padding: 20px; }
.login-card { width: 360px; max-width: 100%; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.login-card .lb { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.login-card .lb .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.login-card h2 { font-size: 17px; margin: 0; }
.login-card p.hint { color: var(--muted); font-size: 12px; margin: 0 0 18px; }
.login-err { background: var(--red-soft); color: var(--red); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; margin-bottom: 12px; }

/* 提示条 */
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: #101828; color: #fff; padding: 9px 16px; border-radius: 9px; font-size: 13px; z-index: 100; opacity: 0; transition: opacity .18s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.toast.err { background: #b42318; }

.notice { padding: 10px 12px; border-radius: 9px; font-size: 12.5px; background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; }
.notice.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.timeline { position: relative; padding-left: 18px; }
.timeline .ti { position: relative; padding: 0 0 14px 0; }
.timeline .ti::before { content: ""; position: absolute; left: -14px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.timeline .ti.s1::before { background: var(--primary); }
.timeline .ti.s2::before { background: #16a34a; }
.timeline .ti.s3::before { background: #f59e0b; }
.timeline .ti.s4::before { background: var(--red); }
.timeline .ti::after { content: ""; position: absolute; left: -10.5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline .ti:last-child::after { display: none; }
.timeline .ti .t { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline .ti .t b { font-size: 13.5px; font-weight: 600; }
.timeline .ti .d { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------------- 生产看板 · 大屏视图 ---------------- */
body.big-mode { background: #060a12; }
body.big-mode .side { display: none; }
body.big-mode .topbar { display: none; }
body.big-mode .content { max-width: none; padding: 0; }

.bigscreen {
  position: relative; height: 100vh; min-height: 0; overflow: hidden; padding: 18px 22px 22px;
  color: #e7eefc; font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 420px at 6% -10%, rgba(56, 110, 255, .22), transparent 62%),
    radial-gradient(820px 460px at 100% -6%, rgba(20, 220, 170, .12), transparent 58%),
    linear-gradient(180deg, #0a1424 0%, #070d18 55%, #050810 100%);
}
.bigscreen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 170, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, .055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 76%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 76%);
}

.big-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; margin-bottom: 16px; flex-wrap: wrap; }
.big-brand { display: flex; align-items: center; gap: 12px; }
.big-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: #25d0a0; box-shadow: 0 0 12px #25d0a0; animation: bigPulse 1.8s ease-in-out infinite; }
.big-brand h2 {
  margin: 0; font-size: 21px; font-weight: 650; letter-spacing: 4px;
  background: linear-gradient(90deg, #eaf2ff, #8fbcff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.big-brand .sub { font-size: 12px; color: #7d94b6; letter-spacing: .6px; }

/* 实时状态：数据更新时刻 + 下次刷新倒计时，刷新成功闪一下绿边，连不上服务变红 */
.big-live {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .4px;
  padding: 6px 12px; border-radius: 999px; color: #87a0c2;
  background: rgba(37, 208, 160, .07); border: 1px solid rgba(37, 208, 160, .2);
  transition: background .2s, border-color .2s;
}
.big-live i { width: 6px; height: 6px; border-radius: 50%; background: #25d0a0; box-shadow: 0 0 8px #25d0a0; animation: bigPulse 2.4s ease-in-out infinite; }
.big-live b { color: #9fd8c6; font-weight: 600; font-variant-numeric: tabular-nums; }
.big-live .cd { color: #6f88a8; font-variant-numeric: tabular-nums; }
.big-live.flash { animation: bigLiveFlash .9s ease-out; }
.big-live.bad { background: rgba(255, 93, 108, .1); border-color: rgba(255, 93, 108, .36); color: #ffb3ba; }
.big-live.bad i { background: #ff5d6c; box-shadow: 0 0 8px #ff5d6c; }
.big-live.bad b, .big-live.bad .cd { color: #ff9aa4; }
@keyframes bigLiveFlash {
  0% { border-color: rgba(37, 208, 160, .95); box-shadow: 0 0 0 4px rgba(37, 208, 160, .16); }
  100% { border-color: rgba(37, 208, 160, .2); box-shadow: 0 0 0 0 rgba(37, 208, 160, 0); }
}
.big-clock { margin-left: auto; display: flex; align-items: baseline; gap: 12px; }
.big-clock .t { font-size: 27px; font-weight: 650; letter-spacing: 1.5px; color: #dbe9ff; }
.big-clock .d { font-size: 12px; color: #87a0c2; letter-spacing: .5px; }
.big-acts { display: flex; gap: 8px; }
.big-btn {
  background: rgba(77, 141, 255, .12); border: 1px solid rgba(120, 170, 255, .34); color: #cfe1ff;
  padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s;
}
.big-btn:hover { background: rgba(77, 141, 255, .24); border-color: rgba(120, 170, 255, .55); }
.big-btn.solid { background: linear-gradient(135deg, #3b82f6, #2563eb); border-color: transparent; color: #fff; }
.big-btn.solid:hover { filter: brightness(1.1); }
.big-btn.ghost { background: transparent; border-color: rgba(120, 170, 255, .22); color: #9db4d4; font-variant-numeric: tabular-nums; }

.big-kpis { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 16px; }
.big-kpi {
  position: relative; overflow: hidden; padding: 13px 18px 14px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(25, 42, 71, .92), rgba(13, 23, 40, .86));
  border: 1px solid rgba(120, 170, 255, .16);
}
.big-kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--k); box-shadow: 0 0 18px var(--k);
}
.big-kpi .k { font-size: 12.5px; color: #8ea6c8; letter-spacing: .6px; }
.big-kpi .v { font-size: 38px; font-weight: 700; line-height: 1.15; letter-spacing: -1px; color: #eaf2ff; }
.big-kpi .v small { font-size: 13px; font-weight: 500; color: #7d94b6; margin-left: 6px; letter-spacing: 0; }
.big-kpi .sub2 { font-size: 11.5px; color: #7d94b6; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.big-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 14px; align-items: stretch; flex: 1; min-height: 0; }
.big-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.big-left .big-panel { display: flex; flex-direction: column; min-width: 0; }
/* 订单进度独占左半边：原来还要挤一个交期日历，现在整块都给订单，
   一屏能排 4 行（原来 2 行），再多就由 JS 慢慢往下滚 */
.big-left .big-panel:first-child { flex: 1 1 auto; min-height: 0; }
.big-panel {
  background: linear-gradient(160deg, rgba(22, 37, 63, .9), rgba(12, 21, 36, .86));
  border: 1px solid rgba(120, 170, 255, .16); border-radius: 14px; padding: 14px 16px;
}
.big-panel h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: #c3d6f2; letter-spacing: 1px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.big-panel h3 span { font-size: 11.5px; font-weight: 400; color: #7d94b6; letter-spacing: 0; }

/* 列数跟着屏宽走：1440 三列、1920 四列、窄屏两列，别把卡片拉得太宽 */
.big-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px;
  align-content: start; flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px;
  scrollbar-width: none; }
.big-cards::-webkit-scrollbar { display: none; }
.big-card {
  border-radius: 12px; padding: 8px 12px 9px; cursor: pointer; line-height: 1.35;
  background: linear-gradient(160deg, rgba(28, 46, 76, .9), rgba(14, 24, 40, .92));
  border: 1px solid rgba(120, 170, 255, .16);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  animation: bigIn .45s cubic-bezier(.2, .7, .3, 1) both;
}
.big-card:hover { transform: translateY(-2px); border-color: rgba(120, 170, 255, .45); box-shadow: 0 12px 26px -16px rgba(77, 141, 255, .6); }
.big-card.od { border-color: rgba(255, 93, 108, .42); box-shadow: 0 0 0 1px rgba(255, 93, 108, .12) inset; }
.big-card.od::before { content: ""; }
.big-card .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.big-card .no { font-size: 14px; font-weight: 650; letter-spacing: .6px; color: #eaf2ff; }
.big-card .pctDone { font-size: 14px; font-weight: 650; color: #6ba7ff; }
.big-card .who { display: flex; align-items: baseline; gap: 8px; margin-top: 1px; min-width: 0; }
.big-card .cust { font-size: 12px; color: #a9bfdc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 55%; }
.big-card .dev { font-size: 11px; color: #7d94b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.big-segs { display: flex; gap: 3px; margin: 5px 0 4px; }
.big-segs i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); }
.big-segs i.d { background: linear-gradient(90deg, #1fbf94, #25d0a0); box-shadow: 0 0 10px rgba(37, 208, 160, .35); }
.big-segs i.lt { box-shadow: 0 0 0 1.5px rgba(255, 180, 84, .85); }
.big-segs i.c { background: linear-gradient(90deg, #3b82f6, #6ba7ff); box-shadow: 0 0 10px rgba(77, 141, 255, .5); animation: bigBreath 1.8s ease-in-out infinite; }
.big-segs i.b { background: linear-gradient(90deg, #ff5d6c, #ff8a94); box-shadow: 0 0 12px rgba(255, 93, 108, .6); animation: bigBreath 1s ease-in-out infinite; }
.big-stagerow { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: #8ea6c8; }
.big-stagerow b { color: #dbe9ff; font-weight: 600; }
.big-card .foot { display: flex; align-items: center; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.big-tag { font-size: 11px; padding: 1px 7px; border-radius: 20px; border: 1px solid rgba(120, 170, 255, .26); color: #a9bfdc; white-space: nowrap; }
.big-tag.line { border-color: rgba(120, 170, 255, .18); color: #7d94b6; }
.big-tag.red { color: #ffb3ba; border-color: rgba(255, 93, 108, .5); background: rgba(255, 93, 108, .12); }
.big-tag.warn { color: #ffd7a3; border-color: rgba(255, 180, 84, .45); background: rgba(255, 180, 84, .12); }
.big-tag.ok { color: #8ff0d0; border-color: rgba(37, 208, 160, .45); background: rgba(37, 208, 160, .12); }
.big-tag.cy { color: #9fe9f5; border-color: rgba(34, 211, 238, .45); background: rgba(34, 211, 238, .12); }
.big-tag.wait { color: #c3cede; border-color: rgba(160, 178, 200, .32); background: rgba(160, 178, 200, .08); }

/* 待售后：生产工序已经全绿，卡片改用青色标识，进度条单独算售后天数 */
.big-card.aft { background: linear-gradient(160deg, rgba(20, 54, 70, .92), rgba(11, 26, 36, .92)); border-color: rgba(34, 211, 238, .28); }
.big-card.aft:hover { border-color: rgba(34, 211, 238, .6); box-shadow: 0 12px 26px -16px rgba(34, 211, 238, .55); }
.big-card .pctDone.cy { color: #67e3f5; }
.big-aftbar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .09); overflow: hidden; margin: 6px 0 5px; }
.big-aftbar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #0ea5b7, #22d3ee); box-shadow: 0 0 10px rgba(34, 211, 238, .45); }
.big-aftbar.late i { background: linear-gradient(90deg, #ff5d6c, #ff8a94); box-shadow: 0 0 10px rgba(255, 93, 108, .55); }
/* 还没点开始：空心条纹，表示「等客户提货、不计时」 */
.big-aftbar.wait { background: repeating-linear-gradient(90deg, rgba(160, 178, 200, .22) 0 6px, rgba(160, 178, 200, .06) 6px 12px); }
.big-aftbar.wait i { background: none; box-shadow: none; }
.big-card .big-remark.aft-note { color: #7fb6c4; }
/* 订单区里分段（在制 → 待售后），整行占满不做卡片 */
.big-group {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; margin: 4px 0 -2px;
  font-size: 12.5px; font-weight: 600; color: #9fe9f5; letter-spacing: .6px;
}
.big-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(34, 211, 238, .4), transparent); align-self: center; }
.big-group span { font-size: 11px; font-weight: 400; color: #6d8fa0; letter-spacing: 0; }

.big-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding-right: 2px; scrollbar-width: none; }
.big-side::-webkit-scrollbar { display: none; }
.big-side .big-panel { flex: 0 0 auto; padding: 12px 14px; }
.big-side .big-panel:last-child { flex: 1 1 auto; }
.big-side .big-panel .big-empty { padding: 6px 0 2px; }
.big-ring { display: flex; align-items: center; gap: 18px; }
.big-ring svg { width: 112px; height: 112px; flex: none; }
.big-ring .pct { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: #eaf2ff; }
.big-ring .txt { font-size: 11.5px; color: #7d94b6; margin-top: 2px; max-width: 150px; line-height: 1.5; }

.big-dept { display: grid; grid-template-columns: 62px 1fr 26px; gap: 8px; align-items: center; font-size: 12.5px; color: #a9bfdc; margin-bottom: 9px; }
.big-dept:last-child { margin-bottom: 0; }
.big-dept .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-dept .track { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.big-dept .fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3b82f6, #6ba7ff); box-shadow: 0 0 10px rgba(77, 141, 255, .4); }
.big-dept .n { text-align: right; color: #dbe9ff; }

.big-item { display: flex; gap: 9px; font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed rgba(120, 170, 255, .14); line-height: 1.55; }
.big-item:last-child { border-bottom: 0; padding-bottom: 0; }
.big-item .dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5d6c; box-shadow: 0 0 8px #ff5d6c; margin-top: 7px; flex: none; }
.big-item .dot.warn { background: #ffb454; box-shadow: 0 0 8px #ffb454; }
.big-item .dot.aft { background: #22d3ee; box-shadow: 0 0 8px #22d3ee; }
.big-item .dot.bad { background: #ff5d6c; box-shadow: 0 0 8px #ff5d6c; }
.big-item.link { cursor: pointer; }
.big-item.link:hover .t { color: #fff; }
.big-item .s b.bad { color: #ff9fa9; font-weight: 650; }
.big-item .t { color: #dbe9ff; }
.big-item .s { color: #7d94b6; }
.big-empty { color: #6d83a3; font-size: 12.5px; padding: 12px 0; text-align: center; }

@keyframes bigIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bigPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }
@keyframes bigBreath { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  .big-card, .big-segs i, .big-brand .dot { animation: none !important; }
}

@media (max-width: 1180px) {
  .big-grid { grid-template-columns: 1fr; }
  .big-kpis { grid-template-columns: repeat(3, 1fr); }
  /* 窄屏不强行压一屏，恢复成可滚动 */
  .bigscreen { height: auto; min-height: 100vh; overflow: visible; }
  .big-cards, .big-side { overflow: visible; }
}

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; }
  .brand { padding: 12px 14px; }
  .nav { display: flex; overflow-x: auto; padding: 4px 8px 8px; gap: 4px; }
  .nav a { white-space: nowrap; margin: 0; padding: 7px 11px; }
  .side-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
  .side-foot .who { margin: 0; }
  .side-foot button { width: auto; margin: 0; padding: 5px 10px; }
  .content { padding: 14px 12px 40px; }
  .topbar { padding: 0 14px; height: 48px; }
  .drawer { width: 100%; max-width: 100%; }
  .prow { grid-template-columns: 22px 1fr 1fr 26px; grid-auto-rows: auto; }
  .prow .h { display: none; }
  .prow .par-c { grid-column: 1 / -1; justify-content: flex-start; height: 26px; }
  .prow .par-c .par-t { display: inline; font-size: 12px; color: var(--text-2); }
  .prow .after-c { grid-column: 1 / -1; justify-content: flex-start; height: 26px; }
  .prow .after-c .after-t { display: inline; font-size: 12px; color: var(--text-2); }
  .prow .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .cal-cell { min-height: 76px; padding: 4px; }
  .ogrp-head { gap: 8px; padding: 11px 12px; }
  .ogrp-prog { margin-left: 0; }
  .ogrp-body table.grid th:first-child, .ogrp-body table.grid td:first-child { padding-left: 12px; }
  .bigscreen { padding: 14px 12px 18px; }
  .big-kpis { grid-template-columns: repeat(2, 1fr); }
  .big-clock { margin-left: 0; }
  .big-clock .t { font-size: 22px; }
  .big-cards { grid-template-columns: 1fr; }
  .cal-item { padding: 3px 4px; }
  .cal-item i, .cal-item em { display: none; }
  .cal-week div { font-size: 11px; }
  .dev-wrap { grid-template-columns: 1fr; }
  .dt-panel { position: static; }
  .dt-acts { display: flex; }
}

/* ---------------- 销售人员 ---------------- */
.sp-hero { padding: 13px 16px 14px; margin-bottom: 12px; }
.sp-hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sp-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sp-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(37, 208, 160, .16); }
.sp-seg { display: inline-flex; background: var(--gray-soft); border-radius: 9px; padding: 3px; }
.sp-seg button { border: 0; background: transparent; padding: 5px 13px; border-radius: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.sp-seg button:hover { color: var(--text); }
.sp-seg button.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.sp-nav { display: flex; align-items: center; gap: 7px; }
.sp-nav b { font-size: 14px; min-width: 132px; text-align: center; }
.sp-range { margin: 10px 0 11px; font-size: 12px; }
.sp-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.sp-kpi { background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.sp-kpi .k { display: block; font-size: 12px; color: var(--text-2); }
.sp-kpi .v { display: block; font-size: 21px; font-weight: 650; letter-spacing: -.4px; line-height: 1.35; }
.sp-kpi .v small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.sp-kpi.blue .v { color: var(--primary); }
.sp-kpi.green .v { color: var(--green); }
.sp-kpi.orange .v { color: var(--orange); }
.sp-kpi.red .v { color: var(--red); }
/* 金额是六张卡里最长的（¥123.5 万），字号收一点，别把卡片撑成两行 */
.sp-kpi.money .v { color: #7c3aed; font-size: 19px; letter-spacing: -.2px; }
.sp-cell.sp-money { font-variant-numeric: tabular-nums; }

.sp-table { overflow: auto; margin-top: 10px; }
.sp-table table.grid { min-width: 860px; }
.sp-table table.grid th, .sp-table table.grid td { padding: 8px 10px; }
.sp-table table.grid th { font-size: 11.5px; }
.sp-table th.sp-cell { text-align: right; vertical-align: bottom; }
.sp-table th.sp-cell em { display: block; font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sp-table td.sp-cell { text-align: right; white-space: nowrap; }
.sp-cell .u { font-size: 11px; color: var(--muted); margin-left: 2px; }
.sp-cell em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.sp-n { font-size: 14px; font-weight: 650; }
.sp-sticky { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; }
.sp-table thead th.sp-sticky { background: #fafbfd; z-index: 2; }
.sp-table tfoot td { background: #fafbfd; font-weight: 600; border-top: 1px solid var(--line); }
.sp-table tfoot td.sp-sticky { background: #fafbfd; }
.sp-table tbody tr:hover td.sp-sticky { background: #fbfcfe; }
.sp-name b { font-size: 13.5px; white-space: nowrap; }
.sp-name .sub, .sp-contact .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sp-zero { color: #c8d1de; }
.sp-red { color: var(--red); }
.sp-total { border-left: 1px dashed var(--line); }
.sp-disabled { opacity: .68; }
.sp-unassigned td { background: #fffdf6; }
.sp-unassigned td.sp-sticky { background: #fffdf6; }
.sp-acts { white-space: nowrap; text-align: right; padding-right: 14px !important; }
.sp-acts .btn { padding: 3px 7px; font-size: 11.5px; }
.sp-off { font-style: normal; color: var(--orange); margin-right: 4px; }
.sp-tip { margin-top: 12px; line-height: 1.75; }

@media (max-width: 1200px) {
  .sp-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sp-kpis { grid-template-columns: repeat(2, 1fr); }
  .sp-nav b { min-width: 96px; font-size: 13px; }
}

/* 服务器代码更新后，还开着旧页面的标签页底部弹的提醒（点一下就刷新） */
.build-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 110;
  display: flex; align-items: center; gap: 12px; background: #101828; color: #fff;
  padding: 8px 8px 8px 16px; border-radius: 999px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 12px 30px rgba(16,24,40,.3); }
.build-bar .btn { background: #2563eb; color: #fff; border-color: transparent; }
.build-bar .btn:hover { background: #1d4ed8; }
@media (max-width: 560px) { .build-bar { white-space: normal; border-radius: 14px; width: calc(100vw - 24px); justify-content: space-between; } }

/* 订单备注：列表里最多两行，看板卡片单独一行，大屏一行省略（悬停看全文） */
table.grid td.cell-remark { width: 210px; max-width: 210px; }
.grid .rmk { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.45; color: var(--text-2); white-space: normal; word-break: break-word; }
.ocard .oremark { display: flex; align-items: baseline; gap: 6px; margin-top: 9px; font-size: 12.5px; color: var(--text-2); }
.ocard .oremark i { font-style: normal; color: var(--muted); flex: none; }
.ocard .oremark span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.5; white-space: normal; word-break: break-word; }
.big-card .big-remark { margin-top: 3px; font-size: 10.5px; color: #94abca; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 订单表：日期/订单号这类不该折行，挤的时候让它横向滚动，比折成两三行好读 */
.ogrid .nw { white-space: nowrap; }
/* 选择器要和上面的 table.grid td 同强度，否则内边距改不动 */
table.ogrid th, table.ogrid td { padding-left: 5px; padding-right: 5px; }
.ogrid td.dev-cell { min-width: 150px; max-width: 200px; }
/* 订单表信息量越来越大，列数不能再涨：下单日期并进订单号、金额并进销售、
   备注并进客户，一格两行，宽度省下来给金额和状态 */
.ogrid td.o-cust { max-width: 190px; }
.ogrid .o-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.ogrid .o-prod { font-size: 12px; color: var(--text-2); margin-top: 2px; font-weight: 400; }
.ogrid .o-rmk { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.ogrid .o-money { font-size: 12.5px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
/* 售后进度并进状态格：一行小字，超标准变红，不再单独占一列 */
.ogrid .o-aft { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.ogrid .o-aft.late { color: var(--red); }
/* 1366 这类笔记本屏（侧栏占掉 176px）比 1440 窄一截，列多就容易把「状态」顶到固定操作列底下。
   整体缩半号字、收一点内边距，十列刚好摆得下，不用横向拖 */
@media (min-width: 641px) and (max-width: 1450px) {
  table.ogrid th, table.ogrid td { padding-left: 4px; padding-right: 4px; }
  table.ogrid td { font-size: 12.5px; }
  table.ogrid th { font-size: 11.5px; }
  .ogrid .o-sub, .ogrid .o-rmk, .ogrid .o-aft { font-size: 11px; }
  .ogrid .o-money { font-size: 12px; }
}

/* 订单表列多（12 列），窄一点的屏幕上要横向滚。操作列钉在右边，滚到哪都能直接点「工序 / 改 / 删」 */
@media (min-width: 641px) {
  .ogrid th:last-child, .ogrid td.o-acts {
    position: sticky; right: 0; background: #fff; z-index: 1;
    box-shadow: -8px 0 10px -8px rgba(15, 23, 42, .18);
  }
  .ogrid th:last-child { z-index: 2; }
}

/* ================= 手机适配（≤640px） =================
   车间里不少人拿手机报工，原来这套界面只在电脑上看过：
   表格被挤成一行一个字、工具栏的说明文字竖成一条、按钮只有 27px 高不好点。
   下面按「一台手机 360~430px 宽」重排，平板和电脑不受影响。 */

/* 日历格子里的订单条是 nowrap 的，grid 项默认 min-width:auto 会被它撑宽，
   7 列放不下就得横向拖。给个 0 让省略号真正生效 */
.cal-cell, .cal-ev, .cal-item { min-width: 0; }

@media (max-width: 640px) {
  /* ---------- 头部与导航：少占高度，当前菜单一定看得见 ---------- */
  .brand { padding: 10px 14px 6px; }
  .brand small { display: none; }
  .brand .logo { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
  .nav { padding: 0 8px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 7px 12px; font-size: 13.5px; min-height: 36px; }
  .side-foot { padding: 6px 14px 10px; }
  .side-foot button { padding: 9px 14px; min-height: 36px; }
  .topbar { height: 50px; padding: 0 12px; }
  .topbar h1 { font-size: 15px; }
  .topbar .sub { font-size: 11px; margin-left: 6px; }
  .content { padding: 12px 10px 44px; }

  /* ---------- 手指点得中 ---------- */
  /* 输入框 16px 是条硬线：小于 16 iOS 一聚焦就整页放大，报工时很烦 */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 36px; }
  .btn.sm { min-height: 34px; padding: 6px 11px; font-size: 12.5px; }
  .prow input, .prow select { font-size: 16px; }

  /* ---------- 工具栏：搜索框独占一行，说明文字别竖成一条 ---------- */
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar input, .toolbar select { min-width: 0 !important; flex: 1 1 calc(50% - 4px); }
  .toolbar input[data-kw] { flex: 1 1 100%; }
  .toolbar .grow { flex: 1 1 100%; font-size: 12px; line-height: 1.6; }
  .toolbar .grow:empty { display: none; }
  .toolbar > .btn:last-child { margin-left: auto; }
  .section-head { margin: 14px 0 8px; }
  .head-acts { flex-wrap: wrap; gap: 6px; }

  /* ---------- 订单列表：一行一单，纵向排，不用左右拖 ---------- */
  table.ogrid, table.ogrid tbody, table.ogrid tr { display: block; }
  table.ogrid thead { display: none; }
  table.ogrid tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  table.ogrid tr:last-child { border-bottom: 0; }
  table.ogrid td {
    display: block; padding: 0 !important; border: 0; font-size: 13px;
    width: auto !important; max-width: none !important; min-width: 0 !important;
    white-space: normal !important;
  }
  table.ogrid .o-no { grid-area: 1 / 1; font-size: 14px; }
  table.ogrid .o-status { grid-area: 1 / 2; justify-self: end; align-self: center; }
  table.ogrid .o-cust { grid-area: 2 / 1 / 3 / 3; }
  table.ogrid .o-cust::before { content: "客户 · "; color: var(--muted); font-size: 12px; }
  table.ogrid .o-cust .o-rmk { max-width: none; }
  table.ogrid .o-dev { grid-area: 3 / 1 / 4 / 3; }
  table.ogrid .o-stage { grid-area: 4 / 1; }
  table.ogrid .o-stage::before { content: "阶段 "; color: var(--muted); font-size: 12px; }
  table.ogrid .o-promise { grid-area: 4 / 2; justify-self: end; }
  table.ogrid .o-promise::before { content: ""; }
  table.ogrid .o-promise .o-sub { display: inline; }
  table.ogrid .o-promise .o-sub::after { content: " · "; }
  table.ogrid .o-prom-lb { display: inline; }
  table.ogrid .o-actual { grid-area: 5 / 1; }
  table.ogrid .o-actual::before { content: "实际 "; color: var(--muted); font-size: 12px; }
  table.ogrid .o-status .o-aft { font-size: 11.5px; margin-top: 2px; }
  table.ogrid .o-sales { grid-area: 6 / 1 / 7 / 3; font-size: 12.5px; }
  table.ogrid .o-sales::before { content: "销售 "; color: var(--muted); font-size: 12px; }
  table.ogrid .o-sales .o-money { display: inline; margin-left: 10px; font-size: 13px; }
  table.ogrid .o-sales .o-money::before { content: "金额 "; color: var(--muted); font-size: 12px; font-weight: 400; }
  table.ogrid .o-acts { grid-area: 7 / 1 / 8 / 3; display: flex; gap: 8px; margin-top: 8px; }
  table.ogrid .o-acts .btn { flex: 1; min-height: 40px; font-size: 13.5px; }

  /* ---------- 我的工序：工序变成一张张卡片，开始/完成 放大到 44px ---------- */
  table.proc-grid, table.proc-grid tbody, table.proc-grid tr { display: block; }
  table.proc-grid thead { display: none; }
  table.proc-grid tr {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 3px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  table.proc-grid tr:last-child { border-bottom: 0; }
  table.proc-grid td {
    display: block; padding: 0 !important; border: 0; font-size: 13px;
    width: auto !important; max-width: none !important; min-width: 0 !important;
    white-space: normal !important;
  }
  /* 勾选框占最左一窄列，工序名、状态、说明都从第二列开始，免得勾选框把标题挤成两行 */
  table.proc-grid td.p-check { grid-area: 1 / 1; align-self: center; padding: 0 !important; }
  table.proc-grid .p-name { grid-area: 1 / 2; font-size: 14px; }
  table.proc-grid .p-state { grid-area: 1 / 3; justify-self: end; align-self: center; }
  table.proc-grid .p-dept { grid-area: 2 / 2 / 3 / 4; color: var(--muted); font-size: 12px; }
  table.proc-grid .p-note { grid-area: 3 / 2 / 4 / 4; }  table.proc-grid .p-acts { grid-area: 4 / 2 / 5 / 4; display: flex; gap: 8px; margin-top: 8px; }
  table.proc-grid .p-acts .btn { flex: 1; min-height: 44px; font-size: 14.5px; border-radius: 9px; }
  table.proc-grid .p-acts .btn.danger { flex: 0 0 34%; }
  .ogrp-bar { flex-wrap: wrap; row-gap: 8px; padding: 9px 12px; }
  .ogrp-head { gap: 6px 8px; }

  /* ---------- 其余表格：一行一条，左边字段名、右边值 ---------- */
  table.grid.m-cards, table.grid.m-cards tbody, table.grid.m-cards tr { display: block; }
  table.grid.m-cards thead { display: none; }
  table.grid.m-cards tr { padding: 11px 12px; border-bottom: 1px solid var(--line); }
  table.grid.m-cards tr:last-child { border-bottom: 0; }
  table.grid.m-cards td {
    display: flex; align-items: baseline; gap: 8px; padding: 2px 0 !important; border: 0;
    width: auto !important; max-width: none !important; min-width: 0 !important;
    white-space: normal !important; font-size: 13px;
  }
  table.grid.m-cards td::before {
    content: attr(data-label); flex: 0 0 54px; color: var(--muted); font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  table.grid.m-cards td[data-label=""]::before,
  table.grid.m-cards td:not([data-label])::before { content: none; }
  /* 空字段（比如「实际到」还没到货）就别占一行了 */
  table.grid.m-cards td:empty { display: none; }
  table.grid.m-cards td > input { max-width: none !important; }
  /* 操作按钮那一格没有表头，独占一行铺开 */
  table.grid.m-cards td:last-child { padding-top: 6px !important; }
  table.grid.m-cards td:last-child .btn { min-height: 38px; }

  /* ---------- 日历：7 列压进屏幕 ---------- */
  .cal-week, .cal-grid { gap: 3px; }
  .cal-week div { font-size: 10.5px; padding: 0; }
  .cal-cell { min-height: 64px; padding: 3px 3px 4px; border-radius: 7px; gap: 2px; }
  .cal-d { font-size: 10.5px; }
  .cal-n { display: none; }
  .cal-item { padding: 4px 3px; border-left-width: 2px; border-radius: 4px; }
  .cal-item b { font-size: 9.5px; }

  /* ---------- 弹窗 / 抽屉：底部留出手势条的位置 ---------- */
  .modal-mask { padding: 3vh 8px calc(3vh + env(safe-area-inset-bottom)); }
  .modal .mhead { padding: 12px 14px; }
  .modal .mbody { padding: 14px; max-height: 64vh; }
  .modal .mfoot { padding: 12px 14px; flex-wrap: wrap; }
  .modal .mfoot .btn { flex: 1; min-height: 42px; }
  .close-x { width: 36px; height: 36px; font-size: 17px; }
  .drawer .dbody { padding: 12px 14px 70px; }
  .drawer .dhead { padding: 12px 14px; }
  .grid2 { grid-template-columns: 1fr; }

  /* 销售业绩表是「销售 × 设备类型」的矩阵，硬拆成卡片反而看不懂，
     保持横向滚动，姓名列已经 sticky 所以不会丢 */
  .sp-table table.grid { min-width: 720px; }
  .sp-kpis { gap: 8px; }
  .sp-kpi { padding: 7px 10px; }
  .sp-kpi .v { font-size: 18px; }
  .sp-hero { padding: 10px 12px 12px; }
  .sp-nav b { min-width: 84px; }
  .sp-seg button { padding: 5px 10px; }
}

/* 平板竖屏（641~900px）介于手机和电脑之间：10 列的表格会被压成一字一行，
   与其硬挤，不如让它横向滚动（外层 .card 本来就是 overflow:auto） */
@media (min-width: 641px) and (max-width: 900px) {
  table.ogrid { min-width: 950px; }
  /* 备注列只有 width 会被别的定宽列挤到 40 多像素，文字就一字一行了 */
  table.ogrid td.cell-remark { min-width: 170px; }
  table.grid.m-cards { min-width: 700px; }
  table.grid.proc-grid { min-width: 600px; }
}

@media (max-width: 640px) {
  /* 提醒里的「查看订单」是行内链接，字号小、点击区只有 15px 高 */
  #page a[data-order] { display: inline-block; padding: 7px 0; }
}

@media (max-width: 640px) {
  /* 部门账号只有 4 个菜单：收紧一点刚好一屏放得下，不会露出半截让人以为少了个页面 */
  body.dept-mode .nav { gap: 2px; padding: 0 6px 6px; }
  body.dept-mode .nav a { padding: 7px 9px; font-size: 13px; gap: 6px; }
  body.dept-mode .nav a svg { width: 15px; height: 15px; }
}

@media (max-width: 640px) {
  /* 部门账号 5 个菜单：一屏挤不下就换成两行，别让它横着滚、露出半截 */
  body.dept-mode .nav { flex-wrap: wrap; overflow-x: visible; row-gap: 4px; }
  body.dept-mode .nav a { flex: 0 0 auto; }
}

/* ================= AI 分析 =================
   一屏看结论：上面六个指标，中间分段结论，下面预计延误的订单明细。 */
.ai-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.ai-kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
}
.ai-kpi b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ai-kpi span { font-size: 12px; color: var(--muted); }
.ai-kpi.bad b { color: var(--red); }
.ai-kpi.warn b { color: var(--orange); }
.ai-report .ai-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.ai-block { margin-top: 12px; }
.ai-block h4 { font-size: 13px; margin: 0 0 4px; color: var(--primary); letter-spacing: .3px; }
.ai-block p { margin: 0; font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }

/* 卡住原因分类：横条比数字更快看出哪类占大头 */
.bl-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.bl-name { flex: 0 0 88px; font-size: 13px; }
.bl-track { flex: 1; height: 8px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; }
.bl-track i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.bl-num { flex: 0 0 84px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .ai-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ai-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ai-kpi b { font-size: 19px; }
  .ai-block p { font-size: 13px; line-height: 1.85; }
  .bl-name { flex-basis: 70px; font-size: 12.5px; }
  .bl-num { flex-basis: 70px; }
}

/* hidden 属性要真的隐藏：.btn 等类自带 display:inline-flex，会盖掉浏览器默认的 [hidden] */
[hidden] { display: none !important; }

/* ---------------- 效率报表 ---------------- */
.eff-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.eff-head b { font-size: 14px; }
.eff-head .muted { font-size: 12px; }
.eff-scroll { overflow-x: auto; }
/* 偏差幅度条：正数（比标准多花）红，负数（提前）绿，长度按本表最大绝对值归一 */
.eff-bar {
  display: inline-block; width: 110px; height: 8px; border-radius: 4px;
  background: var(--gray-soft); overflow: hidden; vertical-align: middle;
}
.eff-bar i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.eff-bar.bad i { background: var(--red); }
.eff-bar.warn i { background: var(--orange); }
.eff-bar.ok i { background: var(--green); }
@media (max-width: 640px) {
  .eff-bar { width: 70px; }
}

/* 新建订单的工序工期表：手机上序号窄一点，天数输入框留够点按面积 */
@media (max-width: 640px) {
  .fp-box { padding: 10px 11px; }
  .fp-row { grid-template-columns: 18px minmax(0, 1fr) 78px; gap: 8px; padding: 5px 2px; }
  .fp-days input { padding: 6px 5px; font-size: 14px; }
  .fp-foot { font-size: 12px; }
}

/* ---------------- 订单表：退单灰显、备注并进设备列 ---------------- */
/* 退单不是删除：这一行还留着对账，但整行灰掉、按钮只剩「查看 / 彻底删除」 */
.ogrid tr.o-returned td { color: var(--muted); background: #f5f6f8; }
.ogrid tr.o-returned .o-no b { color: var(--muted); }
.ogrid tr.o-returned td.o-acts { background: #f5f6f8; }
.ogrid tr.o-returned .o-prod,
.ogrid tr.o-returned .o-money { color: #98a2b3; }
.ogrid .o-ret { font-size: 11.5px; color: var(--orange); margin-top: 3px; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogrid tr.o-returned .o-ret { color: #98a2b3; }
/* 设备列的备注：一行省略，悬停看全文；不再显示型号、设备编号、工艺流程 */
.ogrid td.dev-cell .o-rmk { max-width: 190px; margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.ogrid .o-promise b { font-size: 12.5px; }
.ogrid .o-prom-lb { display: none; font-style: normal; font-weight: 400; color: var(--muted); font-size: 11.5px; }
/* 操作列现在有 5 个按钮，压成紧凑尺寸才放得下（1366 屏也不挤掉状态列） */
.ogrid .o-acts { display: flex; gap: 2px; flex-wrap: nowrap; align-items: center; }
.ogrid .o-acts .btn.sm { padding: 3px 6px; font-size: 11.5px; min-height: 24px; line-height: 1.3; }
.ogrid .o-acts .o-del { padding: 2px 5px; color: var(--muted); font-size: 14px; }

/* ---------------- 验收记录（UV 墨水 / 附着力 / 流平性） ---------------- */
.p-acc { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  font-size: 11.5px; color: var(--primary); background: rgba(37, 99, 235, .08); }
.acc-note { margin-top: 4px; font-size: 11.5px; color: var(--primary); }

/* ---------------- AI 自由提问 ---------------- */
.ask-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 12px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; min-width: 0; }
.ask-samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; font-size: 12px; }
.ask-chip { border: 1px dashed var(--line); background: #f8fafc; color: var(--text-2);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.ask-chip:hover { border-color: var(--primary); color: var(--primary); background: #eff4ff; }
.ask-q-line { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 10px;
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.6; }
.ask-q-line span { flex: none; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--primary); border-radius: 4px; padding: 1px 5px; }
.ask-history { margin-top: 12px; }
.ask-old { display: block; width: 100%; text-align: left; background: none; border: 0;
  border-top: 1px solid var(--line); padding: 9px 0; cursor: pointer; font-family: inherit; }
.ask-old:first-of-type { border-top: 0; }
.ask-old span { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.ask-old i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted);
  margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-old:hover span { color: var(--primary); }

@media (max-width: 640px) {
  .ask-row { flex-direction: column; }
  .ask-row .btn { width: 100%; }
  .ogrid td.dev-cell .o-rmk { max-width: none; white-space: normal; }
  .ogrid .o-ret { max-width: none; white-space: normal; }
  .ogrid tr.o-returned td { background: #f8f9fb; }
}

/* ---------------- 企业微信对接 ---------------- */
/* 侧栏按钮：绑定后变绿，一眼能看出这个账号已经能免登录收提醒 */
.side-foot button.on { color: #86e8c9; background: rgba(37, 208, 160, .14); }
.side-foot button.on:hover { background: rgba(37, 208, 160, .24); color: #c2f8e9; }

/* 登录页顶部提示（企微免登录失败的原因写在这里，比一闪而过的 toast 好读） */
.login-note {
  margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.65;
  background: #fff6e8; color: #8a5a12; border: 1px solid #ffd9a8;
}

/* 报表接收人多选：一行几个，绑没绑企微直接标在右边 */
.wecom-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin-top: 6px; }
.wecom-pick-i {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; min-width: 0;
}
.wecom-pick-i:hover { border-color: #b9c8dd; }
/* 姓名和部门挤一行：一人一格顶多两字部门，竖排会把 8 个人撑成 300px 高 */
.wecom-pick-i > span { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 5px; overflow: hidden; }
.wecom-pick-i > span > i {
  font-style: normal; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wecom-pick-i em { flex: none; font-style: normal; font-size: 10.5px; color: #c26a12; white-space: nowrap; }
/* 推送台账：时间是定长，别让它折成两行；详情里会有很长的错误串，要能断 */
.wlog-time { white-space: nowrap; }
.wlog-detail { font-size: 12px; color: #5b6b81; word-break: break-all; line-height: 1.6; }

/* 日报周报预览：保留换行，等宽一点好对齐 */
.report-pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font: 13px/1.85 "PingFang SC", "Microsoft YaHei", monospace; color: #1f2d3d;
}

/* 全局 input 是 width:100%，勾选框被撑成一整行 —— 这几处必须收回来 */
.wecom-pick-i > input[type="checkbox"],
label.check > input[type="checkbox"] {
  width: 15px; height: 15px; flex: none; padding: 0; margin: 0; cursor: pointer; accent-color: #2563eb;
}
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.6; }

/* 手机上侧栏变成顶部横条，再放一个「企业微信：已绑定」会把姓名挤没；
   顶栏已经有「企微」入口了，这里收起来 */
@media (max-width: 640px) {
  .side-foot [data-wecom] { display: none; }
}
