/* AI生成 */
/* ============ 衣序 全局样式 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e3e6ea;
  --text: #24292f;
  --muted: #8b949e;
  --primary: #2563eb;
  --danger: #d93025;
  --warn: #f59e0b;
  --ok: #16a34a;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.app-header {
  display: flex; align-items: center; gap: 24px;
  background: #1e293b; color: #fff; padding: 10px 20px;
  position: sticky; top: 0; z-index: 50;
}
.brand { font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand .sub { font-size: 11px; font-weight: 400; color: #94a3b8; margin-left: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs button {
  background: transparent; border: none; color: #cbd5e1; padding: 8px 16px;
  font-size: 14px; cursor: pointer; border-radius: 6px; font-family: inherit;
}
.tabs button:hover { background: #334155; color: #fff; }
.tabs button.active { background: var(--primary); color: #fff; }
.header-right { margin-left: auto; font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 10px; }
/* 年份窗口（全局：决定加载哪几年） */
.year-window { display: inline-flex; align-items: center; gap: 5px; color: #cbd5e1; }
.year-window select {
  background: #334155; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px;
  padding: 3px 6px; font-size: 12px; font-family: inherit;
}
.loaded-years { color: #94a3b8; white-space: nowrap; }/* 只读身份提示（业务人员）：页头常驻，避免用户以为按钮坏了 */
.readonly-chip {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600;
}
/* 职位权限矩阵 */
.perm-table td { white-space: nowrap; }
.perm-table th:not(:first-child), .perm-table td:not(:first-child) { text-align: center; width: 84px; }
.perm-hint { display: block; color: #94a3b8; font-size: 11px; font-weight: 400; }
.perm-yes { color: #15803d; font-weight: 700; }
.perm-no { color: #cbd5e1; }
.img-cell.muted { color: #94a3b8; font-size: 11px; }
/* 已下单行的物料信息：锁定态（视觉上比普通只读更"灰"，鼠标为默认） */
td.material-locked { background: #f8fafc; color: #64748b; cursor: default; }
td.material-locked::after { content: " 🔒"; font-size: 9px; opacity: .55; }
.merge-cell[title*="锁定"] { background: #f8fafc; }
@media (max-width: 900px) {
  .loaded-years { display: none; }
}

main { padding: 16px 20px; max-width: 1800px; margin: 0 auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- 预警看板 ---- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.alert-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.alert-card.hot { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(217,48,37,.08); }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card-title .count { background: var(--danger); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 8px; }
.card-title .count.zero { background: var(--ok); }
.card-body { max-height: 300px; overflow-y: auto; }
.alert-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  border-bottom: 1px dashed var(--line); cursor: pointer;
}
.alert-item:hover { background: #f0f4ff; }
.alert-item .style { font-weight: 700; color: var(--primary); white-space: nowrap; }
.alert-item .style.order-link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.alert-item .style.order-link:hover { color: #1d4ed8; }
.alert-item .desc { flex: 1; }
.alert-item .date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.alert-item .date.late { color: var(--danger); font-weight: 700; }
.alert-item .alert-thumb {
  height: 26px; max-width: 38px; border-radius: 3px; border: 1px solid var(--line);
  object-fit: cover; vertical-align: middle; margin-right: 4px; flex-shrink: 0;
}
.alert-item .done-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 4px;
  font-size: 11px; padding: 2px 6px; cursor: pointer; color: var(--muted); font-family: inherit;
}
.alert-item .done-btn:hover { border-color: var(--ok); color: var(--ok); }
.board-note { margin-top: 14px; color: var(--muted); font-size: 12px; }
.handled { opacity: .45; text-decoration: line-through; }

/* ---- 工具栏 / 按钮 ---- */
/* 工具栏吸顶：滚动时新增/导出/搜索/筛选一直留在视图内（紧贴头部下方），
   --toolbar-top 由 app.js 按实际头部高度动态写入 */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
  position: sticky; top: var(--toolbar-top, 57px); z-index: 40;
  background: var(--bg); padding: 8px 0 6px;
}
.btn {
  border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-family: inherit; color: var(--text);
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.search, .num-input {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 13px; width: 220px; font-family: inherit;
}
.num-input { width: 90px; }
.sort-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sort-label select { font-family: inherit; padding: 6px; border: 1px solid var(--line); border-radius: 6px; }
.sort-dir { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.file-label { position: relative; overflow: hidden; display: inline-block; }
.file-label input { position: absolute; left: -999px; }

/* ---- 表格 ---- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table.fixed-layout { table-layout: fixed; }
.data-table.fixed-layout td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; /* colgroup 控宽 + 省略号 */
}
/* 采购表例外：内容换行完整显示，不截断 */
.pur-group .data-table.fixed-layout td { max-width: none; }
.data-table th {
  background: #f1f5f9; text-align: left; padding: 8px 10px; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.data-table td { padding: 7px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.data-table.fixed-layout td { vertical-align: middle; }
.data-table tr:hover td { background: #f8fafc; }
.data-table .style-no { font-weight: 700; color: var(--primary); cursor: pointer; }
.table-wrap.small .data-table { font-size: 12px; }
.empty-tip { padding: 30px; text-align: center; color: var(--muted); }

/* 延误数字徽标 */
.late-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; margin-right: 6px;
}
.late-badge.today-only { background: var(--warn); }

/* 多行单元格（颜色明细/裁床数） */
td.multi-line {
  white-space: normal !important; overflow: visible !important;
  text-overflow: clip !important; max-width: none !important; line-height: 1.5;
}
td.multi-line .cl-line { display: block; }

/* 宽表格横向滚动 */
.table-wrap.wide { overflow-x: auto; }

/* ---- 采购分组模块 ---- */
.pur-groups { }
.pur-group { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.pur-group.focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.25); transition: box-shadow .3s; }
.order-card.focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.25); transition: box-shadow .3s; }
.node-row .mark-btn.undo-btn:hover { border-color: var(--warn); color: #b45309; }
.pur-group-head {
  display: flex; align-items: center; gap: 16px; padding: 8px 14px;
  background: #f1f5f9; border-bottom: 1px solid var(--line);
}
.pur-group-head .g-style { font-weight: 700; color: var(--primary); font-size: 14px; cursor: pointer; }
/* 组头款式图片（从订单带过来） */
.pur-group-head .g-order-img {
  height: 40px; max-width: 56px; border-radius: 4px; border: 1px solid var(--line);
  cursor: zoom-in; object-fit: cover; vertical-align: middle;
}
.pur-group-head .g-order-img:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.2); }
.pur-group-head .g-info { color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.pur-group-head .g-info .g-late { color: var(--danger); font-weight: 700; }
.pur-group-body { overflow-x: auto; }
.pur-group-body .data-table { font-size: 12px; }
.pur-group-body .data-table th { position: static; }
/* 采购表自适应宽度：百分比列 + 100% 宽，正常屏幕无横向滚动条 */
.pur-group-body .data-table.pur-table { table-layout: fixed; width: 100%; }
.pur-group-body .data-table.pur-table td.qty-cell { white-space: nowrap; }
.pur-group-body .data-table.pur-table th.pur-eta-col { white-space: nowrap; }
.pur-group-body .data-table.pur-table td[data-field="etaDate"] { white-space: nowrap; }
/* 物料表边框：数据行画完整的单元格线（比默认淡灰更清楚，便于横向对位）
 * 行内新增行不是数据行 → 不画表格线，于是"空表"里不会出现一排横线 */
.pur-group-body .data-table.pur-table th {
  border: 1px solid #c3ccd9; border-top: none;
}
.pur-group-body .data-table.pur-table tbody tr[data-pid] > td {
  border: 1px solid #cbd5e1;
}
.pur-group-body .data-table.pur-table tbody tr.inline-add-row > td {
  border: none;
}
/* 手动修改过采购数量的格：黄底 + ✎手 角标（自动值无标记） */
.pur-group-body .data-table.pur-table td.qty-manual { background: #fef3c7 !important; box-shadow: inset 0 -2px 0 #f59e0b; }

/* 行内新增输入行 */
.inline-add-row td { background: #f8fafc; border: none; padding: 3px 2px; }
.inline-add-row td.ia-placeholder { background: #f8fafc; border: none; } /* 对齐拖拽手柄列的占位 */
.inline-add-row .ia {
  width: 100%; min-width: 54px; border: 1px solid var(--line); border-radius: 4px;
  padding: 4px 5px; font-size: 12px; font-family: inherit;
}
.inline-add-row .ia:focus { border-color: var(--primary); outline: none; }

/* 直接编辑单元格（采购表）：宽度不够自动换行，内容完整显示 */
.pur-group td.cell-edit {
  cursor: text; position: relative; overflow: visible; text-overflow: clip;
  white-space: normal; word-break: break-all; vertical-align: middle;
  min-height: 18px; outline: none; line-height: 1.4;
}
.pur-group td.cell-edit:hover { background: #f0f9ff; box-shadow: inset 0 0 0 1px #bae6fd; }
.pur-group td.cell-edit:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); z-index: 5; }
.pur-group td.cell-edit:empty::before { content: '—'; color: #cbd5e1; }

/* 订单卡行内编辑（span 版，与采购页一致观感）：点击直接改，失焦/回车即存 */
.order-card span.cell-edit {
  cursor: text; outline: none; border-radius: 4px;
  min-width: 2em; min-height: 18px; display: inline-block;
  white-space: normal; word-break: break-all;
  transition: background .12s, box-shadow .12s;
}
.order-card span.cell-edit:hover { background: #f0f9ff; box-shadow: inset 0 0 0 1px #bae6fd; }
.order-card span.cell-edit:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--primary); z-index: 5; }
.order-card span.cell-edit:empty::before { content: '—'; color: #cbd5e1; }
/* 状态原文格占满剩余宽度（原 oc-status 语义保留） */
.order-card span.cell-edit.oc-status { flex: 1; min-width: 180px; }
.pur-group td.calc { color: #475569; white-space: normal; word-break: break-all; }
.pur-group tbody tr { height: 30px; }
.pur-group td { vertical-align: middle; }
/* 可点击的状态标签（未下单/已下单切换） */
.chip.pur-toggle { font-weight: 700; padding: 3px 12px; }
.chip.pur-toggle:hover { filter: brightness(0.96); box-shadow: inset 0 0 0 2px rgba(0,0,0,.12); }
/* ---- 状态选择菜单（点击状态标签弹出，任选三态） ---- */
.state-menu {
  position: fixed; z-index: 400; min-width: 150px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15,23,42,.18); overflow: hidden;
}
.state-menu .sm-title {
  font-size: 11px; color: var(--muted); padding: 6px 10px 4px;
  border-bottom: 1px dashed var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.state-menu .sm-item {
  padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.state-menu .sm-item:hover { background: #eff6ff; color: var(--primary); font-weight: 700; }
.state-menu .sm-item.cur { background: #f8fafc; }
.state-menu .sm-item .sm-now {
  font-size: 10px; color: var(--ok); margin-left: 6px; font-weight: 400;
  border: 1px solid #bbf7d0; border-radius: 3px; padding: 0 4px; background: #f0fdf4;
}
/* 已导出标记的可删除提示（点击 ✕ 删除） */
.chip.pur-unexport:hover { background: #fef2f2 !important; color: var(--danger) !important; border: 1px solid #fecaca; }
/* 拖拽排序（行首手柄触发） */
.pur-group td.drag-handle {
  cursor: grab; color: #94a3b8; text-align: center; user-select: none;
  font-size: 14px; line-height: 1; vertical-align: middle;
}
.pur-group td.drag-handle:hover { color: var(--primary); }
.pur-group td.drag-handle:active { cursor: grabbing; }
.pur-group tr.dragging { opacity: .45; }
.pur-group tr.drag-over td { border-top: 2px solid var(--primary); }

/* ---- 图片（订单卡/采购行/放大查看） ---- */
.img-cell { display: inline-flex; align-items: center; gap: 4px; }
.thumb { height: 34px; max-width: 60px; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; object-fit: cover; vertical-align: middle; }
.thumb.large { height: 160px; max-width: 240px; }
.btn.img-btn { padding: 2px 8px; font-size: 11px; }
/* 采购行首图片格 */
.pur-group td.p-img-cell { text-align: center; padding: 2px; vertical-align: middle; }

/* ---- 挂起与跟催（pending）---- */
.pur-group tr.row-pending td { background: #fffbeb; }
.pur-group tr.row-pending td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.pur-group tr.row-pending:hover td { background: #fef3c7; }
.pur-group td.pend-cell { text-align: center; padding: 4px 6px; }
.pend-tag {
  display: inline-block; padding: 2px 6px; border-radius: 4px; cursor: pointer;
  background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pend-tag:hover { background: #fde68a; }

/* ---- 挂起输入弹窗（原因+日期+时刻一次填完） ---- */
.pend-dialog-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 300;
  display: flex; align-items: center; justify-content: center;
}
.pend-dialog {
  background: var(--card); border-radius: 12px; padding: 18px 20px; width: 380px; max-width: 92vw;
  box-shadow: 0 12px 40px rgba(15,23,42,.25);
}
.pend-dialog .pd-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; color: #92400e; }
.pend-dialog .pd-row { margin-bottom: 10px; }
.pend-dialog .pd-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.pend-dialog .pd-row input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; font-family: inherit; box-sizing: border-box;
}
.pend-dialog .pd-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.pend-dialog .pd-ops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.node-row.row-pending { background: #fffbeb; border-radius: 4px; }
.node-row .pend-tag.node-pend { flex-shrink: 0; }
.alert-card.card-pending .pend-item .desc { color: #92400e; }
.p-thumb { height: 30px; max-width: 34px; border-radius: 3px; border: 1px solid var(--line); cursor: zoom-in; object-fit: cover; }
.p-img-up {
  border: 1px dashed #cbd5e1; background: #f8fafc; color: #64748b; cursor: pointer;
  border-radius: 4px; padding: 3px 5px; font-size: 13px; font-family: inherit;
}
.p-img-up:hover { border-color: var(--primary); color: var(--primary); }
/* 新增行图片格与清除按钮 */
.inline-add-row td.ia-img-cell { background: #f8fafc; text-align: center; vertical-align: middle; }
.img-clear-add { padding: 1px 5px; font-size: 10px; }
/* 武装粘贴态（等待 Ctrl+V） */
.btn.img-btn.waiting, .p-img-up.waiting {
  background: #fef3c7; border-color: var(--warn); color: #b45309;
  box-shadow: 0 0 0 2px rgba(245,158,11,.25); animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(245,158,11,.35); } }
/* 放大查看遮罩 */
.img-lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out;
}
.img-lightbox .img-lb-bar {
  position: absolute; top: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; align-items: center;
  cursor: default;
}
.img-lightbox .img-lb-del { background: #d93025; border-color: #d93025; color: #fff; }
.img-lightbox .img-lb-del:hover { background: #b91c1c; }
.img-lightbox .img-lb-tip { color: #cbd5e1; font-size: 12px; }
.img-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0,0,0,.5); }

/* ---- 订单卡：折叠只占一行，展开才看详情 ---- */
.order-cards { display: flex; flex-direction: column; gap: 8px; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.order-card.alarm { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(217,48,37,.08); }
.order-card.pending { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.oc-pend-btn.pending { background: #fff7ed; border-color: #fed7aa; color: #b45309; font-weight: 600; }
.oc-main {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 8px; font-size: 13px; line-height: 1.7;
}
.oc-main .oc-thumb, .oc-main .oc-thumb-empty { flex: 0 0 40px; }
.oc-main .oc-field {
  display: flex; align-items: baseline; gap: 3px;
  flex: 0 0 auto;
  min-width: 0; overflow: hidden; white-space: nowrap;
}
.oc-main .oc-field-style { flex: 0 0 134px; align-items: flex-start; }
.oc-main .oc-field-style > .oc-style {
  flex: 1 1 auto; min-width: 0;
  overflow: visible; white-space: normal; text-overflow: clip;
  word-break: break-all; overflow-wrap: anywhere; line-height: 1.45;
}
.oc-main .oc-field-colors { flex: 0 0 130px; }
.oc-main .oc-field-qty { flex: 0 0 112px; }
.oc-main .oc-field-bed, .oc-main .oc-field-actual { flex: 0 0 96px; }
.oc-main .oc-field-factory { flex: 0 0 185px; }
.oc-main .oc-field-orderdate { flex: 0 0 136px; }
.oc-main .oc-field-duedate { flex: 0 0 120px; }
.oc-main .oc-field .k { flex: none; color: var(--muted); margin-right: 0; }
.oc-main .oc-field > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-main .oc-field .cell-edit:focus { overflow: visible; position: relative; z-index: 5; background: #fff; }
/* 工厂名过长：在固定列宽内自动换行，不用省略号截断 */
.oc-main .oc-field-factory { align-items: flex-start; overflow: visible; }
.oc-main .oc-field-factory > span:last-child {
  flex: 1 1 auto; min-width: 0;
  overflow: visible; white-space: normal; text-overflow: clip;
  word-break: break-word; overflow-wrap: anywhere; line-height: 1.45;
}
.oc-main .oc-field-factory .cell-edit { white-space: normal; }
.oc-main .oc-field .v { font-weight: 600; }
.oc-main .oc-field [data-role="qty"] { font-variant-numeric: tabular-nums; }
.oc-main .oc-field .v.danger { color: var(--danger); }
.oc-main .oc-field .v.ok { color: var(--ok); }
/* 颜色列按 5 个颜色宽度设计，超过自动换行（颜色做成小标签） */
.oc-main .oc-field-colors { overflow: visible; }
.oc-main .oc-field-colors > .oc-colors {
  display: flex; flex-wrap: wrap; gap: 2px 3px;
  min-width: 0; max-width: 100%; white-space: normal;
  overflow: visible; text-overflow: clip;
}
.oc-color {
  display: inline-block; padding: 0 4px; border-radius: 4px;
  background: #f1f5f9; color: #334155; font-size: 11px; line-height: 1.6; white-space: nowrap;
}
.oc-colors-empty { color: #cbd5e1; }
/* 是否已签合同：可直接点的标签 */
.oc-detail .oc-field-contract { display: inline-flex; align-items: center; gap: 4px; }
.oc-field-fee { align-items: center; }
.oc-fee-input {
  width: 74px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px;
  font-family: inherit; font-size: 12px; background: #fff; text-align: right;
}
.oc-fee-eye {
  border: 0; background: transparent; cursor: pointer; padding: 0 2px;
  font-size: 13px; line-height: 1; color: #64748b;
}
.oc-fee-eye:hover { color: var(--primary); }
.oc-fee-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.oc-contract-export {
  flex: none; padding: 2px 7px; font-size: 11px; white-space: nowrap;
  border: 1px solid #93c5fd; color: #1d4ed8; background: #eff6ff;
}
.oc-contract-export:hover { background: #dbeafe; }
.oc-short-input {
  width: 320px; max-width: 100%; min-width: 180px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px;
  font-family: inherit; font-size: 12px; background: #fff;
}
.oc-short-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.oc-field-short { align-items: center; }
.contract-tag {
  padding: 1px 8px; font-size: 11px; border-radius: 999px; white-space: nowrap;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; cursor: pointer;
}
.contract-tag.signed { background: #ecfdf5; border-color: #a7f3d0; color: #15803d; }
.contract-tag.unsigned { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.contract-tag:not(button) { cursor: default; }
.oc-main .oc-ops { flex: 1 0 auto; margin-left: auto; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.oc-expander { flex: none; white-space: nowrap; }
.oc-thumb { width: 40px; height: 40px; max-width: 40px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; cursor: zoom-in; flex: none; }
.oc-thumb-empty {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px dashed var(--line); border-radius: 6px; color: #cbd5e1; font-size: 16px; flex: none;
}
.oc-ops .btn { padding: 2px 5px; font-size: 11px; }
.oc-detail { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.order-card.expanded .oc-detail { display: block; }
.oc-detail-sec { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: baseline; font-size: 12.5px; line-height: 1.8; margin-bottom: 4px; }
.oc-detail-title { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: #94a3b8; }
.oc-detail .oc-field { white-space: nowrap; }
.oc-detail .oc-field .k { color: var(--muted); margin-right: 4px; }
.oc-detail .oc-field .v { font-weight: 600; }
.oc-detail .oc-field .v.danger { color: var(--danger); }
.oc-detail .oc-field .v.ok { color: var(--ok); }
/* 空值别只剩一条横线：做成编辑窗口那样的虚线输入框；展开区带「点击填写」，折叠行用短横线省宽度 */
.oc-main span.cell-edit:empty {
  min-width: 44px; padding: 0 4px;
  border: 1px dashed #cbd5e1; background: #f8fafc;
}
.oc-main span.cell-edit:empty::before { content: '—'; color: #b6c2d1; font-weight: 400; }
.oc-detail span.cell-edit:empty {
  min-width: 76px; padding: 0 6px;
  border: 1px dashed #cbd5e1; background: #f8fafc;
}
.oc-detail span.cell-edit:empty::before {
  content: '点击填写'; color: #b6c2d1; font-weight: 400; font-size: 11px;
}
.oc-main span.cell-edit:empty:hover,
.oc-detail span.cell-edit:empty:hover { border-color: #93c5fd; background: #f0f9ff; }
.oc-main span.cell-edit:empty:focus,
.oc-detail span.cell-edit:empty:focus { border-style: solid; border-color: var(--primary); background: #fff; }
.oc-main span.cell-edit:empty:focus::before,
.oc-detail span.cell-edit:empty:focus::before { content: ''; }
.oc-field-long {
  display: inline-flex; align-items: baseline; gap: 4px;
  flex: 1 1 260px; white-space: normal !important;
}
.oc-detail .oc-field-long .cell-edit { flex: 1 1 auto; min-width: 120px; }
.oc-detail .oc-field-remain { display: inline-flex; align-items: baseline; gap: 4px; }
.oc-detail .oc-field-remain .cell-edit { min-width: 56px; }
.oc-qty-sum { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #475569; }
.oc-qty-item {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); background: #f8fafc;
}
.oc-qty-item .k { font-size: 11px; color: #94a3b8; }
.oc-qty-item b { font-size: 14px; font-variant-numeric: tabular-nums; }
.oc-qty-item.q-order { background: #eff6ff; border-color: #bfdbfe; }
.oc-qty-item.q-order b { color: #1d4ed8; }
.oc-qty-item.q-bed { background: #fff7ed; border-color: #fed7aa; }
.oc-qty-item.q-bed b { color: #c2410c; }
.oc-qty-item.q-actual { background: #ecfdf5; border-color: #a7f3d0; }
.oc-qty-item.q-actual b { color: #15803d; }
.oc-qty-table { border-collapse: collapse; font-size: 12px; margin-top: 2px; }
.oc-qty-table th, .oc-qty-table td { border: 1px solid var(--line); padding: 1px 8px; text-align: center; white-space: nowrap; }
.oc-qty-table th { background: #f8fafc; color: #64748b; font-weight: 600; }
.oc-qcell { min-width: 48px; cursor: text; }
.oc-qcell[contenteditable="true"]:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: #fff; }
.oc-qcell:empty::before { content: '—'; color: #cbd5e1; }
.oc-qops { width: 32px; padding: 0 !important; }
.oc-qrow-del { padding: 1px 6px; font-size: 11px; line-height: 1; }
.oc-qty-empty { color: #94a3b8; font-size: 12px; }
/* 一色一张小表：同色尺码向下排，多色向右排（放不下自动换行） */
.oc-qty-grid {
  flex: 1 1 100%; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; align-items: start;
}
.oc-qty-color {
  border: 1px solid var(--line); border-radius: 8px; background: #fcfdff;
  padding: 6px 8px; min-width: 0;
}
.oc-qty-color-head { display: flex; align-items: center; gap: 6px; min-height: 24px; margin-bottom: 4px; }
.oc-color-sum { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.oc-color-sum span {
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 4px;
  padding: 0 4px; font-size: 10px; color: #64748b; white-space: nowrap;
}
.oc-color-sum b { color: #334155; margin-left: 2px; }
.oc-qty-color-name {
  flex: 1 1 auto; min-width: 0; padding: 0 4px; border-radius: 4px; outline: none;
  font-weight: 700; color: #334155; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.oc-qty-color-name[contenteditable="true"]:hover { background: #f0f9ff; }
.oc-qty-color-name:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--primary); }
.oc-qty-color-name:empty::before { content: '（未填颜色）'; color: #cbd5e1; font-weight: 400; }
.oc-qty-color .oc-qty-table { width: 100%; }
.oc-qty-color .oc-qty-table th, .oc-qty-color .oc-qty-table td { padding: 1px 4px; font-size: 11.5px; }
.oc-qty-color .oc-qcell { min-width: 0; }
.oc-add-size { margin-top: 4px; padding: 1px 8px; font-size: 11px; }
.oc-add-qcolor { margin-top: 8px; padding: 2px 8px; font-size: 11px; align-self: flex-start; }
/* 实交只读（由交货明细 − 返修明细汇总） */
.oc-qcell.oc-q-actual { background: #f8fafc; color: #15803d; cursor: default; }
.cr-actual-ro {
  display: inline-flex; align-items: center; justify-content: center; min-width: 70px;
  padding: 4px 8px; border: 1px dashed var(--line); border-radius: 5px;
  background: #f8fafc; color: #15803d; font-size: 12px;
}
/* 排单页：订单搜索 + 30 天日历滑块 */
.schedule-range { display: flex; align-items: center; gap: 8px; flex: 1 1 360px; min-width: 260px; }
.schedule-range-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
#scheduleSlider { flex: 1 1 auto; min-width: 150px; accent-color: var(--primary); cursor: pointer; }
.schedule-zoom { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.schedule-zoom .btn { padding: 1px 8px; font-size: 14px; line-height: 1.4; }
#scheduleZoom { width: 90px; accent-color: var(--primary); cursor: pointer; }
.schedule-zoom-label { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 42px; text-align: center; }

.oc-delivery-grid {
  flex: 1 1 100%; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px; align-items: start; margin-bottom: 6px;
}
.oc-date-card {
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fcfdff;
  padding: 6px 8px; min-width: 0;
}
.oc-date-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.oc-date-imgs { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.oc-date-thumb { width: 34px; height: 26px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; cursor: zoom-in; }
.oc-date-img-btn { padding: 2px 6px; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.oc-date-img-btn.waiting { outline: 2px solid var(--primary); background: #eff6ff; }
.oc-date-input {
  flex: 1 1 auto; min-width: 0; padding: 3px 6px; border: 1px solid var(--line);
  border-radius: 5px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: #334155;
}
.oc-date-text { font-weight: 700; color: #334155; font-size: 12.5px; }
.oc-date-table { width: 100%; }
.oc-date-card[data-dkind="repairs"] { min-width: 340px; }
.oc-date-table .oc-d-remark { min-width: 90px; }
.oc-date-table th, .oc-date-table td { padding: 1px 4px; font-size: 11.5px; }
.oc-date-table input {
  width: 100%; min-width: 0; padding: 2px 4px; border: 1px solid var(--line);
  border-radius: 4px; font-family: inherit; font-size: 11.5px; background: #fff;
}
.oc-date-table .oc-d-qty { text-align: right; }
.oc-dops { width: 30px; padding: 0 !important; }
.oc-drow-del { padding: 1px 5px; font-size: 11px; line-height: 1; }
.oc-add-drow, .oc-add-date { margin-top: 4px; padding: 1px 8px; font-size: 11px; }
.oc-add-date { align-self: flex-start; }

.oc-row { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; line-height: 1.8; }
.oc-row .oc-field { white-space: nowrap; }
.oc-row .oc-field .k { color: var(--muted); margin-right: 4px; }
.oc-row .oc-field .v { font-weight: 600; }
.oc-row .oc-field .v.danger { color: var(--danger); }
.oc-row .oc-field .v.ok { color: var(--ok); }
.oc-style { font-weight: 700; color: var(--primary); cursor: pointer; font-size: 14px; }
.oc-status { white-space: normal !important; }
.oc-cline { display: inline-block; margin-right: 10px; white-space: nowrap; }
.oc-ops { margin-left: auto; display: flex; gap: 6px; }
.oc-bed { color: #64748b; }
/* 编辑卡分段标题：把「订单信息 / 物料与交期 / 颜色尺码 / 状态备注」分开，避免字段混在一起 */
.oc-sec {
  flex: 1 1 100%; font-size: 11px; font-weight: 700; color: #94a3b8;
  margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line);
}
.oc-row:first-child .oc-sec { margin-top: 0; padding-top: 0; border-top: 0; }
.oc-sec-hint { font-weight: 400; color: #b6c2d1; margin-left: 8px; }

/* ---- 订单行内编辑卡（新增/编辑不弹窗，卡内填写） ---- */
.order-card.editing { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); padding: 12px 14px; }
.order-card.editing .oc-row { gap: 6px 14px; }
.ef { display: inline-flex; align-items: center; gap: 6px; }
.ef .k { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ef input, .ef textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.ef input:focus, .ef textarea:focus { border-color: var(--primary); outline: none; }
.ef input[type=date] { width: 128px; }
.ef input[type=number] { width: 84px; }
.ef input.ef-date { width: 96px; }
.ef input:not([type=date]):not([type=number]):not(.ef-date):not([type=checkbox]) { width: 108px; }
.ef input[type=checkbox] { width: auto; height: 16px; accent-color: var(--primary); }
.ef-wide input, .ef-wide textarea { width: 100%; }
.ef textarea { width: 300px; vertical-align: top; }
.ef .req { color: var(--danger); }
/* 数量明细：顶部汇总 + 紧凑表格（限宽，不再一行占满整张卡） */
.size-detail { flex: 1 1 100%; max-width: 860px; min-width: 0; }
.size-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; margin: 2px 0 6px; }
.size-sum-item { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 12px; }
.size-sum-item b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.size-sum .ef { align-items: baseline; }
.size-sum .ef input { width: 84px; }
.edit-colors {
  display: flex; flex-direction: column; gap: 4px; align-items: stretch;
}
.edit-colors .color-head,
.edit-colors .color-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(100px, 1.2fr) minmax(64px, .7fr) minmax(66px, .7fr) minmax(76px, .8fr) minmax(92px, .9fr) 32px;
}
.edit-colors .color-head {
  font-size: 11px; color: var(--muted); padding: 0 2px 3px;
  border-bottom: 1px solid var(--line);
}
.edit-colors .color-row { margin: 0; }
.edit-colors .color-row input { width: 100%; box-sizing: border-box; }
.edit-colors .color-row .cr-del { padding: 4px 0; width: 32px; }
.edit-colors #btnAddColorRow { align-self: flex-start; margin-top: 2px; }
.oc-edit-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---- 看板：顶部交期栏 + 三块并排 ---- */
.board-top { margin-bottom: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.board-top .alert-card { min-width: 0; }
.board-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.alert-card .card-body { max-height: none !important; overflow: visible !important; } /* 全量展开 */
.board-grid-3 .alert-card { min-width: 0; }

/* 状态标记 */
.chip { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }
.chip.done { background: #dcfce7; color: #15803d; }
.chip.arrived { background: #ccfbf1; color: #0f766e; }
.chip.doing { background: #fef9c3; color: #a16207; }
.chip.todo { background: #f1f5f9; color: #64748b; }
/* 采购"未下单"状态用红色，警示待采购 */
.chip.todo.pur-toggle { background: #fee2e2; color: #b91c1c; }
.chip.todo.pur-toggle:hover { background: #fecaca; color: #991b1b; } /* 悬停加深提示可点 */
.chip.late { background: #fee2e2; color: #b91c1c; }
.chip.today { background: #ffedd5; color: #c2410c; }
.float-neg { color: var(--danger); font-weight: 700; }
.float-small { color: var(--warn); font-weight: 700; }
.float-ok { color: var(--ok); }

/* ---- 模态 ---- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; }
.modal.open { display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 12px; width: 640px; max-width: 96vw; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-box.large { width: 1100px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px;
}
.modal-head .close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 16px 18px; }
.paste-area {
  width: 100%; height: 180px; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; font-family: Consolas, monospace; font-size: 12px; resize: vertical;
}
.paste-actions { display: flex; gap: 10px; margin-top: 10px; }
.tip { color: var(--muted); font-size: 12px; margin-bottom: 8px; line-height: 1.6; }
.tip-inline { color: var(--muted); font-size: 12px; }
.parse-summary { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; line-height: 1.7; }
.parse-summary .warn-line { color: #b45309; }

/* ---- 订单详情 ---- */
.detail-sec { margin-bottom: 16px; }
.detail-sec h4 { font-size: 14px; margin-bottom: 6px; color: #334155; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; font-size: 13px; }
.kv-grid .k { color: var(--muted); }
.node-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px dashed var(--line); }
.node-row .name { width: 110px; font-weight: 600; }
.node-row .plan { color: var(--muted); width: 96px; }
.node-row .actual { width: 96px; }
.node-row .mark-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 2px 8px;
  font-size: 11px; cursor: pointer; font-family: inherit; color: var(--muted);
}
.node-row .mark-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---- 排单：按工厂分组 ---- */
.fac-groups { }
.fac-group { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.fac-group-head {
  display: flex; align-items: center; gap: 18px; padding: 10px 14px; flex-wrap: wrap;
  background: #f1f5f9; border-bottom: 1px solid var(--line);
}
.fac-group-head .f-name { font-weight: 700; font-size: 15px; }
.fac-group-head .f-name.nogroup { color: var(--muted); }
.fac-group-head .f-sum { color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.fac-group-head .f-sum .late { color: var(--danger); font-weight: 700; }
.fac-gantt { padding: 8px 12px 10px; overflow-x: auto; }
.fac-gantt-inner { position: relative; min-width: 100%; }
.gantt-row { display: flex; align-items: center; height: 28px; border-bottom: 1px dashed #eef0f3; }
.gantt-row:last-child { border-bottom: none; }
.gantt-label { width: 300px; flex-shrink: 0; font-size: 12px; overflow: visible; white-space: nowrap; }
.gantt-label .gl-style { font-weight: 700; color: var(--primary); cursor: pointer; }
/* 排单行款式图：小缩略图（点击放大，与订单页共享图库） */
.gantt-label .gl-thumb {
  height: 22px; width: 30px; object-fit: cover; vertical-align: middle;
  border-radius: 3px; border: 1px solid var(--line); cursor: zoom-in; margin-right: 4px;
}
.gantt-label .gl-thumb:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.2); }
.gantt-label .gl-thumb-empty {
  display: inline-block; height: 22px; width: 30px; line-height: 22px; text-align: center;
  vertical-align: middle; border: 1px dashed #cbd5e1; border-radius: 3px; color: #cbd5e1;
  font-size: 12px; margin-right: 4px; cursor: default;
}
/* 距交期天数标签：贴在交期点右侧（超期=红，正常=灰绿） */
.gantt-track .gantt-due-tag {
  position: absolute; top: 6px; font-size: 11px; font-weight: 700; white-space: nowrap;
  color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 3px;
  padding: 0 4px; line-height: 16px; pointer-events: none;
}
.gantt-track .gantt-due-tag.overdue { color: #d93025; background: #fef2f2; border-color: #fecaca; }
/* 面辅料发往工厂标记：橙色菱形 + 小日期标签（数据来自订单页发料日期/发料节点） */
.gantt-track .gantt-sent {
  position: absolute; top: 11px; width: 9px; height: 9px;
  transform: rotate(45deg); background: var(--warn); border-radius: 2px;
  box-shadow: 0 0 0 1px #ffedd5; z-index: 3;
}
.gantt-track .gantt-sent-tag {
  position: absolute; top: 6px; font-size: 10px; font-weight: 700; white-space: nowrap;
  color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 3px;
  padding: 0 3px; line-height: 14px; pointer-events: none; z-index: 3;
}
.gantt-track .gantt-sent-tag.outwin { color: #d97706; opacity: .8; }
/* 工厂预计交期标记：紫色方块 + 小日期标签（数据来自订单页「工厂预计交货」字段） */
.gantt-track .gantt-eta {
  position: absolute; top: 12px; width: 9px; height: 9px;
  background: #7c3aed; border-radius: 2px;
  box-shadow: 0 0 0 1px #ede9fe; z-index: 3;
}
.gantt-track .gantt-eta-tag {
  position: absolute; top: 6px; font-size: 10px; font-weight: 700; white-space: nowrap;
  color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 3px;
  padding: 0 3px; line-height: 14px; pointer-events: none; z-index: 3;
}
.gantt-track .gantt-eta-tag.outwin { color: #7c3aed; opacity: .8; }
.gantt-track { position: relative; flex: 1; height: 100%; min-width: 320px; }
.gantt-bar { position: absolute; top: 7px; height: 15px; border-radius: 8px; background: linear-gradient(90deg,#93c5fd,#3b82f6); }
.gantt-bar.conflict { background: linear-gradient(90deg,#fca5a5,#ef4444); }
.gantt-dot { position: absolute; top: 9px; width: 11px; height: 11px; border-radius: 50%; }
.gantt-axis { display: flex; border-bottom: 1px solid var(--line); height: 22px; }
.gantt-axis .tick { font-size: 10px; color: var(--muted); }
.gantt-legend { font-size: 11px; color: var(--muted); padding: 6px 12px; border-top: 1px dashed var(--line); }
.gantt-legend span { margin-right: 14px; }
/* 排单页未分配工厂的行内分配输入（实底琥珀色，按钮感） */
.assign-factory {
  border: 1px solid var(--warn); border-radius: 4px; padding: 2px 8px;
  font-size: 11px; font-family: inherit; width: 122px; color: #92400e;
  background: #fef3c7; /* 实底，不用透明 */
}
.assign-factory::placeholder { color: #b45309; }
.assign-factory:focus { border-color: var(--primary); outline: none; background: #fff; }
/* 已分配订单的"清除工厂"按钮 */
.clear-factory {
  border: 1px dashed #cbd5e1; background: #f8fafc; color: #64748b;
  border-radius: 4px; padding: 1px 7px; font-size: 11px; cursor: pointer; font-family: inherit;
  margin-left: 6px; vertical-align: middle;
}
.clear-factory:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

/* ---- 相同项合并（共用信息列跨行合并；数量/用量/损耗/采购数量/单位永不合并） ---- */
.pur-group td.merge-cell {
  position: relative; background: #fbfdff; vertical-align: middle;
}
.pur-group td.merge-cell:hover { background: #f0f9ff; }
/* 合并格右上角「分」：文字由 CSS 伪元素提供，不进入单元格文本（保存取 textContent 不受影响） */
.pur-group td.merge-cell .merge-split {
  position: absolute; top: 2px; right: 3px; cursor: pointer;
  opacity: 0; transition: opacity .12s; user-select: none; line-height: 1;
}
.pur-group td.merge-cell:hover .merge-split { opacity: 1; }
.pur-group td.merge-cell .merge-split::after {
  content: '分'; display: inline-block; font-size: 10px; font-weight: 700;
  color: var(--primary); background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 3px; padding: 1px 4px;
}
.pur-group td.merge-cell .merge-split:hover::after { background: #dbeafe; border-color: #93c5fd; }

/* 拆分菜单（把合并列单独设置给某一行） */
.split-menu {
  position: fixed; z-index: 400; min-width: 200px; max-width: 280px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15,23,42,.18); overflow: hidden;
}
.split-menu .sm-title {
  font-size: 11px; color: var(--muted); padding: 7px 10px 5px;
  border-bottom: 1px dashed var(--line);
}
.split-menu .sm-row {
  display: flex; gap: 8px; align-items: center; padding: 6px 12px;
  font-size: 13px; cursor: pointer;
}
.split-menu .sm-row:hover { background: #eff6ff; }
.split-menu .sm-row input { margin: 0; }
.split-menu .sm-ops {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 10px; border-top: 1px dashed var(--line);
}

/* ---- 导出选择列表 ---- */
.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 12px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px dashed #eef0f3; font-size: 13px; }
.pick-item:last-child { border-bottom: none; }
.pick-item label { display: flex; gap: 8px; align-items: center; cursor: pointer; flex: 1; }
.pick-item .p-info { color: var(--muted); font-size: 12px; }
.pick-item .p-info .late { color: var(--danger); font-weight: 700; }

/* ---- 设置 ---- */
/* 布局：左侧目录（吸顶）+ 右侧分组内容；窄屏自动变单列、目录变横向标签 */
.settings-layout {
  display: grid; grid-template-columns: 178px minmax(0, 1fr);
  gap: 18px; align-items: start;
}
.settings-nav {
  position: sticky; top: calc(var(--toolbar-top, 57px) + 10px);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
}
.settings-nav .sn-title {
  font-size: 12px; color: var(--muted); padding: 2px 8px 8px;
  border-bottom: 1px dashed var(--line); margin-bottom: 6px;
}
.settings-nav .sn-item {
  display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.settings-nav .sn-item:hover { background: #eff6ff; color: var(--primary); }
.settings-nav .sn-item.active { background: #eff6ff; color: var(--primary); font-weight: 700; }
.settings-nav .sn-foot {
  margin-top: 8px; padding: 8px; font-size: 11px; line-height: 1.5; color: var(--muted);
  border-top: 1px dashed var(--line);
}
.settings-body { min-width: 0; }
.settings-section { margin-bottom: 26px; scroll-margin-top: calc(var(--toolbar-top, 57px) + 12px); }
.settings-section:last-child { margin-bottom: 6px; }
.ss-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 15px; font-weight: 700; color: var(--text);
  padding-bottom: 7px; margin-bottom: 12px; border-bottom: 1px solid var(--line);
}
.ss-head .ss-sub { font-size: 12px; font-weight: 400; color: var(--muted); }

.settings-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.settings-card + .settings-card { margin-top: 12px; }
.settings-card h3 { font-size: 15px; margin-bottom: 8px; }
.settings-card .tip { margin-bottom: 10px; }
.settings-card td input { width: 78px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; font-family: inherit; }

/* 卡片内的小工具条 / 字段 / 勾选 / 操作 */
.set-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.set-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; min-width: 0; }
.set-field.inline { flex-direction: row; align-items: center; gap: 8px; }
.set-field > span { font-size: 12px; color: var(--muted); }
.set-field input, .set-field select {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
  font-size: 13px; font-family: inherit; background: #fff; min-width: 0;
}
.set-field input:focus, .set-field select:focus { border-color: var(--primary); outline: none; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; }
.set-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.set-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.set-hint { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.set-actions-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
/* 备份区的"操作卡片"：每个动作一行说明，避免一排按钮看不出区别 */
.set-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.set-action {
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.set-action .btn { width: 100%; justify-content: center; text-align: center; }
.set-action .set-hint { margin: 0; }
/* 新增账号子块 */
.set-sub { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0 12px; background: #fcfdff; }
.set-sub-title { font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
/* 设置页里的表格：限高滚动 + 表头吸顶，长表不再把整页拉长 */
.data-table-wrap.scroll-y { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
/* 数据体积/同步状态行 */
.data-line {
  display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: #475569;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; margin: 4px 0 12px;
}
.data-line b { color: var(--text); }
.data-line.warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.set-table { margin: 0; }
.set-table th { position: sticky; top: 0; z-index: 2; }
.set-table td { vertical-align: middle; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    position: static; flex-direction: row; overflow-x: auto; gap: 4px;
    padding: 8px; align-items: center;
  }
  .settings-nav .sn-title, .settings-nav .sn-foot { display: none; }
  .settings-nav .sn-item { white-space: nowrap; }
}

/* ---- 表单 ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; margin-bottom: 14px; }
.form-grid label, .form-wide { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.form-grid input, .form-wide input, .form-wide textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-size: 13px; font-family: inherit;
}
.form-wide { margin-bottom: 10px; }
.form-sec { border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.form-sec-head { font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.req { color: var(--danger); font-style: normal; }
.color-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.color-row .cr-color { flex: 1.4; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-family: inherit; }
.color-row .cr-qty { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font-family: inherit; }
.color-row .cr-del { padding: 5px 12px; }
.plan-src { font-size: 10px; padding: 0 4px; border-radius: 3px; margin-left: 4px; }
.plan-src.forward { background: #fef3c7; color: #b45309; }
.plan-src.backward { background: #dbeafe; color: #1d4ed8; }

/* ---- 已完成订单聚合窗口（订单/采购/排单三页底部共用） ---- */
.done-group { margin-top: 18px; }
.done-group .pur-group-head { border-radius: 10px 10px 0 0; }
.done-group .pur-group-head.done-head {
  background: #f0fdf4; border-bottom: 1px solid #bbf7d0;
}
.done-group .pur-group-head.done-head .g-style { color: #15803d; }
.done-group .data-table-wrap { background: var(--card); border: 1px solid #bbf7d0; border-top: none; border-radius: 0 0 10px 10px; overflow: auto; }
.done-group .data-table tr.row-done td { color: #64748b; }
.done-group .data-table tr.row-done:hover td { background: #f6fef8; }
.done-group .data-table td.done-at { color: #94a3b8; font-size: 12px; }
.done-group .btn.undone-btn { border-color: #86efac; color: #15803d; }
.done-group .btn.undone-btn:hover { border-color: #15803d; background: #dcfce7; }
/* 已完成订单的只读物料明细（采购页展开行）：去掉外层单元格留白，内嵌表不加边框 */
.done-group .done-detail-row > td { padding: 0; background: #f8fafc; }
.done-group .done-detail-row table.data-table { border: 0; background: #fff; }
.done-group .done-detail-row table.data-table th { position: static; }
/* 挂起行标黄：与采购主表口径一致（.pur-group 之外也要生效） */
.done-group .done-detail-row tr.row-pending td { background: #fffbeb; }
.done-group .done-detail-row tr.row-pending td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
/* 已完成订单行的复制/明细按钮与恢复按钮同高 */
.done-group .done-detail-btn { border-color: #cbd5e1; color: #475569; }
.done-group .done-detail-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ---- toast ---- */
.toast {
  position: fixed; top: 52px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #1e293b; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 写盘失败常驻告警条（数据层触发）：一直显示到下一次保存成功，避免用户错过 toast */
.persist-warn {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 260;
  background: #7f1d1d; color: #fee2e2; font-size: 12px; line-height: 1.6;
  padding: 8px 16px; box-shadow: 0 -2px 10px rgba(0,0,0,.18);
}

/* ---- 身份权限选择器（页头） ---- */
.role-sel {
  background: #334155; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px;
  padding: 4px 8px; font-size: 12px; font-family: inherit; cursor: pointer; margin-left: 10px;
}
.role-sel:hover { border-color: #94a3b8; }
.role-sel:focus { outline: none; border-color: var(--primary); }

/* ---- 导出下拉菜单（采购页工具栏） ---- */
.export-menu { position: relative; display: inline-block; }
.export-menu-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15,23,42,.18); overflow: hidden;
}
.export-menu-list.open { display: block; }
.export-menu-list .em-item {
  padding: 9px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--text);
}
.export-menu-list .em-item:hover { background: #eff6ff; color: var(--primary); font-weight: 700; }
.export-menu-list .em-item.em-ready { border-top: 1px dashed var(--line); color: #1d4ed8; }
.export-menu-list .em-item.em-sub { padding-left: 30px; font-size: 12px; color: #64748b; background: #f8fafc; }
.export-menu-list .em-item.em-sub:hover { color: #1d4ed8; }

/* 排单页只读身份的"未分配"纯文本标记 */
.assign-ro {
  border: 1px dashed #cbd5e1; border-radius: 4px; padding: 1px 7px; font-size: 11px;
  color: #94a3b8; background: #f8fafc; margin-left: 6px; vertical-align: middle;
}

/* ---- 账号系统：页头用户徽标 + 退出按钮 ---- */
.user-chip {
  margin-left: 10px; font-size: 12px; color: #e2e8f0; cursor: default;
  border: 1px solid #475569; border-radius: 999px; padding: 3px 10px; background: #334155;
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
}
.user-avatar {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255,255,255,.35); background: #475569; flex: none;
}
.btn-logout {
  margin-left: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  background: transparent; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px; font-family: inherit;
}
.btn-logout:hover { border-color: var(--danger); color: #fca5a5; }

/* ---- 个人中心 / 关于：弹窗 ---- */
.profile-mask {
  position: fixed; inset: 0; z-index: 340; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px);
}
.profile-box, .about-box {
  position: relative; width: min(540px, 100%); max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, .5);
}
.about-box { width: min(640px, 100%); }
.profile-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
  font-size: 24px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 2px 6px;
}
.profile-close:hover { color: var(--danger); }
.profile-head { display: flex; align-items: center; gap: 14px; padding-right: 24px; }
.profile-avatar-box { flex: none; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: flex;
  align-items: center; justify-content: center; font-size: 28px; color: #94a3b8;
  background: #e2e8f0; border: 2px solid #e2e8f0;
}
.profile-head-info { flex: 1 1 auto; min-width: 0; }
.profile-title { font-size: 18px; font-weight: 800; color: var(--text); }
.profile-account { font-size: 12px; color: var(--muted); margin: 3px 0 8px; }
.profile-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.profile-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.profile-field input {
  padding: 9px 11px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; background: #f8fafc; box-sizing: border-box;
}
.profile-field input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.profile-sec-title { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; font-weight: 700; color: var(--text); }
.profile-sec-title span { font-weight: 400; color: var(--muted); font-size: 11px; }
.profile-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.profile-foot .btn { font-size: 12px; }

/* ---- 关于：大版本记录 ---- */
.about-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 24px; }
.about-name { font-size: 28px; font-weight: 900; letter-spacing: 3px; color: var(--text); }
.about-tagline { font-size: 12px; color: var(--muted); margin-top: 2px; letter-spacing: 1px; }
.about-ver {
  flex: none; font-size: 12px; color: #1d4ed8; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 999px; padding: 3px 9px;
}
.about-intro { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin: 14px 0 4px; }
.about-h { font-size: 14px; color: var(--text); margin: 16px 0 4px; }
.about-release { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.about-release-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.about-release-head b { font-size: 13px; color: #1d4ed8; }
.about-release-head span { font-size: 11px; color: #94a3b8; }
.about-release-head strong { font-size: 13px; color: var(--text); }
.about-release ul { margin: 5px 0 0; padding-left: 18px; }
.about-release li { font-size: 12px; color: #475569; line-height: 1.75; }

/* ---- 账号系统：登录遮罩（完全不透明，不露出页面内容） ---- */
.login-mask {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 70% -10%, #1e3a8a 0%, transparent 60%),
              radial-gradient(900px 500px at 10% 110%, #0e7490 0%, transparent 55%),
              linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
}
.login-box {
  width: 330px; max-width: 92vw; background: var(--card); border: 1px solid rgba(255,255,255,.6);
  border-radius: 18px; padding: 34px 30px 24px; text-align: center;
  box-shadow: 0 30px 80px rgba(2,6,23,.55), 0 2px 0 rgba(255,255,255,.5) inset;
  animation: loginIn .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 8px 22px rgba(37,99,235,.4);
}
.login-title { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.login-sub { font-size: 12px; color: var(--muted); margin: 6px 0 22px; }
.login-pass-row input {
  width: 100%; padding: 11px 14px; font-size: 14px; border: 1.5px solid var(--line);
  border-radius: 10px; font-family: inherit; box-sizing: border-box; background: #f8fafc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-pass-row input:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.login-pass-row input:disabled { background: #f8fafc; color: #94a3b8; }
#loginMask .login-pass-row + .login-pass-row { margin-top: 12px; }
#btnDoLogin {
  width: 100%; margin-top: 18px; padding: 11px 0; font-size: 15px; font-weight: 700; letter-spacing: 6px;
  color: #fff; background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border: none; border-radius: 10px; cursor: pointer; font-family: inherit;
  box-shadow: 0 10px 24px rgba(37,99,235,.35); transition: transform .12s, box-shadow .12s;
}
#btnDoLogin:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(37,99,235,.45); }
#btnDoLogin:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(37,99,235,.35); }
.login-tip { margin-top: 16px; font-size: 11px; color: var(--muted); text-align: center; }
#loginErr { color: #b91c1c; min-height: 16px; margin-top: 8px; font-weight: 600; }

/* ===== 订单跟催 / 变更历史（时间线） ===== */
.ord-log-line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 4px -2px 0; padding: 4px 8px; border-radius: 6px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  font-size: 12px; color: #475569; cursor: pointer;
}
.ord-log-line:hover { background: #f1f5f9; }
.ord-log-line.empty { color: #94a3b8; background: transparent; border-style: dashed; }
.log-more { color: #2563eb; font-size: 11px; margin-left: auto; }
.ord-log-inline {
  margin: 2px 0 4px; padding: 6px 8px; border: 1px dashed #cbd5e1;
  border-radius: 6px; background: #fff; max-height: 260px; overflow-y: scroll;
}
.log-item { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #f1f5f9; }
.log-item:last-child { border-bottom: none; }
.log-ic { flex: 0 0 auto; }
.log-time { flex: 0 0 auto; color: #94a3b8; font-variant-numeric: tabular-nums; }
.log-mat { flex: 0 0 auto; color: #0369a1; background: #e0f2fe; border-radius: 4px; padding: 0 4px; font-size: 11px; }
.log-txt { flex: 1 1 auto; color: #334155; word-break: break-word; }
.log-by { flex: 0 0 auto; color: #94a3b8; font-size: 11px; }
.log-pend .log-txt { color: #92400e; }
.log-ok .log-txt { color: #15803d; }
.log-danger .log-txt { color: #b91c1c; }
.log-node .log-txt { color: #1d4ed8; }
.log-due .log-txt { color: #7c3aed; }
.log-status .log-txt { color: #0f766e; }
.log-qty .log-txt { color: #b45309; }
.log-empty { color: #94a3b8; font-size: 12px; padding: 6px 2px; }
/* 详情里的补记表单与筛选 */
.log-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.log-form input[type="text"] { flex: 1 1 260px; min-width: 200px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.log-form input[type="date"], .log-form select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.log-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.log-chip { background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; border-radius: 999px; padding: 2px 10px; font-size: 11px; cursor: pointer; }
.log-chip.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.log-list { max-height: 260px; overflow-y: scroll; }
/* 看板预警条目上的「历史」按钮与展开面板 */
.log-peek { margin-left: 6px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; border-radius: 999px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.log-peek:hover { background: #dbeafe; }
.alert-log { margin-top: 6px; padding: 6px 8px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; font-size: 11px; color: #475569; }
.alert-log-line { padding: 2px 0; border-bottom: 1px dashed #eef2f7; }
.alert-log-line:last-of-type { border-bottom: none; }
.alert-log-tip { color: #94a3b8; font-size: 10px; padding-top: 3px; }
/* 部署自检提示（缺 js 文件时页头常驻，不要被其它样式盖住） */
.boot-warn {
  position: relative; z-index: 9999;
  background: #fef2f2; border-bottom: 2px solid #f87171; color: #991b1b;
  font-size: 13px; line-height: 1.6; padding: 10px 14px;
}
.boot-warn code { background: #fee2e2; border-radius: 3px; padding: 0 4px; }
/* 时间线分页：加载更早 */
.log-loadmore {
  display: block; width: 100%; margin: 6px 0 2px; padding: 5px 8px;
  background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 6px;
  color: #475569; font-size: 12px; cursor: pointer;
}
.log-loadmore:hover { background: #e2e8f0; }
/* ===== 订单颜色 × 尺码矩阵（详情里的「尺码明细」） ===== */
.size-matrix-wrap { overflow-x: auto; margin-top: 4px; }
table.size-matrix { border-collapse: collapse; font-size: 12px; min-width: 320px; }
table.size-matrix th, table.size-matrix td {
  border: 1px solid #cbd5e1; padding: 3px 8px; text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.size-matrix thead th { background: #f1f5f9; color: #334155; font-weight: 600; }
table.size-matrix tbody td.sm-color { text-align: left; font-weight: 600; color: #0f172a; }
table.size-matrix td.sm-zero { color: #cbd5e1; }
table.size-matrix td.sm-total { background: #f8fafc; font-weight: 700; }
table.size-matrix tfoot td { background: #eff6ff; font-weight: 700; color: #1e3a8a; }
.sm-warn { color: #b45309; cursor: help; }
/* 颜色行里的尺码输入 */
.color-row .cr-sizes { flex: 1 1 130px; min-width: 110px; }
/* ===== 订单页 · 已完成订单聚合窗口（分区：窗口头 / 指标条 / 列表 / 尾部） ===== */
.done-group { margin: 14px 0 4px; }
.done-shell {
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
}
/* ① 窗口头：标题 + 数量在左，工具（搜索/排序/收起）在右 */
.done-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--line, #e2e8f0);
}
.done-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #0f172a; }
.done-ic { font-size: 15px; }
.done-count {
  font-size: 11px; font-weight: 700; color: #475569;
  background: #e2e8f0; border-radius: 999px; padding: 1px 8px;
}
.done-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.done-search {
  width: 190px; max-width: 42vw; padding: 4px 8px; font-size: 12px;
  border: 1px solid var(--line, #cbd5e1); border-radius: 6px; background: #fff;
}
.done-sort {
  padding: 4px 6px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--line, #cbd5e1); background: #fff; color: #334155;
}
.done-toggle { padding: 3px 10px; font-size: 12px; }
/* ② 指标条：本月完成 / 逾期完成 / 交货差 */
.done-stats {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  padding: 8px 12px; font-size: 12px; color: #475569;
  background: #fbfdff; border-bottom: 1px dashed var(--line, #e2e8f0);
}
.done-stats:empty { display: none; }
.ds-item b { color: #0f172a; font-variant-numeric: tabular-nums; }
.ds-item.ds-warn, .ds-item.ds-warn b { color: #b91c1c; }
.ds-hint { margin-left: auto; color: #94a3b8; font-size: 11px; }
/* ③ 列表：限高滚动 + 表头吸顶 + 数字右对齐 */
.done-table-wrap { max-height: 380px; overflow: auto; }
table.done-table { width: 100%; border-collapse: collapse; }
table.done-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #f8fafc; color: #475569; font-size: 11px; font-weight: 600;
  text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line, #e2e8f0);
  white-space: nowrap;
}
table.done-table thead th.num, table.done-table tbody td.num { text-align: right; }
table.done-table thead th.col-date, table.done-table tbody td.col-date { text-align: center; }
table.done-table thead th.col-ops, table.done-table tbody td.col-ops { text-align: right; }
table.done-table tbody td {
  padding: 6px 10px; font-size: 12px; color: #334155;
  border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
table.done-table tbody tr:hover td { background: #f8fafc; }
table.done-table tbody tr.row-done:last-child td { border-bottom: none; }
.done-table .col-style { width: 22%; }
.done-table .col-ops { width: 150px; white-space: nowrap; }
.done-table tbody td.col-ops .btn { padding: 1px 8px; font-size: 11px; margin-left: 4px; }
/* 交期/实际交货的早晚提示 */
.dl-late { color: #b91c1c; font-weight: 600; }
.dl-late i { font-style: normal; font-size: 10px; }
.dl-early { color: #15803d; }
.dl-early i { font-style: normal; font-size: 10px; color: #16a34a; }
.dl-ok { color: #334155; }
.dl-none { color: #cbd5e1; }
.dl-due-late { color: #b91c1c; }
.done-at { color: #64748b; font-variant-numeric: tabular-nums; }
.done-log {
  font-size: 10px; color: #1d4ed8; background: #eff6ff;
  border-radius: 999px; padding: 0 5px; margin-left: 4px; cursor: help;
}
.done-empty { text-align: center; color: #94a3b8; padding: 18px 8px !important; font-size: 12px; }
/* ④ 尾部说明 */
.done-foot { padding: 6px 12px 8px; font-size: 11px; color: #94a3b8; }
.done-foot:empty { display: none; }
@media (max-width: 760px) {
  .done-tools { width: 100%; margin-left: 0; }
  .done-search { width: 100%; max-width: none; }
  .ds-hint { display: none; }
  .done-table .col-ops { width: 108px; }
}