/* ===== V23.00 批次「信息修正」（仅系统管理员 / 仅运输中、已完成批次）=====
   需求：不能删除原有信息，只能在原有信息旁边追加修正，且修正内容为绿色字体；
         做过信息修正的批次，主界面「配送批次」整行显示为深绿色；其余内容与样式不变。 */

/* —— 1. 详情页：追加在原值旁边的绿色修正值 —— */
.corr-value {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #e8f7ee;
  border: 1px solid #9ed3b3;
  color: #0a7a3d !important;
  font-weight: 700;
  font-size: .92em;
  line-height: 1.5;
  white-space: normal;
  word-break: break-all;
  cursor: help;
  vertical-align: baseline;
}

.corr-value::before {
  content: '修正：';
  font-weight: 400;
  opacity: .75;
  font-size: .85em;
}

/* —— 2. 详情页：绿色「信息修正」按钮（其它角色不会渲染该按钮） —— */
.batch-detail-page .detail-actions .action-correct {
  color: #0a7a3d !important;
  border-color: #8dc9a8 !important;
  background: #eef9f2 !important;
  font-weight: 700;
}

.batch-detail-page .detail-actions .action-correct:hover {
  background: #ddf2e6 !important;
  border-color: #4fae7c !important;
}

/* —— 2.1 V23.03 三个模块标题后面的「左右滑动开关」——
   平时为否（白色），滑到右边为是（绿色）；绿色代表该模块内容全部可点击编辑。
   V23.04 开关整体放大，并与模块标题保持在同一行（不换行）。 */
.block-title-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  min-width: 0;
}

.block-title-main > b {
  white-space: nowrap;
}

.batch-detail-page .flow-fill-block .block-title-main {
  align-items: center;
}

.corr-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* 原生 checkbox 只用于承载状态与无障碍语义，视觉完全由 track/knob 负责 */
.corr-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.corr-switch-track {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #c9d5cd;
  box-shadow: inset 0 1px 2px rgba(16, 40, 28, .08);
  transition: background .18s ease, border-color .18s ease;
}

.corr-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #c2cfc7;
  box-shadow: 0 1px 3px rgba(16, 40, 28, .25);
  transition: left .18s ease, background .18s ease, border-color .18s ease;
}

.corr-switch.on .corr-switch-track {
  background: #0a7a3d;
  border-color: #0a7a3d;
  box-shadow: none;
}

.corr-switch.on .corr-switch-knob {
  left: 28px;
  background: #ffffff;
  border-color: #ffffff;
}

.corr-switch-text {
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  color: #7b8a82;
  line-height: 1.2;
  white-space: nowrap;
}

.corr-switch.on .corr-switch-text {
  color: #0a7a3d;
}

.corr-switch-text > i {
  font-style: normal;
  font-weight: 400;
  opacity: .8;
}

.corr-switch-input:focus-visible + .corr-switch-track {
  outline: 2px solid rgba(10, 122, 61, .35);
  outline-offset: 2px;
}

/* —— 2.15 V23.10 「修改 N 处」统计按钮 + 逐条定位 —— */
.corr-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

/* display 会盖掉浏览器默认的 [hidden]，这里显式补一条 */
.corr-stat[hidden],
.corr-stat > .corr-next-btn[hidden],
.corr-stat > .corr-clear-btn[hidden] {
  display: none !important;
}

.corr-stat-btn {
  border: 1px solid #8dc9a8;
  border-radius: 999px;
  background: #eef9f2;
  color: #0a7a3d !important;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.corr-stat-btn:hover {
  background: #ddf2e6;
  border-color: #4fae7c;
}

.corr-stat-btn > b {
  font-size: 13px;
  color: #0a7a3d !important;
}

.corr-next-btn,
.corr-clear-btn {
  border: 1px solid #cfdcd4;
  border-radius: 999px;
  background: #ffffff;
  color: #4d6156;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
}

.corr-next-btn:hover {
  border-color: #4fae7c;
  color: #0a7a3d;
}

.corr-clear-btn {
  padding: 5px 9px;
  color: #b4453c;
  border-color: #e6cfcd;
}

.corr-clear-btn:hover {
  background: #fdeeed;
  border-color: #d98b84;
}

/* 定位到的修正值：加一圈醒目的绿色光晕，便于一眼看到 */
.corr-value.corr-nav-active {
  outline: 2px solid #0a7a3d;
  outline-offset: 2px;
  animation: corr-nav-pulse 1.2s ease-in-out 2;
}

@keyframes corr-nav-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 122, 61, .0); }
  50% { box-shadow: 0 0 0 6px rgba(10, 122, 61, .22); }
}

/* 开关打开后，模块内可修正的内容变成可点击状态 */
.corr-edit {
  display: inline;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 3px;
  margin: -1px -3px;
  box-shadow: inset 0 -1px 0 0 rgba(10, 122, 61, .45);
  transition: background .15s ease, box-shadow .15s ease;
}

.corr-edit:hover,
.corr-edit:focus-visible {
  background: #e8f7ee;
  box-shadow: inset 0 0 0 1px #9ed3b3;
  outline: none;
}

.corr-editing .block-title b {
  color: #0a7a3d;
}

/* —— 2.2 单项修正弹窗（点哪一项改哪一项）—— */
.corr-field-modal {
  width: min(520px, 94vw) !important;
  max-width: 94vw !important;
}

.corr-field-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 2px 6px;
}

.corr-field-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e2ebe5;
  border-radius: 8px;
  background: #fbfdfc;
  font-size: 13px;
}

.corr-field-row > span {
  flex: 0 0 auto;
  color: #7b8a82;
  font-size: 12px;
}

.corr-field-row > b {
  color: #1f3d2c;
  word-break: break-all;
}

.corr-field-row.is-previous > b {
  color: #0a7a3d;
}

.corr-field-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #7b8a82;
}

.corr-field-input > input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px dashed #9ed3b3;
  border-radius: 8px;
  background: #f7fdf9;
  color: #0a7a3d;
  font: inherit;
  font-weight: 700;
}

.corr-field-input > input:focus {
  outline: none;
  border-style: solid;
  border-color: #0a7a3d;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(10, 122, 61, .12);
}

/* —— 3. 主界面：做过信息修正的批次整行深绿色 —— */
.table-wrap table tbody tr.correction-row,
.table-wrap table tbody tr.correction-row > td {
  background: #14532d !important;
  color: #eaf7ef !important;
}

.table-wrap table tbody tr.correction-row > td * {
  color: #eaf7ef !important;
}

.table-wrap table tbody tr.correction-row > td b,
.table-wrap table tbody tr.correction-row > td strong {
  color: #ffffff !important;
}

.table-wrap table tbody tr.correction-row:hover > td {
  background: #166534 !important;
}

/* 深绿行里的链接/按钮保持可读，但不再抢眼 */
.table-wrap table tbody tr.correction-row > td .drawing-link,
.table-wrap table tbody tr.correction-row > td .drawing-missing {
  color: #d6ffe6 !important;
  border-color: rgba(214, 255, 230, .45) !important;
  background: rgba(255, 255, 255, .12) !important;
}

.table-wrap table tbody tr.correction-row > td .status {
  background: rgba(255, 255, 255, .18) !important;
  color: #ffffff !important;
}

/* —— 4. 信息修正弹窗 —— */
.batch-correction-modal {
  width: min(1180px, 97vw) !important;
  max-width: 97vw !important;
  max-height: 94vh !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}

.batch-correction-modal .modal-head {
  flex: 0 0 auto;
}

.corr-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 4px 2px 8px;
}

.corr-section {
  margin-bottom: 18px;
}

.corr-section > h3 {
  margin: 0 0 8px;
  padding-left: 9px;
  border-left: 3px solid #0a7a3d;
  font-size: 14px;
  color: #14532d;
}

.corr-item {
  border: 1px solid #e2ebe5;
  border-radius: 9px;
  padding: 8px 10px 4px;
  margin-bottom: 10px;
  background: #fbfdfc;
}

.corr-item > h4 {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: #0f5b34;
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.corr-item > h4 > em {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: #7b8b81;
}

.corr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.corr-table > thead > tr > th {
  text-align: left;
  padding: 5px 7px;
  background: #f1f6f3;
  color: #4d6156;
  font-weight: 700;
  border-bottom: 1px solid #e2ebe5;
  white-space: nowrap;
}

.corr-table > tbody > tr > td {
  padding: 4px 7px;
  border-bottom: 1px solid #f0f4f2;
  vertical-align: middle;
}

.corr-table > tbody > tr:last-child > td {
  border-bottom: 0;
}

.corr-table .corr-field {
  width: 96px;
  color: #445249;
  white-space: nowrap;
}

.corr-table .corr-old {
  color: #7d8c84;
  width: 30%;
  word-break: break-all;
}

.corr-table .corr-new {
  width: 42%;
}

.corr-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px dashed #9ed3b3;
  border-radius: 6px;
  background: #f7fdf9;
  color: #0a7a3d;
  font: inherit;
  font-weight: 600;
}

.corr-input::placeholder {
  color: #b3c6ba;
  font-weight: 400;
}

.corr-input:focus {
  outline: none;
  border-style: solid;
  border-color: #0a7a3d;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(10, 122, 61, .12);
}

/* —— 5. 修改备注弹窗（上：修改人 / 下：修改原因） —— */
.corr-reason-backdrop {
  z-index: 1200;
}

.corr-reason-modal {
  width: min(560px, 94vw) !important;
  max-width: 94vw !important;
}

.corr-reason-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 6px;
}

.corr-reason-block {
  border: 1px solid #e2ebe5;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fbfdfc;
}

.corr-reason-block > h3 {
  margin: 0 0 7px;
  padding-left: 9px;
  border-left: 3px solid #0a7a3d;
  font-size: 13px;
  color: #14532d;
}

.corr-reason-person {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: #1f3d2c;
}

.corr-reason-person > em {
  font-style: normal;
  font-size: 11px;
  color: #0a7a3d;
  background: #e8f7ee;
  border: 1px solid #9ed3b3;
  border-radius: 4px;
  padding: 1px 6px;
}

.corr-reason-block > textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid #cfdcd4;
  border-radius: 8px;
  font: inherit;
  color: #1f3d2c;
  resize: vertical;
}

.corr-reason-block > textarea:focus {
  outline: none;
  border-color: #0a7a3d;
  box-shadow: 0 0 0 2px rgba(10, 122, 61, .12);
}

@media (max-width: 760px) {
  .corr-table .corr-old,
  .corr-table .corr-new,
  .corr-table .corr-field {
    width: auto;
  }

  .corr-value::before {
    content: '';
  }
}

/* ===== V23.14 部件位置地图不再悬浮 =====
   地图容器从「body 下 position:fixed 跟随视口」改为「放进部件位置占位块内部、绝对定位铺满」，
   页面上下滚动时地图跟着内容一起走，不再浮在页面上方；其余外观与交互保持不变。 */
.batch-map-block .batch-map-slot > .batch-map-portal {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

.batch-map-block .batch-map-slot > .batch-map-portal[hidden] {
  display: none !important;
}

/* 地图已就位（JS 加 is-live）：占位块的虚线框与浅底色去掉，
   否则地图只铺满「边框以内」的区域，四周会露出一圈残留边框。
   注意：只改边框颜色与线型、不改宽度（仍为 1px），占位块尺寸与改动前完全一致，
   地图可视区域不会因此多出 2px，经纬度对应的屏幕位置零偏移。 */
.batch-map-block .batch-map-slot.is-live {
  border-color: #fff;
  border-style: solid;
  background: #fff;
}

/* ===== V23.15 新建批次弹窗占满可用空间 =====
   宽高都按「视口 - 24px」铺开（四周各留 12px，不贴边、不出现横向滚动条）。
   内部改成纵向 flex：批头/批次信息/底部按钮固定高度，
   部件明细区自动吃掉剩余高度并在内部滚动，因此弹窗四周不再留大片空白。
   用 :not(.batch-edit-modal) 限定，只作用于「新建批次」，
   「修改批次设置」等其它弹窗的尺寸与内容保持不变。
   放在最后加载的样式表里并提高选择器权重，确保不被前面的旧尺寸规则盖掉。 */
.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) {
  width: min(2136px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  height: calc(100vh - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > .modal-head,
.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > .form-grid,
.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > .modal-actions,
.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > datalist {
  flex: 0 0 auto;
}

.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > .item-editor {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) > .item-editor > .item-editor-head {
  flex: 0 0 auto;
}

.modal-backdrop .modal.batch-create-modal:not(.batch-edit-modal) .item-rows {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow: auto;
}


/* ===== V23.40 部件明细 · CAD 绘图 =====
   V23.41 起独占「绘图」列，不再与「添加图纸」同格，因此去掉上边距让按钮与相邻列对齐。 */
.cad-cell {
  display: block;
  margin-top: 0;
}


.cad-badges {
  /* V23.42 「绘图」列三个按钮按列竖排、整体居中 */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cad-badges .link-btn {
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}

.cad-view-btn {
  color: #0f7f74;
  font-weight: 700;
}

.cad-edit-btn {
  color: #3f6ea8;
}

.cad-badges .link-btn:hover {
  text-decoration: underline;
}

/* ===== V23.43 CAD 唤起提示：右下角轻量 toast，替代 alert 弹窗，不打断操作 ===== */
.cad-toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translate(-50%, 12px);
  max-width: min(520px, 86vw);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(18, 33, 30, .93);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
  white-space: pre-line;
}

.cad-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== V23.44 手动上传确认框：提交前亮明部件编号 ===== */
.cad-confirm-modal { width: min(420px, 92vw); }

.cad-confirm-body { padding: 2px 2px 10px; }

.cad-confirm-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.cad-confirm-body li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}

.cad-confirm-body li b { color: #5b6b66; font-weight: 600; }

.cad-confirm-body li span { color: #16232f; word-break: break-all; }

.cad-confirm-body .cad-confirm-number { font-weight: 800; color: #087b46; }

/* ===== V23.45 配送批次列表：表头与单元格统一居中 =====
   与部件明细表同一口径（见 v17-route.css 的 V23.42 注释），不再左对齐。
   图纸列是 inline 的 button / span，text-align:center 即可让其居中；
   状态与操作列同理，无需再单独调 flex。 */
.batches .table-wrap th,
.batches .table-wrap td {
  text-align: center;
}

/* ===== V23.46 导航栏上移：取消左侧栏，6 个菜单按钮横排到顶部 =====
   只改布局，不改任何页面内容与交互：
   1) .admin-layout 由「238px 侧栏 + 内容」改为上下两段；
   2) 原 aside 变成顶部横条，nav 从竖排改横排；
   3) 「外购件管理」原来嵌在「人员管理」下面的子菜单，横向后自然排成第 6 个按钮。
   注意窄屏原本 aside 是 display:none，这里必须改回 block，否则手机上没导航。 */
.admin-layout {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  /* 原来只扣顶栏高度，现在多了一条高度约 57px 的导航条，一并扣掉，避免页面无谓地出现纵向滚动 */
  min-height: calc(100vh - var(--by-topbar-h, 76px) - 57px);
}

.admin-layout > aside {
  border-right: 0;
  border-bottom: 1px solid var(--line, #e5eaef);
  padding: 0 16px;
  background: #fff;
  /* 页面向下滚动时导航条吸在视口顶部，不跟着滚走。
     它要贴在深色顶栏下面，所以 top 取顶栏实际高度（--by-topbar-h 由 render() 同步）。
     z-index 取 20：要压住表格与面板，但不能盖住 .modal-backdrop（z-index 50）。 */
  position: sticky;
  top: var(--by-topbar-h, 62px);
  z-index: 20;
  align-self: start;
  box-shadow: 0 2px 6px rgba(16, 40, 28, .06);
}

/* 深色顶栏同样吸顶：滚到哪里都停在最上面，导航条紧贴其下 */
.web-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.admin-layout > aside > nav {
  position: static;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding: 8px 0;
}

.admin-layout > aside nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  text-align: center;
  white-space: nowrap;
}

.admin-layout > aside nav button span {
  width: auto;
  font-size: 16px;
}

/* 子菜单（外购件管理）跟其它按钮并排，去掉原来的缩进与左侧圆点 */
.admin-layout > aside nav .nav-sub {
  flex-direction: row;
  gap: 6px;
  margin: 0;
}

.admin-layout > aside nav .nav-sub-item {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  text-align: center;
  /* 文字色对齐前五个按钮（原来作为子菜单是更浅的 #7d8b95） */
  color: var(--by-ink-soft, #3d4f5c);
}

.admin-layout > aside nav .nav-sub-item:before {
  display: none;
}

/* 「外购件管理」挂在左栏时代是二级子菜单，激活态是浅蓝底；搬到顶部后它和其它五个
   是同级按钮，激活态必须同样用深色底（--navy），否则六个按钮里唯独它点下去是浅色的。 */
.admin-layout > aside nav .nav-sub-item:hover {
  background: #f2f6f8;
  color: #1d2a38;
}

.admin-layout > aside nav .nav-sub-item.active {
  background: var(--navy, #14283b);
  color: #fff;
  font-weight: 700;
}

/* ===== V23.47 配送批次表头「批号 / 船号」列筛选 =====
   表头文字后面跟一个小箭头，点开是 Excel 那样的取值列表；选中后按钮变深色，一眼能看出该列被筛过。 */
.batch-filter-th {
  position: relative;
  white-space: nowrap;
}

.col-filter {
  width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0;
  border: 1px solid #c7d4e2;
  border-radius: 5px;
  background: #f2f6fb;
  color: #42566a;
  font-size: 13px;
  font-weight: 700;
  line-height: 17px;
  vertical-align: middle;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.col-filter:hover {
  background: #e2eefc;
  border-color: #8fb4df;
  color: #1a6fd4;
}

.col-filter.on {
  background: var(--navy, #14283b);
  border-color: var(--navy, #14283b);
  color: #fff;
}

/* 下拉挂在 body 上（position: fixed）：.table-wrap 是 overflow-x:auto，
   菜单若放在表头里会被横向滚动容器裁掉。z-index 45 高于导航条（30）、低于模态框（50）。 */
.col-filter-menu {
  position: fixed;
  z-index: 45;
  min-width: 168px;
  max-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 40, 28, .18);
  text-align: left;
}

.col-filter-menu .col-filter-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1d2a38;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.col-filter-menu .col-filter-item:hover {
  background: #f2f7ff;
}

.col-filter-menu .col-filter-item.chosen {
  background: var(--navy, #14283b);
  color: #fff;
  font-weight: 600;
}

.col-filter-empty {
  padding: 10px;
  color: #8b98a8;
  font-size: 12px;
  text-align: center;
}

/* 窄屏：导航保留在顶部并允许换行，不再隐藏 */
@media (max-width: 900px) {
  .admin-layout > aside {
    display: block;
    padding: 0 10px;
  }

  .admin-layout > aside nav button,
  .admin-layout > aside nav .nav-sub-item {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
}

/* ===== V23.60 新建批次改为页面内表单（不再弹遮罩窗） =====
   表单结构完全沿用 .batch-create-modal，只是外层由 .modal-backdrop 换成页头下方的
   .batch-create-inline 容器，因此这里只把原来靠 .modal 定位的浮层尺寸改回页面流布局，
   批次信息三列、部件明细单行等内部样式继续复用原规则。 */
.batch-create-inline {
  margin: 0 0 18px;
}

.batch-create-inline .inline-batch-create-form {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: auto !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 18px 20px !important;
  border: 1px solid #dbe4ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(20, 40, 59, .06);
}

/* 明细行随页面自然增高：页面内表单不再像弹窗那样限高内部滚动，
   否则表单会正好占满一屏、把页头与下方列表都顶出视口，看起来像“整页只剩表单”。 */
.batch-create-inline .inline-batch-create-form .item-rows {
  max-height: none !important;
  overflow: visible !important;
}

/* 页内表单不用弹窗那套居中标题，标题与说明左对齐更好读 */
.batch-create-inline .modal-head.center-head > div {
  text-align: left;
  padding: 0;
}

.batch-create-inline .modal-head.center-head h2 {
  width: auto;
  text-align: left;
}

@media (max-width: 760px) {
  .batch-create-inline .inline-batch-create-form {
    padding: 14px !important;
  }

  .batch-create-inline .inline-batch-create-form .item-rows {
    max-height: none;
  }
}

/* ===== V23.61 新建批次页头的「← 返回」按钮 =====
   原来借用 .outline，在 flex 页头里被拉成整行宽带，标题也被挤到换行。
   这里给一个独立类：白底细边框、悬停浅绿，与页面其它次级按钮同一套观感，
   并锁定尺寸与不参与 flex 拉伸，页头恢复「左标题 + 右小按钮」的原有比例。 */
.page-head .batch-create-back {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 96px !important;
  max-width: 160px !important;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid #c3cfd6;
  border-radius: 9px;
  background: #fff;
  color: #33454f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.page-head .batch-create-back:hover {
  background: #f3f8f6;
  border-color: #8fc8a9;
  color: #0d7568;
}

/* 新建批次页的标题不折行，避免日期/标题被挤成两行 */
.page-head h1.batch-create-title {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .page-head .batch-create-back {
    min-width: 0 !important;
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }
}

/* ===== V23.62 新建/修改批次：表格式录入 =====
   批次信息与部件明细都改成「表头 + 数据行」的电子表格形态：
   单元格铺满、无间隙、细边框；列多时在表格容器内横向滚动，序号列吸附在左侧。
   只覆盖新建/修改批次这两处（都带 .batch-create-modal），其它弹窗不受影响。 */

/* —— 批次信息表 —— */
.batch-meta-table {
  overflow-x: auto;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 14px;
}

.batch-meta-head,
.batch-meta-row {
  display: grid;
  /* 船号 | 批号 | 托盘号 | 图纸名称(填满剩余) | 交货日期 | 配送部门 | 配送人 | 电话(15位数字) | 日期 */
  grid-template-columns: 170px 170px 220px minmax(180px, 1fr) 150px 200px 120px 160px 150px;
  min-width: 1520px;
}

.batch-meta-head {
  background: #eef3f7;
  color: #33455a;
  font-size: 14px;
  font-weight: 700;
}

.batch-meta-head > span {
  padding: 9px 10px;
  border-right: 1px solid #dbe4ec;
  border-bottom: 1px solid #dbe4ec;
  text-align: center;
  white-space: nowrap;
}

.batch-meta-head > span:last-child {
  border-right: 0;
}

.batch-meta-row > label {
  display: block;
  margin: 0;
  min-width: 0;
}

.batch-meta-row input {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #18242f;
  font-size: 15px;
  text-align: center;
}

.batch-meta-row > label:not(:last-child) input {
  border-right: 1px solid #e8eef3;
}

.batch-meta-row input:focus {
  outline: none;
  background: #dff1e9;
  box-shadow: none;
}

/* —— 部件明细表 —— */
.batch-item-table {
  overflow-x: auto;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #fff;
  margin-top: 8px;
}

.batch-item-head,
.batch-create-modal .batch-item-table .batch-item-row {
  display: grid !important;
  /* 序号 | 名称 | 代号 | 规格 | 托盘表编号 | 数量 | 米数 | 材料 | 流程 | 装配 | 焊接 | 图纸 | 操作 */
  grid-template-columns: 48px 170px 150px 130px 150px 78px 88px 130px 132px 118px 66px 132px minmax(72px, 1fr) !important;
  column-gap: 0 !important;
  row-gap: 0 !important;
  align-items: stretch !important;
  min-width: 1464px;
}

.batch-item-head {
  background: #eef3f7;
  color: #33455a;
  font-size: 12px;
  font-weight: 700;
}

.batch-item-head > span {
  padding: 9px 8px;
  border-right: 1px solid #dbe4ec;
  border-bottom: 1px solid #dbe4ec;
  text-align: center;
  white-space: nowrap;
}

.batch-item-head > span:last-child {
  border-right: 0;
}

/* 横向滚动时序号列表头与每行序号一起吸附在左侧 */
.batch-item-head > span:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #e7eef3;
}

.batch-create-modal .batch-item-table .batch-item-row {
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e8eef3 !important;
  background: #fff;
}

/* 旧版的 nth-child 固定网格位必须还原，否则单元格会挤在第一行同一格里 */
.batch-create-modal .batch-item-table .batch-item-row > * {
  grid-area: auto !important;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 6px;
  border-right: 1px solid #e8eef3;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell:last-of-type {
  border-right: 0;
}

.batch-create-modal .batch-item-table .batch-item-row .batch-item-index {
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #f7fafc;
  border-right: 1px solid #dbe4ec;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.batch-create-modal .batch-item-table .batch-item-row:hover > .batch-item-cell {
  background: #fbfdfc;
}

/* 单元格里的输入控件：贴合单元格、无间隙 */
.batch-create-modal .batch-item-table .batch-item-row input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row select {
  width: 100%;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #18242f;
  font-size: 13px;
}

.batch-create-modal .batch-item-table .batch-item-row input:focus,
.batch-create-modal .batch-item-table .batch-item-row select:focus {
  outline: none;
  border-color: #8fc8a9;
  background: #f4faf8;
}

.batch-create-modal .batch-item-table .batch-item-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #159a8c;
  cursor: pointer;
}

/* 二次装配列 */
.batch-create-modal .batch-item-table .assembly-enable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #33455a;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .assembly-setup-button {
  height: 24px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .assembly-setup-button.configured {
  background: #e6f4ee;
  border-color: #8fc8a9;
  color: #0d7568;
}

/* 装配/流程的说明文字在表格里不占位，避免把行撑高 */
.batch-create-modal .batch-item-table .assembly-summary {
  display: none;
}

/* 焊接列 */
.batch-create-modal .batch-item-table .welding-control {
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  color: #33455a;
  white-space: nowrap;
}

/* 图纸列：按钮 + 一行被截断的摘要 */
.batch-create-modal .batch-item-table .new-item-drawing-cell {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}

.batch-create-modal .batch-item-table .new-item-drawing-button {
  width: 100%;
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .new-item-drawing-summary {
  display: block;
  max-width: 118px;
  color: #8b98a8;
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.batch-create-modal .batch-item-table .new-item-drawing-summary.has-drawing {
  color: #0d7568;
  font-weight: 600;
}

/* 操作列 */
.batch-create-modal .batch-item-table .batch-item-op {
  justify-content: center;
  border-right: 0;
}

.batch-create-modal .batch-item-table .batch-item-delete {
  height: 26px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #e7b9b1;
  border-radius: 5px;
  background: #fff;
  color: #c0392b;
  font-size: 12px;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .batch-item-delete:hover {
  background: #fdecea;
}

/* 镀锌/涂装单位：选到对应流程时在行下方展开一整行 */
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-extras {
  grid-column: 1 / -1 !important;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 10px;
  border-right: 0;
  border-bottom: 1px solid #e8eef3;
  background: #f7fbf9;
}

.batch-create-modal .batch-item-table .batch-item-extras .batch-item-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #33455a;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .batch-item-extras select,
.batch-create-modal .batch-item-table .batch-item-extras input {
  width: auto;
  min-width: 160px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #ccd7d1;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

/* 明细行与表头严丝合缝：
   V23.62 之前「一行一个部件卡片」留下了行外边距 12px、明细区右内边距 2px、
   行顶边框等样式，套进表格后会变成「表格里又套了很多小表格」。这里统一清零，
   让行与行、行与表头连成一张连续的电子表格。 */
.batch-create-modal .batch-item-table .item-rows {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  max-height: none !important;
  overflow: visible !important;
}

.batch-create-modal .batch-item-table .batch-item-row {
  margin: 0 !important;
  border-radius: 0;
  box-shadow: none;
}

/* 最后一行末尾不再画线，避免与表格外框形成双线 */
.batch-create-modal .batch-item-table .batch-item-row:last-child {
  border-bottom: 0 !important;
}

/* 部件明细区不再需要一条横贯的分隔线（表格本身已经是边界） */
.batch-create-modal .item-editor {
  border-top: 0 !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* ===== V23.65 部件明细：控件融入单元格，去掉「表格里又套小格子」的观感 =====
   只作用于部件明细表，不动批次信息表与页面其它部分。
   输入框/下拉平时无边框、按钮改成浅色文字按钮，整张表只剩网格线。 */
.batch-create-modal .batch-item-table .batch-item-row input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row select {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.batch-create-modal .batch-item-table .batch-item-row input:focus,
.batch-create-modal .batch-item-table .batch-item-row select:focus {
  border: 0 !important;
  background: transparent;
  box-shadow: none !important;
  outline: none !important;
}

/* 当前编辑的格子只用底色标出，不画任何内嵌边框 */
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell:focus-within {
  background: #dff1e9;
}

.batch-create-modal .batch-item-table .new-item-drawing-button,
.batch-create-modal .batch-item-table .assembly-setup-button,
.batch-create-modal .batch-item-table .batch-item-delete {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #0d7568;
  padding: 0 5px;
  font-weight: 600;
  box-shadow: none;
}

.batch-create-modal .batch-item-table .batch-item-delete {
  color: #c0392b;
}

.batch-create-modal .batch-item-table .new-item-drawing-button:hover,
.batch-create-modal .batch-item-table .assembly-setup-button:hover {
  background: #eef7f3;
}

.batch-create-modal .batch-item-table .batch-item-delete:hover {
  background: #fdecea;
}

.batch-create-modal .batch-item-table .assembly-setup-button.configured {
  background: #e6f4ee;
  color: #0d7568;
}

/* ===== V23.68 部件明细：严格一行一个部件 =====
   之前图纸列是「按钮 + 文件名」上下两行、装配列还会自动换行，一个部件被撑成两行高，
   看起来像占了好几行。这里统一压成单行，行高与新建批次设置（40px）一致。 */
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell {
  flex-wrap: nowrap;
  min-height: 40px;
  padding: 0;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > select {
  height: 40px;
  text-align: center;
}

/* 图纸列：只留一个按钮，文件名改到悬停提示里 */
.batch-create-modal .batch-item-table .new-item-drawing-cell {
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.batch-create-modal .batch-item-table .new-item-drawing-summary {
  display: none;
}

/* 装配列：勾选框与「设置方案」并排，不换行 */
.batch-create-modal .batch-item-table .item-action-assembly {
  flex-wrap: nowrap;
  gap: 3px;
  justify-content: center;
}

.batch-create-modal .batch-item-table .item-action-assembly .assembly-setup-button {
  height: 26px;
  min-height: 26px;
  padding: 0 5px;
  font-size: 11px;
}

.batch-create-modal .batch-item-table .batch-item-head > span {
  min-height: 40px;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-index {
  min-height: 40px;
}

/* ===== V23.66 部件明细：格子本身就是输入区 =====
   部件名称/代号/规格等文字列，把输入框撑满整个单元格、去掉单元格内边距，
   点格子任意位置就能直接打字（label 包着 input，点哪里都聚焦），
   视觉上不再有「格子里再嵌一个输入框」的层次。仅改样式，取值与提交不变。 */
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell {
  padding: 0;
  min-height: 40px;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > select {
  height: 40px;
  padding: 0 8px;
  align-self: stretch;
}

/* 含按钮的列保留一点内边距，按钮不贴边线 */
.batch-create-modal .batch-item-table .batch-item-row > .item-action-assembly,
.batch-create-modal .batch-item-table .batch-item-row > .welding-control,
.batch-create-modal .batch-item-table .batch-item-row > .new-item-drawing-cell,
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-op {
  padding: 3px 6px;
}

/* 表头与数据行等高，格线对齐 */
.batch-create-modal .batch-item-head > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

/* 正在填写的那一行整行浅底，一眼看出在填哪一行 */
.batch-create-modal .batch-item-table .batch-item-row:focus-within > .batch-item-cell,
.batch-create-modal .batch-item-table .batch-item-row:focus-within > .batch-item-index {
  background: #eef7f3;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-index {
  min-height: 40px;
}

/* —— 表格底部：新增行 —— */
.batch-item-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.batch-item-foot small {
  color: #8b98a8;
  font-size: 12px;
}

.batch-item-add {
  height: 36px;
  padding: 0 14px;
  border: 1px dashed #9ab7c8;
  border-radius: 8px;
  background: #fff;
  color: #33455a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.batch-item-add:hover {
  border-color: #159a8c;
  background: #f4faf8;
  color: #0d7568;
}

/* ===== V23.69 部件明细：填写内容统一居中 =====
   文字、数字、占位提示与下拉选项全部水平居中（下拉用 text-align-last 才生效），
   行下方展开的镀锌/涂装单位下拉同样居中。仅改文本对齐，不影响取值。 */
.batch-create-modal .batch-item-table input,
.batch-create-modal .batch-item-table select {
  text-align: center;
  text-align-last: center;
}

.batch-create-modal .batch-item-table input::placeholder {
  text-align: center;
}

.batch-create-modal .batch-item-table .batch-item-row input[type="number"] {
  text-align: center;
}

/* ===== V23.70 部件明细：一行一格、内容居中，与「新建批次设置」同一套观感 =====
   1) 列宽微调：二次装配 140、焊接 76、图纸 120，避免勾选框与按钮挤成两行；
   2) 每格内容统一水平垂直居中，且一律不换行，行高固定 40px；
   3) 只有正在编辑的那一格变色，不再整行铺浅绿。 */
.batch-create-modal .batch-item-head,
.batch-create-modal .batch-item-table .batch-item-row {
  grid-template-columns: 48px 170px 150px 130px 150px 78px 88px 130px 132px 140px 76px 120px minmax(70px, 1fr) !important;
  min-width: 1492px !important;
}

.batch-create-modal .batch-item-table .batch-item-row {
  min-height: 40px !important;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 4px;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > select {
  width: 100%;
  height: 40px;
  text-align: center;
  text-align-last: center;
}

/* 二次装配：勾选框 + 需要 + 按钮保持一行 */
.batch-create-modal .batch-item-table .item-action-assembly {
  flex-wrap: nowrap;
  gap: 4px;
  justify-content: center;
}

.batch-create-modal .batch-item-table .assembly-enable {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.batch-create-modal .batch-item-table .assembly-setup-button {
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
}

/* 焊接：勾选框 + 需要保持一行 */
.batch-create-modal .batch-item-table .welding-control {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

/* 图纸与操作列内容居中 */
.batch-create-modal .batch-item-table .new-item-drawing-cell,
.batch-create-modal .batch-item-table .batch-item-op {
  justify-content: center;
  align-items: center;
}

/* 只有当前格子高亮 */
.batch-create-modal .batch-item-table .batch-item-row:focus-within > .batch-item-cell {
  background: transparent;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell:focus-within {
  background: #dff1e9;
}

/* ===== V23.71 部件明细：序号与内容同一起跑线 =====
   1) 旧版把序号画成 23px 的圆形徽标，塞进表格后自然偏下，这里改回普通单元格；
   2) 单元格本身是 <label>，继承了全局 .modal label 的 margin-bottom:16px，
      每格底部多出 16px，行被撑高、内容看起来贴顶，这里统一清零。 */
.batch-create-modal .batch-item-table label {
  margin: 0 !important;
  font-weight: 400;
  color: inherit;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-index {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: stretch !important;
  width: auto !important;
  height: auto !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: #f7fafc !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell {
  align-items: center !important;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > input:not([type="checkbox"]),
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-cell > select {
  align-self: center !important;
}

/* ===== V23.72 图纸列：锁死在一行内、按钮居中 =====
   旧版图纸格是「按钮 + 文件名摘要」上下堆叠，还把按钮 align-self:end，
   放进表格后按钮贴到格子顶部、格子被撑高，看起来整体偏移。 */
.batch-create-modal .batch-item-table .new-item-drawing-cell {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 4px !important;
  overflow: hidden;
}

.batch-create-modal .batch-item-table .new-item-drawing-button {
  align-self: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 26px !important;
  min-height: 26px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  font-size: 12px !important;
  line-height: 26px !important;
  white-space: nowrap;
}

/* 文件名摘要不再占位（文件名在按钮悬停提示里） */
.batch-create-modal .batch-item-table .new-item-drawing-summary {
  display: none !important;
}

/* 修改批次时同一格里还有「删除图纸」，压小一点与主按钮并排 */
.batch-create-modal .batch-item-table .item-drawing-clear {
  flex: 0 0 auto;
  height: 24px;
  min-height: 24px;
  padding: 0 4px;
  font-size: 11px;
  white-space: nowrap;
}

/* ===== V23.73 操作列收窄、删除按钮不再被拉宽 =====
   原来最后一列是 minmax(70px,1fr)，会把整行剩余宽度全吃掉，操作列变得特别宽；
   按钮又继承了旧样式被拉伸成一大块。这里把弹性让给「部件名称」，
   操作列固定 80px（与焊接列接近），删除按钮按内容宽度居中。 */
/* V23.78 在「部件材料」后插入「核料（千克）」列；
   托盘表编号 150→75、焊接 76→38、图纸 120→60、操作 80→40（宽度减半）。
   V23.81 「部件名称」缩小 1/3（占整行宽的比例由约 25% 降到约 17%），
   腾出来的宽度按比例分给其它列 —— 所以这里全部列都改成 fr：
   表格变宽时各列一起等比例变大、始终铺满，部件名称列也不会再独吞剩余空间。 */
.batch-create-modal .batch-item-head,
.batch-create-modal .batch-item-table .batch-item-row {
  grid-template-columns: 54fr 287fr 167fr 145fr 84fr 87fr 98fr 145fr 123fr 189fr 156fr 42fr 67fr 45fr !important;
  min-width: 1427px !important;
}

.batch-create-modal .batch-item-table .batch-item-row > .batch-item-op {
  justify-content: center !important;
  align-items: center !important;
  padding: 0 4px !important;
}

.batch-create-modal .batch-item-table .batch-item-delete {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  align-self: center !important;
  border-radius: 5px !important;
  font-size: 12px !important;
  line-height: 24px !important;
  white-space: nowrap;
}

/* ===== V23.76 镀锌/涂装单位改为弹窗填写 =====
   选到需要镀锌/涂装的流程时，「处理流程」格里出现一个「设」按钮；
   点该按钮（或刚改完流程时自动）弹出小窗口，选题对应的单位与涂装代码。
   表格仍保持 13 列，行高不变。 */
.batch-create-modal .batch-item-table .process-control {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.batch-create-modal .batch-item-table .process-control .process-route-select {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
}

.batch-create-modal .batch-item-table .item-units-button {
  flex: 0 0 auto;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  margin: 0;
  padding: 0;
  border: 1px solid #cfd8dc;
  border-radius: 5px;
  background: #fff;
  color: #1e6091;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.batch-create-modal .batch-item-table .item-units-button:hover {
  border-color: #8fc8a9;
  background: #eef7f3;
  color: #0d7568;
}

/* 单位弹窗（新建与修改批次共用） */
.item-units-modal {
  width: min(420px, 92vw);
  max-width: 420px;
  margin: 0 auto;
}

.item-units-modal .item-units-fields {
  display: grid;
  gap: 12px;
  padding: 4px 0 12px;
}

.item-units-modal .item-units-fields > label {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.item-units-modal .item-units-fields > label > span {
  font-size: 12px;
  font-weight: 700;
  color: #33455a;
}

.item-units-modal .item-units-fields select,
.item-units-modal .item-units-fields input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #ccd7d1;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.item-units-modal .item-units-fields select:focus,
.item-units-modal .item-units-fields input:focus {
  outline: none;
  border-color: #8fc8a9;
  background: #f4faf8;
}

/* ===== V23.77 序号列与表头对齐 =====
   v17-route.css 里序号原本是「圆形徽标」：.batch-item-index 带着
   justify-self:center 和 min-width:28px。表格化之后宽度/圆角/margin 都被清掉了，
   但 justify-self:center 还在 —— 序号格只按「1」「2」的内容宽度居中，
   在 48px 的列里左右都留白，右边线也跟着缩到中间，
   于是和表头「序号」格错开、上下行之间看着有间隔。
   这里让它重新铺满整个网格列，右边缘与表头连成一条线。 */
.batch-create-modal .batch-item-table .batch-item-row > .batch-item-index {
  justify-self: stretch !important;
  align-self: stretch !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box;
  border-right: 1px solid #dbe4ec !important;
}

/* ===== V23.78 窄列适配 + 核料列 ===== */

/* 列收窄后表头文字要放得下：减小左右内边距（「托盘表编号」「核料（千克）」最宽） */
.batch-create-modal .batch-item-table .batch-item-head > span {
  padding: 9px 4px !important;
}

/* —— 核料列 —— */
.batch-create-modal .batch-item-table .item-check-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 4px !important;
}

/* V23.79 去掉「未核料」四周的方框：表格本身已经有格线，
   这一格只放文字（灰 → 绿），不再在格子里再画一个按钮框。 */
.batch-create-modal .batch-item-table .item-check-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  height: 100%;
  min-height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #93a1b2;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.batch-create-modal .batch-item-table .item-check-toggle:hover {
  color: #0d7568;
}

.batch-create-modal .batch-item-table .item-check-cell.is-checked .item-check-toggle {
  color: #0d7568;
  font-weight: 700;
}

.batch-create-modal .batch-item-table .item-check-state {
  font-size: 12px;
}

.batch-create-modal .batch-item-table .item-check-weight {
  color: #0d7568;
  font-size: 12px;
  font-weight: 800;
}

/* —— 焊接列减半：只留勾选框，居中 —— */
.batch-create-modal .batch-item-table .welding-control {
  justify-content: center !important;
  padding: 0 2px !important;
  gap: 0 !important;
}

/* —— 图纸列减半：主按钮更紧凑，「删除图纸」收成右上角的小 ×，不再占一格宽度 —— */
.batch-create-modal .batch-item-table .new-item-drawing-cell {
  position: relative !important;
  padding: 0 4px !important;
}

.batch-create-modal .batch-item-table .new-item-drawing-button {
  width: 100% !important;
  padding: 0 4px !important;
}

.batch-create-modal .batch-item-table .item-drawing-clear {
  position: absolute !important;
  right: 0;
  top: 1px;
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  max-height: 14px;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #e7b9b1;
  border-radius: 50%;
  background: #fff;
  color: #c0392b;
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  z-index: 2;
}

/* —— 操作列减半 —— */
.batch-create-modal .batch-item-table .batch-item-delete {
  padding: 0 4px !important;
  font-size: 11px !important;
}

/* —— 核料明细模块（新建批次页面里的第三个模块） —— */
.item-check-panel {
  flex: 0 0 auto;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #fff;
}

.item-check-panel[hidden] {
  display: none !important;
}

.item-check-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.item-check-panel-head b {
  color: #18242f;
  font-size: 14px;
}

.item-check-panel-head small {
  color: #0d7568;
  font-size: 12px;
  font-weight: 700;
}

.item-check-panel-body {
  color: #8b98a8;
  font-size: 12px;
}

/* ===== V23.82 核料：列状态、核料弹窗、核料明细表 ===== */

/* 部件行「核料」列 */
.batch-create-modal .batch-item-table .item-check-cell.is-checked .item-check-weight {
  color: #0d7568;
  font-size: 12px;
  font-weight: 800;
}

.batch-create-modal .batch-item-table .item-check-cell.is-pending .item-check-state {
  color: #b45309;
  font-weight: 700;
}

.batch-create-modal .batch-item-table .item-check-cell.is-pending .item-check-weight {
  color: #b45309;
}

/* 核料弹窗 */
.item-check-modal {
  /* V23.88 左窄右宽：材料树固定窄列，右侧放编辑区 + 已加入材料 + 汇总 + 按钮 */
  width: min(1100px, 96vw);
  max-width: 1100px;
}

.item-check-meta {
  /* V23.85 整体放大字号，界面更清爽易读 */
  margin: 6px 0 0;
  color: #5b6b7c;
  font-size: 14px;
}

.item-check-picker-row {
  display: grid;
  /* V23.88 左半部分收窄到固定 320px，右半部分占满剩余宽度 */
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 12px;
}

.item-check-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.item-check-picker {
  display: flex;
  flex-direction: column;
  /* V23.87 弹窗拉长：材料区更高，一屏看到更多分类 */
  min-height: 600px;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  overflow: hidden;
  background: #fbfdfc;
}

.item-check-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 88px;
  padding: 0 8px 8px;
  overflow: auto;
}

.item-check-chip {
  padding: 3px 9px;
  border: 1px solid #d6e0ea;
  border-radius: 999px;
  background: #fff;
  color: #3c4d5f;
  font-size: 12px;
  cursor: pointer;
}

.item-check-chip.active {
  border-color: #8fc8a9;
  background: #eef8f2;
  color: #0d7568;
  font-weight: 700;
}

.item-check-materials {
  flex: 1 1 auto;
  max-height: 300px;
  overflow: auto;
  border-top: 1px solid #eef3f7;
  background: #fff;
}

.item-check-material {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #f1f5f8;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.item-check-material b {
  color: #18242f;
  font-size: 13px;
}

.item-check-material small {
  grid-column: 1 / 2;
  color: #7d8b9b;
  font-size: 11px;
}

.item-check-material span {
  grid-row: 1 / 3;
  align-self: center;
  color: #0d7568;
  font-size: 12px;
  white-space: nowrap;
}

.item-check-material em {
  color: #b45309;
  font-style: normal;
}

.item-check-material.active,
.item-check-material:hover {
  background: #f4faf8;
}

.item-check-empty {
  margin: 0;
  padding: 14px;
  color: #8b98a8;
  font-size: 14px;
}

.item-check-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  background: #fff;
}

.item-check-selected {
  display: grid;
  gap: 3px;
  min-height: 52px;
  color: #3c4d5f;
  font-size: 14px;
}

.item-check-selected b {
  color: #18242f;
  font-size: 17px;
}

.item-check-selected span {
  color: #0d7568;
  font-weight: 700;
}

.item-check-warn {
  color: #b45309;
  font-style: normal;
  font-size: 13px;
}

.item-check-inputs {
  display: grid;
  gap: 10px;
}

.item-check-inputs label {
  display: grid;
  gap: 5px;
  color: #4a5a6b;
  font-size: 14px;
}

.item-check-inputs input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ccd7d1;
  border-radius: 6px;
  font-size: 15px;
}

.item-check-add {
  height: 42px;
  border: 1px solid #8fc8a9;
  border-radius: 8px;
  background: #eef8f2;
  color: #0d7568;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.item-check-add:disabled {
  border-color: #dbe4ec;
  background: #f5f8fa;
  color: #a9b6c2;
  cursor: not-allowed;
}

.item-check-draft {
  /* V23.88 移入右侧栏后由父级 gap 控制间距 */
  margin-top: 0;
  border: 1px solid #dbe4ec;
  border-radius: 10px;
  overflow: hidden;
}

.item-check-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #eef3f7;
  color: #3c4d5f;
  font-size: 14px;
}

.item-check-draft-list {
  display: grid;
  max-height: 240px;
  overflow: auto;
}

.item-check-draft-row {
  display: grid;
  /* V23.88 移入右侧栏，列宽收紧 */
  grid-template-columns: minmax(104px, 1.15fr) 78px 66px 66px minmax(72px, 0.95fr) 44px 44px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #f1f5f8;
  font-size: 14px;
}

.item-check-draft-row .draft-main {
  display: grid;
}

.item-check-draft-row .draft-main small,
.item-check-draft-row .draft-size small,
.item-check-draft-row .draft-weight small {
  color: #8b98a8;
  font-size: 12px;
}

.item-check-draft-row .draft-weight {
  text-align: right;
  font-weight: 700;
  color: #18242f;
}

.item-check-draft-row .draft-remark {
  height: 34px;
  padding: 0 8px;
  border: 1px solid #dbe4ec;
  border-radius: 5px;
  font-size: 13px;
}

.item-check-draft-row .draft-edit,
.item-check-draft-row .draft-remove {
  height: 32px;
  padding: 0 6px;
  border: 1px solid #dbe4ec;
  border-radius: 5px;
  background: #fff;
  color: #3c4d5f;
  font-size: 12px;
  cursor: pointer;
}

.item-check-draft-row .draft-remove {
  border-color: #e7b9b1;
  color: #c0392b;
}

.item-check-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /* V23.88 移入右侧栏后由父级 gap 控制间距 */
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid #cfe6da;
  border-radius: 10px;
  background: #f4faf8;
  color: #3c4d5f;
  font-size: 15px;
}

/* V23.88 按钮组跟随右侧栏宽度 */
.item-check-modal .item-check-actions {
  margin: 0;
  justify-content: flex-end;
}

.item-check-preview b {
  color: #0d7568;
  font-size: 19px;
}

/* 部件明细下方的核料明细表 */
.item-check-panel-body {
  display: grid;
  gap: 14px;
}

.item-check-group {
  border: 1px solid #e2eaf1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.item-check-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f4f8fb;
  color: #3c4d5f;
  font-size: 12px;
}

.item-check-group-head b {
  color: #18242f;
  font-size: 13px;
}

.item-check-group-head em {
  color: #b45309;
  font-style: normal;
  font-weight: 700;
}

.item-check-row {
  display: grid;
  grid-template-columns: 120px 160px 150px 110px 110px 120px 120px minmax(120px, 1fr);
  align-items: center;
  border-top: 1px solid #eef3f7;
  font-size: 12px;
  color: #33455a;
}

.item-check-row > span {
  padding: 7px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-check-row-head {
  border-top: 0;
  background: #eef3f7;
  font-weight: 700;
  color: #33455a;
}

.item-check-subtotal {
  padding: 7px 12px;
  border-top: 1px solid #eef3f7;
  background: #fbfdfc;
  color: #3c4d5f;
  font-size: 12px;
  text-align: right;
}

.item-check-subtotal b {
  color: #0d7568;
  font-size: 13px;
}

/* 详情页 */
.check-empty {
  color: #8b98a8;
}

.check-weight {
  color: #0d7568;
}

.check-pending {
  color: #b45309;
  font-weight: 700;
}

.item-check-detail-table .item-check-subtotal-row td {
  background: #fbfdfc;
  color: #0d7568;
  font-weight: 700;
}

/* ===== V23.83 核料弹窗：材料分类树（分类 → 规格） ===== */
/* V23.85 去掉搜索框后放大字号，行高更舒展 */
/* V23.87 去掉右侧单重，列表更紧凑；材料区加高，弹窗整体变长 */
.item-check-tree {
  flex: 1 1 auto;
  max-height: 600px;
  overflow: auto;
  padding: 2px 0 6px;
  border-top: 1px solid #eef3f7;
  background: #fff;
}

.tree-cat {
  border-bottom: 1px solid #f4f8fb;
}

.tree-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #33455a;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.tree-cat-head > i {
  width: 14px;
  color: #8b98a8;
  font-style: normal;
  font-size: 15px;
  text-align: center;
}

.tree-cat-head b {
  font-weight: 600;
}

.tree-cat-head small {
  color: #9aa8b6;
  font-size: 13px;
}

.tree-cat-head:hover {
  background: #f7fbfa;
}

.tree-cat.open > .tree-cat-head b {
  color: #0d7568;
}

.tree-items {
  display: grid;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 34px;
  border: 0;
  background: transparent;
  color: #3c4d5f;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.tree-item small {
  color: #8b98a8;
  font-size: 13px;
}

.tree-item em {
  color: #b45309;
  font-size: 12px;
  font-style: normal;
  margin-left: auto;
}

.tree-item:hover {
  background: #f4faf8;
}

.tree-item.active {
  background: #eef8f2;
  color: #0d7568;
  font-weight: 700;
}

/* V23.88 窄屏（平板/手机）：左右两栏改为上下排列，避免右侧内容被挤压 */
@media (max-width: 860px) {
  .item-check-picker-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .item-check-picker {
    min-height: 320px;
  }

  .item-check-tree {
    max-height: 320px;
  }
}
