:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --bg: #f0fdfa;
  --card: #ffffff;
  --text: #134e4a;
  --muted: #64748b;
  --danger: #dc2626;
  --border: #d7e5e3;
  --radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Microsoft YaHei";
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow-x: hidden;
  overflow: hidden;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  line-height: 1.4;
}
body { -webkit-tap-highlight-color: transparent; }

/* #app 必须承继 html/body 的 100% 高度并成为 flex 容器，
   否则 #view-shell 的 height:100%/flex:1 失效，.shell-foot 被推出视口被 body overflow:hidden 裁掉 */
#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 全局统一滚动条样式 —— 2px 宽 */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 1px;
}
*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.view {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.view[hidden], .shell[hidden], .list-pane[hidden] { display: none !important; }

html.gak-authed-boot #view-login { display: none !important; }
html.gak-authed-boot #view-shell,
html.gak-authed-boot #view-shell[hidden] { display: flex !important; }

/* —— 登录（迈方同款） —— */
#view-login.view-login {
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(900px 500px at 100% 100%, rgba(13, 148, 136, 0.18), transparent 50%),
    linear-gradient(160deg, #ecfeff 0%, #f0fdfa 45%, #e2e8f0 100%);
}
.login-shell { display: flex; width: 100%; height: 100%; min-height: 100%; }
.login-hero {
  display: none;
  flex: 1.05;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.92), rgba(13, 148, 136, 0.88)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px; border-radius: 50%;
  right: -120px; bottom: -140px;
  background: rgba(255, 255, 255, 0.08);
}
.login-hero-inner { position: relative; z-index: 1; max-width: 420px; }
.login-mark {
  width: auto;
  max-width: 280px;
  height: auto;
  min-height: 56px;
  border-radius: 0;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 20px;
  box-sizing: border-box;
  overflow: hidden;
}
.login-mark-img {
  display: block;
  width: 100%;
  max-width: 248px;
  height: auto;
  object-fit: contain;
}
.login-hero-title { font-size: 28px !important; font-weight: 500 !important; letter-spacing: 0.02em; margin-bottom: 8px; }
.login-hero-mods {
  margin: 0 0 12px; font-size: 16px !important; font-weight: 500 !important;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.95);
}
.login-hero-desc { margin: 0; font-size: 14px !important; line-height: 1.7 !important; color: rgba(255,255,255,0.88); }
.login-panel {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,0.92);
  border-radius: 20px; padding: 36px 32px 28px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 16px 40px rgba(13,148,136,0.12);
  border: 1px solid rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
}
.login-card-head { margin-bottom: 22px; }
.login-card .brand { font-size: 22px !important; font-weight: 500 !important; color: #0f766e; }
.login-card .sub { color: #64748b; margin: 8px 0 0; font-size: 13px !important; line-height: 1.5; }
.login-card .field { display: grid; gap: 8px; margin-bottom: 16px; }
.login-card .field span { font-size: 12px; font-weight: 500; color: #334155; }
.login-card .field input {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid #d7e5e3; background: #f8fffe;
  font: inherit; color: var(--text);
}
.login-card .field input:hover { border-color: #99f6e4; }
.login-card .field input:focus {
  outline: none; background: #fff; border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}
.btn-login {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Microsoft YaHei" !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: 0.12em;
  color: #fff !important;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%);
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-login:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.42);
}
.btn-login:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}
.btn-login:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}
.wecom-login-wrap {
  margin-top: 6px;
}
.wecom-login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: #cbd5e1;
  font-size: 12px !important;
}
.wecom-login-divider::before,
.wecom-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.btn-wecom-login {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-family: "Microsoft YaHei" !important;
  font-size: 14px !important;
  color: #334155 !important;
  background: #fff;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn-wecom-login svg { color: #14b8a6; }
.btn-wecom-login:hover {
  border-color: #14b8a6;
  background: #f0fdfa;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}
.btn-wecom-login:active {
  transform: translateY(1px);
}
.btn-wecom-login:disabled {
  opacity: 0.6;
  cursor: default;
}
.login-foot-tip {
  margin: 16px 0 0;
  text-align: center;
  color: #94a3b8;
  font-size: 12px !important;
  line-height: 1.5;
}
.login-icp {
  text-align: center;
  margin-top: 16px;
  flex-shrink: 0;
}
.login-icp a {
  color: #94a3b8;
  font-size: 12px;
  text-decoration: none;
}
.login-icp a:hover {
  color: #64748b;
}
.error {
  color: #991b1b; background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; font-size: 12px;
}
.login-conn-tip {
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.5;
}
.login-conn-tip.ok {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.login-conn-tip.err {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.login-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 12px;
  background: #eef8f6;
}
.login-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: "Microsoft YaHei" !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #64748b;
}
.login-tab.active {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.btn-linkish {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: none;
  background: transparent;
  color: #0d9488;
  cursor: pointer;
  font-family: "Microsoft YaHei" !important;
  font-size: 13px !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ok-msg {
  margin: 0 0 12px;
  color: #047857;
  font-size: 13px !important;
}
.error.ok-msg {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.settings-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 24px;
}
.settings-card {
  max-width: 720px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 20px 20px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.settings-card-title {
  margin: 0 0 8px;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #0f766e;
}
.settings-card-desc {
  margin: 0 0 16px;
  color: #64748b;
  line-height: 1.6 !important;
  font-size: 13px;
}
.settings-meta {
  margin: -6px 0 14px;
  color: #94a3b8;
  font-size: 12px !important;
}
.field-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.field-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.field-check span {
  display: inline !important;
  margin: 0 !important;
  color: #334155;
  font-weight: 500 !important;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.hw-auth-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hw-auth-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #f8fffe;
}
.hw-auth-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hw-auth-main code {
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 12px !important;
  color: #0f766e;
  word-break: break-all;
}
.hw-auth-note { color: #64748b; font-size: 12px; }
.hw-auth-meta {
  grid-column: 1 / -1;
  color: #94a3b8;
  font-size: 12px !important;
}
@media (min-width: 860px) {
  .login-hero { display: flex; }
  .login-panel { padding: 40px; }
  .login-card {
    max-width: 420px;
    padding: 40px 36px 32px;
  }
}

/* —— 主壳 —— */
#view-shell.shell {
  display: flex; flex-direction: column;
  flex: 1; height: 100%; min-height: 0; padding: 0;
  background: var(--bg); overflow: hidden; position: relative;
}
.shell-main {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  padding: 0; position: relative;
  overflow: hidden; background: var(--card);
}

/* 标签栏 */
.tab-bar {
  display: flex;
  align-items: center;
  height: 32px;
  background: #f8f9fb;
  border: none;
  padding: 0 8px;
  flex-shrink: 0;
}
.tab-bar-list {
  display: flex;
  align-items: center;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 2px;
}
.tab-bar-list::-webkit-scrollbar {
  height: 3px;
}
.tab-bar-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  background: #fff;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  max-width: 160px;
}
.tab-item:hover {
  background: #f1f5f9;
  border-bottom-color: #cbd5e1;
}
.tab-item.active {
  background: #fff;
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 500;
  box-shadow: none;
}
.tab-item .tab-icon {
  font-size: 12px;
  flex-shrink: 0;
}
.tab-item .tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-item .tab-close {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.tab-item .tab-close:hover {
  background: #e2e8f0;
  color: #475569;
}
.tab-item.home-tab .tab-close {
  display: none;
}
.tab-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}
.tab-bar-btn {
  height: 22px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 3px;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab-bar-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
.tab-bar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.list-pane {
  flex: 1; display: flex; flex-direction: column;
  min-height: 0; background: var(--card); overflow: hidden;
  font-size: 12px; font-family: "Microsoft YaHei";
  line-height: 1.4;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 12px; flex-wrap: wrap; flex-shrink: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.page-header-left { display: flex; align-items: center; gap: 4px; }
.page-title { display: none; }

/* QMS 检验记录组内快捷按钮：与「[菜单] 菜单」同行显示（头部胶囊，无独立 tab 栏）
   按钮组显示时：header 禁止换行（否则右侧工具栏被挤到下一行，右侧区域宽度改变）；
   工具栏不 wrap（横向滚动），保证 header 始终单行 44px，右侧区域宽度/高度不变。
   适用宿主：#page-module（QMS/材料/CRM/样品/采购/报价/生产计划）、#page-orders（订单组）、
   #page-customers（客户列表）、#page-aps / #page-attendance（生产计划组独立整页）。 */
#page-module > .page-header:has(.qms-insp-tabs-bar:not([hidden])),
#page-orders > .page-header:has(.qms-insp-tabs-bar:not([hidden])),
#page-customers > .page-header:has(.qms-insp-tabs-bar:not([hidden])),
#page-aps > .page-header:has(.qms-insp-tabs-bar:not([hidden])),
#page-attendance > .page-header:has(.qms-insp-tabs-bar:not([hidden])) {
  flex-wrap: nowrap;
}
#page-module > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar,
#page-orders > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar,
#page-customers > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar,
#page-aps > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar,
#page-attendance > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar {
  flex: 1 1 auto; min-width: 0;
  flex-wrap: nowrap;
  /* 保持 overflow: visible —— 绝对定位的操作下拉（.tb-dd-menu）依赖容器不裁剪；
     overflow-x: auto 会把超出工具栏可视区的下拉裁掉（与销售订单式样不一致）。 */
}
/* 仅禁止 CRUD 按钮容器换行；不得 flex-grow（否则被拉伸占满、按钮左对齐打散右侧排列） */
#page-module > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar .toolbar-biz {
  flex: 0 1 auto; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin;
}
.qms-insp-tabs-bar {
  display: inline-flex; flex-wrap: wrap;
  gap: 2px; align-items: center; margin-left: 8px; padding-left: 8px;
  border-left: 1px solid var(--border);
  flex: 0 1 auto; min-width: 0;
}
.qms-insp-tabs-bar[hidden] { display: none !important; }
/* 当标签栏可见时，隐藏 page-title（避免与面包屑重复显示） */
.page-header:has(.qms-insp-tabs-bar:not([hidden])) .page-title {
  display: none;
}
/* 组名 label：标签为「新建/列表」时（如 PLM）显示当前组名以区分 */
.qms-insp-group-label {
  color: #334155; font-size: 12px; line-height: 1.6;
  padding: 0 4px 0 0; white-space: nowrap; flex-shrink: 0;
  font-family: "Microsoft YaHei";
}
.qms-insp-tab {
  border: 1px solid transparent; background: transparent;
  color: #475569; border-radius: 999px; padding: 2px 8px;
  font-size: 12px; font-family: "Microsoft YaHei"; line-height: 1.6;
  cursor: pointer; white-space: nowrap; outline: none; flex-shrink: 0;
}
.qms-insp-tab:hover { background: #e8eef4; color: #0f172a; }
.qms-insp-tab.active {
  background: var(--primary, #0f766e); color: #fff; font-weight: 500;
  border-color: var(--primary, #0f766e);
}
/* 材料管理标签页组分隔线（红线）：入库组 / 出库组 / 库存组 之间 */
.wms-material-tab-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #ef4444;
  margin: 0 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
/* 来料检验(IQC)：左侧状态文件夹树（点击展开/收缩）+ 可拖分隔条，右侧选中记录预览区 */
#page-module.has-iqc-folder-tree {
  display: grid;
  grid-template-columns: var(--iqc-tree-w, 460px) 6px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "folder splitter preview"
    "footer footer footer";
}
#page-module.has-iqc-folder-tree > .page-header { grid-area: header; }
#page-module.has-iqc-folder-tree > .iqc-folder-tree { grid-area: folder; }
#page-module.has-iqc-folder-tree > .iqc-preview { grid-area: preview; }
#page-module.has-iqc-folder-tree > #iqc-folder-splitter { grid-area: splitter; }
#page-module.has-iqc-folder-tree > #module-list { display: none; }
#page-module.has-iqc-folder-tree > .page-footer { grid-area: footer; }
/* 样品订单-列表：左侧状态文件夹树 + 可拖分隔条 + 右侧预览（对标来料检验 iqc，布局/样式复用） */
#page-module.has-sample-folder-tree {
  display: grid;
  grid-template-columns: var(--sa-tree-w, 460px) 6px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "folder splitter preview"
    "footer footer footer";
}
#page-module.has-sample-folder-tree > .page-header { grid-area: header; }
#page-module.has-sample-folder-tree > .iqc-folder-tree { grid-area: folder; }
#page-module.has-sample-folder-tree > #sample-folder-splitter { grid-area: splitter; }
#page-module.has-sample-folder-tree > .iqc-preview { grid-area: preview; }
#page-module.has-sample-folder-tree > #module-list { display: none; }
#page-module.has-sample-folder-tree > .page-footer { grid-area: footer; }
.iqc-folder-tree {
  min-height: 0;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.iqc-folder-tree-head {
  font-size: 12px;
  color: #94a3b8;
  padding: 4px 8px 6px;
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
}
.iqc-search {
  padding: 0 8px 8px;
  flex-shrink: 0;
}
.iqc-search-input {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  color: #334155;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}
.iqc-search-input::placeholder { color: #b6c2ce; }
.iqc-search-input:focus { border-color: var(--primary, #0f766e); }
.iqc-folder-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.iqc-folder-node {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  color: #475569;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  outline: none;
  flex-shrink: 0;
}
.iqc-folder-node:hover { background: #e8eef4; color: #0f172a; }
.iqc-folder-node.active {
  color: var(--primary, #0f766e);
  font-weight: 500;
}
.iqc-folder-label { flex: 1; }
.iqc-folder-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 500;
  box-sizing: border-box;
}
.iqc-folder-node.active .iqc-folder-badge { background: #dc2626; color: #fff; }
.iqc-folder-caret { font-size: 11px; opacity: 0.75; flex-shrink: 0; }
/* 已检验/已审核 下的下级文件夹（合格/不合格）缩进 */
.iqc-folder-kids {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.iqc-folder-node-sub {
  padding-left: 18px;
}
/* 选中文件夹下方展开的记录（简洁行：日期 | 编号 | 代码 | 状态 | 创建人） */
.iqc-records {
  margin: 2px 0 4px 20px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.iqc-record {
  display: block;
  padding: 5px 12px;
  font-size: 12px;
  color: #475569;
  font-family: "Microsoft YaHei";
  line-height: 1.5;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
}
.iqc-record:hover { background: #eef4f8; }
.iqc-record.selected { background: #e0f2f1; }
.iqc-rec-no { color: #1e293b; font-weight: 500; }
.iqc-rec-sep { color: #cbd5e1; }
.iqc-rec-status.iqc-st-pending { color: #b45309; font-weight: 500; }
.iqc-rec-status.iqc-st-checked { color: #1d4ed8; font-weight: 500; }
.iqc-rec-status.iqc-st-done { color: #047857; font-weight: 500; }
.iqc-rec-status.iqc-st-plain { color: #64748b; }
.iqc-record-empty {
  padding: 8px 12px;
  color: #94a3b8;
  font-size: 12px;
}
/* 右侧选中记录预览区（复用桌面版完整只读表单） */
.iqc-preview {
  min-height: 0;
  overflow-y: auto;
  background: var(--card);
  padding: 0;
}
.iqc-preview-head {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  padding: 14px 16px 10px;
}
.iqc-preview-body { display: block; }
/* 样品订单预览：状态水印浮动覆盖（复用销售订单椭圆印章样式） */
#sample-preview {
  position: relative;
}
/* 来料检验-预览：状态水印浮动覆盖（复用销售订单椭圆印章样式） */
#iqc-preview {
  position: relative;
}
/* 全局 11px !important 特异性更高，需用更高特异性选择器放大字号 */
#app #sample-preview .so-pending-watermark,
#app #iqc-preview .so-pending-watermark {
  font-size: 26px !important;
  line-height: 1.4 !important;
}
.iqc-create-body { padding: 0 16px; }
.iqc-create-body .iqc-po-form { max-width: none; }
.iqc-create-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.iqc-preview-empty {
  color: #94a3b8;
  font-size: 12px;
  padding: 24px 16px;
  text-align: center;
}
/* 生产计划组按钮已并入页头胶囊（.qms-insp-tab）；.aps-mod-tab 仅产线看板/检测数据独立整页使用 */
.aps-mod-tab {
  border: 1px solid transparent; background: transparent;
  color: #475569; border-radius: 999px; padding: 4px 14px;
  font-size: 12px; font-family: "Microsoft YaHei"; line-height: 1.4;
  cursor: pointer; white-space: nowrap; outline: none;
}
.aps-mod-tab:hover { background: #e8eef4; color: #0f172a; }
.aps-mod-tab.active {
  background: var(--primary, #0f766e); color: #fff; font-weight: 500;
  border-color: var(--primary, #0f766e);
}
.toolbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; justify-content: flex-end;
}
.toolbar-biz {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  align-items: center; margin-right: 2px;
}
.tb-btn {
  border: none; background: transparent; color: var(--primary-dark);
  border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 400;
  font-family: "Microsoft YaHei"; line-height: 1.4; cursor: pointer; white-space: nowrap;
  box-shadow: none; outline: none;
}
.tb-btn:hover { background: #e6f4f2; color: var(--primary-dark); }
.tb-btn:active, .tb-btn.active { background: #ccfbf1; }
.tb-btn:focus,
.tb-btn:focus-visible { outline: none; box-shadow: none; }
.tb-btn[hidden] { display: none !important; }
.tb-btn:disabled,
.tb-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  color: #94a3b8;
  pointer-events: none;
}
.tb-btn.danger-text:disabled,
.tb-btn.danger-text[disabled] {
  color: #f1a8a8;
}
.tb-btn.danger-text { color: #b91c1c; }
.tb-btn-primary { font-weight: 500; color: var(--primary-dark); }
.tb-btn-muted { color: #64748b; }
.delivery-layout-menu {
  position: fixed;
  z-index: 300;
  min-width: 148px;
  padding: 4px;
  background: #fff;
  border: 1px solid #d1e7e3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.tb-btn-muted:hover { background: #f1f5f9; color: #475569; }
.tb-dd {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tb-dd[hidden] { display: none !important; }
.tb-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 80;
  min-width: 148px;
  padding: 4px;
  background: #fff;
  border: 1px solid #d1e7e3;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.tb-dd-menu[hidden] { display: none !important; }
.tb-dd-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--primary-dark);
  text-align: left;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  cursor: pointer;
  white-space: nowrap;
}
.tb-dd-item:hover { background: #e6f4f2; }
.tb-dd-item.danger-text { color: #b91c1c; }
.tb-dd-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: #64748b;
}
.tb-dd-item:disabled:hover { background: transparent; }
.tb-dd-item[hidden] { display: none !important; }
#module-ops-extra,
#cust-ops-extra {
  display: contents;
}
/* shell-menu-btn 已全部移除（HTML 中已无此元素），死样式已清理 */
.ws-menu-btn { display: none !important; }
.search-bar {
  display: flex; gap: 8px; padding: 8px 12px 0; margin: 0;
  flex-shrink: 0;
}
.search-bar input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font: inherit; background: #fff;
}
.search-bar input:focus {
  outline: none; border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}
.list-body { flex: 1; min-height: 0; overflow: hidden; padding: 0; }
.list-body .table-wrap {
  border: none;
  border-radius: 0;
  max-height: none;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: auto;
}
/* 客户列表：左列表 + 右详情主从布局 */
.cust-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;
}
.cust-list-col {
  /* 左列表偏窄；拖拽后由 JS 写像素宽（flex: 0 0 Npx） */
  flex: 0 1 36%;
  max-width: 480px;
  min-width: 240px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cust-list-col.has-saved-split {
  /* 标记已恢复用户分栏宽度，避免被默认 max-width:480 顶回 */
  max-width: none;
}
.cust-list-col .list-body { min-width: 0; }
.cust-split-resizer {
  flex: 0 0 6px;
  width: 6px;
  margin: 0 -1px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  background: transparent;
  align-self: stretch;
}
.cust-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
.cust-split-resizer:hover::before,
.cust-split-resizer:focus-visible::before,
body.cust-split-dragging .cust-split-resizer::before {
  left: 1px;
  width: 4px;
  background: #0d9488;
}
body.cust-split-dragging {
  cursor: col-resize !important;
  user-select: none !important;
}
body.cust-split-dragging * {
  cursor: col-resize !important;
  user-select: none !important;
}
.cust-detail-col {
  flex: 1 1 auto;
  min-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #e2e8f0;
  background: #f0f2f5;
}
.cust-detail-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f7fffe 0%, #eef9f7 100%);
  border-bottom: 1px solid #e8eaed;
}
.cust-detail-title {
  font-size: 13px;
  font-weight: 500;
  color: #134e4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cust-detail-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cust-detail-actions .tb-btn { padding: 4px 8px; }
.cust-detail-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  padding: 24px;
  text-align: center;
}
.cust-detail-col .crm-hub-sub { padding: 6px 12px; }
.cust-detail-col .crm-hub-tabs { padding: 6px 12px 0; }
.cust-detail-col .crm-hub-body {
  padding: 12px 14px 16px !important;
  overflow: auto;
}
.cust-detail-col .crm-hub-body.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 窄屏（手机/平板竖屏）：上下堆叠，列表在上详情在下；隐藏拖拽条 */
@media (max-width: 860px) {
  .cust-main {
    flex-direction: column;
  }
  .cust-split-resizer {
    display: none;
  }
  .cust-list-col {
    flex: 0 0 42vh !important;
    width: auto !important;
    max-width: none !important;
    min-height: 220px;
    border-bottom: 1px solid #e2e8f0;
  }
  .cust-detail-col {
    flex: 1 1 auto;
    border-left: none;
    min-height: 42vh;
  }
}
.status-line {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  padding: 6px 14px;
}
.status-line[hidden] { display: none !important; }

.shell-foot {
  flex-shrink: 0; height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: #fff;
  border-top: 1px solid var(--border); z-index: 30;
}
.shell-foot-spacer { flex: 1; min-width: 8px; }
.shell-foot-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 8px;
}
.shell-foot-pager[hidden] { display: none !important; }
.foot-page-btn {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
}
.foot-page-btn:hover:not(:disabled) {
  border-color: var(--accent, #0D9488);
  color: var(--accent, #0D9488);
}
.foot-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.foot-page-info {
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.shell-foot-status {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 0;
  padding-right: 4px;
  text-align: right;
}
.shell-foot-icp {
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 8px;
}
.shell-foot-icp:hover {
  color: #64748b;
}

.list-pane .page-header {
  align-items: flex-start;
}
.list-pane .page-header,
.list-pane .page-header .toolbar,
.list-pane .page-header .tb-btn,
.list-pane .page-header .btn {
  font-family: "Microsoft YaHei" !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}
.list-pane .page-header .toolbar {
  flex: 1 1 auto;
  min-width: min(100%, 520px);
  justify-content: flex-end;
}
.list-pane .page-header .tb-btn {
  flex: 0 0 auto;
}
.list-pane .page-header .page-title {
  font-family: "Microsoft YaHei" !important;
  font-size: 15px !important;
  font-weight: 400 !important;
}

/* —— 左侧文件管理器式可折叠导航面板（收起=图标条，展开=完整面板，内容随面板推移） —— */
/* 默认展开态 220px；shell 可见时自动覆盖 hidden 属性 */
.nav-popup {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  width: 180px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #fafbfc;
  border-right: 1px solid #e2e8f0;
  box-shadow: 1px 0 3px rgba(15, 23, 42, 0.04);
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: auto;
  transition: width 0.22s ease;
}
.nav-popup.open,
.nav-popup.locked { width: 180px; }
.nav-popup.collapsed { width: 48px; }
.nav-popup[hidden] { display: none !important; }
/* shell 可见时：强制显示 nav-popup（覆盖 hidden 属性） */
#view-shell:not([hidden]) .nav-popup {
  display: flex !important;
}
#view-shell:not([hidden]) .nav-popup:not(.collapsed) {
  width: 180px;
}
#view-shell:not([hidden]) .nav-popup.collapsed {
  width: 48px;
}

.nav-popup-rail {
  display: none;
}
.nav-rail-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex: 0 0 auto;
}
.nav-rail-btn:hover {
  background: #e6f4f2;
  color: var(--primary-dark);
}
.nav-rail-btn.active {
  background: #ccfbf1;
  color: var(--primary-dark);
}
.nav-rail-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-popup.collapsed .nav-rail-title { display: none; }
.nav-popup.collapsed .nav-popup-rail { justify-content: center; gap: 4px; padding: 0 6px; }

.nav-popup-drawer {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
}
.nav-popup-drawer-head { display: none; }
.nav-popup-drawer-title { font-size: 14px; font-weight: 500; color: var(--text); }
.nav-popup-lock-btn { display: none; }

.nav-popup-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.nav-popup-main {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
/* 收起态：主区收窄为图标条，隐藏文字/非图标元素 */
.nav-popup.collapsed .nav-popup-main {
  width: 48px; min-width: 48px; max-width: 48px; flex-basis: 48px;
}
.nav-popup.collapsed .nav-popup-user,
.nav-popup.collapsed .nav-popup-user-dropdown,
.nav-popup.collapsed .nav-popup-sep,
.nav-popup.collapsed .nav-popup-change-pwd,
.nav-popup.collapsed .nav-popup-logout { display: none; }
.nav-popup.collapsed .nav-item {
  justify-content: center; padding-left: 0; padding-right: 0;
}
.nav-popup.collapsed .nav-item > span:not(.nav-ico):not(.nav-badge):not(.nav-nested-chevron),
.nav-popup.collapsed .nav-nested-label,
.nav-popup.collapsed .nav-popup-name,
.nav-popup.collapsed .nav-popup-role { display: none; }

/* 主内容区固定 180px 左偏移（展开态）；收起态 48px */
#view-shell:not([hidden]) .shell-main {
  margin-left: 180px;
  transition: margin-left 0.22s ease;
}
body.nav-collapsed #view-shell:not([hidden]) .shell-main { margin-left: 48px; }
/* 旧右侧飞出面板：彻底禁用，改为二级菜单在一级菜单下方展开 */
.nav-popup-side { display: none !important; }

/* 一级分组子项：在分组标题下方纵向展开 */
.nav-group > .nav-sub {
  display: flex;
  flex-direction: column;
  padding: 2px 0 6px 0;
  border-top: 1px solid #f1f5f9;
}
.nav-group > .nav-sub[hidden] { display: none !important; }
.nav-group > .nav-sub .nav-sub-item {
  padding-left: 28px !important;
  font-size: 11px !important;
  color: #475569 !important;
}
.nav-group > .nav-sub .nav-sub-item .nav-label {
  color: #475569 !important;
}
.nav-group > .nav-sub .nav-sub-item.active .nav-label {
  color: var(--primary-dark);
  font-weight: 500;
}
.nav-group > .nav-sub .nav-nested-head {
  padding-left: 28px;
  font-size: 11px;
  color: #475569;
}
.nav-group > .nav-sub .nav-nested-head .nav-nested-chevron {
  transition: transform 0.15s ease;
}
.nav-group > .nav-sub .nav-nested-head[aria-expanded="true"] .nav-nested-chevron {
  transform: rotate(90deg);
}
.nav-group > .nav-sub .nav-sub-nested {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px 0;
}
.nav-group > .nav-sub .nav-sub-nested[hidden] { display: none !important; }
.nav-group > .nav-sub .nav-sub-nested .nav-item {
  padding-left: 44px !important;
  font-size: 10px !important;
  color: #64748b !important;
}
.nav-group > .nav-sub .nav-sub-nested .nav-item .nav-label {
  color: #64748b !important;
}
.nav-flyout-nest-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.nav-flyout-nest-head .nav-nested-chevron {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
}
.nav-flyout-nest-head.is-open .nav-nested-chevron,
.nav-flyout-nest-head.has-active .nav-nested-chevron {
  color: #0d9488;
}
.nav-popup-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}
.nav-popup-user:hover {
  background: #f8fafc;
}
.nav-popup-user-chevron {
  margin-left: auto;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.nav-popup-user.is-open .nav-popup-user-chevron {
  transform: rotate(180deg);
}
.nav-popup-user-dropdown {
  display: none;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 0;
  position: relative;
  z-index: 10;
}
.nav-popup-user-dropdown[hidden] {
  display: none;
}
.nav-popup-user.is-open + .nav-popup-user-dropdown {
  display: flex;
}
.nav-popup-user-dropdown .nav-popup-change-pwd {
  justify-content: flex-start;
  padding: 8px 12px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  transition: background-color 0.15s ease;
}
.nav-popup-user-dropdown .nav-popup-change-pwd:hover {
  background: #f1f5f9;
}
.nav-popup-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
}
.nav-popup-user-meta { min-width: 0; }
.nav-popup-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-popup-role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.nav-popup-sep {
  height: 1px;
  background: #e2e8f0;
  flex-shrink: 0;
  margin: 4px 12px;
}
/* 对齐迈方：列表吃满剩余高度，禁止再写 max-height 把弹层裁矮 */
.nav-popup-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.nav-popup-list::-webkit-scrollbar {
  width: 2px;
}
.nav-popup-list::-webkit-scrollbar-track {
  background: transparent;
}
.nav-popup-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 1px;
}
.nav-popup-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.nav-popup-user,
.nav-popup-logout {
  flex-shrink: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: var(--text);
  text-align: left; padding: 6px 10px 6px 10px; cursor: pointer; font-size: 12px;
  box-sizing: border-box; white-space: nowrap;
  overflow: visible;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-item .nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
}
.nav-item .nav-label-right,
.nav-group-toggle .nav-label-right {
  display: none;
}
.nav-item .nav-badge,
.tb-btn .tb-badge,
.qms-insp-tab .nav-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  vertical-align: text-top;
  flex-shrink: 0;
}
.nav-item .nav-badge[hidden],
.tb-btn .tb-badge[hidden],
.qms-insp-tab .nav-badge[hidden] {
  display: none !important;
}
.nav-item:hover { background: #f0f9f8; color: var(--primary-dark); }
.nav-item:hover .nav-label { color: var(--primary-dark); }
.nav-item.active { background: #e6f4f2; color: var(--primary-dark); }
.nav-item.active .nav-label { color: var(--primary-dark); font-weight: 500; }
.nav-ico {
  display: none;
}
.nav-group { width: 100%; }
.nav-group-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: none; background: transparent; color: var(--text);
  text-align: left; padding: 6px 10px 6px 10px; cursor: pointer; font-size: 12px;
  font-weight: 500;
  box-sizing: border-box; white-space: nowrap;
  overflow: visible;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-group-toggle:hover { background: #e6f4f2; color: var(--primary-dark); }
.nav-group-toggle.is-open,
.nav-group-toggle.has-active {
  color: var(--primary-dark);
}
.nav-group-toggle.is-current-group {
  background: #e6f4f2; color: var(--primary-dark);
  box-shadow: inset 2px 0 0 var(--primary);
}
.nav-group-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1e293b; }
.nav-group-toggle .nav-label-right {
  display: none;
}
.nav-group-chevron {
  display: none;
}
.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
  transform: rotate(90deg);
}
.nav-sub { padding: 0 0 4px; }
.nav-sub[hidden] { display: none !important; }
.nav-sub-item { padding-left: 28px; font-size: 11px; color: #475569; }

/* 一级菜单项（single_leaf） */
.nav-top-item {
  padding-left: 10px;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
}
.nav-top-item .nav-label {
  color: #1e293b;
}
.nav-subgroup { width: 100%; }
.nav-nested-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-left: 36px;
  font-size: 10px;
  color: #64748b;
}
.nav-nested-head .nav-nested-label {
  color: #64748b;
}
.nav-nested-head.has-active .nav-nested-label {
  color: var(--primary-dark);
  font-weight: 500;
}
.nav-nested-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.nav-nested-chevron {
  display: none;
}
.nav-popup.wo-expanded .nav-nested-head[data-nav-flyout="wo-status"] .nav-nested-chevron,
.nav-popup.wms-hub-expanded .nav-nested-head[data-nav-flyout="wms-hub"] .nav-nested-chevron,
.nav-nested-head[aria-expanded="true"] .nav-nested-chevron {
  color: #0d9488;
}
.nav-nested-head.has-active {
  color: var(--primary, #0d9488);
  font-weight: 500;
}
.nav-flyout-section {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0.02em;
  user-select: none;
}
.nav-flyout-item {
  padding: 8px 12px;
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-flyout-item:hover {
  background: #e6f4f2;
  color: var(--primary-dark, #0f766e);
}
.nav-flyout-item.active {
  background: #ccfbf1;
  color: var(--primary-dark, #0f766e);
  font-weight: 500;
}
.nav-sub-nested {
  padding: 0 0 2px;
}
.nav-sub-nested .nav-sub-item,
.nav-nested-leaf {
  padding-left: 44px;
  font-size: 10px;
  color: #64748b;
}
.nav-sub-nested .nav-sub-item .nav-label,
.nav-nested-leaf .nav-label {
  color: #64748b;
}
.nav-popup-logout {
  width: 100%; border: none; background: transparent; flex-shrink: 0;
  text-align: left; padding: 8px 16px; cursor: pointer; font-size: 13px; color: #b91c1c;
  box-sizing: border-box;
}
.nav-popup-logout:hover { background: #fef2f2; }
.nav-popup-change-pwd {
  width: 100%; border: none; background: transparent; flex-shrink: 0;
  text-align: left; padding: 8px 16px; cursor: pointer; font-size: 13px; color: #0f766e;
  box-sizing: border-box; display: flex; align-items: center; gap: 6px;
}
.nav-popup-change-pwd:hover { background: #ecfdf5; }
.nav-popup-change-pwd .nav-ico { width: 20px; display: inline-flex; justify-content: center; }

/* =============================================
   修改密码弹窗
   ============================================= */
.modal-card-change-pwd {
  width: min(460px, calc(100vw - 32px));
  max-width: 460px;
}
.change-pwd-body {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 24px 4px;
}
.change-pwd-row {
  display: flex; flex-direction: column; gap: 6px;
}
.change-pwd-row > label {
  font-size: 13px; color: #334155; font-weight: 500;
}
.change-pwd-field {
  position: relative;
  display: flex; align-items: center;
}
.change-pwd-field > input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 6px 40px 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color .12s linear, box-shadow .12s linear;
}
.change-pwd-field > input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.change-pwd-field > .pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none; background: transparent;
  cursor: pointer;
  font-size: 15px;
  border-radius: 6px;
  color: #64748b;
  display: inline-flex; align-items: center; justify-content: center;
}
.change-pwd-field > .pwd-toggle:hover { background: #f1f5f9; color: #0f172a; }
.change-pwd-hint {
  font-size: 12px; color: #64748b; line-height: 1.5;
}
.change-pwd-hint:not(:empty) { margin-top: -2px; }
.change-pwd-status {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  min-height: 20px;
  background: #f8fafc;
  color: #475569;
  border: 1px dashed transparent;
  line-height: 1.5;
}
.change-pwd-status.is-ok {
  color: #065f46;
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.35);
}
.change-pwd-status.is-err {
  color: #991b1b;
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.35);
}
.change-pwd-foot {
  padding: 12px 24px 18px;
  display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid transparent;
}

/* —— 表格（对齐迈方 data-table / sticky / col-resizer） —— */
.table-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.table-wrap::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}
.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 1px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.data-table {
  width: max-content;
  min-width: 100%;
  /* collapse 下 sticky 右列（操作）在横向滚动时常失效 */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}
.data-table.resizable th {
  position: sticky;
  top: 0;
  overflow: visible; /* 列宽拖动手柄需可点 */
}
.data-table th,
.data-table td {
  padding: 5px 8px;
  border-right: 1px solid #e8efee;
  border-bottom: 1px solid #e8efee;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 400;
  font-family: "Microsoft YaHei";
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.data-table th {
  background: #0d9488;
  color: #fff;
  font-weight: 400;
  position: sticky;
  top: 0;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table.resizable th {
  overflow: visible;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:nth-child(even) { background: #f8fffe; }
.data-table tbody tr:hover { background: #e6f4f2; }
.data-table tbody tr.selected { background: #99f6e4 !important; }
/* 材料入库←采购：左侧勾选列 */
.data-table th.col-check,
.data-table td.col-check {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
  vertical-align: middle;
}
.data-table .inbound-po-check,
.data-table .inbound-wo-check,
.data-table .outbound-wo-check,
#inbound-po-check-all,
#inbound-wo-check-all,
#outbound-wo-check-all {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.data-table.has-inbound-po-check tbody tr.selected td.col-check {
  background: #99f6e4;
}
/* 销售订单状态列着色（只读展示） */
.so-status-text { font: inherit; }
.so-st-pending { color: #0d9488; }
.so-st-approved { color: #2563eb; }
.so-st-closed { color: #b91c1c; }
.so-st-other { color: #64748b; }
.data-table col.col-sel { width: 42px; }
.data-table col.col-idx,
.data-table th.col-idx,
.data-table td.col-idx {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
  box-sizing: border-box !important;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: #f0fdfa;
  text-align: center;
  overflow: hidden;
  text-overflow: clip;
}
.data-table th.col-idx { background: #0f766e; color: #fff; }
/* 左侧自定义冻结列（行号 + 列设置勾选的连续前缀） */
.data-table th.gak-sticky-left,
.data-table td.gak-sticky-left {
  position: sticky;
  z-index: 3;
}
.data-table th.gak-sticky-left {
  z-index: 4;
  background: #0d9488;
  color: #fff;
}
.data-table th.gak-sticky-left.col-idx {
  background: #0f766e;
}
.data-table td.gak-sticky-left {
  background: #fff;
}
.data-table td.gak-sticky-left.col-idx {
  background: #f0fdfa;
}
.data-table tbody tr:nth-child(even) td.gak-sticky-left {
  background: #f8fffe;
}
.data-table tbody tr:nth-child(even) td.gak-sticky-left.col-idx {
  background: #f0fdfa;
}
.data-table tbody tr:hover td.gak-sticky-left {
  background: #e6f4f2;
}
.data-table tbody tr:hover td.gak-sticky-left.col-idx {
  background: #ccfbf1;
}
.data-table tbody tr.selected td.gak-sticky-left {
  background: #99f6e4 !important;
}
.data-table td.gak-sticky-left-last,
.data-table th.gak-sticky-left-last {
  box-shadow: 4px 0 8px rgba(15, 23, 42, 0.08);
}
.data-table th.gak-sticky-left-last {
  box-shadow: 4px 0 8px rgba(15, 23, 42, 0.14);
}
/* 操作列：所有 data-table 统一右侧固定（GAK-WEB-OPS-STICKY-001） */
.data-table th.col-ops,
.data-table td.col-ops,
.data-table th[data-col="操作"],
.data-table td[data-col="操作"] {
  position: sticky !important;
  right: 0 !important;
  z-index: 6;
  min-width: 40px;
  max-width: none !important;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  background: #fff;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}
.data-table th.col-ops,
.data-table th[data-col="操作"] {
  top: 0; /* 表头同时贴顶 + 贴右 */
  z-index: 8;
  background: #0d9488;
  color: #fff;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.12);
  overflow: visible;
}
/* 右侧固定列：拖宽手柄放左侧，避免贴边点不到 */
.data-table th.col-ops .col-resizer,
.data-table th[data-col="操作"] .col-resizer {
  left: 0;
  right: auto;
  width: 12px;
  z-index: 6;
}
.data-table th.col-ops .col-resizer::after,
.data-table th[data-col="操作"] .col-resizer::after {
  left: 3px;
  right: auto;
}
.data-table tbody tr:nth-child(even) td.col-ops,
.data-table tbody tr:nth-child(even) td[data-col="操作"] { background: #f8fffe; }
.data-table tbody tr:hover td.col-ops,
.data-table tbody tr:hover td[data-col="操作"] { background: #e6f4f2; }
.data-table tbody tr.selected td.col-ops,
.data-table tbody tr.selected td[data-col="操作"] { background: #99f6e4; }
.data-table td.col-ops .tb-btn,
.data-table td[data-col="操作"] .tb-btn {
  padding: 2px 6px;
  font-size: 12px;
}
/* 操作列自动收起：表头 ›；收起后右侧热区悬停展开（对齐迈方） */
.table-wrap > .ops-hover-rail {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 100%;
  z-index: 15;
  cursor: pointer;
  background: transparent;
}
.table-wrap.ops-rail-on > .ops-hover-rail {
  display: block;
}
.data-table th.col-ops,
.data-table th[data-col="操作"] {
  padding-left: 36px;
  padding-right: 28px;
}
.data-table th.col-ops .ops-fold-btn,
.data-table th[data-col="操作"] .ops-fold-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  min-width: 22px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  z-index: 13;
}
.data-table th.col-ops .ops-fold-btn:hover,
.data-table th[data-col="操作"] .ops-fold-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}
/* 操作列锁定：表头右侧 [系统功能]；锁定后禁止自动收起（对齐迈方） */
.data-table th.col-ops .ops-lock-btn,
.data-table th[data-col="操作"] .ops-lock-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  min-width: 22px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: #fde68a;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  z-index: 13;
  opacity: 0.85;
}
.data-table th.col-ops .ops-lock-btn:hover,
.data-table th[data-col="操作"] .ops-lock-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
}
.data-table th.col-ops .ops-lock-btn.is-locked,
.data-table th[data-col="操作"] .ops-lock-btn.is-locked,
.data-table.ops-fold-locked th.col-ops .ops-lock-btn,
.data-table.ops-fold-locked th[data-col="操作"] .ops-lock-btn {
  background: rgba(253, 230, 138, 0.35);
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(253, 230, 138, 0.55);
}
.data-table.ops-collapsed th.col-ops .ops-lock-btn,
.data-table.ops-collapsed th[data-col="操作"] .ops-lock-btn {
  display: none;
}
.data-table.ops-collapsed th.col-ops,
.data-table.ops-collapsed td.col-ops,
.data-table.ops-collapsed th[data-col="操作"],
.data-table.ops-collapsed td[data-col="操作"] {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  padding: 0 !important;
  overflow: hidden;
  cursor: pointer;
}
.data-table.ops-collapsed th.col-ops,
.data-table.ops-collapsed th[data-col="操作"] {
  font-size: 0;
  letter-spacing: 0;
  padding-left: 0 !important;
}
.data-table.ops-collapsed th.col-ops .ops-fold-btn,
.data-table.ops-collapsed th[data-col="操作"] .ops-fold-btn {
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 100%;
  min-height: 28px;
  border-radius: 0;
  font-size: 18px;
}
.data-table.ops-collapsed td.col-ops .tb-btn,
.data-table.ops-collapsed td.col-ops .btn,
.data-table.ops-collapsed td[data-col="操作"] .tb-btn,
.data-table.ops-collapsed td[data-col="操作"] .btn {
  display: none !important;
}
/* sticky 操作列前的占位列：只吃空白，不参与列宽持久化 */
.data-table col.col-ops-fill,
.data-table th.col-ops-fill,
.data-table td.col-ops-fill,
.data-table th[data-col="_ops_fill"],
.data-table td[data-col="_ops_fill"] {
  padding: 0 !important;
  border-left: none !important;
  border-right: none !important;
  max-width: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
  box-shadow: none !important;
}
.data-table th.col-ops-fill,
.data-table th[data-col="_ops_fill"] {
  background: #0d9488 !important;
  color: transparent !important;
}
.data-table td.col-ops-fill,
.data-table td[data-col="_ops_fill"] {
  background: #fff !important;
}
.data-table tbody tr:nth-child(even) td.col-ops-fill,
.data-table tbody tr:nth-child(even) td[data-col="_ops_fill"] {
  background: #f8fffe !important;
}
.data-table tbody tr:hover td.col-ops-fill,
.data-table tbody tr:hover td[data-col="_ops_fill"] {
  background: #e6f4f2 !important;
}
.data-table tbody tr.selected td.col-ops-fill,
.data-table tbody tr.selected td[data-col="_ops_fill"] {
  background: #99f6e4 !important;
}
.page-footer {
  display: none; /* 统计文案改到底栏 shell-foot，与迈方一致 */
}
.list-body .empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.data-table col.col-hidden {
  visibility: collapse;
  width: 0 !important;
}
.data-table .col-hidden { display: none; }
.data-table th.hf-th {
  cursor: grab;
  user-select: none;
}
.data-table th.hf-th:hover { filter: brightness(1.06); }
.data-table th.col-dragging {
  opacity: 0.45;
}
.data-table th.col-drop-before {
  box-shadow: inset 3px 0 0 #fbbf24;
}
.data-table th.col-drop-after {
  box-shadow: inset -3px 0 0 #fbbf24;
}
body.col-reordering,
body.col-reordering * {
  cursor: grabbing !important;
  user-select: none !important;
}
.data-table th.hf-active {
  background: #0f766e;
  box-shadow: inset 0 -3px 0 #fbbf24;
}
.data-table td.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
  white-space: normal;
  max-width: none;
}
.col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
  user-select: none;
  touch-action: none;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 3px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}
.col-resizer:hover::after,
body.col-resizing .col-resizer:hover::after {
  background: rgba(255, 255, 255, 0.85);
}
body.col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
body.col-resizing * {
  cursor: col-resize !important;
}

/* 表头筛选 */
.hf-dropdown {
  position: fixed; z-index: 1200; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  display: flex; flex-direction: column;
  max-height: min(420px, calc(100vh - 24px)); overflow: hidden;
}
.hf-accent { height: 2px; background: var(--primary); flex-shrink: 0; }
.hf-head { padding: 10px 14px 6px; }
.hf-title { font-size: 12px; font-weight: 500; color: #1a1a2e; }
.hf-search-wrap { padding: 0 14px 8px; }
.hf-search {
  width: 100%; border: 1px solid #ddd; border-radius: 6px;
  padding: 6px 10px; font-size: 12px;
}
.hf-list {
  flex: 1; overflow: auto; padding: 4px 8px 8px;
  border-top: 1px solid #f0f0f0; min-height: 80px;
}
.hf-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--text);
}
.hf-item:hover { background: #f0fdfa; }
.hf-item.hf-all {
  font-weight: 500; border-bottom: 1px solid #f0f0f0;
  margin-bottom: 4px; border-radius: 0;
}
.hf-item input { flex-shrink: 0; }
.hf-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hf-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 14px 10px; border-top: 1px solid #f0f0f0; background: #fafafa;
}
.hf-btn {
  border: none; background: transparent; color: #666;
  border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px;
}
.hf-btn:hover { background: #f0f0f0; }
.hf-btn.danger { color: var(--danger); }
.hf-btn.danger:hover { background: #fef2f2; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15, 23, 42, 0.35);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
/* 待审列表上再开审核/编辑：订单弹窗须压在待审之上 */
#modal-mat-pending,
#modal-so-pending { z-index: 55; }
#modal-wo-insight { z-index: 58; }
#modal-order,
#modal-module-edit,
#modal-material-type-edit { z-index: 60; }

/* 待审采购订单：独立菜单页（复用弹窗 DOM，铺满模块内容区） */
#modal-purchase-pending.is-page-mode {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-purchase-pending.is-page-mode .modal-card-desk-so-pending {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
}
/* 页模式：顶栏已有「待审采购订单」，隐藏弹窗内重复标题与底栏 */
#modal-purchase-pending.is-page-mode .modal-head,
#modal-purchase-pending.is-page-mode .modal-foot {
  display: none !important;
}
/* 待审采购页：仅「同意」放大；导出合同保持普通工具栏尺寸 */
#module-toolbar #btn-purchase-pending-export,
#module-toolbar #btn-purchase-pending-approve {
  display: inline-flex !important;
  align-items: center;
}
#module-toolbar #btn-purchase-pending-export[hidden],
#module-toolbar #btn-purchase-pending-approve[hidden] {
  display: none !important;
}
#module-toolbar #btn-purchase-pending-approve {
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  min-width: 108px;
  padding: 8px 18px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  border-radius: 8px;
  border: 1px solid #047857;
  line-height: 1.2;
  margin-right: 6px;
  color: #fff !important;
  background: #059669 !important;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}
#module-toolbar #btn-purchase-pending-approve:hover {
  background: #047857 !important;
  color: #fff !important;
}
#module-toolbar #btn-purchase-pending-approve:disabled,
#module-toolbar #btn-purchase-pending-approve[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
#module-list.is-purchase-pending-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}

/* 待审报价单：独立菜单页（复用弹窗 DOM，铺满模块内容区） */
#modal-quotation-pending.is-page-mode {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-quotation-pending.is-page-mode .modal-card-desk-so-pending {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
}
/* 页模式：顶栏已有「待审报价单」，隐藏弹窗内重复标题与底栏 */
#modal-quotation-pending.is-page-mode .modal-head,
#modal-quotation-pending.is-page-mode .modal-foot {
  display: none !important;
}
/* 待审报价页：仅「同意」放大；保持普通工具栏尺寸 */
#module-toolbar #btn-quotation-pending-approve {
  display: inline-flex !important;
  align-items: center;
}
#module-toolbar #btn-quotation-pending-approve[hidden] {
  display: none !important;
}
#module-toolbar #btn-quotation-pending-approve {
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  min-width: 108px;
  padding: 8px 18px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  border-radius: 8px;
  border: 1px solid #047857;
  line-height: 1.2;
  margin-right: 6px;
  color: #fff !important;
  background: #059669 !important;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.25);
}
#module-toolbar #btn-quotation-pending-approve:hover {
  background: #047857 !important;
  color: #fff !important;
}
#module-toolbar #btn-quotation-pending-approve:disabled,
#module-toolbar #btn-quotation-pending-approve[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
#module-list.is-quotation-pending-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}

/* 待审销售订单：独立菜单页（复用弹窗 DOM，铺满订单列表内容区） */
#modal-so-pending.is-page-mode {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-so-pending.is-page-mode .modal-card-desk-so-pending {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
}
/* 页模式：顶栏已有「待审销售订单」，隐藏弹窗内重复标题与底栏
   （用直达子选择器限定为待审页自身壳，避免误伤内嵌其右侧预览区的新增订单表单） */
#modal-so-pending.is-page-mode > .modal-card > .modal-head,
#modal-so-pending.is-page-mode > .modal-card > .modal-foot {
  display: none !important;
}
/* 分栏页动作按钮：与刷新/重置同级普通工具栏尺寸，不放大 */
#orders-toolbar #btn-so-pending-approve[hidden],
#orders-toolbar #btn-so-split-edit[hidden],
#orders-toolbar #btn-so-split-mid[hidden],
#orders-toolbar #btn-so-split-del[hidden] {
  display: none !important;
}
#orders-toolbar #btn-so-pending-approve:disabled,
#orders-toolbar #btn-so-pending-approve[aria-disabled="true"],
#orders-toolbar #btn-so-split-edit:disabled,
#orders-toolbar #btn-so-split-mid:disabled,
#orders-toolbar #btn-so-split-del:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#orders-list.is-so-pending-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}

/* 「订单列表」标签（表格列表）：搜索框 + 表格纵向排布，
   否则 .list-body .table-wrap 的 height:100% 按整高计算，
   底部 36px（含横向滚动条）被 overflow:hidden 裁掉。
   仅作用于纯列表态（orders_all），待审/新增分屏页有自己的布局 */
#orders-list.list-body:not(.is-so-pending-page):not(.is-so-create-page) {
  display: flex;
  flex-direction: column;
}
#orders-list.list-body:not(.is-so-pending-page):not(.is-so-create-page) .table-wrap {
  height: auto;
  flex: 1;
  min-height: 0;
}

/* 「订单列表」标签（表格列表）：顶部搜索框 */
.orders-all-search {
  padding: 0 10px 8px;
  flex-shrink: 0;
}
.orders-all-search-input {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  color: #334155;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}
.orders-all-search-input::placeholder { color: #b6c2ce; }
.orders-all-search-input:focus { border-color: var(--primary, #0f766e); }

/* 新增销售订单：左待审列表 + 右表单（对标新增样品订单） */
#orders-list.is-so-create-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  background: #e8eaed;
}
#so-create-split.so-create-split-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-items: stretch;
  gap: 0;
  padding: 10px;
  box-sizing: border-box;
}
#so-create-split .so-create-list-pane {
  flex: 0 0 320px;
  width: 320px;
  min-width: 220px;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 2px;
  padding: 10px 10px 8px;
  box-sizing: border-box;
}
#so-create-split .so-create-list-pane.has-saved-split {
  max-width: none;
}
#so-create-split .so-create-split-resizer {
  flex: 0 0 6px;
  width: 6px;
  cursor: col-resize;
  position: relative;
  z-index: 2;
  background: transparent;
}
#so-create-split .so-create-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: #dadce0;
}
#so-create-split .so-create-split-resizer:hover::before,
#so-create-split .so-create-split-resizer:focus-visible::before,
body.sa-create-split-dragging #so-create-split .so-create-split-resizer::before {
  background: #4f6ef7;
}
#so-create-split .so-create-form-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 6px;
}
#so-create-split #so-create-pending-table.mat-pending-table {
  width: max-content !important;
  min-width: 100%;
  table-layout: fixed !important;
}
#so-create-split #so-create-pending-table th,
#so-create-split #so-create-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#so-create-split #so-create-pending-table tr.so-pending-row {
  cursor: pointer;
}
#so-create-split #so-create-pending-table tr.so-pending-row:hover {
  background: #ecfdf5;
}
#so-create-split #so-create-pending-table tr.so-pending-row.is-selected {
  background: #e8f0fe;
}
#modal-order.is-so-create-page {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  box-sizing: border-box;
  justify-content: stretch;
  align-items: stretch;
  pointer-events: auto;
}
#modal-order.is-so-create-page .modal-card-desk-so-edit {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12) !important;
  border-radius: 4px !important;
  border: 1px solid #dadce0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
#modal-order.is-so-create-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
}
@media (max-width: 900px) {
  #so-create-split.so-create-split-body {
    flex-direction: column;
  }
  #so-create-split .so-create-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  #so-create-split .so-create-split-resizer {
    display: none;
  }
}

/* 待审样品订单：独立菜单页（复用弹窗 DOM，铺满模块列表内容区） */
#module-list.is-sample-pending-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
#modal-sa-pending.is-page-mode {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-sa-pending.is-page-mode .modal-card-desk-so-pending {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
}
/* 页模式：隐藏弹窗内重复标题与底栏，操作按钮在顶部 head 条 */
#modal-sa-pending.is-page-mode .modal-head,
#modal-sa-pending.is-page-mode .modal-foot {
  display: none !important;
}
/* 待审样品：modal-body 纵向排列（左列表 + 右预览） */
#modal-sa-pending .sa-pending-body-col {
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
  min-height: 0;
}
/* 待审样品订单页：右侧预览区头部（基本信息上方，标题左 + 同意/关闭右） */
#modal-sa-pending .sa-pending-preview-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f7fffe 0%, #eef9f7 100%);
  border-bottom: 1px solid #e2e8f0;
}
#modal-sa-pending .sa-pending-preview-head:empty {
  display: none;
}
#modal-sa-pending .sa-pending-preview-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f766e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
#modal-sa-pending .sa-pending-preview-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
#modal-sa-pending .sa-pending-preview-btns .btn-text {
  margin-left: 0;
}
#modal-sa-pending .sa-pending-preview-btns #btn-sa-pending-approve {
  min-height: 32px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
}
#modal-sa-pending .sa-pending-preview-btns #btn-sa-pending-approve:hover {
  background: #e6f4f2 !important;
  color: #0d9488 !important;
}
#modal-sa-pending .sa-pending-preview-btns #btn-sa-pending-head-close {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 6px;
  color: #475569;
}
#modal-sa-pending .sa-pending-preview-btns #btn-sa-pending-head-close:hover {
  background: #e2e8f0;
}
/* 待审样品：左右分栏可拖拽（对标待审采购） */
#modal-sa-pending .sa-pending-split-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  align-items: stretch;
}
#modal-sa-pending .so-pending-list-pane {
  flex: 0 0 360px;
  width: 360px;
  min-width: 220px;
  max-width: 70%;
}
#modal-sa-pending .so-pending-list-pane.has-saved-split {
  max-width: none;
}
#modal-sa-pending .sa-pending-split-resizer {
  flex: 0 0 12px;
  width: 12px;
  margin: 0 -3px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  background: transparent;
  align-self: stretch;
}
#modal-sa-pending .sa-pending-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
#modal-sa-pending .sa-pending-split-resizer:hover::before,
#modal-sa-pending .sa-pending-split-resizer:focus-visible::before,
body.sa-pending-split-dragging #modal-sa-pending .sa-pending-split-resizer::before {
  background: #0d9488;
}
body.sa-pending-split-dragging {
  cursor: col-resize !important;
  user-select: none !important;
}
body.sa-pending-split-dragging * {
  cursor: col-resize !important;
  user-select: none !important;
}
#modal-sa-pending .so-pending-preview-pane {
  flex: 1 1 auto;
  min-width: 280px;
}
@media (max-width: 900px) {
  #modal-sa-pending .sa-pending-split-body {
    flex-direction: column !important;
  }
  #modal-sa-pending .so-pending-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  #modal-sa-pending .sa-pending-split-resizer {
    display: none;
  }
}

/* 新增样品订单：左待审列表 + 右表单 */
#module-list.is-sample-create-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  background: #e8eaed;
}
#sa-create-split.sa-create-split-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-items: stretch;
  gap: 0;
  padding: 0;
  box-sizing: border-box;
}
#sa-create-split .sa-create-list-pane {
  flex: 0 0 360px;
  width: 360px;
  min-width: 220px;
  max-width: 70%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
#sa-create-split .sa-create-list-pane.has-saved-split {
  max-width: none;
}
#sa-create-split .sa-create-split-resizer {
  flex: 0 0 12px;
  width: 12px;
  align-self: stretch;
  cursor: col-resize;
  position: relative;
  z-index: 3;
  background: transparent;
  touch-action: none;
}
#sa-create-split .sa-create-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
#sa-create-split .sa-create-split-resizer:hover::before,
#sa-create-split .sa-create-split-resizer:focus-visible::before,
body.sa-create-split-dragging #sa-create-split .sa-create-split-resizer::before {
  width: 2px;
  margin-left: -1px;
  background: #0d9488;
}
body.sa-create-split-dragging {
  cursor: col-resize !important;
  user-select: none !important;
}
body.sa-create-split-dragging * {
  cursor: col-resize !important;
}
#sa-create-split .sa-create-form-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 0;
}
#sa-create-split #sa-create-pending-table.mat-pending-table {
  width: 100% !important;
  table-layout: fixed !important;
}
#sa-create-split #sa-create-pending-table th,
#sa-create-split #sa-create-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#sa-create-split #sa-create-pending-table td:nth-child(3) {
  text-align: left;
}
#sa-create-split #sa-create-pending-table tr.so-pending-row {
  cursor: pointer;
}
#sa-create-split #sa-create-pending-table tr.so-pending-row:hover {
  background: #ecfdf5;
}
#sa-create-split #sa-create-pending-table tr.so-pending-row.is-selected {
  background: #e8f0fe;
}
/* 样品新增页：复用待审页同一套版面（共享 .sa-split-page 作用域）
   左列表白卡片 / 分隔条 / 右预览灰卡片 均与 #modal-sa-pending 一致 */
.sa-split-page .sa-pending-split-body {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-items: stretch;
  gap: 0 !important;
}
.sa-split-page .so-pending-list-pane {
  flex: 0 0 360px;
  width: 360px;
  min-width: 220px;
  max-width: 70%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #DADCE0;
  border-radius: 2px;
  padding: 10px 10px 8px;
  box-sizing: border-box;
}
.sa-split-page .so-pending-list-pane.has-saved-split {
  max-width: none;
}
.sa-split-page .sa-pending-split-resizer {
  flex: 0 0 12px;
  width: 12px;
  margin: 0 -3px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  background: transparent;
  align-self: stretch;
}
.sa-split-page .sa-pending-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
.sa-split-page .sa-pending-split-resizer:hover::before,
.sa-split-page .sa-pending-split-resizer:focus-visible::before,
body.sa-pending-split-dragging .sa-split-page .sa-pending-split-resizer::before {
  background: #0d9488;
}
/* 右预览区：与待审页同一套 .so-pending-preview-pane / .so-pending-preview-main，灰底白卡 */
.sa-split-page .so-pending-preview-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F0F2F5;
  border: 1px solid #DADCE0;
  border-radius: 2px;
  box-sizing: border-box;
}
.sa-split-page .so-pending-preview-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 10px 10px;
  box-sizing: border-box;
}
.sa-split-page .sa-pending-form-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
@media (max-width: 900px) {
  .sa-split-page .sa-pending-split-body {
    flex-direction: column !important;
  }
  .sa-split-page .so-pending-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  .sa-split-page .sa-pending-split-resizer {
    display: none;
  }
}

#modal-module-edit.is-sample-create-page {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  box-sizing: border-box;
  justify-content: stretch;
  align-items: stretch;
  pointer-events: auto;
}
#modal-module-edit.is-sample-create-page .modal-card {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}
#modal-module-edit.is-sample-create-page .modal-head {
  display: none !important;
}
#modal-module-edit.is-sample-create-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  background: transparent;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f7fffe 0%, #eef9f7 100%);
  border-bottom: 1px solid #e2e8f0;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-actions:empty {
  display: none;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f766e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
#modal-module-edit.is-sample-create-page .sa-create-head-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1px solid #d7e5e3;
  flex: 0 0 auto;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns .btn-text {
  margin-left: 0;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns #btn-module-edit-save {
  min-height: 32px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns #btn-module-edit-save:hover {
  background: #e6f4f2 !important;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns .sa-create-head-cancel {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 6px;
  color: #475569;
}
#modal-module-edit.is-sample-create-page .sa-create-form-head-btns .sa-create-head-cancel:hover {
  background: #e2e8f0;
}
#modal-module-edit.is-sample-create-page .modal-foot {
  display: none !important;
}
#modal-module-edit.is-sample-create-page .modal-body-desk > .desk-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
#modal-module-edit.is-sample-create-page .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
#modal-module-edit.is-sample-create-page #module-edit-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
}
#modal-module-edit.is-sample-create-page #module-edit-form .sa-sample-host {
  max-width: none;
}
#modal-module-edit.is-sample-create-page .modal-foot {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}
/* 出货计划弹窗：底栏取消/保存提到顶部操作栏（无审核流，只保留取消/保存） */
#modal-module-edit.is-ship-plan-edit .sa-create-form-head-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
#modal-module-edit.is-ship-plan-edit .sa-create-form-head-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f766e;
  white-space: nowrap;
}
#modal-module-edit.is-ship-plan-edit .sa-create-form-head-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
#modal-module-edit.is-ship-plan-edit .sa-create-form-head-btns #btn-module-edit-save {
  min-height: 32px;
  padding: 6px 18px;
}
#modal-module-edit.is-ship-plan-edit .sa-create-form-head-btns .sa-create-head-cancel {
  min-height: 32px;
  padding: 6px 14px;
}
#modal-module-edit.is-ship-plan-edit .modal-foot {
  display: none;
}
@media (max-width: 900px) {
  #sa-create-split.sa-create-split-body {
    flex-direction: column;
  }
  #sa-create-split .sa-create-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  #sa-create-split .sa-create-split-resizer {
    display: none;
  }
  #sa-create-split .sa-create-form-pane {
    margin-left: 0;
    margin-top: 8px;
  }
}

/* ── 物料管理：左右分栏（左侧列表 + 右侧编辑表单，可拖拽分隔条）── */
/* grid 保证第 2 行吃满剩余高度，左侧 table-wrap 才能滚轮滚动 */
#page-module.is-mat-split-page {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 6px minmax(420px, 1.2fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  align-items: stretch;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
}
#page-module.is-mat-split-page > .page-header {
  grid-column: 1 / -1;
  grid-row: 1;
  border-bottom: 1px solid var(--border);
}
#page-module.is-mat-split-page .mat-split-left {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
#page-module.is-mat-split-page .mat-split-left #module-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
#page-module.is-mat-split-page .mat-split-left #module-list .table-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#page-module.is-mat-split-page .mat-split-left .page-footer {
  /* 覆盖全局 .page-footer { display: none }，分栏模式下列表底部状态栏需要可见 */
  display: flex !important;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}
#page-module.is-mat-split-page .mat-split-resizer {
  grid-column: 2;
  grid-row: 2;
  width: 4px;
  min-height: 0;
  cursor: col-resize;
  background: #e2e8f0;
  border: none;
  touch-action: none;
}
#page-module.is-mat-split-page .mat-split-resizer:hover,
body.mat-split-dragging .mat-split-resizer {
  background: #7dd3fc;
}
#page-module.is-mat-split-page .mat-split-right {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #eef1f4;
  border: none;
  display: flex;
  flex-direction: column;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f7fffe 0%, #eef9f7 100%);
  border-bottom: 1px solid #e2e8f0;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f766e;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-actions .btn-text {
  margin-left: 0;
}
/* 按钮与「取消」同行：禁止按钮文本逐字换行撑高；空间不足时整行按钮换行（完整显示） */
#page-module.is-mat-split-page .mat-split-right .mat-split-right-actions .btn-text,
#page-module.is-mat-split-page .mat-split-right .mat-split-right-actions .tb-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
/* 物料管理 / 盘点计划 / 盘点执行 / 盘点差异：隐藏表单卡片标题栏（物料信息 / 基本信息），保留顶部按钮条 */
#page-module.is-mat-split-page[data-split-mode="materials"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="materials"] #modal-module-view .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_plans"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_plans"] #modal-module-view .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_execute"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_execute"] #modal-module-view .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_diff"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="stocktake_diff"] #modal-module-view .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
/* 物料分栏窄面板：顶栏按钮区不换行、标题单行省略，避免挤压 */
#page-module.is-mat-split-page[data-split-mode="materials"] .mat-split-right-head {
  flex-wrap: nowrap;
  gap: 8px;
}
#page-module.is-mat-split-page[data-split-mode="materials"] .mat-split-right-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
#page-module.is-mat-split-page[data-split-mode="materials"] .mat-split-right-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
/* BOM / 产品：底栏按钮已挪到右侧顶栏，隐藏空底栏；去掉外壳「BOM信息」分区头 */
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit.is-bom-split-edit .modal-foot,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit.is-bom-split-edit .modal-foot,
#page-module.is-mat-split-page[data-split-mode="products"] #modal-module-edit.is-bom-split-edit .modal-foot,
#page-module.is-mat-split-page[data-split-mode="products_list"] #modal-module-edit.is-bom-split-edit .modal-foot,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-top-actions .modal-foot {
  display: none !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
/* BOM 右侧：整链禁横向撑破，仅明细 wrap 内横滚 */
#page-module.is-mat-split-page[data-split-mode="bom"] .mat-split-right,
#page-module.is-mat-split-page[data-split-mode="bom"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .mat-split-right,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .mat-split-right-body {
  overflow-x: hidden !important;
  min-width: 0 !important;
  max-width: 100%;
}
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit,
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit.is-mat-split-page,
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit .modal-card,
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit .modal-body-desk > .desk-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit.is-mat-split-page,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit .modal-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit .modal-body-desk > .desk-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] #modal-module-edit #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom"] #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #modal-module-edit #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #module-edit-form.bom-edit-host {
  background: #eef1f4 !important;
  padding: 8px 8px 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  /* 分栏：表单壳不自滚，避免与右侧 body 双滚动条导致切行跳动 */
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
/* BOM 分栏：表头+附件高度锁定（--bom-head-h），明细区独立滚动 */
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root {
  --bom-head-h: var(--gak-bom-head-h, auto);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout {
  flex: 0 0 auto;
  min-height: 0;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 10px 12px;
  align-items: stretch;
  align-content: start;
  /* 未量高前勿用全局默认 300px，否则附件虚高撑破底边 */
  --product-head-h: auto;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-main,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-main {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  align-self: stretch !important;
  display: block !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-main > .bom-header-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-main > .bom-header-card {
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
  flex: 0 0 auto !important;
  height: auto !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-main .desk-form-2,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-main .desk-form-2 {
  height: auto !important;
  grid-auto-rows: auto !important;
  align-content: start !important;
}
/* 附件高度严格对齐左侧表头（由 syncBomHeadHeightLock 写入 --product-head-h） */
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach {
  align-self: stretch !important;
  height: var(--product-head-h) !important;
  min-height: var(--product-head-h) !important;
  max-height: var(--product-head-h) !important;
  overflow: hidden !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach .attach-list,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach .empty.small,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach .empty.small {
  padding: 6px 4px !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach .attach-drop-hint,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach .attach-drop-hint {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .bom-header-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .bom-header-card {
  flex: 0 0 auto;
  min-height: var(--bom-head-h, auto);
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .bom-detail-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .bom-detail-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-detail-body,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-detail-wrap,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-detail-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto !important;
  scrollbar-gutter: stable;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .mat-split-right-body {
  /* 始终预留纵滚条槽；内容在明细 wrap 内滚，body 不再二次滚动造成左右跳 */
  overflow-y: hidden !important;
  scrollbar-gutter: stable;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-body {
  flex: 1 1 auto;
  min-height: 0;
  /* 始终预留纵滚条槽，避免 BOM/内容变高时输入框左右跳动 */
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 12px;
  display: flex;
  flex-direction: column;
}
#page-module.is-mat-split-page .mat-split-right .mat-split-right-empty {
  color: #94a3b8;
  text-align: center;
  padding: 60px 20px;
  font-size: 13px;
}
/* 右侧编辑表单（复用 modal-module-edit DOM，非浮层铺满） */
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-card,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-card-desk,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-card-desk-mod-edit,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-card-split-fill,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-card-desk-ib-edit {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
}
/* 材料入库←采购 / 出入库←工单：右侧单据灰底画布 */
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk {
  background: #eef1f4 !important;
  padding: 10px 12px 8px !important;
  overflow: auto;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card > .desk-card-head,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] #module-edit-form.ib-inbound-form-host,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] #module-edit-form.ib-inbound-form-host,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] #module-edit-form.ib-inbound-form-host {
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
  display: block !important;
  min-height: 0;
  height: auto;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] .ib-voucher,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] .ib-voucher,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] .ib-voucher {
  min-height: 0;
}
/* 单据自带大标题，右侧栏标题收为细条提示 */
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] .mat-split-right-head,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] .mat-split-right-head,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] .mat-split-right-head {
  background: #fff;
  border-bottom: 1px solid #d8e0ea;
  min-height: 36px;
  padding: 6px 12px;
}
#page-module.is-mat-split-page[data-split-mode="inbound_from_po"] .mat-split-right-title,
#page-module.is-mat-split-page[data-split-mode="outbound_from_wo"] .mat-split-right-title,
#page-module.is-mat-split-page[data-split-mode="inbound_from_wo"] .mat-split-right-title {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
}
/* 库存调整：左调整单列表 + 右操作区（对齐盘点执行右侧式样：浅灰底 + 圆角明细容器） */
#page-module.is-mat-split-page[data-split-mode="adjust"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] #modal-module-edit.is-mat-split-page .modal-body-desk {
  background: #eef1f4 !important;
  padding: 0 !important;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] #module-edit-form.ib-inbound-form-host {
  background: transparent !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0;
  height: 100%;
}
/* 调整单整体：浅灰画布上下留白 + 明细区向下拉满 */
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 8px;
  overflow: hidden;
  box-sizing: border-box;
}
/* 明细卡片：仅作 flex 容器，边框交给内层 table-wrap（避免「框中框」） */
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-host > .aj-adjust-detail {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
/* 明细工具条：标题 + 按钮（对齐 stocktake-edit-tools） */
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-detail .aj-detail-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
  padding: 0;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-detail .aj-detail-tools-title {
  margin-right: auto;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-detail .aj-detail-actions {
  display: flex;
  gap: 8px;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-detail .aj-detail-actions .btn-text {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
/* 明细表容器：圆角边框滚动区（对齐 stocktake-edit-list-wrap） */
#page-module.is-mat-split-page[data-split-mode="adjust"] .aj-adjust-detail .aj-detail-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
/* 明细中「调整类型」不显示选择框式样：无边框融入单元格，悬停/聚焦才显边框 */
.aj-detail-table select[data-aj-detail="调整类型"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #002FA7;
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
  box-sizing: border-box;
  height: 26px;
  text-align: center;
  cursor: pointer;
}
.aj-detail-table select[data-aj-detail="调整类型"]:hover,
.aj-detail-table select[data-aj-detail="调整类型"]:focus {
  border-color: #0d9488;
  background: #fff;
  outline: none;
}
/* 明细表格：单元格/输入框无边框融入（对齐 .ib-detail-table） */
.aj-detail-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.aj-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d9488;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}
.aj-detail-table tbody td {
  background: #fff;
  text-align: center;
}
.aj-detail-table tbody tr:hover td {
  background: #f8fafc;
}
.aj-detail-table input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #002FA7;
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
  box-sizing: border-box;
  height: 26px;
  text-align: center;
}
.aj-detail-table input:focus {
  border-color: #0d9488;
  background: #fff;
  outline: none;
}
.aj-detail-table input[type="number"] {
  min-width: 64px;
}
.aj-detail-table tbody td.col-idx,
.aj-detail-table thead th.col-idx {
  color: #64748b;
  font-size: 12px;
}
.aj-detail-table tbody td.empty-row {
  padding: 24px 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
/* 库存调整：右侧栏头部细条提示 */
#page-module.is-mat-split-page[data-split-mode="adjust"] .mat-split-right-head {
  background: #fff;
  border-bottom: 1px solid #d8e0ea;
  min-height: 36px;
  padding: 6px 12px;
}
#page-module.is-mat-split-page[data-split-mode="adjust"] .mat-split-right-title {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
}
/* QMS 品质分栏：左列表 + 右表单（完全替代弹窗；对齐 adjust 浅灰画布 + 白卡片） */
#page-module.is-mat-split-page[data-split-mode="qms"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
  /* 外层启用滚动，避免表单内容超出时被裁掉（修复"列表/预览区固定不动"问题） */
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
/* 来料检验-新增（iqc_po_new）：标题栏/底色对齐列表页 qms 分栏 */
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] .mat-split-right-head {
  background: #fff;
  border-bottom: 1px solid #d8e0ea;
  min-height: 36px;
  padding: 6px 12px;
}
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] .mat-split-right-title {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
}
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] .mat-split-right-body {
  background: #eef1f4;
  /* 保留 flex 布局以填充剩余空间（flex:1 由通用样式提供），同时强制启用滚动 */
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] #iqc-po-form {
  /* 关键：表单不参与 flex 压缩，按原始内容高度展开，超出时父容器滚动 */
  flex: 0 0 auto !important;
  min-height: auto !important;
  max-height: none !important;
  height: auto !important;
  width: 100%;
  box-sizing: border-box;
}
/* 确保 iqc-edit 内部卡片不限制高度 */
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] .iqc-edit,
#page-module.is-mat-split-page[data-split-mode="iqc_po_new"] .iqc-card {
  height: auto !important;
  max-height: none !important;
}
/* 标题栏对齐新增视图：渐变绿 + 深绿标题（FAI 列表/待审走 fai_new 分栏，直接用默认渐变绿标题栏） */
#page-module.is-mat-split-page[data-split-mode="qms"] .mat-split-right-head {
  background: #fff;
  border-bottom: 1px solid #d8e0ea;
  min-height: 36px;
  padding: 6px 12px;
}
#page-module.is-mat-split-page[data-split-mode="qms"] .mat-split-right-title {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  letter-spacing: 0;
}
/* 表单卡片白底圆角；去掉「[列表] 基本信息」分区头（右侧标题已示模块名） */
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
/* 校验提示紧贴表单底部，避免被 desk-card 透明区裁掉 */
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page #module-edit-error {
  margin: 6px 0 0;
}
/* 检验明细区（qms-insp-wrap）在右侧拉高按内容展开，减少纵向滚动跳跃 */
#page-module.is-mat-split-page[data-split-mode="qms"] .qms-insp-wrap {
  max-height: none;
}
/* 表单壳内滚、外层不二次滚动，避免双滚动条导致切行跳动。
   2026-08-13 修复：flex:0 0 auto 会把表单按内容撑高，超出处被外层 overflow:hidden 裁掉且不产生滚动，
   导致列表/待审预览区「判断结果/签核区」看不见 —— 改回参与 flex 布局，由 #module-edit-form 内滚 */
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: transparent;
}
/* 列表/待审页去掉白色 modal 垫底壳，露灰底画布 —— 卡片间缝隙与新增视图一致（灰底 + 白卡片，统一显示标准） */
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page .modal-card,
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page .modal-card-desk,
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page .modal-card-split-fill,
#page-module.is-mat-split-page[data-split-mode="qms"] #modal-module-edit.is-mat-split-page #module-edit-form {
  background: transparent !important;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-head {
  display: none !important;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: transparent;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page #module-edit-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  padding: 12px;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-foot {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
  padding: 8px 12px;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .modal-foot .btn-text {
  margin-left: 8px;
}
/* 物料分栏窄面板：表单+附件同列堆叠，标签左齐 */
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .mat-edit-layout {
  flex-direction: column;
  padding: 8px 10px 12px;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .desk-form-mat {
  --desk-label-w: 72px;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .mat-edit-attach {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
}
/* 物料管理：右侧编辑面板与盘点计划一致（左基本信息卡片 + 右图片附件卡片） */
#page-module.is-mat-split-page[data-split-mode="materials"] .mat-split-right-body {
  overflow: hidden;
}
/* 物料管理复用盘点计划分栏：字段网格适配（textarea 高度、代码 label 垂直居中） */
#modal-module-edit #module-edit-form.mat-edit-host.stocktake-edit-host .desk-form-stocktake > .desk-cell > .desk-field > textarea {
  min-height: 64px !important;
  height: auto !important;
  padding: 6px 8px !important;
  resize: vertical;
  box-sizing: border-box;
}
#modal-module-edit #module-edit-form.mat-edit-host.stocktake-edit-host .desk-form-stocktake > .desk-cell.desk-cell-code > label {
  padding-top: 0;
}

/* 待审销售订单：大于 1600×900，左列表 + 右预览审核 */
.modal.gak-desk .modal-card-desk-so-pending {
  width: min(1760px, 98vw);
  min-width: min(1600px, 98vw);
  height: min(960px, 96vh);
  max-height: min(96vh, 960px);
  min-height: min(920px, 96vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-so-pending .so-pending-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  box-sizing: border-box;
}
/* 销售订单 / 待审销售订单：左右分栏可拖拽（对标待审采购） */
#modal-so-pending .so-pending-split-body {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  align-items: stretch;
}
#modal-so-pending .so-pending-list-pane {
  flex: 0 0 360px;
  width: 360px;
  min-width: 220px;
  max-width: 70%;
}
#modal-so-pending .so-pending-list-pane.has-saved-split {
  max-width: none;
}
#modal-so-pending .so-pending-split-resizer {
  flex: 0 0 12px;
  width: 12px;
  margin: 0 -3px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  background: transparent;
  align-self: stretch;
}
#modal-so-pending .so-pending-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
#modal-so-pending .so-pending-split-resizer:hover::before,
#modal-so-pending .so-pending-split-resizer:focus-visible::before,
body.so-pending-split-dragging #modal-so-pending .so-pending-split-resizer::before {
  background: #0d9488;
}
body.so-pending-split-dragging {
  cursor: col-resize !important;
  user-select: none !important;
}
body.so-pending-split-dragging * {
  cursor: col-resize !important;
  user-select: none !important;
}
#modal-so-pending .so-pending-preview-pane {
  flex: 1 1 auto;
  min-width: 280px;
}
#modal-so-pending #so-pending-table thead th.hf-th,
#modal-sa-pending #sa-pending-table thead th.hf-th,
#sa-create-split #sa-create-pending-table thead th.hf-th,
#so-create-split #so-create-pending-table thead th.hf-th,
#modal-purchase-pending #purchase-pending-table thead th.hf-th,
#modal-quotation-pending #quotation-pending-table thead th.hf-th,
#modal-supplier-pending #supplier-pending-table thead th.hf-th {
  cursor: grab;
  user-select: none;
}
#modal-so-pending #so-pending-table thead th.hf-th:hover,
#modal-sa-pending #sa-pending-table thead th.hf-th:hover,
#sa-create-split #sa-create-pending-table thead th.hf-th:hover,
#so-create-split #so-create-pending-table thead th.hf-th:hover,
#modal-purchase-pending #purchase-pending-table thead th.hf-th:hover,
#modal-quotation-pending #quotation-pending-table thead th.hf-th:hover,
#modal-supplier-pending #supplier-pending-table thead th.hf-th:hover {
  background: #e8f0fe;
}
#modal-so-pending #so-pending-table thead th.hf-active,
#modal-sa-pending #sa-pending-table thead th.hf-active,
#sa-create-split #sa-create-pending-table thead th.hf-active,
#so-create-split #so-create-pending-table thead th.hf-active,
#modal-purchase-pending #purchase-pending-table thead th.hf-active,
#modal-quotation-pending #quotation-pending-table thead th.hf-active,
#modal-supplier-pending #supplier-pending-table thead th.hf-active {
  color: #1d4ed8;
  font-weight: 500;
}
#modal-so-pending #so-pending-table.resizable th,
#modal-sa-pending #sa-pending-table.resizable th,
#sa-create-split #sa-create-pending-table.resizable th,
#so-create-split #so-create-pending-table.resizable th,
#modal-purchase-pending #purchase-pending-table.resizable th,
#modal-quotation-pending #quotation-pending-table.resizable th,
#modal-supplier-pending #supplier-pending-table.resizable th {
  overflow: visible;
}
#modal-so-pending #so-pending-table,
#modal-sa-pending #sa-pending-table,
#sa-create-split #sa-create-pending-table,
#so-create-split #so-create-pending-table,
#modal-purchase-pending #purchase-pending-table,
#modal-quotation-pending #quotation-pending-table,
#modal-supplier-pending #supplier-pending-table {
  width: max-content !important;
  min-width: 100%;
  table-layout: fixed !important;
}

/* 弹窗待审左表旁：重置/显隐（仅无页顶栏的弹窗使用） */
.pending-side-list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 6px;
  flex-wrap: wrap;
}
.pending-side-list-tools .btn-text {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
/* 页模式统一走顶栏，禁止左表旁再出重置/显隐 */
#orders-list.is-so-pending-page .pending-side-list-tools,
#orders-list.is-so-create-page .pending-side-list-tools,
#so-create-split .pending-side-list-tools,
#module-list.is-sample-pending-page .pending-side-list-tools,
#module-list.is-sample-create-page .pending-side-list-tools,
#module-list.is-purchase-pending-page .pending-side-list-tools,
#sa-create-split .pending-side-list-tools,
#module-list.is-quotation-pending-page .pending-side-list-tools,
#modal-so-pending.is-page-mode .pending-side-list-tools,
#modal-sa-pending.is-page-mode .pending-side-list-tools,
#modal-purchase-pending.is-page-mode .pending-side-list-tools,
#modal-quotation-pending.is-page-mode .pending-side-list-tools {
  display: none !important;
}

/* 样品模块左表「图片」列缩略图（用户勾选列设置后渲染） */
.sa-side-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.sa-side-img-thumb {
  max-width: 72px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  background: #F8F9FA;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}
.sa-side-img-thumb:hover {
  border-color: var(--primary, #2563EB);
  box-shadow: 0 0 0 1px var(--primary, #2563EB);
}
.sa-side-img-empty {
  color: #9CA3AF;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  #modal-so-pending .so-pending-split-body {
    flex-direction: column !important;
  }
  #modal-so-pending .so-pending-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  #modal-so-pending .so-pending-split-resizer {
    display: none;
  }
}
.modal.gak-desk .so-pending-list-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #DADCE0;
  border-radius: 2px;
  padding: 10px 10px 8px;
  box-sizing: border-box;
}
.modal.gak-desk .so-pending-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.modal.gak-desk #so-pending-table.mat-pending-table,
.modal.gak-desk #sa-pending-table.mat-pending-table {
  width: 100% !important;
  table-layout: fixed !important;
}
.modal.gak-desk #so-pending-table th,
.modal.gak-desk #so-pending-table td,
.modal.gak-desk #sa-pending-table th,
.modal.gak-desk #sa-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.modal.gak-desk #so-pending-table td:nth-child(3),
.modal.gak-desk #sa-pending-table td:nth-child(3) {
  text-align: left;
}
.modal.gak-desk #so-pending-table tr.so-pending-row,
.modal.gak-desk #sa-pending-table tr.so-pending-row {
  cursor: pointer;
}
.modal.gak-desk #so-pending-table tr.so-pending-row:hover,
.modal.gak-desk #sa-pending-table tr.so-pending-row:hover {
  background: #ecfdf5;
}
.modal.gak-desk #so-pending-table tr.so-pending-row.is-selected,
.modal.gak-desk #sa-pending-table tr.so-pending-row.is-selected {
  background: #e8f0fe;
}
.modal.gak-desk .so-pending-preview-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F0F2F5;
  border: 1px solid #DADCE0;
  border-radius: 2px;
  box-sizing: border-box;
}
.modal.gak-desk .so-pending-preview-empty {
  margin: auto;
  padding: 24px;
  text-align: center;
  font-size: 14px;
}
.modal.gak-desk .so-pending-preview-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  box-sizing: border-box;
}
/* 预览区状态水印：浮动覆盖在「订单分类」下方，位置由 JS 计算 */
.so-pending-watermark {
  position: absolute;
  top: -9999px;
  left: 0;
  z-index: 20;
  display: block;
  padding: 8px 16px;
  border: 2px solid rgba(220, 38, 38, 0.55);
  border-radius: 50%;
  font-family: "Microsoft YaHei";
  color: rgba(220, 38, 38, 0.55);
  letter-spacing: 4px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
/* 全局 11px !important 特异性更高，需用更高特异性选择器放大字号 */
#app #so-pending-preview .so-pending-watermark {
  font-size: 20px !important;
  line-height: 1.4 !important;
}
.so-pending-watermark:empty {
  display: none;
}
/* 样品待审右侧：完整只读申请单 */
.modal.gak-desk .sa-pending-preview-main {
  gap: 0;
  padding: 0 10px 10px;
}
.modal.gak-desk .sa-pending-form-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.modal.gak-desk .sa-pending-form-host .sa-sample-host,
.modal.gak-desk .sa-pending-form-host .po-purchase-host {
  max-width: none;
}

/* 待审采购右侧：对标桌面导出 DOCX（采购合同_CG*.docx） */
/* 待审采购：左右分栏可拖拽 */
#modal-purchase-pending .po-pending-split-body {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  align-items: stretch;
}
#modal-purchase-pending .so-pending-list-pane {
  flex: 0 0 520px;
  width: 520px;
  min-width: 220px;
  max-width: 70%;
}
#modal-purchase-pending .so-pending-list-pane.has-saved-split {
  max-width: none;
}
#modal-purchase-pending .po-pending-split-resizer {
  flex: 0 0 12px;
  width: 12px;
  margin: 0 -3px;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 3;
  background: transparent;
  align-self: stretch;
}
#modal-purchase-pending .po-pending-split-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
  width: 2px;
  background: #e2e8f0;
  transition: background 0.12s ease, width 0.12s ease, left 0.12s ease;
}
#modal-purchase-pending .po-pending-split-resizer:hover::before,
#modal-purchase-pending .po-pending-split-resizer:focus-visible::before,
body.po-pending-split-dragging #modal-purchase-pending .po-pending-split-resizer::before {
  background: #0d9488;
}
body.po-pending-split-dragging {
  cursor: col-resize !important;
  user-select: none !important;
}
body.po-pending-split-dragging * {
  cursor: col-resize !important;
  user-select: none !important;
}
#modal-purchase-pending .so-pending-preview-pane {
  flex: 1 1 auto;
  min-width: 280px;
}
#modal-purchase-pending #purchase-pending-table.mat-pending-table {
  width: max-content !important;
  min-width: 100%;
  table-layout: fixed !important;
}
#modal-purchase-pending #purchase-pending-table th,
#modal-purchase-pending #purchase-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  position: relative;
}
#modal-purchase-pending #purchase-pending-table th[data-col="供应商"],
#modal-purchase-pending #purchase-pending-table td:nth-child(3) {
  text-align: center;
}
#modal-purchase-pending #purchase-pending-table.resizable th {
  overflow: visible;
}
@media (max-width: 900px) {
  #modal-purchase-pending .po-pending-split-body {
    flex-direction: column !important;
  }
  #modal-purchase-pending .so-pending-list-pane {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    max-height: 220px;
  }
  #modal-purchase-pending .po-pending-split-resizer {
    display: none;
  }
}

#purchase-pending-form-host {
  background: #e8eaed;
}
#purchase-pending-form-host .po-ref-scroll {
  padding: 12px 8px 20px;
  box-sizing: border-box;
  overflow: auto;
}
.po-ref-sheet {
  /* 竖向 A4：210×297mm；左右边距收窄（对标 DOCX 0.7cm） */
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  border: 1px solid #c5c5c5;
  box-sizing: border-box;
  padding: 10mm 7mm;
  color: #111;
  font-family: SimHei, "黑体", sans-serif;
  font-size: 9pt;
  line-height: 1.15;
}
.po-ref-sheet .po-ref-p {
  margin: 0 0 2px;
}
.po-ref-sheet .po-ref-title {
  margin-bottom: 0;
  line-height: 1.2;
}
.po-ref-sheet .po-ref-subtitle {
  margin-bottom: 4px;
}
.po-ref-sheet .po-ref-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.po-ref-sheet .po-ref-tab {
  flex: 1 1 auto;
}
.po-ref-sheet .po-ref-clause-one {
  margin: 6px 0 4px;
  font-weight: 500;
}
.po-ref-sheet .po-ref-clause {
  margin: 2px 0;
  text-align: justify;
}
.po-ref-party,
.po-ref-detail,
.po-ref-sign,
.po-ref-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 4px 0;
}
.po-ref-party td,
.po-ref-detail th,
.po-ref-detail td,
.po-ref-sign td,
.po-ref-table td {
  border: 1px solid #000;
  padding: 2px 4px;
  vertical-align: middle;
  word-break: break-word;
}
.po-ref-party td {
  width: 50%;
  font-size: 8pt;
  text-align: left;
}
.po-ref-detail th,
.po-ref-detail td {
  text-align: center;
  font-size: 8pt;
  font-weight: 400;
}
.po-ref-detail .po-ref-sum {
  font-weight: 500;
  background: #dce6f0;
}
.po-ref-detail .po-ref-sum-label {
  text-align: right !important;
  padding-right: 8px;
}
.po-ref-sign td {
  width: 50%;
  vertical-align: top;
  min-height: 130px;
  padding: 8px 10px;
  font-size: 9pt;
}
.po-ref-seal {
  display: block;
  width: 38mm;
  height: 38mm;
  margin-top: 4px;
  object-fit: contain;
}

/* 采购订单编辑：输出版式样（与待审预览 .po-ref-sheet 同源） */
#module-edit-form.po-edit-export-skin,
.ib-inbound-form-host.po-edit-export-skin {
  background: #e8eaed;
  padding: 0;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.po-purchase-export-skin {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}
.po-form-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 4;
}
.po-form-bar-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
}
.po-form-bar-field > span {
  color: #64748b;
  flex-shrink: 0;
}
.po-form-bar-field .po-ref-inline {
  min-width: 110px;
  max-width: 200px;
}
.po-ref-detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 4px;
}
.po-form-add-btn {
  color: #0f766e !important;
  font-weight: 500;
  font-size: 12px !important;
}
.po-purchase-export-skin .po-ref-scroll {
  flex: 1 1 auto;
  padding: 16px 36px 24px;
  box-sizing: border-box;
  overflow: auto;
  background: #e8eaed;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
/* 编辑/新增：比 A4 宽，但左右留灰边，勿贴满屏幕 */
.po-purchase-export-skin .po-ref-form-sheet {
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  flex: 0 1 auto;
  padding: 20px 28px 28px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}
.po-purchase-export-skin .po-ref-detail {
  table-layout: auto;
}
.po-purchase-export-skin .po-ref-detail th,
.po-purchase-export-skin .po-ref-detail td {
  font-size: 9pt;
  padding: 4px 6px;
}

/* 新增采购订单：整页嵌入（非浮层），铺满内容区 */
#module-list.is-purchase-create-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
#modal-module-edit.is-po-create-page {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-module-edit.is-po-create-page .modal-card {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: column;
}
#modal-module-edit.is-po-create-page .modal-head {
  display: none !important;
}
#modal-module-edit.is-po-create-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: #e8eaed;
}
#modal-module-edit.is-po-create-page .modal-body-desk > .desk-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
#modal-module-edit.is-po-create-page #module-edit-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #e8eaed;
}
#modal-module-edit.is-po-create-page .po-purchase-export-skin {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* 新增报价单：整页嵌入（非浮层），铺满内容区（对标新增采购订单） */
#module-list.is-quotation-create-page {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
}
#modal-module-edit.is-quotation-create-page {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  background: transparent !important;
  z-index: auto !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  align-items: stretch;
  pointer-events: auto;
}
#modal-module-edit.is-quotation-create-page .modal-card {
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex;
  flex-direction: column;
}
#modal-module-edit.is-quotation-create-page .modal-head {
  display: none !important;
}
#modal-module-edit.is-quotation-create-page .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  background: #e8eaed;
}
#modal-module-edit.is-quotation-create-page #module-edit-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #e8eaed;
  padding: 12px;
}
#modal-module-edit.is-quotation-create-page .qt-quotation-host {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.po-ref-form-sheet .po-ref-emph {
  color: #c45c26;
  font-weight: 500;
}
/* 采购合同纸：精简后的版式 */
.po-ref-form-sheet .po-ref-title {
  text-align: center;
  font-size: 20pt;
  font-weight: 500;
  margin: 0 0 2px;
  letter-spacing: 0.12em;
}
.po-ref-form-sheet .po-ref-subtitle {
  text-align: center;
  font-size: 11pt;
  color: #444;
  letter-spacing: 0.2em;
  margin: 0 0 10px;
}
.po-ref-form-sheet .po-ref-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 9pt;
  flex-wrap: wrap;
}
.po-ref-form-sheet .po-ref-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  color: #111;
}
.po-ref-form-sheet .po-ref-meta-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.po-ref-form-sheet .po-ref-meta-left .po-ref-inline {
  min-width: 72px;
  max-width: 160px;
}
.po-ref-form-sheet .po-ref-meta-right {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
}
/* 收货地址：标签左固定，输入框同行铺满，避免 justify 把字撑开 */
.po-ref-form-sheet .po-ref-clause-addr {
  display: flex;
  align-items: baseline;
  gap: 4px;
  text-align: left;
}
.po-ref-form-sheet .po-ref-clause-addr .po-ref-clause-label {
  flex: 0 0 auto;
  letter-spacing: normal;
  white-space: nowrap;
}
.po-ref-form-sheet .po-ref-clause-addr .po-ref-inline.is-wide {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.po-ref-form-sheet .po-ref-party td {
  padding: 5px 8px;
  line-height: 1.45;
  vertical-align: middle;
}
.po-ref-form-sheet .po-ref-party b {
  font-weight: 500;
  margin-right: 2px;
}
.po-ref-form-sheet .po-ref-detail-toolbar {
  margin: 4px 0 2px;
}
.po-ref-form-sheet .po-form-add-btn {
  border: 1px dashed #94a3b8 !important;
  background: #f8fafc !important;
  color: #0f766e !important;
  border-radius: 4px !important;
  padding: 2px 10px !important;
}
.po-ref-form-sheet .po-ref-clause {
  margin: 3px 0;
  line-height: 1.35;
}
.po-ref-form-sheet .po-ref-remark .po-ref-inline {
  margin-top: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 4px 6px;
  min-height: 40px;
}
.po-ref-form-sheet .po-ref-sign-tip {
  color: #64748b;
  font-size: 8.5pt;
}
.po-ref-form-sheet .po-ref-sign td {
  min-height: 110px;
  padding: 10px 12px;
}
/* 采购编辑弹窗：合同纸居中展示 */
#modal-module-edit:not(.is-po-create-page) .po-edit-export-skin {
  max-height: min(78vh, 860px);
  overflow: auto;
  background: #e8eaed;
  border-radius: 4px;
}
#modal-module-edit:not(.is-po-create-page) .po-purchase-export-skin .po-ref-scroll {
  padding: 14px 10px 20px;
}
#modal-module-edit.is-po-create-page .modal-foot {
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  justify-content: flex-end;
}
/* 审批信息并入采购单（非底栏红框） */
.po-purchase-host .po-audit-card {
  margin-top: 12px;
}
.po-purchase-host.is-po-form-disabled .ib-control.is-ro,
.po-purchase-host.is-po-form-disabled select:disabled,
.po-purchase-host.is-po-form-disabled input:disabled,
.po-purchase-host.is-po-form-disabled textarea:disabled {
  background: #f8fafc;
  color: #334155;
}
/* 甲乙方并列卡片（对标桌面 PurchaseDialog） */
.po-purchase-host .po-party-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 12px;
}
.po-purchase-host .po-party-card {
  margin: 0;
}
.po-purchase-host .po-party-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.po-purchase-host .po-party-fields .ib-field {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}
.po-purchase-host .po-party-fields .ib-field > label {
  text-align: right;
  margin: 0;
  white-space: nowrap;
}
.po-purchase-host .po-party-fields .ib-control {
  min-width: 0;
}
@media (max-width: 900px) {
  .po-purchase-host .po-party-row {
    grid-template-columns: 1fr;
  }
}
.po-ref-form-sheet .po-ref-inline {
  font-family: SimHei, "黑体", sans-serif;
  font-size: 8.5pt;
  color: #111;
  border: none;
  border-bottom: 1px solid #94a3b8;
  background: transparent;
  padding: 1px 2px;
  margin: 0 2px;
  outline: none;
  max-width: 100%;
  box-sizing: border-box;
  vertical-align: baseline;
}
.po-ref-form-sheet .po-ref-inline.is-wide {
  width: calc(100% - 6px);
  min-width: 0;
}
.po-ref-form-sheet select.po-ref-inline {
  border: 1px solid #94a3b8;
  border-radius: 2px;
  background: #fff;
  padding: 1px 4px;
}
.po-ref-form-sheet textarea.po-ref-inline {
  display: block;
  width: 100%;
  border: 1px solid #94a3b8;
  border-radius: 2px;
  margin-top: 2px;
  resize: vertical;
  min-height: 36px;
}
.po-ref-form-sheet .po-ref-inline:focus {
  border-color: #0d9488;
  background: #f0fdfa;
}
.po-ref-form-sheet .po-ref-party .po-ref-inline {
  width: calc(100% - 4.5em);
  min-width: 80px;
}
.po-ref-form-sheet .po-ref-detail input,
.po-ref-form-sheet .po-ref-detail select {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  font-family: SimHei, "黑体", sans-serif;
  font-size: 8pt;
  text-align: center;
  padding: 1px 2px;
  outline: none;
}
.po-ref-form-sheet .po-ref-detail input:focus,
.po-ref-form-sheet .po-ref-detail select:focus {
  background: #f0fdfa;
  outline: 1px solid #0d9488;
}
.po-ref-form-sheet .po-ref-remark-cell {
  position: relative;
  padding-right: 22px;
}
.po-ref-form-sheet .po-remove-row {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px !important;
  font-size: 11px !important;
  min-height: auto;
  line-height: 1;
}
.po-ref-form-sheet .po-summary-row td {
  font-weight: 500;
  background: #dce6f0;
}
.po-purchase-export-skin .ib-audit-bar {
  margin: 0;
  border-radius: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}
.modal.gak-desk .so-pending-top-row {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 10px;
  min-height: 0;
  max-height: 42%;
}
.modal.gak-desk .so-pending-info-card {
  flex: 0 0 auto;
  margin: 0;
  min-width: 0;
  position: relative;
  overflow: auto;
}
.modal.gak-desk .so-pending-attach-card {
  margin: 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.gak-desk .so-pending-attach-gallery {
  flex: 1 1 auto;
  min-height: 120px;
  overflow: auto;
  padding: 8px 10px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  align-content: start;
  background: #f8fafc;
  border-top: 1px dashed #cbd5e1;
}
.modal.gak-desk .so-pending-attach-gallery .so-pend-attach-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 28px 8px;
}
.modal.gak-desk .so-pending-attach-gallery .so-attach-thumb {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: zoom-in;
}
.modal.gak-desk .so-pending-attach-gallery .so-attach-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8fafc;
}
.modal.gak-desk .so-pending-attach-gallery .so-attach-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  word-break: break-all;
  background: #f1f5f9;
}
.modal.gak-desk .so-pending-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 10px 16px 14px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
}
/* 每个字段：标签与值同一行，带表格单元格边框 */
.modal.gak-desk .so-pending-info-grid > div {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f6;
  border-right: 1px solid #eef2f6;
}
.modal.gak-desk .so-pending-info-grid > div:nth-child(3n) {
  border-right: none;
}
.modal.gak-desk .so-pending-info-grid label {
  flex: none;
  min-width: 56px;
  color: #64748b;
  font-size: 12px;
  margin-right: 6px;
  text-align: right;
  white-space: nowrap;
}
.modal.gak-desk .so-pending-info-grid > div > div:not(.so-pending-watermark) {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 22px;
  word-break: break-all;
}
.modal.gak-desk .so-pending-info-grid > .sp-info-span {
  grid-column: span 3;
  border-right: none;
  border-bottom: none;
}
.modal.gak-desk .so-pending-lines-card {
  flex: 1 1 auto;
  min-height: 220px;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.gak-desk .so-pending-lines-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0 12px 12px;
  border: 1px solid #E8EAED;
  background: #fff;
}
.modal.gak-desk #so-pending-lines-table,
.modal.gak-desk #sa-pending-lines-table {
  width: max-content;
  min-width: 100%;
}
.modal.gak-desk #so-pending-lines-table th,
.modal.gak-desk #so-pending-lines-table td,
.modal.gak-desk #sa-pending-lines-table th,
.modal.gak-desk #sa-pending-lines-table td {
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 8px;
}
.modal.gak-desk #so-pending-lines-table.resizable th {
  overflow: visible;
  cursor: grab;
  user-select: none;
}
.modal.gak-desk #so-pending-lines-table th.col-idx {
  cursor: default;
}
.modal.gak-desk #so-pending-lines-table td.so-pend-qty {
  text-align: center;
}
.modal.gak-desk #so-pending-lines-table td.so-pend-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.modal.gak-desk #so-pending-lines-table tfoot td {
  background: #f1f5f9;
  font-weight: 500;
}
@media (max-width: 1200px) {
  .modal.gak-desk .modal-card-desk-so-pending .so-pending-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .modal.gak-desk .so-pending-list-pane {
    max-height: 220px;
  }
  .modal.gak-desk .so-pending-top-row {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }
  .modal.gak-desk .so-pending-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .modal.gak-desk .so-pending-info-grid > div {
    border-right: 1px solid #eef2f6;
  }
  .modal.gak-desk .so-pending-info-grid > div:nth-child(2n) {
    border-right: none;
  }
  .modal.gak-desk .so-pending-info-grid > .sp-info-span {
    grid-column: span 2;
    border-bottom: none;
    border-right: none;
  }
}
/* 列设置 / 流程·脱敏须压在业务编辑弹窗 / 分栏页 / 附件预览之上 */
#gak-col-dialog,
#modal-workflow { z-index: 15000 !important; }
.modal[hidden] { display: none !important; }
.modal-card {
  width: min(420px, 100%); background: #fff; border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal.modal-md .modal-card,
.modal-card.modal-card-lg { width: min(960px, 96vw); }
.modal-head, .modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-foot {
  border-bottom: 0; border-top: 1px solid var(--border); justify-content: flex-end;
}
.modal-title, #modal-order-title, #modal-cust-title, #modal-module-title {
  font-weight: 500; color: var(--primary-dark);
}
.modal-body { padding: 12px 14px; overflow: auto; }
.modal-foot .tb-btn,
.modal-foot button {
  border: none; background: transparent; color: var(--primary-dark);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 12px;
}
.modal-foot .tb-btn:hover,
.modal-foot button:hover { background: #e6f4f2; }
.btn-text {
  border: 0; background: transparent; color: var(--primary-dark); cursor: pointer; font: inherit;
}

/* —— 桌面版弹窗壳（对齐 GAK 客户弹窗：灰底白卡 + 标签右对齐等宽栅格） —— */
.modal.gak-desk {
  padding: 12px;
  /* 实色遮罩：双显卡(核显+独显)拖图时减少半透明合成闪黑 */
  background: #2b2d30;
}
.modal.gak-desk .modal-card-desk {
  width: min(1600px, 98vw);
  height: min(900px, 94vh);
  max-height: min(900px, 94vh);
  border-radius: 4px;
  border: 1px solid #DADCE0;
  box-shadow: 0 8px 28px rgba(32, 33, 36, 0.28);
  overflow: hidden;
  background: #fff;
}
/* 桌面同构表单（QMS品质/设备/认证/SOP/生产/盘点）：对标桌面 600~900 宽、内容贴合高
   （设备 600×500 / 认证 560 贴合 / QMS C 类 900，统一取宽 920、高随内容收 上限 900） */
.modal.gak-desk .modal-card-desk-mod-edit {
  width: min(920px, 98vw);
  height: auto;
  max-height: min(92vh, 900px);
  min-height: min(420px, 84vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-mod-edit .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 100%;
}
/* 销售订单弹窗：对标桌面 C 类 1600×900；基本信息多列网格 */
.modal.gak-desk .modal-card-desk-so-edit {
  width: min(1600px, 98vw);
  min-width: min(1200px, 98vw);
  height: min(900px, 94vh);
  max-height: min(94vh, 900px);
  min-height: min(900px, 94vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-so-edit .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 100%;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header {
  --desk-label-w: 72px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin: 10px 16px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
/* 单元格：标签与输入框同行，带表格分隔线 */
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header > .desk-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f6;
  border-right: 1px solid #eef2f6;
  box-sizing: border-box;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header > .desk-cell:nth-child(3n) {
  border-right: none;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-2 {
  grid-column: span 2;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-3 {
  grid-column: span 3;
  border-right: none;
  border-bottom: none;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-4,
.modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-6 {
  grid-column: span 3;
  border-right: none;
  border-bottom: none;
}
/* 基本信息 | 图片附件：2:1 并排；整行不超过弹窗内容区一半高度 */
.modal.gak-desk .modal-card-desk-so-edit .so-form-top-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin-bottom: 10px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 50%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.modal.gak-desk .modal-card-desk-so-edit .so-basic-card {
  min-width: 0;
  margin: 0;
  border: 1px solid #DADCE0;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
}
.modal.gak-desk .modal-card-desk-so-edit .so-attach-card {
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
  align-self: stretch;
  border: 1px solid #DADCE0;
  background: #fff;
  /* head 固定 + 投放区占满剩余高度；禁止被高图撑破 */
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  box-sizing: border-box;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
.modal.gak-desk .modal-card-desk-so-edit .so-basic-card .desk-card-head,
.modal.gak-desk .modal-card-desk-so-edit .so-attach-card .desk-card-head {
  flex: 0 0 auto;
}
.modal.gak-desk .modal-card-desk-so-edit .so-basic-card .desk-form {
  flex: 0 0 auto;
}
/* 销售订单附件：对标迈方 attach-section（GAK-WEB-ATTACH-UI-001） */
.modal.gak-desk .so-attach-card.gak-std-attach {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}
.modal.gak-desk .so-attach-card .gak-std-attach-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
  border: none;
  padding: 0;
}
.modal.gak-desk .so-attach-card .section-title {
  font-weight: 500;
  font-size: 13px;
  color: #1e293b;
  margin: 0;
}
.modal.gak-desk .so-attach-card .file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.modal.gak-desk .so-attach-card .attach-list,
.modal.gak-desk #so-attach-gallery.attach-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal.gak-desk .so-attach-card .attach-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  border: 1px solid #E8EAED;
  border-radius: 10px;
  background: #fff;
}
.modal.gak-desk .so-attach-card .attach-preview {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #E8EAED;
}
.modal.gak-desk .so-attach-card .attach-thumb {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  cursor: pointer;
  background: #f8fafc;
}
.modal.gak-desk .so-attach-card .attach-drop-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  flex: 0 0 auto;
}
.modal.gak-desk .so-attach-card.is-dragover {
  border-color: #0d9488;
  background: #f0fdfa;
  outline: none;
}
.modal.gak-desk .desk-card-attach-std {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.modal.gak-desk .desk-card-attach-std > .gak-std-attach {
  min-height: 200px;
}
.modal.gak-desk .so-attach-gallery {
  /* 兼容旧选择器：现为 attach-list */
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
}
/* 有附件：按投放区铺满预览（对标样品申请客供产品图片 / GAK-WEB-ATTACH-001） */
.modal.gak-desk .so-attach-gallery.is-fill {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  align-content: stretch;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.modal.gak-desk .so-attach-gallery.is-fill:has(.so-attach-thumb:only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.modal.gak-desk .so-attach-gallery.is-fill .so-attach-thumb {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 96px;
  aspect-ratio: auto;
  align-self: stretch;
}
.modal.gak-desk .so-attach-gallery.is-fill:has(.so-attach-thumb:only-child) .so-attach-thumb {
  min-height: 100%;
}
.modal.gak-desk .so-attach-gallery.is-fill .so-attach-thumb img {
  object-fit: contain;
  background: #f8fafc;
}
.modal.gak-desk .so-attach-card.is-dragover,
.modal.gak-desk .so-attach-card.is-dragover .so-attach-dropzone,
.modal.gak-desk .so-attach-dropzone.is-dragover,
.modal.gak-desk .so-attach-card:has(.so-attach-dropzone.is-dragover) {
  border-color: #1a73e8;
  background: #e8f1fc;
}
.modal.gak-desk .so-attach-card.is-dragover,
.modal.gak-desk .so-attach-card:has(.so-attach-dropzone.is-dragover) {
  outline: 2px solid #1a73e8;
  outline-offset: -2px;
}
.modal.gak-desk .so-attach-thumb {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: zoom-in;
}
.modal.gak-desk .so-attach-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal.gak-desk .so-attach-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  word-break: break-all;
  background: #f1f5f9;
}
.modal.gak-desk .so-attach-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  border: 0;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.modal.gak-desk .so-attach-thumb-del:hover {
  background: #dc2626;
}
.modal.gak-desk .so-attach-hint {
  margin: 10px 4px 4px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}
.modal.gak-desk .so-attach-hint[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .modal.gak-desk .modal-card-desk-so-edit .so-form-top-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .modal.gak-desk .modal-card-desk-so-edit .so-attach-card {
    width: 100%;
    min-height: 200px;
  }
}
.modal.gak-desk .desk-radios {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 32px;
  border: none;
  background: transparent;
  padding: 0 2px;
}
.modal.gak-desk .desk-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
}
.modal.gak-desk .desk-radio input {
  width: auto;
  margin: 0;
  accent-color: #0d9488;
}
.modal.gak-desk .desk-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.modal.gak-desk .desk-btn-danger {
  color: #dc2626 !important;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-upload {
  color: #fff !important;
  background: #4285F4 !important;
  font-weight: 500;
  padding: 4px 14px !important;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-upload:hover {
  background: #3367d6 !important;
  color: #fff !important;
}
/* 待审采购：同意按钮始终占位可见（禁用态仍显示；页模式在顶栏同效） */
#modal-purchase-pending #btn-purchase-pending-approve,
#module-toolbar #btn-purchase-pending-approve {
  display: inline-flex !important;
  align-items: center;
  visibility: visible;
}
#modal-purchase-pending #btn-purchase-pending-approve[hidden],
#module-toolbar #btn-purchase-pending-approve[hidden] {
  display: none !important;
}
#modal-purchase-pending #btn-purchase-pending-approve:disabled,
#modal-purchase-pending #btn-purchase-pending-approve[aria-disabled="true"],
#module-toolbar #btn-purchase-pending-approve:disabled,
#module-toolbar #btn-purchase-pending-approve[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: auto;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-card-so-lines {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines {
  margin: 0 20px 8px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  min-width: 0;
  width: auto;
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  position: relative;
}
/* 操作列贴右但不画出明细区右缘 */
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th.col-ops,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td.col-ops,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th[data-col="操作"],
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td[data-col="操作"] {
  overflow: hidden;
  box-sizing: border-box;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th.col-ops,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th[data-col="操作"] {
  padding-left: 28px;
  padding-right: 22px;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table thead th[data-col]:not([data-col="行号"]) {
  cursor: grab;
  user-select: none;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td {
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 8px;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tr.is-selected td {
  background: #e8f0fe;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table .so-line-money-cell,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table .so-line-money-cell input,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td.so-line-sum-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table th[data-col="订单数量"],
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td[data-col="订单数量"],
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td[data-col="订单数量"] input,
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table td.so-line-sum-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tfoot tr.so-line-sum td {
  background: #f1f5f9;
  font-weight: 500;
  color: #0f172a;
  border-top: 1px solid #cbd5e1;
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tfoot tr.so-line-sum td.col-ops {
  background: #f1f5f9;
}
/* 明细行删除：不固定列，hover 行时在右侧浮现「删除」 */
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tbody tr {
  position: relative;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tbody tr .so-line-del-abs {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  display: none;
  padding: 2px 8px;
  border: 1px solid rgba(220, 38, 38, 0.45);
  border-radius: 3px;
  background: #fff;
  color: #dc2626;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tbody tr:hover .so-line-del-abs {
  display: inline-block;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-lines .lines-table tbody tr .so-line-del-abs:hover {
  color: #fff;
  background: #dc2626;
  border-color: #dc2626;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-attach-panel {
  margin: 0 20px 10px;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-attach-panel .attach-list {
  padding: 4px 0;
  flex: 1;
  margin: 0;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-attach-panel .attach-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  border: 0;
  padding: 0;
  list-style: none;
}
.modal.gak-desk .modal-card-desk-so-edit .desk-attach-panel .attach-list .muted {
  color: #94a3b8;
  font-size: 13px;
}
.modal.gak-desk .lines-table input.so-line-auto[readonly] {
  color: #1A73E8;
  background: transparent;
  cursor: default;
}
/* 可搜索下拉（对标桌面 searchable combobox） */
.modal.gak-desk .desk-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  padding-right: 0;
}
.modal.gak-desk .desk-combo > input {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 28px;
}
.modal.gak-desk .desk-combo-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.modal.gak-desk .desk-combo-toggle:hover {
  color: #0d9488;
}
.modal.gak-desk .desk-combo-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 40;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.modal.gak-desk .desk-combo-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.35;
}
.modal.gak-desk .desk-combo-item:hover,
.modal.gak-desk .desk-combo-item.is-active {
  background: #e8f0fe;
}
.modal.gak-desk .desk-combo-item .combo-name {
  font-weight: 500;
}
.modal.gak-desk .desk-combo-item .combo-extra {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}
.modal.gak-desk .desk-combo-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 13px;
}
/* 挂到 body 的客户下拉：保持与弹窗内相同的单列列表式样（避免脱离 .modal 作用域后按钮并排） */
.desk-combo-panel.is-floating {
  position: fixed;
  z-index: 13000;
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  display: block;
}
.desk-combo-panel.is-floating .desk-combo-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.35;
}
.desk-combo-panel.is-floating .desk-combo-item:hover,
.desk-combo-panel.is-floating .desk-combo-item.is-active {
  background: #e8f0fe;
}
.desk-combo-panel.is-floating .desk-combo-item .combo-name {
  font-weight: 500;
}
.desk-combo-panel.is-floating .desk-combo-item .combo-extra {
  color: #64748b;
  font-size: 12px;
  margin-top: 2px;
}
.desk-combo-panel.is-floating .desk-combo-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 13px;
}

/* 可搜索下拉框组件 */
.gak-searchable-select {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  width: 100%;
}
.gak-searchable-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #1e293b;
  font-size: 12px;
  line-height: 28px;
  outline: none;
  cursor: text;
  transition: border-color 0.15s ease;
}
.gak-searchable-input:focus {
  border-color: var(--primary, #0d9488);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}
.gak-searchable-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gak-searchable-toggle:hover {
  color: var(--primary, #0d9488);
}
.gak-searchable-panel {
  max-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  z-index: 13000;
}
.gak-searchable-item {
  padding: 7px 10px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.4;
  border-bottom: 1px solid #f1f5f9;
}
.gak-searchable-item:last-child {
  border-bottom: 0;
}
.gak-searchable-item:hover,
.gak-searchable-item.is-active {
  background: #e8f0fe;
}
.gak-searchable-item.is-selected {
  background: #f0fdfa;
  color: var(--primary-dark, #0f766e);
  font-weight: 500;
}
.gak-searchable-empty {
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}
@media (max-width: 720px) {
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header {
    grid-template-columns: 1fr;
  }
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header > .desk-cell {
    border-right: none;
  }
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-2,
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-3,
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-4,
  .modal.gak-desk .modal-card-desk-so-edit .desk-form-so-header .desk-cell-span-6 {
    grid-column: span 1;
  }
}
.modal.gak-desk .modal-card-desk-md {
  width: min(720px, 96vw);
  height: auto;
  max-height: min(80vh, 720px);
}
.modal.gak-desk .modal-card-desk-lg {
  width: min(1200px, 98vw);
  height: auto;
  max-height: min(92vh, 900px);
}
/* 物料弹窗：对标桌面 DIALOG_WIDTH / DIALOG_WIDTH_EDIT */
.modal.gak-desk .modal-card-desk-wo-insight {
  width: min(960px, 96vw);
  height: min(900px, 92vh);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-wo-detail {
  width: min(1200px, 98vw);
  height: min(860px, 92vh);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-wo-detail .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.wo-detail-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.wo-info-card {
  flex: 0 0 auto;
  margin-bottom: 0;
}
.wo-detail-header {
  margin-bottom: 0;
  --desk-label-w: 108px;
}
#modal-module-view .wo-detail-header .desk-cell > label {
  white-space: nowrap !important;
  overflow: visible;
  text-overflow: clip;
  flex: 0 0 var(--desk-label-w);
  width: var(--desk-label-w);
  min-width: var(--desk-label-w);
  max-width: var(--desk-label-w);
}
#modal-module-view .wo-detail-header .desk-field-ro > span {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal !important;
  line-height: 20px;
}
.wo-bom-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.wo-bom-card .desk-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.wo-bom-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wo-bom-table-wrap {
  flex: 1 1 auto;
  max-height: min(420px, 48vh);
  overflow: auto;
  margin: 0 12px 12px;
}
.wo-bom-empty {
  padding: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.wo-bom-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
.wo-bom-table th,
.wo-bom-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-bom-table th.col-idx,
.wo-bom-table td.col-idx,
.wo-bom-table col[data-col="行号"] {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}
.modal.gak-desk .modal-card-desk-wo-insight .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.wo-insight-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  font-size: 13px;
  color: #0f766e;
  line-height: 1.55;
  white-space: pre-wrap;
}
.wo-insight-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wo-insight-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.wo-insight-card-head {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  background: #f8fafc;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.wo-insight-card-body {
  margin: 0;
  padding: 10px 14px 12px;
  list-style: none;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
}
.wo-insight-card-body li {
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.wo-insight-card-body li:last-child {
  border-bottom: none;
}
.modal.gak-desk .modal-card-desk-mat-pending {
  width: min(920px, 96vw);
  height: min(600px, 90vh);
  max-height: min(90vh, 600px);
  min-height: min(600px, 90vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-mat-pending .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mat-pending-hint {
  margin: 0 0 8px;
  padding: 0 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  flex: 0 0 auto;
}
.mat-pending-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 0 4px;
  flex: 0 0 auto;
}
.mat-pending-check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.mat-pending-sel-hint {
  font-size: 12px;
  color: #64748b;
}
.mat-pending-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#mat-pending-table.mat-pending-table {
  width: 100% !important;
  table-layout: fixed !important;
}
#mat-pending-table th,
#mat-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mat-pending-table td:nth-child(4) {
  text-align: left;
}
#mat-pending-table tr.mat-pending-row {
  cursor: pointer;
}
#mat-pending-table tr.mat-pending-row:hover {
  background: #ecfdf5;
}
#mat-pending-table tr.mat-pending-row.is-checked {
  background: #f0fdf4;
}
#mat-pending-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  vertical-align: middle;
}
.tb-btn .tb-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  vertical-align: text-top;
}
.tb-btn .tb-badge[hidden] {
  display: none !important;
}
.modal.gak-desk .modal-card-desk-mat-pending {
  width: min(920px, 96vw);
  height: min(600px, 90vh);
  max-height: min(90vh, 600px);
  min-height: min(600px, 90vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-mat-pending .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.gak-desk .modal-card-desk-mat-types {
  width: min(820px, 96vw);
  height: min(560px, 92vh);
  max-height: min(92vh, 640px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-mat-types .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.gak-desk .modal-card-desk-mat-types .desk-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.mat-types-hint {
  margin: 0 0 10px;
  padding: 0 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  flex: 0 0 auto;
}
.mat-types-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.mat-types-toolbar .tb-btn {
  border: 1px solid #d1e7e3;
  background: #fff;
  min-height: 30px;
  padding: 4px 12px;
}
.mat-types-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  width: 100%;
}
#mat-types-table.mat-types-table,
.mat-types-table {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100%;
  table-layout: fixed !important;
}
#mat-types-table col[data-col="行号"] {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
}
#mat-types-table col:not([data-col="行号"]) {
  width: auto;
}
#mat-types-table th,
#mat-types-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mat-types-table th.col-idx,
#mat-types-table td.col-idx,
#mat-types-table th[data-col="行号"],
#mat-types-table td[data-col="行号"] {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  padding-left: 4px;
  padding-right: 4px;
}

/* 新增/编辑仓库：对标桌面 600×480 */
.modal.gak-desk .modal-card-desk-wh-edit {
  width: min(600px, 96vw);
  height: min(480px, 90vh);
  max-height: min(90vh, 560px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-wh-edit .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* 新增/编辑/查看物料：C 类单据高度 900 */
.modal.gak-desk .modal-card-desk-mat-edit {
  width: min(1120px, 98vw);
  height: min(900px, 92vh);
  max-height: min(92vh, 900px);
  min-height: min(900px, 92vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-mat-edit .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.modal.gak-desk .modal-card-desk-mat-edit .modal-body-desk > .desk-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.mat-code-wrap {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mat-code-wrap .desk-field {
  flex: 1 1 auto;
  min-width: 0;
}
.mat-code-actions {
  display: inline-flex;
  flex-shrink: 0;
  gap: 4px;
  align-items: center;
}
.mat-code-actions .tb-btn {
  border: 1px solid #E8EAED;
  background: #F8F9FA;
  padding: 3px 8px;
  font-size: 12px;
}
.desk-cell-code {
  align-items: flex-start;
}
.desk-cell-code > label {
  padding-top: 6px;
}
.mat-edit-host {
  padding: 0;
  margin: 0;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.mat-edit-layout.is-edit {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 8px 12px 12px;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
}
.mat-edit-layout .desk-form-mat {
  --desk-label-w: 72px;
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  box-sizing: border-box;
}
.mat-edit-layout .desk-form-mat > .desk-cell {
  width: 100%;
  box-sizing: border-box;
}
.mat-edit-layout .desk-form-mat > .desk-cell > label,
.mat-edit-layout .desk-form-mat > .desk-span-full > label {
  text-align: left; /* 短标签与长标签左边齐，避免「备注/状态」视觉偏右 */
}
.mat-edit-layout .desk-form-mat > .desk-cell.desk-span-full,
.mat-edit-layout .desk-form-mat > .mat-edit-attach {
  align-items: flex-start;
}
.mat-edit-layout .desk-form-mat > .desk-cell.desk-span-full > label,
.mat-edit-layout .desk-form-mat > .mat-edit-attach > label {
  padding-top: 6px;
}
.mat-edit-layout .desk-form-mat .desk-field {
  flex: 1 1 auto;
  min-width: 0;
}
/* 查看/只读：灰底禁用感（对标桌面 read_only） */
.mat-edit-layout.is-view .desk-field,
.mat-edit-layout .desk-field:has(input[readonly]),
.mat-edit-layout .desk-field:has(textarea[readonly]),
.mat-edit-layout .desk-field:has(select:disabled) {
  background: #F8F9FA;
}
.mat-edit-layout.is-view .desk-field > input,
.mat-edit-layout.is-view .desk-field > textarea,
.mat-edit-layout.is-view .desk-field > select,
.mat-edit-layout .desk-field > input[readonly],
.mat-edit-layout .desk-field > textarea[readonly],
.mat-edit-layout .desk-field > select:disabled {
  color: #334155;
  cursor: default;
}
/* 旧横向「标签+列表」壳；迈方标准区用 .gak-std-attach，勿套此规则 */
.mat-edit-layout .mat-edit-attach:not(.gak-std-attach) {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 4px;
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
}
.mat-edit-layout .mat-edit-attach:not(.gak-std-attach) > label {
  flex: 0 0 var(--desk-label-w);
  width: var(--desk-label-w);
  min-width: var(--desk-label-w);
  max-width: var(--desk-label-w);
  text-align: left;
  color: #64748b;
  font-size: 12px;
  line-height: 1.2;
  margin: 0;
  padding-top: 6px;
  box-sizing: border-box;
}
.mat-edit-layout .mat-attach-field {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid #E8EAED;
  background: #fff;
  min-height: 160px;
  overflow: hidden;
}
.mat-edit-layout .mat-attach-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid #E8EAED;
  flex: 0 0 auto;
  background: #f8fafc;
}
.mat-edit-layout .mat-edit-attach .desk-attach-actions .btn-text {
  font-size: 12px;
  padding: 2px 8px;
}
.mat-edit-layout .mat-edit-attach .attach-list,
.product-edit-layout .product-edit-attach .attach-list {
  flex: 1 1 auto;
  min-height: 120px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}
.mat-attach-dropzone {
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  position: relative;
  outline: none;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 6px;
  /* 禁止 transition/合成层：旧显卡驱动拖入时易整窗黑屏 */
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  contain: layout paint;
}
.mat-edit-attach {
  outline: none;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
/* 拖入仅改边框色，不改透明度/阴影/大面积图层 */
.mat-edit-attach.is-dragover .mat-attach-dropzone,
.mat-attach-dropzone.is-dragover {
  border-color: #0d9488;
  background: #f0fdfa;
  box-shadow: none;
}
.mat-edit-layout .mat-edit-attach .attach-row,
.product-edit-layout .product-edit-attach .attach-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #F1F5F9;
}
/* 旧横排缩略图（attach-main）；迈方 attach-item/preview 不用此套 */
.mat-edit-layout .mat-edit-attach:not(.gak-std-attach) .attach-main,
.product-edit-layout .product-edit-attach .attach-main {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  cursor: pointer;
}
.mat-edit-layout .mat-edit-attach:not(.gak-std-attach) .attach-thumb,
.product-edit-layout .product-edit-attach .attach-main .attach-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #E8EAED;
  background: #F8F9FA;
  flex: 0 0 72px;
  display: block;
}
.mat-edit-layout .mat-edit-attach:not(.gak-std-attach) .attach-thumb-ph,
.product-edit-layout .product-edit-attach .attach-main .attach-thumb-ph {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  border: 1px solid #E8EAED;
  background: #F1F5F9;
  color: #94a3b8;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 72px;
}
.mat-edit-layout .mat-edit-attach .attach-meta,
.product-edit-layout .product-edit-attach .attach-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}
.mat-attach-pending-gallery-wrap {
  padding: 8px 10px !important;
  border-bottom: 1px solid #E8EAED !important;
  display: block !important;
}
.mat-attach-pending-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.mat-attach-pending-thumb {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 0;
  margin: 0;
  border: 1px solid #E8EAED;
  border-radius: 6px;
  background: #F8F9FA;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}
.mat-attach-pending-thumb:hover {
  border-color: #0d9488;
}
.mat-attach-pending-thumb img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}
.mat-attach-pending-thumb span {
  display: block;
  padding: 2px 6px 6px;
  font-size: 11px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 物料附件预览灯箱 */
.mat-attach-preview {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mat-attach-preview[hidden] { display: none !important; }
.mat-attach-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
}
.mat-attach-preview-card {
  position: relative;
  z-index: 1;
  width: min(960px, 96vw);
  height: min(860px, 92vh);
  max-height: 92vh;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #DADCE0;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mat-attach-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #E8EAED;
  flex: 0 0 auto;
}
.mat-attach-preview-head #mat-attach-preview-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mat-attach-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 12px;
}
.mat-attach-preview-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.mat-attach-preview-body iframe,
.mat-attach-preview-body embed,
.mat-attach-preview-body video,
.mat-attach-preview-body audio {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.mat-attach-preview-body .mat-preview-fallback {
  color: #e2e8f0;
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
  padding: 24px;
}
.mat-attach-preview-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #E8EAED;
  flex: 0 0 auto;
  background: #fff;
}
.mat-attach-preview-page {
  min-width: 64px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
}
#modal-module-edit .desk-card:has(.mat-edit-host),
#modal-module-view .desk-card:has(.mat-edit-host) {
  background: #fff;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.desk-form-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 6px;
}
.modal.gak-desk .modal-card-crm-quote {
  width: min(1100px, 98vw);
  max-height: min(94vh, 920px);
}
#crm-entity-section.crm-quote-plain,
#modal-module-edit .desk-card:has(.crm-quote-host),
#modal-module-view .desk-card:has(.crm-quote-host) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.crm-quote-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 2px 4px;
}
.crm-quote-wrap .crm-quote-card {
  margin: 0;
}
.crm-quote-pad {
  padding: 8px 16px 14px;
}
.crm-quote-header-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
  margin-bottom: 6px;
}
.crm-quote-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.crm-quote-line-wide {
  grid-template-columns: 72px minmax(0, 1fr);
  margin-top: 2px;
}
.crm-quote-line .desk-field {
  min-height: 28px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 2px;
}
.crm-quote-line .desk-field > input,
.crm-quote-line .desk-field > select,
.crm-quote-line .desk-field > textarea {
  color: #002FA7 !important;
  opacity: 1 !important;
  font-size: 13px;
  min-height: 26px;
}
.crm-quote-party {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 28px;
}
.crm-quote-party-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.crm-quote-party .crm-quote-line {
  grid-template-columns: 64px minmax(0, 1fr);
}
.crm-quote-detail-hint {
  margin: 0 0 6px;
  font-size: 12px;
  color: #64748b;
}
.crm-quote-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 0;
}
.crm-quote-detail-toolbar .tb-btn-primary {
  color: #0f766e;
  font-weight: 500;
}
.crm-quote-detail-toolbar .tb-btn-danger {
  color: #b91c1c;
}
.crm-quote-detail-wrap {
  overflow: auto;
  max-height: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.crm-quote-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.crm-quote-detail-table th,
.crm-quote-detail-table td {
  border-bottom: 1px solid #e8efee;
  border-right: 1px solid #e8efee;
  padding: 2px 4px;
  text-align: center;
  vertical-align: middle;
}
.crm-quote-detail-table th {
  background: #0d9488;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 400;
}
.crm-quote-detail-table input,
.crm-quote-detail-table select {
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 4px 2px;
  font: inherit;
  color: #002FA7;
  box-sizing: border-box;
  text-align: center;
}
.crm-quote-detail-table tr.selected { background: #ccfbf1; }
.crm-quote-terms-shell {
  min-height: 148px;
}
.crm-quote-terms {
  min-height: 148px !important;
  resize: vertical;
}
@media (max-width: 860px) {
  .crm-quote-header-row {
    grid-template-columns: 1fr 1fr;
  }
  .crm-quote-party {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
@media (max-width: 520px) {
  .crm-quote-header-row {
    grid-template-columns: 1fr;
  }
  .crm-quote-line,
  .crm-quote-line-wide,
  .crm-quote-party .crm-quote-line {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}
.modal.gak-desk .modal-head #modal-module-title,
.modal.gak-desk .modal-head #modal-module-edit-title {
  color: #134e4a;
  font-weight: 500;
  font-size: 14px;
}
#modal-module-view .desk-field-ro {
  background: #fff;
  min-height: 28px;
  display: flex;
  align-items: center;
}
#modal-module-view .desk-field-ro > span {
  display: block;
  width: 100%;
  padding: 4px 8px;
  font-size: 13px;
  color: #002FA7;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}
#modal-module-view .desk-span-full .desk-field-ro {
  min-height: 96px;
  align-items: flex-start;
}
.desk-field > textarea {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  color: #002FA7;
  background: transparent !important;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.4;
}
.desk-cell.desk-span-full .desk-field {
  align-items: stretch;
}
.modal.gak-desk .modal-head {
  padding: 8px 16px;
  min-height: 40px;
  background: #fff;
  border-bottom: 1px solid #E8EAED;
}
.modal.gak-desk .modal-head #modal-order-title,
.modal.gak-desk .modal-head #modal-cust-title,
.modal.gak-desk .modal-head #modal-module-title,
.modal.gak-desk .modal-head #modal-col-title,
.modal.gak-desk .modal-head .modal-title {
  color: #134e4a;
  font-weight: 500;
  font-size: 14px;
}
.modal.gak-desk .modal-head .btn-text {
  color: #64748b;
  font-size: 13px;
  padding: 4px 6px;
}
.modal.gak-desk .modal-head .btn-text:hover {
  color: #0d9488;
}
/* 表单顶部标题栏操作按钮组（销售订单新增/编辑/审核） */
.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal.gak-desk .modal-body-desk {
  background: #F0F2F5;
  padding: 16px 24px 20px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.modal.gak-desk .modal-foot {
  min-height: 40px;
  height: 40px;
  padding: 2px 16px;
  background: #fff;
  border-top: 1px solid #E8EAED;
  gap: 4px;
  box-sizing: border-box;
}
.modal.gak-desk .desk-btn-primary {
  color: #0d9488 !important;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-success {
  color: #059669 !important;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-warning {
  color: #d97706 !important;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-secondary {
  color: #64748b !important;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 13px;
}
.modal.gak-desk .desk-btn-primary:hover,
.modal.gak-desk .desk-btn-success:hover,
.modal.gak-desk .desk-btn-warning:hover,
.modal.gak-desk .desk-btn-secondary:hover {
  background: #e6f4f2 !important;
}
.desk-card {
  background: #FFFFFF;
  margin-bottom: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.desk-card:last-of-type { margin-bottom: 0; }

/* ===== 新增客户弹窗 · 左右两栏：左信息内容 / 右名片+图片附件 ===== */
/* 客户列表右侧 CRM Hub 详情页共用同一套两栏布局 */
#modal-customer .cust-edit-2col,
.crm-hub-basic-wrap .cust-edit-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
  gap: 12px;
  align-items: start;
}
#modal-customer .cust-edit-left,
.crm-hub-basic-wrap .cust-edit-left {
  min-width: 0;
}
#modal-customer .cust-edit-right,
.crm-hub-basic-wrap .cust-edit-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
}
#modal-customer .cust-edit-right > .desk-card,
.crm-hub-basic-wrap .cust-edit-right > .desk-card {
  margin-bottom: 0;
}
/* 名片正反面：单列显示（正面在上、反面在下） */
#modal-customer .cust-namecard-2col,
.crm-hub-basic-wrap .cust-namecard-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 0 12px 14px;
}
#modal-customer .cust-namecard-2col .nc-side,
.crm-hub-basic-wrap .cust-namecard-2col .nc-side {
  min-height: 200px;
}
#modal-customer .cust-basic-fields {
  min-width: 0;
}
#modal-customer .cust-basic-fields .desk-form {
  padding: 8px 0 14px;
}
#modal-customer .cust-basic-fields .desk-form-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#modal-customer .cust-basic-fields .desk-cell.desk-span-full {
  grid-column: 1 / -1;
}
#modal-customer .cust-basic-fields .desk-field-addr {
  display: block;
}
#modal-customer .cust-basic-fields .desk-addr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
#modal-customer .cust-basic-fields .desk-addr-sel {
  flex: 0 0 88px;
  min-width: 88px;
  max-width: none;
}
#modal-customer .cust-basic-fields .desk-addr-sel-dist {
  flex: 0 0 120px;
  min-width: 120px;
}
#modal-customer .cust-basic-fields .desk-addr-detail {
  flex: 1 1 calc(100% - 4px);
  min-width: 12em;
}
/* ===== 新增客户弹窗 · 左边表格式样（单元格带边框、标签灰底右对齐） ===== */
/* 客户列表右侧 CRM Hub 详情页共用同一套表格式样 */
#modal-customer .cust-edit-left .desk-card,
.crm-hub-basic-wrap .desk-card {
  background: #fff;
  border: 1px solid #d9e0e8;
  margin-bottom: 12px;
}
#modal-customer .cust-edit-left .desk-card-head,
.crm-hub-basic-wrap .desk-card-head {
  background: #f1f5f9;
  border-bottom: 1px solid #d9e0e8;
  padding: 7px 12px;
}
#modal-customer .cust-edit-left .desk-form,
.crm-hub-basic-wrap .desk-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  align-items: stretch;
  border-top: 1px solid #d9e0e8;
  border-left: 1px solid #d9e0e8;
}
#modal-customer .cust-edit-left .desk-form-4,
.crm-hub-basic-wrap .desk-form-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#modal-customer .cust-edit-left .desk-cell,
.crm-hub-basic-wrap .desk-cell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-right: 1px solid #d9e0e8;
  border-bottom: 1px solid #d9e0e8;
  padding: 0;
  min-width: 0;
  min-height: 34px;
  background: #fff;
}
#modal-customer .cust-edit-left .desk-cell > label,
.crm-hub-basic-wrap .desk-cell > label {
  flex: 0 0 86px;
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  height: auto;
  background: #f8fafc;
  border-right: 1px solid #d9e0e8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  color: #475569;
  font-weight: 500;
  font-size: 12px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
  box-sizing: border-box;
}
#modal-customer .cust-edit-left .desk-field,
.crm-hub-basic-wrap .desk-field {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
#modal-customer .cust-edit-left .desk-cell.desk-span-full,
.crm-hub-basic-wrap .desk-cell.desk-span-full {
  grid-column: 1 / -1;
}
#modal-customer .cust-edit-left .desk-subhead,
.crm-hub-basic-wrap .desk-subhead {
  grid-column: 1 / -1;
  background: #f8fafc;
  padding: 6px 8px;
  border-bottom: 1px solid #d9e0e8;
}
/* 地址等整行字段：标签固定 86px，输入区填满 */
#modal-customer .cust-edit-left .desk-field-addr,
.crm-hub-basic-wrap .desk-field-addr {
  display: block;
  padding: 4px 6px;
}
#modal-customer .cust-edit-left .desk-addr-row,
.crm-hub-basic-wrap .desk-addr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}
#modal-customer .cust-edit-left .desk-addr-sel,
.crm-hub-basic-wrap .desk-addr-sel {
  flex: 0 0 88px;
  min-width: 88px;
  max-width: none;
}
#modal-customer .cust-edit-left .desk-addr-sel-dist,
.crm-hub-basic-wrap .desk-addr-sel-dist {
  flex: 0 0 120px;
  min-width: 120px;
}
#modal-customer .cust-edit-left .desk-addr-detail,
.crm-hub-basic-wrap .desk-addr-detail {
  flex: 1 1 auto;
  min-width: 8em;
}
#modal-customer .nc-side,
.crm-hub-basic-wrap .nc-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  border: 1px solid #d7e5e3;
  border-radius: 10px;
  background: #f8fffe;
  padding: 8px;
  box-sizing: border-box;
}
#modal-customer .nc-side-label,
.crm-hub-basic-wrap .nc-side-label {
  font-size: 12px;
  font-weight: 500;
  color: #0f766e;
  letter-spacing: 0.06em;
  text-align: center;
  flex: 0 0 auto;
}
#modal-customer .cust-namecard-empty,
#modal-customer .cust-namecard-preview,
.crm-hub-basic-wrap .cust-namecard-empty,
.crm-hub-basic-wrap .cust-namecard-preview {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 8px;
}
#modal-customer .cust-namecard-empty[hidden],
#modal-customer .cust-namecard-preview[hidden],
.crm-hub-basic-wrap .cust-namecard-empty[hidden],
.crm-hub-basic-wrap .cust-namecard-preview[hidden] {
  display: none !important;
}
#modal-customer .cust-namecard-empty,
.crm-hub-basic-wrap .cust-namecard-empty {
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  border: 1px dashed #99d5cd;
  background: linear-gradient(165deg, #f8fffe 0%, #eef8f6 100%);
  padding: 16px 8px;
  cursor: pointer;
  aspect-ratio: auto;
  height: 100%;
}
#modal-customer .cust-namecard-empty:hover,
.crm-hub-basic-wrap .cust-namecard-empty:hover {
  border-color: #0d9488;
  background: #f0fdfa;
}
#modal-customer .nc-upload-icon,
.crm-hub-basic-wrap .nc-upload-icon {
  font-size: 22px;
  line-height: 1;
  opacity: 0.85;
}
#modal-customer .nc-upload-title,
.crm-hub-basic-wrap .nc-upload-title {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}
#modal-customer .nc-upload-hint,
.crm-hub-basic-wrap .nc-upload-hint {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}
#modal-customer .cust-namecard-preview,
.crm-hub-basic-wrap .cust-namecard-preview {
  gap: 6px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
#modal-customer .cust-namecard-preview img,
.crm-hub-basic-wrap .cust-namecard-preview img {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  height: 0;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: block;
}
#modal-customer .nc-slot-actions,
.crm-hub-basic-wrap .nc-slot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
}
#modal-customer .nc-ocr-status,
.crm-hub-basic-wrap .nc-ocr-status {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  word-break: break-word;
}
#modal-customer .nc-ocr-status.is-busy,
.crm-hub-basic-wrap .nc-ocr-status.is-busy {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #7dd3fc;
}
#modal-customer .nc-ocr-status.is-ok,
.crm-hub-basic-wrap .nc-ocr-status.is-ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #6ee7b7;
}
#modal-customer .nc-ocr-status.is-err,
.crm-hub-basic-wrap .nc-ocr-status.is-err {
  color: #b45309;
  background: #fff7ed;
  border-color: #fdba74;
}
#modal-customer .nc-ocr-status-global {
  grid-column: 1 / -1;
}
#modal-customer .nc-ocr-status-global[hidden] {
  display: none !important;
}
#modal-customer .nc-pick.btn,
#modal-customer .nc-reupload.btn,
.crm-hub-basic-wrap .nc-pick.btn,
.crm-hub-basic-wrap .nc-reupload.btn {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #0d9488;
  background: #fff;
  color: #0f766e;
  cursor: pointer;
}
#modal-customer .nc-pick.btn:hover,
#modal-customer .nc-reupload.btn:hover,
.crm-hub-basic-wrap .nc-pick.btn:hover,
.crm-hub-basic-wrap .nc-reupload.btn:hover {
  background: #f0fdfa;
}
#modal-customer .nc-clear-side.linkish,
.crm-hub-basic-wrap .nc-clear-side.linkish {
  font-size: 12px;
  color: #b45309;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
#modal-customer .nc-clear-side.linkish:hover,
.crm-hub-basic-wrap .nc-clear-side.linkish:hover {
  text-decoration: underline;
}
@media (max-width: 1280px) {
  #modal-customer .cust-edit-2col,
  .crm-hub-basic-wrap .cust-edit-2col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  }
}
@media (max-width: 1100px) {
  #modal-customer .cust-edit-2col,
  .crm-hub-basic-wrap .cust-edit-2col {
    grid-template-columns: 1fr;
  }
  #modal-customer .cust-edit-right,
  .crm-hub-basic-wrap .cust-edit-right {
    flex-direction: row;
    align-items: stretch;
    position: static;
  }
  #modal-customer .cust-edit-right > .desk-card,
  .crm-hub-basic-wrap .cust-edit-right > .desk-card {
    flex: 1 1 50%;
    min-width: 0;
  }
}
@media (max-width: 860px) {
  #modal-customer .cust-edit-right,
  .crm-hub-basic-wrap .cust-edit-right {
    flex-direction: column;
  }
  #modal-customer .cust-namecard-2col,
  .crm-hub-basic-wrap .cust-namecard-2col {
    grid-template-columns: 1fr;
  }
}
.desk-card-flash {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
}
.crm-hub-sub {
  padding: 6px 16px;
  font-size: 12px;
  color: #64748b;
  background: #f8fffe;
  border-bottom: 1px solid #e8eaed;
}
.crm-hub-sub strong { color: #0f766e; font-weight: 500; }
.crm-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 12px 0;
  background: #F0F2F5;
  border-bottom: 1px solid #e8eaed;
}
.crm-hub-tab {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-family: "Microsoft YaHei";
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.crm-hub-tab:hover { background: #e6f4f2; color: #0f766e; }
.crm-hub-tab.active {
  background: #fff;
  color: #0f766e;
  font-weight: 500;
  box-shadow: 0 -1px 0 #fff;
}
.crm-hub-tab em {
  font-style: normal;
  color: #94a3b8;
  margin-left: 4px;
  font-weight: 500;
}
.crm-hub-tab.active em { color: #0d9488; }
.crm-hub-body {
  flex: 1;
  min-height: 0;
  padding: 12px 20px 16px !important;
  background: #F0F2F5 !important;
}
.crm-hub-basic-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crm-hub-basic-wrap .desk-card {
  margin-bottom: 0;
}
.crm-hub-basic-wrap .cust-edit-left .crm-hub-card {
  margin-bottom: 12px !important;
}
.crm-hub-basic-wrap .cust-edit-left .crm-hub-card:last-child {
  margin-bottom: 0 !important;
}
.crm-hub-card {
  margin-bottom: 0 !important;
  border: 1px solid #d9e0e8 !important;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}
.crm-hub-card .desk-card-head {
  background: #f1f5f9;
  border-bottom: 1px solid #d9e0e8;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.crm-hub-card .desk-card-head .desk-card-code {
  color: #64748b;
  font-size: 12px;
}
.crm-hub-card .desk-card-head .crm-hub-basic-edit,
.crm-hub-card .desk-card-head .crm-hub-basic-edit-actions {
  margin-left: auto;
  flex-shrink: 0;
}
.crm-hub-basic-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.crm-hub-basic-wrap.is-editing .desk-field {
  background: #fff;
}
.crm-hub-basic-wrap.is-editing .desk-field > input,
.crm-hub-basic-wrap.is-editing .desk-field > select,
.crm-hub-basic-wrap.is-editing .desk-field > textarea {
  color: #002FA7;
}
/* 详情页只读态：与「新增客户弹窗」输入框同式样（蓝字、可读灰底） */
.crm-hub-basic-wrap .desk-field > input:read-only,
.crm-hub-basic-wrap .desk-field > textarea:read-only {
  color: #002FA7;
  background: #fff;
}
.crm-hub-basic-wrap .desk-field > select:disabled {
  color: #002FA7;
  background: #fff;
  opacity: 1;
  -webkit-text-fill-color: #002FA7;
}
.crm-hub-basic-wrap .desk-field > input:disabled {
  color: #002FA7;
  background: #fff;
  -webkit-text-fill-color: #002FA7;
  opacity: 1;
}
.crm-hub-card .desk-form {
  background: #fff;
}
.crm-hub-card .desk-cell-span,
.crm-hub-card .desk-span-full {
  grid-column: 1 / -1;
}
.crm-hub-card .desk-field-ro {
  background: #fff;
  min-height: 28px;
  display: flex;
  align-items: center;
}
.crm-hub-card .desk-field-ro > span {
  display: block;
  width: 100%;
  padding: 4px 8px;
  font-size: 13px;
  color: #002FA7;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}
.crm-hub-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
  border: 1px solid #DADCE0;
  border-radius: 0;
  background: #fff;
}
.crm-hub-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.crm-hub-table th,
.crm-hub-table td {
  border-bottom: 1px solid #e8efee;
  border-right: 1px solid #e8efee;
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crm-hub-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0d9488;
  color: #fff;
  font-weight: 500;
}
.crm-hub-table tbody tr:nth-child(even) { background: #f8fffe; }
.crm-hub-table tbody tr:hover { background: #e6f4f2; }
.crm-hub-table tbody tr.selected { background: #99f6e4 !important; }
.crm-hub-table tbody tr { cursor: pointer; }
.crm-hub-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
.crm-hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.crm-hub-toolbar .tb-btn { min-height: 28px; }
.crm-hub-empty {
  padding: 28px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
/* CRM 行内编辑样式 */
.crm-hub-table tbody tr.crm-editing { background: #fef3c7 !important; }
.crm-hub-table tbody tr.crm-editing:hover { background: #fde68a !important; }
.crm-inline-edit-cell { padding: 2px 4px !important; }
.crm-inline-edit-cell input,
.crm-inline-edit-cell select,
.crm-inline-edit-cell textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
  text-align: left;
}
.crm-inline-edit-cell input:focus,
.crm-inline-edit-cell select:focus,
.crm-inline-edit-cell textarea:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}
.crm-inline-edit-cell textarea {
  resize: vertical;
  min-height: 36px;
}
.crm-inline-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 70px;
  padding: 4px !important;
}
.crm-inline-action .tb-btn {
  width: 100%;
  min-height: 24px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.4;
}
.crm-new-row { opacity: 0.95; }
.crm-new-row-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #22c55e;
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
.crm-new-row-highlight {
  animation: crmNewRowPulse 0.5s ease-out;
}
@keyframes crmNewRowPulse {
  0% { background-color: #86efac !important; box-shadow: 0 0 0 4px #86efac; }
  100% { background-color: #fef3c7 !important; box-shadow: none; }
}
.crm-new-row td { font-weight: 500; }
@media (max-width: 1200px) {
  .crm-hub-card .desk-form-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-hub-card .desk-form-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .crm-hub-card .desk-form-5 { grid-template-columns: 1fr; }
  .crm-hub-card .desk-form-4 { grid-template-columns: 1fr; }
}
.desk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 6px;
  border-bottom: 1px solid #E8EAED;
}
.desk-card-title {
  color: #134e4a;
  font-size: 13px;
  font-weight: 500;
}
.desk-card-code {
  color: #0d9488;
  font-size: 13px;
  white-space: nowrap;
}
.desk-card-code b { font-weight: 500; }
.desk-card-pad { padding: 12px 20px 14px; }

/* 5 组「标签+输入」：标签在左锁宽，输入框跨行竖线对齐 */
.desk-form {
  --desk-label-w: 96px;
  display: grid;
  gap: 10px 0;
  padding: 8px 12px 14px;
  align-items: center;
}
.desk-form-stack {
  grid-template-columns: 1fr;
  column-gap: 0;
}
.desk-form-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 6px;
}
.desk-form-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 6px;
}
.desk-form-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 6px;
}
.desk-form-8 {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  column-gap: 6px;
}
/* ── 材料入库弹窗：对标桌面 WMS_INOUT_MODAL（1600×内容收高，minW=1200） ── */
.modal.gak-desk .modal-card-desk-ib-edit {
  width: min(1600px, 98vw);
  min-width: min(1200px, 98vw);
  height: min(900px, 94vh);
  max-height: min(94vh, 900px);
  min-height: min(900px, 94vh);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-ib-edit .modal-body-desk {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #F0F2F5;
  padding: 16px 24px 20px;
}
/* 隐藏外层通用「基本信息」壳，避免与表单内卡片标题重复 */
.modal.gak-desk .modal-card-desk-ib-edit .modal-body-desk > .desk-card,
.modal.gak-desk .modal-card-desk-ib-edit .modal-body-desk > .desk-card.ib-outer-flat {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}
.modal.gak-desk .modal-card-desk-ib-edit .modal-body-desk > .desk-card > .desk-card-head,
.modal.gak-desk .ib-outer-flat > .desk-card-head {
  display: none !important;
}
.ib-inbound-form-host {
  display: block;
  padding: 0 !important;
  margin: 0;
  background: transparent;
  border: 0;
}
.ib-inbound-host {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ib-card {
  background: #FFFFFF;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.ib-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 2px;
  border-bottom: 0;
}
.ib-card-head::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: #E8EAED;
}
.ib-card-head {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: 2px;
}
.ib-card-title {
  color: #202124;
  font-size: 13px;
  font-weight: 500;
}
.ib-card-no {
  margin-left: auto;
  color: #1A73E8;
  font-size: 12px;
  white-space: nowrap;
}
.ib-card-no b {
  font-weight: 500;
  color: #1A73E8;
}
.ib-card-body {
  padding: 8px 20px 12px;
}
.ib-header-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ib-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}
.ib-header-row-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.ib-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ib-field-full {
  width: 100%;
}
.ib-field-span2 {
  grid-column: span 2;
}
.ib-field > label {
  flex: 0 0 72px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: right;
  color: #5F6368;
  font-size: 12px;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
}
.ib-field-span2 > label {
  flex-basis: 80px;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}
.ib-control {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid #E8EAED;
  background: #fff;
  box-sizing: border-box;
}
.ib-control.is-ro {
  background: #fff;
}
.ib-control > input,
.ib-control > select,
.ib-control > textarea {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  color: #002FA7;
  background: transparent !important;
  box-sizing: border-box;
  height: 28px;
  line-height: 20px;
}
.ib-control > textarea {
  height: auto;
  min-height: 56px;
  resize: vertical;
  line-height: 1.4;
  padding: 6px 8px;
}
.ib-control:focus-within {
  border-color: #0d9488;
  box-shadow: 0 0 0 1px #0d9488;
}
/* 样品参数：readonly 预览模式下空字段显示「未填写」灰字占位 */
.ib-control.is-empty-hint {
  border-style: dashed;
  border-color: #D0D5DD;
  background: #FAFBFC;
}
.ib-control.is-empty-hint > input.sa-empty-hint,
.ib-control.is-empty-hint > textarea.sa-empty-hint {
  color: #98A2B3;
  font-style: italic;
}
.ib-inbound-detail .ib-card-head {
  flex-wrap: nowrap;
}
/* ── 采购/报价弹窗明细卡（对标桌面 detail_card） ── */
.ib-detail-card {
  background: #FFFFFF;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 20px 12px;
}
.ib-detail-title {
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  padding: 10px 0 8px;
  border-bottom: 1px solid #E8EAED;
  margin-bottom: 8px;
}
.ib-detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
/* ── 审批信息栏（对齐桌面 _audit_bar：内容区底边） ── */
.ib-audit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  background: #FFFFFF;
  border-top: 1px solid #E8EAED;
  padding: 8px 20px 12px;
}
.ib-audit-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.ib-audit-item em {
  font-style: normal;
  font-size: 12px;
  color: #5F6368;
}
.ib-audit-item b {
  font-size: 12px;
  font-weight: 500;
  color: #1565C0;
}
.ib-audit-item.is-revoke b {
  color: #E65100;
}
/* ── 采购明细合计行（对齐桌面 summary_row 浅蓝底） ── */
.po-summary-row {
  background: #E3F2FD !important;
}
.po-summary-row td {
  font-weight: 500;
  color: #1565C0;
  border-top: 1px solid #BBDEFB;
}
.po-summary-row .po-summary-label {
  color: #202124;
}
/* ── 供应商弹窗头部布局（左主列 + 右附件列，对标桌面供应商弹窗） ── */
.sp-header-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-basic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 12px;
  align-items: start;
}
.sp-main-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-attach-panel {
  flex: 1 1 auto;
  min-height: 140px;
}
.sp-region-row .ib-field {
  flex: 1 1 0;
}
.ib-detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ib-detail-body {
  /* 与 .ib-card-body 左右 20px 对齐，避免明细比基本信息更宽 */
  padding: 8px 20px 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ib-detail-wrap {
  /* 不再限高：明细行数随业务自然展开，超长时由外层表单整体滚动 */
  overflow-x: auto;
  overflow-y: visible;
  margin: 0;
  border: 1px solid #E8EAED;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: none;
}
.ib-detail-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
}
.ib-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1e3a5f !important;
  color: #fff !important;
  font-weight: 500;
  font-size: 12px;
  text-align: center;
  border-bottom: 1px solid #152a45;
  padding: 6px 8px;
  white-space: nowrap;
}
.ib-detail-table th,
.ib-detail-table td {
  white-space: nowrap;
  padding: 3px 6px;
  border-right: 1px solid #E8EAED;
  border-bottom: 1px solid #F1F5F9;
}
.ib-detail-table th.col-idx,
.ib-detail-table td.col-idx {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  text-align: center;
  color: #64748b;
}
.ib-detail-table tbody td {
  background: #fff;
  text-align: center;
}
.ib-detail-table input {
  width: 100%;
  min-width: 0; /* 勿用固定 min-width 撑破列宽/卡片 */
  max-width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #002FA7;
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
  box-sizing: border-box;
  height: 26px;
  text-align: center;
}
.ib-detail-table input:focus {
  border-color: #0d9488;
  background: #fff;
  outline: none;
}
.ib-detail-table input[type="number"] {
  min-width: 64px;
}
/* 明细行删除按钮：默认隐藏，鼠标滑过行时显示 */
.ib-detail-row .ib-row-del-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.ib-detail-row:hover .ib-row-del-btn {
  opacity: 1;
  visibility: visible;
}
.ib-row-del-btn:hover {
  color: #dc2626;
  background: #fee2e2;
  border-radius: 3px;
}
/* 明细行行内悬浮「删」按钮：挂在最后一个单元格右侧，鼠标滑过行才显示（非操作列） */
.ib-detail-table .ib-detail-last {
  position: relative;
}
.ib-detail-row .ib-row-del-float {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 3;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 4px;
  color: #ef4444;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.ib-detail-row:hover .ib-row-del-float {
  opacity: 1;
  visibility: visible;
}
.ib-row-del-float:hover {
  color: #dc2626;
  background: #fee2e2;
  border-color: #fca5a5;
}
.ib-row-action {
  text-align: center;
  vertical-align: middle;
}

/* ── 采购入库单：专业单据式样（对标参考图） ── */
.ib-voucher {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 15px;
}
.ib-voucher-sheet {
  background: #fff;
  border: 1px solid #c5d0de;
  box-shadow: 0 2px 10px rgba(30, 58, 95, 0.08);
  padding: 18px 22px 16px;
  box-sizing: border-box;
  max-width: 1180px;
  margin: 0 auto;
}
.ib-voucher-title {
  text-align: center;
  font-size: 26px !important;
  font-weight: 500 !important;
  letter-spacing: 0.35em;
  color: #1e3a5f;
  margin: 4px 0 20px;
  padding-bottom: 0;
  border-bottom: none !important;
  box-shadow: none !important;
  font-family: "SimHei", "Microsoft YaHei", sans-serif;
}
.ib-voucher-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-bottom: 10px;
}
/* 表头：左字段网格 + 右附件，2:1 布局 */
.ib-voucher-head {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0 20px;
  align-items: stretch;
  margin: 0 0 14px;
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 55%);
  border: 1px solid #d7e0ec;
  box-sizing: border-box;
}
.ib-voucher-head-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ib-voucher-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 14px;
  align-items: center;
}
.ib-voucher-meta-grid > .ib-voucher-meta-item.is-span-all {
  grid-column: 1 / -1;
}
.ib-voucher-head-attach {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px dashed #c5d0de;
  padding-left: 16px;
}
.ib-voucher-head-attach .ib-voucher-attach,
.ib-voucher-head-attach .mat-edit-attach {
  flex: 1 1 auto;
  min-height: 118px;
  height: 100%;
  margin: 0;
  border: 1px dashed #94a3b8;
  background: #fff;
  border-radius: 2px;
  box-sizing: border-box;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.ib-voucher-head-attach .gak-std-attach-bar,
.ib-voucher-head-attach .section-bar {
  margin-bottom: 4px;
  flex: 0 0 auto;
}
.ib-voucher-head-attach #mat-attach-title,
.ib-voucher-head-attach .section-title {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #1e3a5f !important;
  letter-spacing: 0.06em;
}
.ib-voucher-head-attach .attach-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 48px;
  overflow: auto;
}
.ib-voucher-head-attach .attach-drop-hint,
.ib-voucher-head-attach #mat-attach-hint {
  font-size: 11px !important;
  color: #94a3b8 !important;
  margin: 4px 0 0;
  line-height: 1.35 !important;
}
.ib-voucher-head-attach #mat-attach-status {
  display: none;
}
.ib-voucher-meta-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.ib-voucher-meta-item {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}
.ib-voucher-meta-item.is-wide {
  width: 100%;
}
.ib-voucher-meta-label {
  flex: 0 0 4.5em;
  width: 4.5em;
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  text-align: justify;
  text-align-last: justify;
  letter-spacing: 0;
}
.ib-voucher-meta-colon {
  flex: 0 0 auto;
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  margin-right: 6px;
}
.ib-voucher-meta-item .ib-control {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  border-bottom: 1px solid #94a3b8;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.ib-voucher-meta-item .ib-control:focus-within {
  border-color: #1e3a5f;
  box-shadow: none;
}
.ib-voucher-meta-item .ib-control > input,
.ib-voucher-meta-item .ib-control > select,
.ib-voucher-meta-item .ib-control > textarea {
  color: #0f172a !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  height: 30px;
  padding: 2px 2px;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.ib-voucher-meta-item .ib-control > select {
  cursor: pointer;
}
.ib-voucher-meta-remark {
  margin: 4px 0 0;
}
.ib-voucher-meta-remark .ib-voucher-meta-item {
  align-items: flex-start;
}
.ib-voucher-meta-remark .ib-control {
  border: 1px solid #cbd5e1;
  border-radius: 2px;
}
.ib-voucher-meta-remark .ib-control > textarea {
  min-height: 48px;
  font-size: 14px;
}
.ib-voucher-table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 6px;
}
.ib-voucher-table-wrap {
  max-height: none;
  border: 1px solid #1e3a5f;
  margin-bottom: 0;
}
.ib-voucher-table thead th {
  background: #1e3a5f !important;
  color: #fff !important;
  border-bottom: 1px solid #152a45;
  border-right: 1px solid #2c4a6e;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 9px 8px;
  text-align: center !important;
}
.ib-voucher-table thead th[data-col]:not(.col-idx) {
  cursor: grab;
}
.ib-voucher-table thead th.col-dragging {
  cursor: grabbing;
}
#ib-detail-table.ib-voucher-table thead th,
#ib-detail-table.ib-voucher-table thead th.col-idx,
#ib-detail-table.ib-detail-table.ib-voucher-table thead th {
  background: #1e3a5f !important;
  color: #fff !important;
  border-bottom-color: #152a45 !important;
}
.ib-voucher-table th,
.ib-voucher-table td {
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px !important;
}
.ib-voucher-table .col-hidden {
  display: none !important;
}
.ib-voucher-table tbody td {
  background: #fff;
  text-align: center;
}
.ib-voucher-table tbody tr.ib-detail-row:nth-child(even) td {
  background: #f8fafc;
}
.ib-voucher-table tbody tr.ib-detail-row:hover td {
  background: #eef4fb;
}
.ib-voucher-table.ib-detail-table input {
  font-size: 13px !important;
  height: 30px;
  padding: 3px 4px;
  text-align: inherit;
}
.ib-voucher-table .ib-qty-cell,
.ib-voucher-table .ib-qty-cell input {
  text-align: center !important;
}
.ib-voucher-table .ib-money-cell {
  text-align: right !important;
  white-space: nowrap;
}
.ib-voucher-table .ib-money-cell input {
  text-align: right !important;
  display: inline-block;
  width: calc(100% - 14px);
  max-width: 96px;
  vertical-align: middle;
}
.ib-voucher-table .ib-rmb-prefix {
  display: inline-block;
  width: 12px;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  vertical-align: middle;
}
.ib-voucher-table .ib-num-cell input,
.ib-voucher-table input[type="number"] {
  text-align: right;
}
.ib-voucher-total-row td,
.ib-voucher-total-row .ib-total-cell {
  background: #e8eef6 !important;
  font-weight: 500;
  color: #1e3a5f;
  border-top: 1px solid #1e3a5f;
  padding: 8px 6px;
  font-size: 14px;
}
.ib-voucher-total-row .ib-total-label {
  text-align: center;
  letter-spacing: 0.2em;
}
.ib-voucher-total-row .ib-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ib-voucher-amount-words {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 10px;
  padding: 10px 4px 6px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 15px;
  color: #1e293b;
}
.ib-voucher-amount-label {
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
}
.ib-voucher-amount-cn {
  font-weight: 500;
  color: #0f172a;
  letter-spacing: 0.04em;
  font-size: 16px;
}
.ib-voucher-amount-num {
  margin-left: auto;
  color: #475569;
  font-size: 14px;
}
.ib-voucher-amount-num b {
  color: #1e3a5f;
  font-size: 15px;
}
.ib-voucher-signs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 14px;
  padding-top: 4px;
}
.ib-voucher-sign {
  display: flex;
  align-items: baseline;
  gap: 2px;
  min-width: 0;
  font-size: 15px;
  color: #334155;
  border-bottom: 1px solid #94a3b8;
  padding-bottom: 4px;
  min-height: 30px;
}
.ib-voucher-sign span {
  flex: 0 0 auto;
  font-weight: 500;
  white-space: nowrap;
}
.ib-voucher-sign em {
  font-style: normal;
  margin-right: 4px;
}
.ib-voucher-sign b {
  flex: 1 1 auto;
  font-weight: 500;
  color: #0f172a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal.gak-desk .modal-card-desk-ib-edit .ib-voucher-sheet {
  max-width: none;
}
/* ── 物料代码可搜索下拉框 ── */
.ib-mat-combo {
  position: relative;
  width: 100%;
  min-width: 0;
}
.ib-mat-combo-input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  color: #002FA7;
  background: transparent !important;
  box-sizing: border-box;
  height: 28px;
  line-height: 20px;
  cursor: text;
}
.ib-mat-combo-dropdown {
  position: fixed;
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #E8EAED;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  display: none;
  min-width: 620px;
  box-sizing: border-box;
}
.ib-mat-combo-dropdown.is-open {
  display: block;
}
.ib-mat-combo-item {
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  border-bottom: 1px solid #f1f5f9;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left !important;
}
.ib-mat-combo-item.ib-mat-4col {
  grid-template-columns: 130px 180px minmax(180px, 1fr) 180px;
  gap: 10px;
}
.ib-mat-combo-item:last-child {
  border-bottom: 0;
}
.ib-mat-combo-item:hover,
.ib-mat-combo-item.is-active {
  background: #eff6ff;
  color: #1e3a5f;
}
.ib-mat-combo-item .mat-code {
  font-weight: 500;
  color: #1e3a5f;
  white-space: nowrap;
  text-align: left !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-mat-combo-item .mat-name {
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
  min-width: 0;
  display: block;
}
.ib-mat-combo-item .mat-spec {
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: left;
  border-left: 1px dashed #e2e8f0;
  padding-left: 8px;
}
.ib-mat-combo-item .mat-extra {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.ib-mat-combo-item .mat-supplier {
  color: #059669;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.ib-mat-combo-item .mat-warehouse {
  color: #6366f1;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-mat-combo-empty {
  padding: 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
/* FAI 首件检验：工单编号/物料代码可搜索下拉（单行选项，对齐统一下拉式样） */
.ib-mat-combo-item.fai-combo-item {
  display: block;
  padding: 5px 10px;
}
@media (max-width: 900px) {
  .ib-voucher-meta {
    grid-template-columns: 1fr;
  }
  .ib-voucher-head {
    grid-template-columns: 1fr;
  }
  .ib-voucher-head-attach {
    border-left: 0;
    border-top: 1px dashed #c5d0de;
    padding-left: 0;
    padding-top: 12px;
  }
  .ib-voucher-meta-grid {
    grid-template-columns: 1fr;
  }
  .ib-voucher-signs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ib-voucher-title {
    font-size: 22px !important;
    letter-spacing: 0.22em;
  }
}
/* 样品明细行内删除（对标销售订单明细 col-line-del / 删） */
#sa-detail-table th.col-line-del,
#sa-detail-table td.col-line-del {
  width: 44px;
  min-width: 44px;
  max-width: 48px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  cursor: default;
  user-select: none;
}
#sa-detail-table td.col-line-del .sa-detail-del,
#sa-detail-table td.col-line-del .so-line-del {
  min-width: 0;
  padding: 0 4px;
  font-size: 12px;
  color: #c0392b;
  border: none;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
#sa-detail-table td.col-line-del .sa-detail-del:hover,
#sa-detail-table td.col-line-del .so-line-del:hover {
  color: #922b21;
  text-decoration: underline;
}
#sa-detail-table.resizable th {
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
#sa-detail-table th.col-idx,
#sa-detail-table th.col-line-del {
  cursor: default;
}
#sa-detail-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}
/* 样品明细：限制在卡片宽度内横向滚动，不撑破 1600 内容区 */
.sa-sample-host {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
.sa-sample-host .sa-sample-detail,
.sa-sample-host .sa-sample-info,
.sa-sample-host .sa-sample-footer,
.sa-sample-host .sa-params-host {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.sa-sample-host .sa-sample-detail {
  /* 不再 hidden：让明细行能按内容自然展开 */
  overflow: visible;
}
.sa-sample-host .sa-sample-detail .ib-detail-wrap.desk-lines {
  /* 样品明细：不限制纵向高度，明细行数随业务自然展开 */
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: none;
}
#modal-module-edit.is-sample-create-page #module-edit-form,
#modal-module-edit.is-sample-create-page .modal-body-desk {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
@media (max-width: 1100px) {
  .ib-header-row-6 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ib-field-span2 {
    grid-column: span 2;
  }
}
@media (max-width: 720px) {
  .ib-header-row-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ib-field-span2 {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .ib-header-row-6 {
    grid-template-columns: 1fr;
  }
  .ib-field-span2 {
    grid-column: auto;
  }
  .ib-field > label,
  .ib-field-span2 > label {
    flex-basis: 88px;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
  }
}
.desk-form-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 6px;
}
.desk-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding-right: 0;
  box-sizing: border-box;
}
.desk-cell > label {
  flex: 0 0 var(--desk-label-w);
  width: var(--desk-label-w);
  min-width: var(--desk-label-w);
  max-width: var(--desk-label-w);
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  margin: 0;
  line-height: 1.2;
  box-sizing: border-box;
}
.desk-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid #E8EAED;
  border-radius: 0;
  background: #fff;
  box-sizing: border-box;
}
.desk-field:focus-within {
  border-color: #0d9488;
  box-shadow: 0 0 0 1px #0d9488;
}
.desk-field > input,
.desk-field > select,
.desk-field > textarea {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  color: #002FA7;
  background: transparent !important;
  box-sizing: border-box;
  height: 28px;
  line-height: 20px;
}
.desk-field > input[type="date"],
.desk-field > input[type="datetime-local"] {
  color-scheme: light;
  cursor: pointer;
  min-height: 28px;
  padding-right: 4px;
}
.desk-field > input[type="date"]::-webkit-calendar-picker-indicator,
.desk-field > input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
.desk-field > select {
  padding-right: 4px;
  cursor: pointer;
}
.desk-field > input:disabled,
.desk-field > select:disabled {
  color: #64748b;
  background: #F8F9FA !important;
}
.desk-span-2 { grid-column: span 2; }
.desk-span-full {
  grid-column: 1 / -1;
  padding-right: 0 !important;
}
.desk-span-full > label {
  flex: 0 0 var(--desk-label-w);
  width: var(--desk-label-w);
  min-width: var(--desk-label-w);
  max-width: var(--desk-label-w);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 不满整行：仍占满父网格列宽，便于与 5 列字段竖线对齐（优先直接放 desk-cell，少用本包装） */
.desk-row {
  grid-column: 1 / -1;
  display: grid;
  column-gap: 6px;
  align-items: center;
  min-width: 0;
}
.desk-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desk-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.desk-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 子网格与父 5 列同轨：不满 5 个字段时输入框仍与上方列对齐 */
.desk-form-5 > .desk-row.desk-row-align-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.desk-field-addr {
  flex-wrap: nowrap;
  padding: 0;
  gap: 0;
}
.desk-addr-row {
  display: flex;
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  padding: 0;
  box-sizing: border-box;
}
.desk-addr-sel {
  width: 108px;
  flex: 0 0 108px;
  height: 28px;
  border: 0 !important;
  border-right: 1px solid #E8EAED !important;
  border-radius: 0 !important;
  padding: 0 4px !important;
  font-size: 13px !important;
  background: transparent !important;
  color: #002FA7;
  box-sizing: border-box;
  outline: none !important;
  box-shadow: none !important;
}
.desk-addr-sel-dist {
  width: 200px;
  flex: 0 0 200px;
  min-width: 200px;
}
.desk-addr-detail {
  flex: 1;
  min-width: 0;
  height: 28px;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 8px !important;
  font-size: 13px !important;
  background: transparent !important;
  color: #002FA7;
  box-sizing: border-box;
  outline: none !important;
  box-shadow: none !important;
}
.desk-addr-sel:focus,
.desk-addr-detail:focus {
  border-color: #E8EAED !important;
  outline: none;
}
.desk-subhead {
  grid-column: 1 / -1;
  font-weight: 500;
  color: #134e4a;
  font-size: 12px;
  padding: 10px 0 2px;
}
.desk-lines {
  margin: 0 20px 14px;
  border: 1px solid #E8EAED;
  border-radius: 0;
  background: #fff;
}
.modal.gak-desk .attach-list {
  margin: 0;
  padding: 0;
}
.modal.gak-desk .attach-list li {
  border-color: #E8EAED;
  border-radius: 0;
}
.desk-attach-panel {
  margin: 0 20px 14px;
  border: 1px solid #E8EAED;
  background: #fff;
  box-sizing: border-box;
  min-height: 44px;
}
.crm-hub-attach-panel {
  margin: 0 12px 14px;
}
.desk-attach-panel .attach-list {
  margin: 0;
}
.desk-attach-panel .attach-list li {
  margin: 0;
  border: 0;
  border-bottom: 1px solid #E8EAED;
  border-radius: 0;
  padding: 8px 10px;
}
.desk-attach-panel .attach-list li:last-child { border-bottom: 0; }
.desk-attach-panel .attach-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 2px;
}
#plm-attach-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 产品/技术文档：左表单 + 右附件（固定尺寸侧栏，对标图示）；备注通栏；BOM 在下 */
.product-edit-host {
  display: block;
  min-height: 0;
  box-sizing: border-box;
}
/* 右侧附件栏固定宽 280px；高度与左侧基本信息字段区对齐拉伸 */
.product-edit-layout {
  --product-attach-w: 280px;
  --product-head-h: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--product-attach-w);
  grid-template-rows: auto;
  gap: 10px 12px;
  padding: 8px 12px 10px;
  box-sizing: border-box;
  align-content: start;
  align-items: start;
  min-height: 0;
  /* 勿 height:100% + minmax(0,*)，会把通栏备注裁进不可见区域 */
}
.product-edit-layout.has-remark {
  grid-template-rows: auto auto;
}
.product-edit-layout.has-remark.has-bom {
  grid-template-rows: auto auto auto;
}
.product-edit-layout.has-bom:not(.has-remark) {
  grid-template-rows: auto auto;
}
.product-edit-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: visible;
  align-self: stretch;
}
.product-edit-main > .desk-form-2 {
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  /* 行高均分，版本/备注与各列底边对齐，不再一高一低 */
  align-content: stretch;
  grid-auto-rows: minmax(32px, 1fr);
}
.product-edit-main .desk-form-2 > .desk-cell {
  align-self: stretch;
  align-items: center;
  min-height: 0;
}
.product-edit-main .desk-form-2 > .desk-cell > .desk-field {
  align-self: stretch;
  min-height: 28px;
  height: 28px;
  max-height: 28px;
}
.product-edit-remark {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}
.product-edit-remark > .desk-cell {
  width: 100%;
  box-sizing: border-box;
}
.product-edit-remark textarea {
  min-height: 52px;
}
/*
  右侧附件槽：定宽；高度与左侧基本信息对齐。
  分栏切行时禁止 height:0 塌缩（否则左侧重建瞬间右侧跟着跳）。
*/
.product-edit-layout > .product-edit-attach {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  width: var(--product-attach-w);
  min-width: var(--product-attach-w);
  max-width: var(--product-attach-w);
  min-height: var(--product-head-h);
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.product-edit-layout > .product-edit-attach > .gak-std-attach {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}
/* 备注与版本同行：强制单行高，与普通输入框底边齐平 */
.product-edit-main .desk-form-2 > .desk-cell textarea[data-mod-field="备注"] {
  min-height: 28px !important;
  height: 28px !important;
  max-height: 28px !important;
  line-height: 20px !important;
  padding: 4px 8px !important;
  resize: none !important;
  overflow: hidden;
  box-sizing: border-box;
}
/* 产品分栏：上半区（基本信息+附件）同高同底 */
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-layout,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-layout,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .product-edit-layout {
  --product-attach-w: 260px;
  --product-head-h: var(--gak-product-head-h, 300px);
  padding: 6px 8px 8px;
  grid-template-columns: minmax(0, 1fr) var(--product-attach-w);
  grid-template-rows: var(--product-head-h) minmax(0, auto);
  align-items: stretch;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-layout.has-bom,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-layout.has-bom,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .product-edit-layout.has-bom {
  grid-template-rows: var(--product-head-h) minmax(0, 1fr);
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-main,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-main {
  height: var(--product-head-h);
  min-height: var(--product-head-h);
  max-height: var(--product-head-h);
  overflow: hidden;
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-main > .desk-form-2,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-main > .desk-form-2 {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-layout > .product-edit-attach .attach-list,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-layout > .product-edit-attach .attach-list {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-edit-layout > .product-edit-attach,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-edit-layout > .product-edit-attach {
  height: var(--product-head-h) !important;
  min-height: var(--product-head-h) !important;
  max-height: var(--product-head-h);
  align-self: stretch;
}
@media (max-width: 1100px) {
  .product-edit-layout {
    --product-attach-w: 100%;
    grid-template-columns: 1fr;
  }
  .product-edit-layout > .product-edit-attach {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
  }
}

/* 对标迈方 #attach-section / #plm-attach-section */
#modal-module-edit .gak-std-attach,
#modal-module-view .gak-std-attach,
.mat-edit-layout .gak-std-attach,
.product-edit-layout .gak-std-attach {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 180px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #E8EAED;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
  outline: none;
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
#modal-module-edit .gak-std-attach .gak-std-attach-bar,
#modal-module-view .gak-std-attach .gak-std-attach-bar,
.mat-edit-layout .gak-std-attach .gak-std-attach-bar,
.product-edit-layout .gak-std-attach .gak-std-attach-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
#modal-module-edit .gak-std-attach .section-title,
#modal-module-view .gak-std-attach .section-title,
.mat-edit-layout .gak-std-attach .section-title,
.product-edit-layout .gak-std-attach .section-title {
  font-weight: 500;
  font-size: 13px;
  color: #1e293b;
  margin: 0;
}
#modal-module-edit .gak-std-attach .file-btn,
#modal-module-view .gak-std-attach .file-btn,
.mat-edit-layout .gak-std-attach .file-btn,
.product-edit-layout .gak-std-attach .file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
#modal-module-edit .gak-std-attach .attach-list,
#modal-module-view .gak-std-attach .attach-list,
.mat-edit-layout .gak-std-attach .attach-list,
.product-edit-layout .gak-std-attach .attach-list {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
}
.product-edit-layout .gak-std-attach .attach-list {
  max-height: none;
}
#modal-module-edit .gak-std-attach .attach-item,
#modal-module-view .gak-std-attach .attach-item,
.mat-edit-layout .gak-std-attach .attach-item,
.product-edit-layout .gak-std-attach .attach-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  border: 1px solid #E8EAED;
  border-radius: 10px;
  background: #fff;
}
#modal-module-edit .gak-std-attach .attach-preview,
#modal-module-view .gak-std-attach .attach-preview,
.mat-edit-layout .gak-std-attach .attach-preview,
.product-edit-layout .gak-std-attach .attach-preview {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #E8EAED;
}
#modal-module-edit .gak-std-attach .attach-thumb,
#modal-module-view .gak-std-attach .attach-thumb,
.mat-edit-layout .gak-std-attach .attach-thumb,
.product-edit-layout .gak-std-attach .attach-thumb {
  display: block;
  width: 100%;
  max-height: 160px;
  min-height: 72px;
  object-fit: contain;
  cursor: pointer;
  background: #f8fafc;
}
#modal-module-edit .gak-std-attach .attach-thumb-ph,
#modal-module-view .gak-std-attach .attach-thumb-ph,
.mat-edit-layout .gak-std-attach .attach-thumb-ph,
.product-edit-layout .gak-std-attach .attach-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  max-height: 160px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 13px;
  border: 1px dashed #cbd5e1;
}
#modal-module-edit .gak-std-attach .attach-name-row,
#modal-module-view .gak-std-attach .attach-name-row,
.mat-edit-layout .gak-std-attach .attach-name-row,
.product-edit-layout .gak-std-attach .attach-name-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
#modal-module-edit .gak-std-attach .attach-name-row > a,
#modal-module-edit .gak-std-attach .attach-name-row > span,
#modal-module-view .gak-std-attach .attach-name-row > a,
#modal-module-view .gak-std-attach .attach-name-row > span,
.mat-edit-layout .gak-std-attach .attach-name-row > a,
.mat-edit-layout .gak-std-attach .attach-name-row > span,
.product-edit-layout .gak-std-attach .attach-name-row > a,
.product-edit-layout .gak-std-attach .attach-name-row > span {
  flex: 1;
  min-width: 0;
}
#modal-module-edit .gak-std-attach .attach-open,
#modal-module-edit .gak-std-attach .attach-name-plain,
#modal-module-view .gak-std-attach .attach-open,
#modal-module-view .gak-std-attach .attach-name-plain,
.mat-edit-layout .gak-std-attach .attach-open,
.mat-edit-layout .gak-std-attach .attach-name-plain,
.product-edit-layout .gak-std-attach .attach-open,
.product-edit-layout .gak-std-attach .attach-name-plain {
  display: block;
  font-size: 12px;
  color: #0f172a;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.35;
}
#modal-module-edit .gak-std-attach .attach-open,
#modal-module-view .gak-std-attach .attach-open,
.mat-edit-layout .gak-std-attach .attach-open,
.product-edit-layout .gak-std-attach .attach-open {
  color: #0f766e;
  cursor: pointer;
}
#modal-module-edit .gak-std-attach .attach-size,
#modal-module-view .gak-std-attach .attach-size,
.mat-edit-layout .gak-std-attach .attach-size,
.product-edit-layout .gak-std-attach .attach-size {
  color: #94a3b8;
}
#modal-module-edit .gak-std-attach .attach-actions,
#modal-module-view .gak-std-attach .attach-actions,
.mat-edit-layout .gak-std-attach .attach-actions,
.product-edit-layout .gak-std-attach .attach-actions {
  display: flex;
  gap: 4px;
  width: 100%;
  justify-content: flex-end;
  flex-shrink: 0;
}
#modal-module-edit .gak-std-attach .btn-rename-att,
#modal-module-view .gak-std-attach .btn-rename-att,
.mat-edit-layout .gak-std-attach .btn-rename-att,
.product-edit-layout .gak-std-attach .btn-rename-att {
  flex-shrink: 0;
  padding: 0 4px;
  font-size: 12px;
  color: #0f766e;
}
#modal-module-edit .gak-std-attach .attach-drop-hint,
#modal-module-view .gak-std-attach .attach-drop-hint,
.mat-edit-layout .gak-std-attach .attach-drop-hint,
.product-edit-layout .gak-std-attach .attach-drop-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  flex: 0 0 auto;
}
#modal-module-edit .gak-std-attach .status-line,
#modal-module-view .gak-std-attach .status-line,
.mat-edit-layout .gak-std-attach .status-line,
.product-edit-layout .gak-std-attach .status-line {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
  min-height: 0;
}
#modal-module-edit .gak-std-attach .empty.small,
#modal-module-view .gak-std-attach .empty.small,
.mat-edit-layout .gak-std-attach .empty.small,
.product-edit-layout .gak-std-attach .empty.small {
  color: #94a3b8;
  font-size: 12px;
  padding: 12px 4px;
  text-align: center;
}
#modal-module-edit .gak-std-attach.is-dragover,
#modal-module-view .gak-std-attach.is-dragover,
.mat-edit-layout .gak-std-attach.is-dragover,
.product-edit-layout .gak-std-attach.is-dragover {
  border-color: #0d9488;
  background: #f0fdfa;
}
#modal-module-edit .gak-std-attach.is-dragover .attach-drop-hint,
#modal-module-view .gak-std-attach.is-dragover .attach-drop-hint,
.mat-edit-layout .gak-std-attach.is-dragover .attach-drop-hint,
.product-edit-layout .gak-std-attach.is-dragover .attach-drop-hint {
  color: #0f766e;
  font-weight: 500;
}

/* 产品编辑：对应 BOM（对标桌面 PLM 关联 → BOM） */
.product-bom-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  border: 1px solid #E8EAED;
  background: #fff;
  box-sizing: border-box;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.product-edit-layout.has-remark .product-bom-panel {
  grid-row: 3;
}
.product-bom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 4px;
  border-bottom: 1px solid #F1F3F4;
  flex-shrink: 0;
}
.product-bom-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-left: auto;
}
/* 显/隐固定最右（对标列表工具栏右簇） */
.product-bom-head-actions #btn-product-bom-list-cols {
  margin-left: 0;
  flex-shrink: 0;
}
.product-bom-hint {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.product-bom-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.product-bom-empty {
  color: #94a3b8;
  font-size: 12.5px;
  padding: 18px 8px;
  text-align: center;
}
.product-bom-list-wrap,
.product-bom-detail-wrap {
  overflow: auto;
  max-height: 220px;
  border: 1px solid #EEF2F7;
}
.product-bom-list-table,
.product-bom-detail-table {
  width: max-content;
  /* 禁止 min-width:100% 把差额摊到行号列（标准行号固定 50px） */
  min-width: max-content;
  border-collapse: separate;
}
.product-bom-list-table th,
.product-bom-list-table td,
.product-bom-detail-table th,
.product-bom-detail-table td {
  white-space: nowrap;
  font-size: 12px;
}
.product-bom-list-table th.col-idx,
.product-bom-list-table td.col-idx,
.product-bom-list-table col.col-idx,
.product-bom-list-table col[data-col="行号"],
.product-bom-detail-table th.col-idx,
.product-bom-detail-table td.col-idx,
.product-bom-detail-table col.col-idx,
.product-bom-detail-table col[data-col="行号"] {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
  box-sizing: border-box !important;
}
.product-bom-row {
  cursor: pointer;
}
.product-bom-row.is-active,
.product-bom-row.is-active td {
  background: #e8f5e9 !important;
}
.product-bom-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  flex-shrink: 0;
}
.product-bom-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.product-bom-detail-actions #btn-product-bom-detail-cols {
  flex-shrink: 0;
}
.product-bom-detail-head .desk-card-title {
  font-size: 13px;
}
.product-bom-detail-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
tr.bom-row-substitute td {
  color: #c62828;
}
/* 产品分栏：外层不滚，只滚 BOM 表；消除双滚动条 */
#page-module.is-mat-split-page[data-split-mode="products"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="products_list"] .mat-split-right-body {
  overflow: hidden !important;
  scrollbar-gutter: auto;
}
#page-module.is-mat-split-page[data-split-mode="products"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="products_list"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="products"] #modal-module-edit.is-mat-split-page #module-edit-form,
#page-module.is-mat-split-page[data-split-mode="products_list"] #modal-module-edit.is-mat-split-page #module-edit-form {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#page-module.is-mat-split-page[data-split-mode="products"] #modal-module-edit.is-mat-split-page #module-edit-form,
#page-module.is-mat-split-page[data-split-mode="products_list"] #modal-module-edit.is-mat-split-page #module-edit-form {
  padding: 0;
  flex: 1 1 auto;
}
#page-module.is-mat-split-page[data-split-mode="products"] #modal-module-edit.is-mat-split-page #module-edit-form > .product-edit-layout,
#page-module.is-mat-split-page[data-split-mode="products_list"] #modal-module-edit.is-mat-split-page #module-edit-form > .product-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  grid-template-rows: var(--product-head-h) minmax(0, 1fr);
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-bom-panel,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-bom-panel {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-bom-list-wrap,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-bom-list-wrap {
  max-height: 128px;
  flex: 0 0 auto;
}
#page-module.is-mat-split-page[data-split-mode="products"] .product-bom-detail-wrap,
#page-module.is-mat-split-page[data-split-mode="products_list"] .product-bom-detail-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 80px;
}
.attach-list .attach-empty {
  color: #94a3b8;
  font-size: 12.5px;
  padding: 8px 10px;
}
.attach-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.attach-main {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  cursor: pointer;
  user-select: none;
}
/* 全局兜底：避免无布局前缀时 img 塌成细线（产品侧栏曾踩坑） */
.mat-edit-attach .attach-thumb,
.desk-attach-panel .attach-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #E8EAED;
  background: #F8F9FA;
  flex: 0 0 72px;
  display: block;
}
.mat-edit-attach .attach-thumb-ph,
.desk-attach-panel .attach-thumb-ph {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  border: 1px solid #E8EAED;
  background: #F1F5F9;
  color: #94a3b8;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 72px;
}
.attach-name {
  color: #0f766e;
  font-size: 13px;
  word-break: break-all;
}
.attach-size { color: #94a3b8; font-size: 12px; }
.attach-ops {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2px;
}
.attach-op {
  font-size: 12px !important;
  padding: 2px 6px !important;
  color: #0f766e;
}
.attach-op.danger-text { color: #dc2626 !important; }
.desk-attach-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.desk-attach-hint {
  color: #94a3b8;
  font-size: 12px;
  padding: 10px 12px;
}
.attach-pending-tag {
  color: #b45309;
  font-size: 11px;
  margin-left: 6px;
}
.modal.gak-desk .lines-table input,
.modal.gak-desk .lines-table input.so-line-cell-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.modal.gak-desk .lines-table input:hover:not([readonly]) {
  border-bottom-color: #cbd5e1;
}
.modal.gak-desk .lines-table input:focus {
  border: 0;
  border-bottom: 1px solid #0d9488;
  background: transparent;
  box-shadow: none;
  color: #0f172a;
}
.modal.gak-desk .lines-table input[type="date"] {
  min-height: 1.4em;
}
.modal.gak-desk .lines-table input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.35;
  cursor: pointer;
}
.modal.gak-desk .lines-table input[type="number"] {
  -moz-appearance: textfield;
}
.modal.gak-desk .lines-table input[type="number"]::-webkit-outer-spin-button,
.modal.gak-desk .lines-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
@media (max-width: 1200px) {
  .desk-form-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desk-form-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .desk-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mat-edit-layout.is-edit { flex-direction: column; }
  .mat-edit-layout .mat-edit-attach {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-height: 140px;
  }
}
@media (max-width: 720px) {
  .modal.gak-desk .modal-body-desk { padding: 10px 10px 14px; }
  .desk-form { padding: 8px 12px 12px; }
  .desk-card-head { padding: 8px 12px 6px; }
  .desk-form-5,
  .desk-form-4,
  .desk-form-2 { grid-template-columns: 1fr; column-gap: 0; }
  .desk-row-2,
  .desk-row-3,
  .desk-row-4 { grid-template-columns: 1fr; column-gap: 0; row-gap: 10px; }
  .desk-cell { padding-right: 0 !important; }
  .desk-form { --desk-label-w: 88px; padding: 8px 10px 12px; }
  .desk-cell > label,
  .desk-span-full > label {
    flex-basis: var(--desk-label-w);
    width: var(--desk-label-w);
    min-width: var(--desk-label-w);
    max-width: var(--desk-label-w);
    text-align: right;
  }
  .modal.gak-desk .modal-card-desk {
    width: min(100vw - 8px, 960px);
    height: min(96vh, 900px);
  }
  .desk-addr-sel { width: 86px; flex-basis: 86px; }
  .desk-addr-sel-dist { width: 140px; flex-basis: 140px; min-width: 140px; }
}

.field { display: grid; gap: 6px; margin-bottom: 10px; }
.field span { color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font: inherit; background: #f8fffe;
  color: #002FA7;
}
.field input:focus {
  outline: none; border-color: #14b8a6; background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px;
}
.field-span { grid-column: 1 / -1; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 8px; color: var(--primary-dark);
}
.lines-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.lines-table { min-width: 780px; width: 100%; }
.lines-table input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 2px 0;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
}
.lines-table input:focus {
  border-bottom-color: #0d9488;
  background: transparent;
}
.attach-list { list-style: none; margin: 0; padding: 0; }
.attach-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px;
}
.attach-list a { color: var(--primary-dark); text-decoration: none; }
.muted { color: var(--muted); }
.btn.ghost {
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.btn.ghost:hover { background: #e6f4f2; color: var(--primary-dark); }
.modal-card-cols {
  width: min(520px, 96vw);
  max-height: min(80vh, 640px);
}
.col-set-body {
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.col-set-ops {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.col-set-width-lab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); margin-left: auto;
}
.col-set-width-lab input {
  width: 72px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.col-set-sort {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f0fdfa;
  border: 1px solid #99f6e4; border-radius: 8px;
}
.col-set-sort-title { font-size: 12px; font-weight: 500; color: #0f766e; }
.col-set-sort-fields {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
}
.col-set-sort-lab {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.col-set-sort select {
  min-width: 120px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; background: #fff; color: #0f172a;
}
.col-set-sort-tip { font-size: 11px; color: #0d9488; margin-left: auto; }
.col-set-table-wrap {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: auto; max-height: min(48vh, 360px);
}
.col-set-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.col-set-table th,
.col-set-table td {
  padding: 7px 10px; border-bottom: 1px solid #f1f5f9; text-align: left;
}
.col-set-table th {
  background: #f8fafc; font-weight: 500;
  position: sticky; top: 0; z-index: 1;
}
.col-set-table .col-set-vis,
.col-set-table .col-set-freeze,
.col-set-table .col-set-w { width: 72px; text-align: center; }
.col-set-table .col-set-w input[type="number"] {
  width: 56px;
  padding: 2px 4px;
  border: 1px solid #E8EAED;
  border-radius: 2px;
  font: inherit;
  font-size: 12px;
  text-align: center;
  color: #202124;
  box-sizing: border-box;
}
.col-set-table .col-set-w input[type="number"]:focus {
  border-color: #0d9488;
  outline: none;
}
.col-set-table tr.locked .col-set-w input[type="number"] {
  color: #0d9488;
  font-weight: 500;
}
.col-set-table .col-set-sort-col { width: 88px; text-align: center; }
.col-set-table tbody tr { cursor: pointer; }
.col-set-table tbody tr:hover { background: #f0fdfa; }
.col-set-table tbody tr.selected {
  background: #ccfbf1;
  outline: 2px solid #0d9488;
  outline-offset: -2px;
}
.col-set-table tbody tr.dragging { opacity: 0.45; }
.col-set-table tbody tr.drag-over { box-shadow: inset 0 2px 0 #0d9488; }
.col-set-name { display: flex; align-items: center; gap: 8px; }
.col-set-drag {
  color: #94a3b8; letter-spacing: -2px; cursor: grab;
  user-select: none; font-size: 12px;
}
.col-set-table tbody tr.dragging .col-set-drag { cursor: grabbing; }
.col-set-table input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
}
.col-set-sort-btns {
  display: inline-flex; gap: 4px; justify-content: center;
}
.col-set-sort-btns button {
  min-width: 28px; padding: 2px 6px; font-size: 11px; line-height: 1.4;
  border: 1px solid #cbd5e1; border-radius: 4px;
  background: #fff; color: #64748b; cursor: pointer;
}
.col-set-sort-btns button:hover { border-color: #0d9488; color: #0f766e; }
.col-set-sort-btns button.active {
  background: #0d9488; border-color: #0d9488; color: #fff; font-weight: 500;
}
.col-set-hint { margin: 0; font-size: 11px; color: #94a3b8; }

/* —— 系统功能介绍首页（商务科技 · 链路分栏） —— */
@keyframes home-hero-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes home-card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes home-flow-pulse {
  0%, 100% { opacity: 0.35; transform: scaleX(0.8); }
  50% { opacity: 1; transform: scaleX(1); }
}
@keyframes home-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes home-shine {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(220%) skewX(-18deg); }
}

.home-intro-body {
  padding: 0 0 28px;
  background:
    radial-gradient(ellipse 70% 36% at 90% 8%, rgba(2, 132, 199, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 30% at 10% 70%, rgba(13, 148, 136, 0.08), transparent 50%),
    linear-gradient(180deg, #ecfdf8 0%, #f8fffc 22%, #ffffff 100%);
  position: relative;
  overflow: auto;
}
.home-intro-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px 16px;
  margin: 0;
  background:
    radial-gradient(ellipse 65% 140% at -5% 40%, rgba(45, 212, 191, 0.28), transparent 55%),
    radial-gradient(ellipse 45% 90% at 100% -20%, rgba(56, 189, 248, 0.22), transparent 50%),
    linear-gradient(125deg, #0f766e 0%, #0d9488 48%, #0369a1 100%);
  color: #fff;
  overflow: hidden;
  animation: home-hero-in 0.5s ease both;
}
.home-intro-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(100deg, rgba(0,0,0,0.5), transparent 70%);
  pointer-events: none;
}
.home-intro-stage::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 68%);
  pointer-events: none;
}
.home-intro-hero {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.home-intro-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: rgba(204, 251, 241, 0.92);
  text-transform: uppercase;
}
.home-intro-brand {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.85rem, 4.2vw, 2.55rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}
.home-intro-brand span {
  color: #99f6e4;
}
.home-intro-lead {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(240, 253, 250, 0.92);
  line-height: 1.5;
  max-width: 34em;
}
.home-intro-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 14px 0 0;
}
.home-intro-flow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #0f766e;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.home-intro-flow i {
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(153,246,228,0.3), #99f6e4, rgba(153,246,228,0.3));
  animation: home-flow-pulse 1.6s ease-in-out infinite;
}
.home-intro-flow i:nth-child(4) { animation-delay: 0.12s; }
.home-intro-flow i:nth-child(6) { animation-delay: 0.24s; }
.home-intro-flow i:nth-child(8) { animation-delay: 0.36s; }
.home-intro-flow i:nth-child(10) { animation-delay: 0.48s; }

.home-intro-hero-aside {
  position: relative;
  z-index: 1;
  padding-right: 6px;
}
.home-intro-orbit {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  position: relative;
}
.home-intro-orbit::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  animation: home-orbit-spin 16s linear infinite;
}
.home-intro-orbit b {
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
}
.home-intro-orbit small {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(236, 253, 245, 0.9);
}

.home-intro-panels {
  position: relative;
  width: min(1360px, calc(100% - 48px));
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 0 0;
}
.home-intro-panel + .home-intro-panel {
  margin-top: 22px;
}
.home-intro-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
}
.home-intro-sec-head strong {
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: 0.02em;
}
.home-intro-sec-head span {
  font-size: 13px;
  color: #64748b;
}
.home-intro-sub {
  margin: 18px 0 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.45;
  text-align: center;
}

.home-intro-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
/* 仅在模块导航页（page-module-nav）下：去掉外层容器的宽度限制，让卡片填满整页 */
#page-module-nav {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* 让 page-header + module-nav-tabs 同行显示（菜单按钮 + 顶部 Tab） */
#page-module-nav > .page-header,
#page-module-nav > .module-nav-tabs {
  display: flex;
  align-items: center;
}
/* 把 page-header 收成 flex 行内的左侧分组：菜单按钮 + 标题 */
#page-module-nav > .page-header {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 6px 0;
  gap: 0;
}
#page-module-nav > .page-header .page-header-left {
  flex: 0 0 auto;
  padding-left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#page-module-nav > .module-nav-tabs {
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
  padding: 0 16px;
  background: transparent;
  border-bottom: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: static;
  top: auto;
  z-index: auto;
}
/* 由于 page-header 和 module-nav-tabs 是块级兄弟节点，用 grid 把它们并入一行 */
#page-module-nav {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 1fr;
}
#page-module-nav > .page-header {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 6px 0;
  gap: 0;
}
#page-module-nav > .module-nav-tabs {
  grid-row: 1;
  grid-column: 1 / -1;
  align-self: center;
  margin-left: 200px;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
  padding: 0 16px 0 0;
  background: transparent;
  border-bottom: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: static;
  top: auto;
  z-index: auto;
  height: 44px;
}
#page-module-nav > .list-body,
#page-module-nav > .page-footer {
  grid-row: 2;
  grid-column: 1 / -1;
}
#page-module-nav .home-intro-panels,
#page-module-nav .home-intro-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 20px 0 0;
}
#page-module-nav .list-body.home-intro-body {
  padding: 0;
}
/* 模块导航页：隐藏分组小标题（QMS 品质管理 · 点卡片进入具体功能 · 共 7 项） */
#page-module-nav .home-intro-sec-head {
  display: none !important;
}
/* 模块导航页：去掉卡片顶部 band（step + mark + tip）后的样式调整 */
#page-module-nav .home-intro-card.is-primary {
  min-height: 240px;
  padding-top: 8px;
}
#page-module-nav .home-intro-card.is-primary .home-intro-card-title {
  margin-top: 4px;
}
/* 模块导航页：leaf 卡片也去掉顶部 band（保持与 subgroup 一致） */
#page-module-nav .home-intro-card.is-primary .home-intro-card-band {
  display: none !important;
}
/* 模块导航页：leaf 卡片去除重复的 desc（避免与 title 重复） */
#page-module-nav .home-intro-card.is-primary .home-intro-card-desc {
  display: none !important;
}
/* 模块导航页：leaf 卡片去除 tags */
#page-module-nav .home-intro-card.is-primary .home-intro-tags {
  display: none !important;
}
/* 模块导航页下卡片水平居中：宽度自适应内容（用 auto-fit + max 列数） */
#page-module-nav .home-intro-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 100%;
}

/* ===== 删除 v26 加的"顶部工具栏"样式（不再需要） ===== */
#mod-nav-toolbar,
.mod-toolbar,
.mod-toolbar-btn { display: none !important; }

.home-intro-grid::-webkit-scrollbar { height: 6px; }
.home-intro-grid::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.home-intro-grid::-webkit-scrollbar-track { background: transparent; }
/* 首页功能介绍：固定每行 3 个卡片（主链路 3 张 1 行；支撑能力 4 张 3+1，窄屏由媒体查询接管） */
.home-intro-grid.is-primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-intro-grid.is-support {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-intro-card {
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.14);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  color: inherit;
  font: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-intro-card.is-primary {
  min-height: 280px;
  box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
}
.home-intro-card.is-primary .home-intro-card-band {
  min-height: 56px;
  padding: 8px 10px;
}
.home-intro-card.is-primary .home-intro-card-body {
  padding: 10px;
  gap: 6px;
}
.home-intro-card.is-primary .home-intro-card-title {
  font-size: 18px;
  font-weight: 500;
}
.home-intro-card.is-primary .home-intro-mark {
  height: 22px;
  font-size: 12px;
  padding: 0 6px;
}
.home-intro-card.is-primary .home-intro-tip {
  font-size: 10px;
}
.home-intro-card.is-support {
  min-height: 260px;
}
.home-intro-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.12), 0 8px 12px -4px rgba(0, 0, 0, 0.06);
}
.home-intro-card-shine {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}
.home-intro-card:hover .home-intro-card-shine {
  opacity: 1;
  animation: home-shine 0.7s ease;
}
.home-intro-card:hover {
  transform: translateY(-7px) scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.14);
}
.home-intro-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.home-intro-card.accent-crm { --accent: #14b8a6; --accent-deep: #0f766e; --accent-soft: rgba(20, 184, 166, 0.16); }
.home-intro-card.accent-mes { --accent: #0ea5e9; --accent-deep: #0369a1; --accent-soft: rgba(14, 165, 233, 0.16); }
.home-intro-card.accent-wms { --accent: #10b981; --accent-deep: #047857; --accent-soft: rgba(16, 185, 129, 0.16); }
.home-intro-card.accent-plm { --accent: #2dd4bf; --accent-deep: #0f766e; --accent-soft: rgba(45, 212, 191, 0.16); }
.home-intro-card.accent-qms { --accent: #f59e0b; --accent-deep: #b45309; --accent-soft: rgba(245, 158, 11, 0.16); }
.home-intro-card.accent-srm { --accent: #2563eb; --accent-deep: #1d4ed8; --accent-soft: rgba(37, 99, 235, 0.16); }
.home-intro-card.accent-usr { --accent: #64748b; --accent-deep: #334155; --accent-soft: rgba(100, 116, 139, 0.14); }
.home-intro-card.accent-eq { --accent: #7c3aed; --accent-deep: #5b21b6; --accent-soft: rgba(124, 58, 237, 0.16); }
.home-intro-card.accent-cert { --accent: #0891b2; --accent-deep: #155e75; --accent-soft: rgba(8, 145, 178, 0.16); }
.home-intro-card.accent-esop { --accent: #db2777; --accent-deep: #9d174d; --accent-soft: rgba(219, 39, 119, 0.16); }
.home-intro-card.accent-board { --accent: #059669; --accent-deep: #065f46; --accent-soft: rgba(5, 150, 105, 0.16); }
.home-intro-card.accent-tool { --accent: #ca8a04; --accent-deep: #854d0e; --accent-soft: rgba(202, 138, 4, 0.16); }
.home-intro-card.accent-hrm { --accent: #e11d48; --accent-deep: #be123c; --accent-soft: rgba(225, 29, 72, 0.16); }
.home-intro-card.is-disabled { opacity: 0.5; cursor: not-allowed; }
.home-intro-card.is-disabled:hover { transform: none; box-shadow: none; }

/* 模块导航分组 Tab 切换 */
.module-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  z-index: 10;
}
.module-nav-tabs::-webkit-scrollbar { height: 3px; }
.module-nav-tabs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.module-nav-tabs::-webkit-scrollbar-track { background: transparent; }
.module-nav-tabs[hidden] { display: none !important; }
.module-nav-tab-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: 13px;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  position: relative;
  font-weight: 500;
}
.module-nav-tab-btn:hover {
  color: #0d9488;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.module-nav-tab-btn.is-active {
  color: #0d9488;
  background: #ecfdf5;
  border-color: #a7f3d0;
  font-weight: 500;
}
.module-nav-tab-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #0d9488;
  border-radius: 1px;
}

/* 模块导航卡片内：subgroup 子功能标签按钮组 */
.mod-sub-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 4px 0;
}
.mod-sub-tab {
  width: 100%;
  justify-content: flex-start;
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
  font-weight: 500;
  font-family: inherit;
  position: relative;
  z-index: 2;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mod-sub-tab::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #0d9488);
  flex-shrink: 0;
  opacity: 0.7;
}
.mod-sub-tab:hover {
  background: var(--accent, #0d9488);
  color: #fff;
  border-color: var(--accent, #0d9488);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}
.mod-sub-tab:hover::before {
  background: #fff;
  opacity: 1;
}
.mod-sub-tab:focus-visible {
  outline: 2px solid var(--accent, #0d9488);
  outline-offset: 2px;
}
.mod-sub-tab[disabled],
.mod-sub-tab[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  box-shadow: none;
  transform: none;
}
.mod-sub-tab[disabled]::before,
.mod-sub-tab[aria-disabled="true"]::before {
  background: #cbd5e1;
}

/* subgroup 卡片（div 容器）的点击热区 + 子标签 z-index */
.home-intro-card { position: relative; }
.home-intro-card-hit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
  border-radius: inherit;
  padding: 0;
  margin: 0;
}
.home-intro-card-hit:focus { outline: none; }
.home-intro-card.is-disabled .home-intro-card-hit { cursor: not-allowed; }
.home-intro-card .mod-sub-tab,
.home-intro-card .home-intro-card-band,
.home-intro-card .home-intro-card-body { position: relative; z-index: 2; }

.home-intro-card-band {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 3px solid var(--accent);
  color: #0f172a;
}
.home-intro-card.is-primary .home-intro-card-band {
  min-height: 72px;
  padding: 14px 18px;
}
.home-intro-step {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: #94a3b8;
  min-width: 22px;
}
.home-intro-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
}
.home-intro-card.is-primary .home-intro-mark {
  height: 30px;
  font-size: 15px;
}
.home-intro-tip {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}
.home-intro-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  flex: 1;
}
.home-intro-card.is-primary .home-intro-card-body {
  padding: 18px;
}
.home-intro-card-title {
  font-size: 16px;
  font-weight: 500;
  color: #0f172a;
  letter-spacing: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.home-intro-card.is-primary .home-intro-card-title {
  font-size: 18px;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
}
/* 模块导航页：标题更大、加粗、居中 */
#page-module-nav .home-intro-card.is-primary .home-intro-card-title {
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  margin: 6px 8px 10px;
  padding: 0 4px;
  line-height: 1.3;
  color: #0f172a;
  word-break: keep-all;
  overflow-wrap: break-word;
  display: block;
  width: calc(100% - 16px);
  box-sizing: border-box;
}
.home-intro-card-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  flex: 1;
}
.home-intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-intro-tags em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
}
.home-intro-card-go {
  margin-top: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  padding: 6px 12px;
  background: var(--accent-soft);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  transition: all 0.15s ease;
}
.home-intro-card-go::after {
  content: " →";
  display: inline-block;
  transition: transform 0.2s ease;
}
.home-intro-card:hover .home-intro-card-go::after {
  transform: translateX(4px);
}
.home-intro-card:hover .home-intro-card-go {
  background: var(--accent);
  color: #fff;
}

/* 主链路卡片之间的流程箭头（单行布局下不显示） */
.home-intro-grid.is-primary {
  position: relative;
}
@media (min-width: 961px) {
  .home-intro-grid.is-primary::before,
  .home-intro-grid.is-primary::after,
  .home-intro-grid.is-primary > .home-intro-arrow { display: none; }
}

@media (max-width: 960px) {
  .home-intro-grid.is-primary,
  .home-intro-grid.is-support {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  #page-module-nav .home-intro-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .home-intro-hero-aside { display: none; }
  .home-intro-stage { grid-template-columns: 1fr; }
  .home-intro-grid.is-primary::before,
  .home-intro-grid.is-primary::after { display: none; }
}
@media (max-width: 640px) {
  .home-intro-stage { padding: 16px 14px 14px; }
  .home-intro-panels {
    width: calc(100% - 24px);
    padding: 14px 0 0;
  }
  .home-intro-sec-head { justify-content: flex-start; flex-wrap: wrap; }
  .home-intro-sub { text-align: left; }
  .home-intro-grid.is-primary,
  .home-intro-grid.is-support { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
  .home-intro-brand { font-size: 1.7rem; }
  .home-intro-card.is-primary,
  .home-intro-card.is-support { min-height: 0; }
}

.sensitive-block {
  margin: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #f7fffe;
}
.sensitive-block h3 { margin: 0 0 8px; font-size: 13px; color: var(--primary-dark); }
.sensitive-grid { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.sensitive-grid label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }

/* —— 用户管理（单表平铺 + 左冻右操作） —— */
.perms-layout {
  display: flex; flex-direction: column;
  padding: 0; min-height: 0; overflow: hidden;
}
.perms-tabbar {
  display: flex; gap: 4px; align-items: center;
  padding: 8px 16px 0;
  flex-shrink: 0;
}
.perms-tabbar .qms-insp-tab {
  padding: 4px 16px;
}
.perms-view-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 14px;
  flex-shrink: 0;
}
/* 系统设置各视图：必须成为 flex 子项才能把 .list-body/.settings-body 撑开，
   否则内容溢出且无法滚动（企业微信标签页下移失效的根因） */
#perms-view-users,
#perms-view-devices,
#perms-view-menus,
#perms-view-sysperm,
#perms-view-settings {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* 切 tab 时 JS 通过设置 .hidden 来隐藏非活动视图。
   上面 id 选择器的 display:flex 优先级(1,0,0)高于 [hidden] 的 display:none(0,1,0)，
   会导致隐藏失效、各视图叠加错乱。这里显式用 [hidden] 覆盖，确保隐藏真正生效。 */
#perms-view-users[hidden],
#perms-view-devices[hidden],
#perms-view-menus[hidden],
#perms-view-sysperm[hidden],
#perms-view-settings[hidden],
#perms-view-ai[hidden] {
  display: none !important;
}
#perms-view-settings .settings-body {
  flex: 1;
  min-height: 0;
  /* 企业微信页卡片 2 列排版（对齐卡片等宽、留白均匀）；AI 页保持单列 */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}
#perms-view-settings .settings-body .settings-card {
  max-width: none;
  margin: 0;
}
#perms-view-settings .settings-body .settings-card.span-2 {
  grid-column: 1 / -1;
}
.perms-users-wrap {
  margin: 0; border: none; border-radius: 0;
  flex: 1; min-height: 0; height: auto; max-height: none;
  overflow: auto;
}
.perms-users-wrap .data-table {
  /* sticky 多列在 collapse 下会错位留白（行号旁空一列） */
  border-collapse: separate;
  border-spacing: 0;
  /* fixed：配合 colgroup 让列设置里的列宽权威生效（此前 auto 只把 th 宽度当提示） */
  table-layout: fixed;
}
.perms-users-wrap .data-table th,
.perms-users-wrap .data-table td {
  white-space: nowrap;
  max-width: none;
  text-align: center;
  vertical-align: middle;
}
/* 单元格内控件：无边框，避免框中框 */
.perms-users-wrap input[data-field],
.perms-users-wrap select[data-field] {
  width: 100%;
  min-width: 64px;
  border: none !important;
  border-radius: 0;
  padding: 2px 4px;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}
.perms-users-wrap select[data-field] {
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 10px) calc(50% + 1px), calc(100% - 5px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 16px;
}
.perms-users-wrap input[data-field]:focus,
.perms-users-wrap select[data-field]:focus {
  background-color: rgba(13, 148, 136, 0.08) !important;
  box-shadow: inset 0 -1px 0 #0d9488 !important;
}
.perms-users-wrap input[data-field="password"] {
  min-width: 88px;
}
.perms-users-wrap input[data-field="password"]::placeholder {
  color: #94a3b8;
}
.perms-menu-cb {
  width: 16px; height: 16px; cursor: pointer;
  vertical-align: middle;
}
.perms-users-wrap th.perms-menu-col,
.perms-users-wrap td.perms-menu-col {
  text-align: center;
  min-width: 72px;
}
/* 左侧冻结：行号 → 状态 */
.perms-users-wrap .data-table th.perms-sticky-left,
.perms-users-wrap .data-table td.perms-sticky-left {
  position: sticky;
  z-index: 3;
}
.perms-users-wrap .data-table th.perms-sticky-left {
  z-index: 5;
  background: #0d9488;
  color: #fff;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
}
.perms-users-wrap .data-table th.col-idx.perms-sticky-left {
  z-index: 6;
  background: #0f766e;
}
.perms-users-wrap .data-table td.perms-sticky-left {
  background: #fff;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.05);
}
.perms-users-wrap .data-table td.col-idx.perms-sticky-left {
  background: #f0fdfa;
}
.perms-users-wrap .data-table tbody tr:nth-child(even) td.perms-sticky-left {
  background: #f8fffe;
}
.perms-users-wrap .data-table tbody tr:nth-child(even) td.col-idx.perms-sticky-left {
  background: #eef9f7;
}
.perms-users-wrap .data-table tbody tr:hover td.perms-sticky-left {
  background: #e6f4f2;
}
.perms-users-wrap .data-table tbody tr:hover td.col-idx.perms-sticky-left {
  background: #dcf5f1;
}
.perms-users-wrap .data-table th.col-ops,
.perms-users-wrap .data-table td.col-ops {
  z-index: 4;
  min-width: 148px;
}
.perms-users-wrap .data-table th.col-ops {
  z-index: 7;
}
.perms-users-wrap .data-table td.col-ops {
  text-align: center;
}
/* 用户管理：取消左侧冻结，保留操作列右侧冻结 */
#perms-table.no-col-freeze th.perms-sticky-left,
#perms-table.no-col-freeze td.perms-sticky-left,
#perms-table.no-col-freeze th.col-idx,
#perms-table.no-col-freeze td.col-idx {
  position: static !important;
  left: auto !important;
  box-shadow: none !important;
  z-index: auto !important;
}
#perms-table.no-col-freeze th.col-idx {
  background: #0f766e;
  color: #fff;
}
#perms-table.no-col-freeze td.col-idx {
  background: #f0fdfa;
}
#perms-table.no-col-freeze th.col-ops,
#perms-table.no-col-freeze td.col-ops {
  position: sticky !important;
  right: 0 !important;
  z-index: 4;
  box-shadow: -4px 0 8px rgba(15, 23, 42, 0.06);
}
#perms-table.no-col-freeze th.col-ops {
  z-index: 7;
  background: #0d9488;
  color: #fff;
}
#perms-table.no-col-freeze td.col-ops {
  background: #fff;
}
#perms-table.no-col-freeze tbody tr:nth-child(even) td.col-ops {
  background: #f8fffe;
}
#perms-table.no-col-freeze tbody tr:hover td.col-ops {
  background: #e6f4f2;
}
.perms-users-wrap .data-table td.col-ops .tb-btn {
  margin-right: 4px;
  display: inline-block;
  vertical-align: middle;
}
.perms-users-wrap .data-table td.col-ops .tb-btn:last-child {
  margin-right: 0;
}
.perms-users-wrap .data-table td.col-ops .danger-text {
  color: #b91c1c;
}

/* 按部门分组显示：每个部门前插入部门分隔行，明显分隔不同部门 */
#perms-table tbody tr.perms-dept-head td {
  background: #f0fdfa;
  color: #0f766e;
  padding: 5px 12px;
  cursor: default;
  text-align: left;
  border-top: 1px solid #ccfbf1;
  border-bottom: 1px solid #ccfbf1;
}
#perms-table tbody tr.perms-dept-head:hover td {
  background: #f0fdfa;
}

/* 生产计划按生产线分类显示：分组标题行 */
.aps-table tbody tr.aps-line-head td {
  background: #eff6ff;
  color: var(--primary, #2563eb);
  padding: 5px 12px;
  cursor: default;
  text-align: left;
  border-top: 1px solid #dbeafe;
  border-bottom: 1px solid #dbeafe;
}
.aps-table tbody tr.aps-line-head:hover td {
  background: #eff6ff;
}

/* —— 流程设置 / 脱敏（对标桌面 AuditWorkflowConfigDialog） —— */
.modal.gak-desk .modal-card-desk.modal-card-desk-wf {
  width: max-content;
  max-width: min(98vw, 1400px);
  min-width: min(560px, 96vw);
  height: auto;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-card-desk-wf .modal-body-desk {
  padding: 12px 20px 14px;
}
.wf-banner {
  margin: 0 0 8px;
  padding: 6px 10px;
  background: #E8F0FE;
  color: #174EA6;
  border-radius: 0;
  line-height: 1.45;
  font-size: 13px;
}
.wf-matrix-wrap {
  max-height: min(48vh, 420px);
  overflow: auto;
  border: 1px solid #C5CDD6;
  border-radius: 0;
  background: #fff;
}
.wf-matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}
.wf-matrix th,
.wf-matrix td {
  border-bottom: 1px solid #E8ECF0;
  border-right: 1px solid #E8ECF0;
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}
.wf-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #EEF1F6;
  font-weight: 500;
  color: #3C4043;
  padding: 8px 6px;
}
.wf-matrix .wf-user-th {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  min-width: 96px;
  max-width: 160px;
  padding-left: 12px;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  font-weight: 500;
  color: #202124;
}
.wf-matrix thead .wf-user-th {
  z-index: 3;
  background: #EEF1F6;
  color: #3C4043;
  font-weight: 500;
}
.wf-feat-th {
  min-width: 72px;
}
.wf-feat-name {
  font-weight: 500;
  color: #3C4043;
}
.wf-matrix tbody tr.wf-row-odd td,
.wf-matrix tbody tr.wf-row-odd .wf-user-th {
  background: #F5F7FA;
}
.wf-matrix tbody tr:hover td,
.wf-matrix tbody tr:hover .wf-user-th {
  background: #E8F0FE;
}
/* 系统功能权限弹窗：角色列 / admin 可收紧提示 */
.wf-matrix .wf-role-col {
  min-width: 96px;
  text-align: left;
}
.wf-matrix td:first-child {
  font-weight: 500;
  text-align: left;
  color: #3C4043;
}
.wf-role-note {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #B06000;
}
/* 自定义蓝底 ✓（对齐桌面 _SETTINGS_CHECK_*） */
.wf-ck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
  position: relative;
}
.wf-ck input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.wf-ck-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1px solid #B0B6BE;
  background: #fff;
  border-radius: 2px;
  flex: 0 0 16px;
}
.wf-ck-box::after {
  content: "";
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
}
.wf-ck input:checked + .wf-ck-box {
  background: #1A73E8;
  border-color: #1A73E8;
}
.wf-ck input:checked + .wf-ck-box::after {
  content: "✓";
}
.wf-ck-row {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 0;
  width: 100%;
}
.wf-ck-text {
  color: #202124;
  font-size: 13px;
  line-height: 1.4;
}
.wf-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #5F6368;
  line-height: 1.45;
  word-break: break-word;
}
.wf-sep {
  height: 1px;
  background: #E8EAED;
  margin: 10px 0 6px;
}
.wf-creator-title {
  font-weight: 500;
  color: #202124;
  font-size: 13px;
  margin-bottom: 4px;
}
.wf-creator-hint {
  margin: 2px 0 4px 4px;
  font-size: 12px;
  color: #999;
}
.wf-list {
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid #C5CDD6;
  border-radius: 0;
  padding: 6px 8px;
  background: #fff;
}
.wf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  border-radius: 4px;
}
.wf-check:hover { background: #E8F0FE; }
.wf-check input { flex: 0 0 auto; }
.wf-check span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wf-two h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #202124;
  font-weight: 500;
}
.wf-two h4 em {
  font-style: normal;
  font-weight: 500;
  color: #5F6368;
  font-size: 12px;
  margin-left: 4px;
}
/* 脱敏弹窗：对标桌面 show_wms_sensitive_dialog（与设置同款蓝勾矩阵式样） */
.modal.gak-desk .modal-card-desk.modal-wf-sensitive {
  width: min(760px, 96vw);
  height: auto;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.modal.gak-desk .modal-wf-sensitive .modal-body-desk {
  padding: 12px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  background: #F0F2F5;
}
.modal.gak-desk .modal-wf-sensitive .wf-banner {
  margin: 0;
  flex: 0 0 auto;
}
.wf-sens-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.wf-sens-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border: 1px solid #C5CDD6;
  background: #fff;
}
.wf-sens-col-head {
  flex: 0 0 auto;
  padding: 8px 12px;
  background: #EEF1F6;
  border-bottom: 1px solid #C5CDD6;
  font-weight: 500;
  font-size: 13px;
  color: #3C4043;
}
.wf-sens-col-body {
  flex: 1;
  min-height: 220px;
  max-height: min(56vh, 520px);
  overflow: auto;
  background: #fff;
}
.wf-sens-row {
  padding: 2px 8px;
  border-bottom: 1px solid #E8ECF0;
  background: #fff;
}
.wf-sens-row.wf-sens-row-odd {
  background: #F5F7FA;
}
.wf-sens-row:hover {
  background: #E8F0FE;
}
.wf-sens-row .wf-ck-row {
  padding: 4px 0;
  width: 100%;
}
.wf-sens-row .wf-ck-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.wf-panel .wf-list {
  flex: 1;
  min-height: 180px;
}
@media (max-width: 720px) {
  .wf-two,
  .wf-sens-matrix { grid-template-columns: 1fr; }
  .wf-matrix .wf-user-th { min-width: 88px; max-width: 120px; }
  .wf-sens-col-body { max-height: min(40vh, 320px); }
}

.mod-view-dl {
  display: grid;
  grid-template-columns: minmax(110px, 28%) 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 13px;
}
.mod-view-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.mod-view-dl dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}


/* —— 全局字体锁：仅微软雅黑 11px（对齐迈方，再调小1号） —— */
:root {
  --font: "Microsoft YaHei";
  font-family: "Microsoft YaHei";
  font-size: 11px;
}
html, body, #app,
#app *:not(script):not(style):not(.nav-popup):not(.nav-item):not(.nav-group-toggle):not(.nav-label):not(.nav-label-right):not(.nav-group-label):not(.nav-sub-item):not(.nav-nested-head):not(.nav-sub-nested):not(.nav-top-item):not(.nav-nested-leaf):not(.nav-nested-label) {
  font-family: "Microsoft YaHei" !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
}
button, input, select, textarea, table, th, td, label, a, span, p, div,
.shell-foot, .btn, .page-footer,
.data-table, .data-table th, .data-table td, .modal, .modal-title, .tab {
  font-family: "Microsoft YaHei" !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}
.data-table th,
.data-table th.col-idx {
  color: #fff !important;
}
.list-pane .page-header,
.list-pane .page-header .toolbar,
.list-pane .page-header .tb-btn,
.list-pane .page-header .btn {
  font-family: "Microsoft YaHei" !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}
.list-pane .page-header .page-title {
  font-family: "Microsoft YaHei" !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

/* 采购入库单据：突破全局 12px 字体锁
   全局规则 #app *:not(script):not(style) 特异性为 (1,2,1)，
   须用同级 :not 或更高类选择器才能压过。 */
#app .ib-voucher,
#app .ib-voucher * {
  font-family: "SimHei", "Microsoft YaHei", sans-serif !important;
  line-height: 1.45 !important;
}
#app .ib-voucher .ib-voucher-title:not(script):not(style),
#app div.ib-voucher-title:not(script):not(style),
#page-module .ib-voucher-title:not(script):not(style) {
  font-size: 26px !important;
  font-weight: 500 !important;
  letter-spacing: 0.28em !important;
  color: #1e3a5f !important;
  border-bottom: none !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
  padding-bottom: 0 !important;
  margin: 4px 0 14px !important;
}
#app .ib-voucher .ib-voucher-meta-label:not(script):not(style),
#app .ib-voucher .ib-voucher-meta-colon:not(script):not(style) {
  font-size: 15px !important;
  font-weight: 500 !important;
}
#app .ib-voucher .ib-voucher-meta-item .ib-control > input:not(script):not(style),
#app .ib-voucher .ib-voucher-meta-item .ib-control > select:not(script):not(style),
#app .ib-voucher .ib-voucher-meta-item .ib-control > textarea:not(script):not(style) {
  font-size: 15px !important;
  font-weight: 500 !important;
}
#app .ib-voucher .ib-voucher-table thead th:not(script):not(style) {
  font-size: 14px !important;
  font-weight: 500 !important;
  background: #1e3a5f !important;
  color: #fff !important;
}
#app .ib-voucher .ib-voucher-table td:not(script):not(style),
#app .ib-voucher .ib-voucher-table.ib-detail-table input:not(script):not(style) {
  font-size: 14px !important;
  font-weight: 400 !important;
}
#app .ib-voucher .ib-voucher-total-row td:not(script):not(style),
#app .ib-voucher .ib-voucher-total-row .ib-total-cell:not(script):not(style) {
  font-size: 14px !important;
  font-weight: 500 !important;
}
#app .ib-voucher .ib-voucher-amount-words:not(script):not(style),
#app .ib-voucher .ib-voucher-amount-label:not(script):not(style),
#app .ib-voucher .ib-voucher-amount-num:not(script):not(style) {
  font-size: 15px !important;
}
#app .ib-voucher .ib-voucher-sign:not(script):not(style),
#app .ib-voucher .ib-voucher-sign-label:not(script):not(style) {
  font-size: 14px !important;
}
#app .ib-voucher .ib-voucher-amount-cn:not(script):not(style) {
  font-size: 16px !important;
  font-weight: 500 !important;
}
#app .ib-voucher .ib-voucher-sign span:not(script):not(style),
#app .ib-voucher .ib-voucher-sign b:not(script):not(style) {
  font-size: 15px !important;
  font-weight: 500 !important;
}
#app .ib-voucher .ib-voucher-sign b:not(script):not(style) {
  font-weight: 500 !important;
}

/* 登录页字号不受 12px 锁压制 */
#view-login .login-mark {
  font-size: inherit !important;
  font-weight: inherit !important;
}
#view-login .login-hero-title {
  font-size: 28px !important;
  font-weight: 500 !important;
}
#view-login .login-hero-mods {
  font-size: 16px !important;
  font-weight: 500 !important;
}
#view-login .login-hero-desc {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
}
#view-login .login-card .brand {
  font-size: 22px !important;
  font-weight: 500 !important;
}
#view-login .login-card .sub {
  font-size: 13px !important;
}
#view-login .btn-login {
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 55%, #0f766e 100%) !important;
}

/* 首页介绍：保留设计稿字号（与迈方截图一致） */
.home-intro-brand {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-size: clamp(1.85rem, 4.2vw, 2.55rem) !important;
  font-weight: 500 !important;
  line-height: 1.1 !important;
}
.home-intro-kicker { font-size: 10px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-lead { font-size: 14px !important; font-weight: 400 !important; line-height: 1.5 !important; }
.home-intro-flow span { font-size: 11px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-orbit b { font-size: 28px !important; font-weight: 500 !important; line-height: 1 !important; }
.home-intro-orbit small { font-size: 10px !important; font-weight: 400 !important; line-height: 1.4 !important; }
.home-intro-sec-head strong { font-size: 16px !important; font-weight: 500 !important; line-height: 1.4 !important; white-space: nowrap !important; }
.home-intro-sec-head span { font-size: 13px !important; font-weight: 400 !important; line-height: 1.4 !important; }
.home-intro-card-title { font-size: 16px !important; font-weight: 500 !important; line-height: 1.3 !important; word-break: keep-all !important; }
.home-intro-card.is-primary .home-intro-card-title { font-size: 20px !important; font-weight: 500 !important; text-align: center !important; }
.home-intro-card-desc { font-size: 13.5px !important; font-weight: 400 !important; line-height: 1.55 !important; }
.home-intro-mark { font-size: 13px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-card.is-primary .home-intro-mark { font-size: 14px !important; }
.home-intro-step { font-size: 12px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-tip { font-size: 13px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-tags em { font-size: 11px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-card-go { font-size: 13px !important; font-weight: 500 !important; line-height: 1.4 !important; }
.home-intro-sub { font-size: 13px !important; font-weight: 400 !important; line-height: 1.45 !important; }
/* 基础导航项字体 - 仅适用于一级菜单项 */
.nav-group > .nav-group-toggle { font-size: 12px !important; font-weight: 500 !important; }
.nav-group > .nav-group-toggle.active { font-weight: 500 !important; }

/* 一级菜单项（single_leaf 直接子项） */
.nav-group > .nav-top-item { font-size: 12px !important; font-weight: 500 !important; color: #1e293b !important; }

/* 二级菜单：字体11px，颜色中等灰色 */
.nav-group > .nav-sub > .nav-sub-item {
  font-size: 11px !important;
  font-weight: 400 !important;
  color: #475569 !important;
  padding-left: 28px !important;
}
.nav-group > .nav-sub > .nav-sub-item .nav-label {
  font-size: 11px !important;
  color: #475569 !important;
}

/* 二级菜单激活状态 */
.nav-group > .nav-sub > .nav-sub-item.active .nav-label {
  color: var(--primary-dark) !important;
  font-weight: 500 !important;
}

/* ── 三级菜单专用样式 ── */

/* 三级菜单 - 分组标题（来料检验(IQC) 这种，button 元素，可点击展开/折叠） */
.nav-3rd-head {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 6px 12px 4px 28px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  user-select: none !important;
  margin-top: 4px !important;
  line-height: 1.4 !important;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-3rd-head:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
}
.nav-3rd-head .nav-3rd-head-label,
.nav-3rd-head .nav-label {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  flex: 1 1 auto;
}
.nav-3rd-head .nav-ico {
  display: none !important;
}
/* 折叠/展开箭头 */
.nav-3rd-head-chevron {
  margin-left: auto;
  color: #94a3b8;
  transition: transform 0.2s ease;
}
.nav-3rd-head[aria-expanded="false"] .nav-3rd-head-chevron {
  transform: rotate(-90deg);
}

/* 三级菜单容器 - 默认显示，可通过 hidden 属性折叠 */
.nav-group .nav-sub-inline {
  padding: 0 !important;
  margin: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
}
/* 二级标题折叠时，隐藏同级的三级菜单容器 */
.nav-group .nav-3rd-head[aria-expanded="false"] + .nav-sub-inline {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
}

/* 三级菜单 - 菜单项（来料检验-新增、来料检验-待审-合格 这种） */
.nav-3rd-item,
.nav-group .nav-sub-inline .nav-3rd-item,
.nav-group .nav-sub-inline .nav-sub-item.nav-3rd-item {
  padding-left: 48px !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  line-height: 1.5 !important;
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}
.nav-3rd-item .nav-label,
.nav-group .nav-sub-inline .nav-3rd-item .nav-label {
  font-size: 10px !important;
  color: #64748b !important;
}
.nav-3rd-item.active,
.nav-3rd-item.active .nav-label {
  color: var(--primary-dark) !important;
  font-weight: 500 !important;
}

/* 通用输入框下拉（工单编号/物料代码） */
.gak-input-combo {
  position: relative;
  display: inline-block;
  width: 100%;
}
.gak-input-combo > input {
  width: 100%;
}
.gak-input-combo-panel {
  z-index: 10000;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
  font-size: 12px;
  color: #1e293b;
}
.gak-input-combo-item {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gak-input-combo-item:last-child {
  border-bottom: none;
}
.gak-input-combo-item:hover,
.gak-input-combo-item.is-active {
  background: #e0e7ff;
  color: #1e293b;
}
.gak-input-combo-empty {
  padding: 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* 菜单分组分割线：区分入/出/库存区域 */
.nav-sub-sep {
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(148, 163, 184, 0.35) 20%,
    rgba(148, 163, 184, 0.55) 50%,
    rgba(148, 163, 184, 0.35) 80%,
    transparent 100%);
  margin: 4px 12px 4px 32px;
  border-radius: 1px;
}
.nav-sub-sep[data-sep="io"] {
  margin: 6px 12px 6px 32px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(99, 102, 241, 0.4) 15%,
    rgba(99, 102, 241, 0.6) 50%,
    rgba(99, 102, 241, 0.4) 85%,
    transparent 100%);
}
.nav-sub-sep[data-sep="stock"] {
  margin: 6px 12px 4px 32px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(16, 185, 129, 0.35) 15%,
    rgba(16, 185, 129, 0.55) 50%,
    rgba(16, 185, 129, 0.35) 85%,
    transparent 100%);
}

/* 兼容旧 .nav-sub-nested 结构（如有） */
.nav-group > .nav-sub > .nav-sub-nested > .nav-item {
  font-size: 10px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  padding-left: 44px !important;
}
.nav-group > .nav-sub > .nav-sub-nested > .nav-item .nav-label {
  font-size: 10px !important;
  color: #64748b !important;
}

/* 全局默认（非导航菜单内的nav-item） */
.nav-item:not(.nav-group > .nav-sub > *) { font-size: 12px !important; }
.nav-item.active { font-weight: 500 !important; }

@media (max-width: 640px) {
  .home-intro-brand { font-size: 1.7rem !important; }
}

/* ── 样品申请弹窗：对标桌面表头+明细+参数+签批 ── */
.ib-header-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
/* 样品编号：自动生成只读；字色与其它输入框统一（#002FA7） */
#sa-detail-table input.sa-sample-no-auto[readonly] {
  color: #002FA7;
  background: transparent;
  cursor: default;
}
.sa-detail-intro {
  margin: 0 0 8px;
  color: #5F6368;
  font-size: 12px;
}
.sa-attach-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.sa-attach-summary {
  color: #5F6368;
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}
/* 基本信息：左列六字段不变 · 右列=业务三字段同行 + 下方图片附件区拉满 */
.sa-basic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: stretch;
}
.sa-basic-grid .ib-field {
  min-width: 0;
}
.sa-cust-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  /* 客户 desk-combo 下拉不被父级裁切（对标销售订单） */
  overflow: visible;
}
.sa-cust-stack .ib-field,
.sa-cust-stack .ib-control.desk-combo {
  overflow: visible;
}
.sa-cust-stack .ib-field > label {
  flex: 0 0 84px;
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}
/* 样品申请客户下拉：复用销售订单 desk-combo，适配 ib-control 壳 */
.sa-cust-stack .ib-control.desk-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  padding-right: 0;
}
.sa-cust-stack .ib-control.desk-combo > input {
  flex: 1 1 auto;
  padding-right: 28px;
}
/* 样品申请客户下拉：展开按钮与弹窗标准 desk-combo 一致 */
.sa-cust-stack .desk-combo-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.sa-cust-stack .desk-combo-toggle:hover {
  color: #0d9488;
}
/* 下拉面板已统一为挂 body 的 .desk-combo-panel.is-floating（见全局样式），不再内嵌于表单 */
.sa-right-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
}
/* 下样日期 / 业务员 / 业务联系方式：同行 */
.sa-biz-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  min-width: 0;
  flex: 0 0 auto;
}
.sa-biz-row .ib-field {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.sa-biz-row .ib-field > label {
  flex: none;
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: left;
}
/* 红框：右列图片附件区，下向拉满与左列底对齐 */
.sa-right-col .sa-header-attach-panel {
  flex: 1 1 auto;
  min-height: 140px;
}
.sa-header-attach-panel {
  border: 1px solid #E8EAED;
  background: #FAFBFC;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 8px 10px 10px;
  box-sizing: border-box;
}
/* 对标迈方：拖入高亮、禁滤镜/阴影动画（避免整窗发黑） */
.gak-attach-dropzone {
  outline: none;
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
.gak-attach-dropzone.is-dragover .attach-drop-hint {
  color: #0f766e;
  font-weight: 500;
}
.sa-header-attach-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #202124;
  margin-bottom: 6px;
  min-width: 0;
}
.sa-header-attach-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sa-header-attach-drop {
  flex: 1 1 auto;
  min-height: 96px;
  border: 1px dashed #DADCE0;
  background: #fff;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  outline: none;
}
.sa-header-attach-drop.is-dragover {
  border-color: #0d9488;
  background: #F0FDFA;
  box-shadow: inset 0 0 0 1px #0d9488;
}
.sa-header-attach-drop.is-ro {
  cursor: default;
}
.sa-header-attach-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.sa-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid #E8EAED;
  background: #F8F9FA;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.sa-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 缩略图删除：对标销售订单 so-attach-thumb-del */
.sa-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  border: 0;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.sa-thumb-del:hover {
  background: #dc2626;
}
.sa-thumb-file span {
  font-size: 16px;
  line-height: 1;
}
.sa-thumb-file em {
  font-style: normal;
  font-size: 9px;
  color: #5F6368;
  max-width: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sa-header-attach-hint {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
  color: #9AA0A6;
  font-size: 12px;
  padding: 8px 6px;
  line-height: 1.4;
}
.sa-header-attach-hint[hidden] {
  display: none !important;
}
/* 选择/管理按钮：标题行右侧（不在虚线框内） */
.sa-header-attach-actions {
  display: flex;
  gap: 4px;
  margin: 0;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  padding: 0;
  border: none;
}
.sa-header-attach-actions .btn-text {
  padding: 2px 6px;
  font-size: 12px;
}
/* 上传：label 全覆盖透明 file，点「上传」即点到 input（桌面/平板均可靠） */
.sa-attach-pick-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.sa-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}
/* 样品申请图片预览：复用 .mat-attach-preview（z-index 12000），勿用 .modal(z-index 50) 否则被编辑窗挡住 */
@media (max-width: 900px) {
  .sa-basic-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sa-biz-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .sa-biz-row .ib-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .sa-biz-row .ib-field > label {
    flex: 0 0 84px;
    width: 84px;
    min-width: 84px;
    max-width: 84px;
    text-align: right;
  }
}
.sa-attach-hint,
.sa-param-img-hint {
  color: #9AA0A6;
  font-size: 12px;
}
.sa-param-img-hint {
  margin: 4px 0 0;
}
.sa-param-main {
  display: grid;
  /* 左：参数两列等分区 · 右：客供产品图片下向拉满与左侧同高 */
  grid-template-columns: minmax(0, 1fr) minmax(220px, 32%);
  gap: 12px 16px;
  align-items: stretch;
}
.sa-param-fields {
  min-width: 0;
  width: 100%;
}
.sa-param-body .sa-param-row {
  display: grid;
  /* 左右字段列严格等分 */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 16px;
  margin-bottom: 8px;
  align-items: center;
}
.sa-param-body .sa-param-row-full {
  grid-template-columns: minmax(0, 1fr);
}
/* 参数区：标签列按最长文案收齐（完整显示），两列仍等分 */
.sa-param-fields .ib-field {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.sa-param-fields .ib-field > label {
  flex: none;
  width: auto;
  min-width: 7.5em;
  max-width: none;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}
.sa-param-fields .ib-field .ib-control {
  width: 100%;
  min-width: 0;
}
.sa-param-fields .sa-param-row-full .ib-field {
  grid-template-columns: max-content minmax(0, 1fr);
}
/* 同行两列标签同宽，避免左短右长视觉不齐 */
.sa-param-body .sa-param-row:not(.sa-param-row-full) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.sa-param-body .sa-param-row:not(.sa-param-row-full) .ib-field > label {
  min-width: 11em; /* 够放下「线材长度/mm(不含端子)」 */
}
/* 客供产品图片：复用头图附件样式，并随左侧参数区下向拉满（grid stretch 等高，底部对齐） */
.sa-param-img-panel.sa-header-attach-panel {
  align-self: stretch;
  height: auto;
  min-height: 140px;
}
.sa-param-img-panel .sa-header-attach-drop {
  flex: 1 1 auto;
  min-height: 120px;
  /* 有图时预览占满虚线区（按钮条除外），勿再顶左角贴 56px 小图 */
  overflow: hidden;
}
.sa-param-img-panel .sa-header-attach-thumbs {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  /* 图片预览限高：附件区高度受控，与左侧参数填写区等高、底部对齐；多图时滚动查看 */
  max-height: 250px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  align-content: stretch;
  align-items: stretch;
}
/* 附件图/拖拽区在面板内垂直居中，避免下方留白（参数区内容高度固定） */
.sa-param-img-panel .sa-header-attach-drop {
  justify-content: center;
}
.sa-param-img-panel .sa-header-attach-thumbs.has-preview {
  min-height: 96px;
}
/* 单图：整区预览 */
.sa-param-img-panel .sa-header-attach-thumbs:has(.sa-thumb:only-child) {
  grid-template-columns: minmax(0, 1fr);
}
.sa-param-img-panel .sa-thumb {
  width: 100%;
  height: 100%;
  min-height: 96px;
  border-radius: 4px;
}
.sa-param-img-panel .sa-header-attach-thumbs:has(.sa-thumb:only-child) .sa-thumb {
  min-height: 100%;
}
.sa-param-img-panel .sa-thumb img {
  width: 100%;
  height: 100%;
  max-height: 246px;
  object-fit: contain; /* 按区域完整显示，不裁切 */
  background: #F8F9FA;
}
.sa-attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sa-attach-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #F1F3F4;
}
.sa-attach-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.sa-attach-empty {
  color: #9AA0A6;
  font-size: 13px;
  text-align: center;
  padding: 24px;
}
.modal.gak-desk .modal-card-desk-sa-attach {
  width: min(560px, 96vw);
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
}
@media (max-width: 900px) {
  .sa-param-main {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sa-sign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.sa-sign-grp {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 240px;
  min-width: 220px;
}
.sa-sign-grp label {
  color: #5F6368;
  font-size: 12px;
  white-space: nowrap;
}
.sa-sign-grp input {
  flex: 1 1 72px;
  min-width: 64px;
  max-width: 140px;
  height: 32px;
  border: 1px solid #DADCE0;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  font: inherit;
  color: #002FA7;
  background: #fff;
  box-sizing: border-box;
}
.sa-sign-grp input[type="date"] {
  color: #002FA7;
  color-scheme: light;
  cursor: pointer;
}
.sa-sign-grp input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
/* 样品申请整单：输入字色统一，避免 date / autofill / 签批区各走各的 */
.sa-sample-host .ib-control > input,
.sa-sample-host .ib-control > select,
.sa-sample-host .ib-control > textarea,
.sa-sample-host .ib-detail-table input,
.sa-sample-host .sa-sign-grp input {
  color: #002FA7;
  -webkit-text-fill-color: #002FA7;
}
.sa-sample-host .ib-control > input[type="date"],
.sa-sample-host .ib-detail-table input[type="date"] {
  color: #002FA7;
  -webkit-text-fill-color: #002FA7;
  color-scheme: light;
}
.sa-sample-host input:-webkit-autofill,
.sa-sample-host input:-webkit-autofill:hover,
.sa-sample-host input:-webkit-autofill:focus,
.sa-sample-host textarea:-webkit-autofill {
  -webkit-text-fill-color: #002FA7;
  caret-color: #002FA7;
  transition: background-color 99999s ease-in-out 0s;
}

/* 样品申请 · 审批流程设置：勾选矩阵（复用 .wf-matrix / .wf-ck） */
.modal.gak-desk .modal-card-desk.modal-card-sa-signoff {
  width: max-content;
  min-width: min(520px, 96vw);
  max-width: min(98vw, 980px);
}
.sa-wf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.sa-wf-move {
  font-size: 13px !important;
  padding: 2px 8px !important;
  color: #137333 !important;
  background: transparent !important;
}
.sa-wf-move:hover {
  background: #E6F4EA !important;
  color: #0D652D !important;
}
.sa-wf-sel-label {
  font-size: 12px;
  color: #5F6368;
  margin-left: 4px;
}
.sa-wf-matrix .sa-wf-step-th {
  cursor: pointer;
  user-select: none;
}
.sa-wf-matrix .sa-wf-step-th.is-active {
  background: #D2E3FC !important;
  color: #174EA6;
}
.sa-wf-matrix .sa-wf-step-th:hover {
  background: #E8F0FE !important;
}

/* ── 出勤工时（移植自迈方 MES） ────────────────────────────── */
.mes-attend-panel {
  max-width: min(1280px, 100%);
  padding: 12px 16px 24px;
}
.mes-attend-panel-wide {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}
.mes-attend-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.mes-attend-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}
.mes-attend-section {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.mes-attend-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.mes-attend-defaults {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 32px 40px;
  align-items: stretch;
  width: 100%;
}
.mes-attend-defaults .mes-attend-time-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  width: 100%;
  white-space: normal;
  margin: 0;
  padding: 10px 8px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  border-top-width: 3px;
  box-sizing: border-box;
  background: #f8fafc;
}
.mes-attend-defaults .mes-attend-tone-label {
  text-align: center;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.mes-attend-defaults .mes-attend-time-inputs {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 4px;
}
.mes-attend-defaults .mes-attend-time-inputs input[type="time"] {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: none;
  box-sizing: border-box;
  background: #fff;
}
.mes-attend-tone-work {
  border-color: #99f6e4;
  border-top-color: #0d9488;
  background: #f0fdfa;
}
.mes-attend-tone-work .mes-attend-tone-label { color: #0f766e; }
.mes-attend-tone-am {
  border-color: #bfdbfe;
  border-top-color: #2563eb;
  background: #eff6ff;
}
.mes-attend-tone-am .mes-attend-tone-label { color: #1d4ed8; }
.mes-attend-tone-noon {
  border-color: #fde68a;
  border-top-color: #d97706;
  background: #fffbeb;
}
.mes-attend-tone-noon .mes-attend-tone-label { color: #b45309; }
.mes-attend-tone-pm {
  border-color: #ddd6fe;
  border-top-color: #7c3aed;
  background: #f5f3ff;
}
.mes-attend-tone-pm .mes-attend-tone-label { color: #6d28d9; }
.mes-attend-tone-eve {
  border-color: #fecdd3;
  border-top-color: #e11d48;
  background: #fff1f2;
}
.mes-attend-tone-eve .mes-attend-tone-label { color: #be123c; }
.mes-attend-tone-ot {
  border-color: #fdba74;
  border-top-color: #ea580c;
  background: #fff7ed;
}
.mes-attend-tone-ot .mes-attend-tone-label { color: #c2410c; }
.mes-attend-day-table th.th-slot-work { color: #0f766e; background: #f0fdfa; }
.mes-attend-day-table th.th-slot-am { color: #1d4ed8; background: #eff6ff; }
.mes-attend-day-table th.th-slot-noon { color: #b45309; background: #fffbeb; }
.mes-attend-day-table th.th-slot-pm { color: #6d28d9; background: #f5f3ff; }
.mes-attend-day-table th.th-slot-eve { color: #be123c; background: #fff1f2; }
.mes-attend-day-table th.th-slot-ot { color: #c2410c; background: #fff7ed; }
.mes-attend-day-table td.col-slot-work { background: rgba(240, 253, 250, 0.45); }
.mes-attend-day-table td.col-slot-am { background: rgba(239, 246, 255, 0.45); }
.mes-attend-day-table td.col-slot-noon { background: rgba(255, 251, 235, 0.55); }
.mes-attend-day-table td.col-slot-pm { background: rgba(245, 243, 255, 0.5); }
.mes-attend-day-table td.col-slot-eve { background: rgba(255, 241, 242, 0.5); }
.mes-attend-day-table td.col-slot-ot { background: rgba(255, 247, 237, 0.55); }
@media (max-width: 1100px) {
  .mes-attend-defaults {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .mes-attend-defaults {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.mes-attend-month-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.mes-attend-month-bar strong {
  min-width: 5.5em;
  text-align: center;
  font-size: 14px;
}
.mes-attend-month-summary {
  margin: 0 0 8px;
  font-size: 12px;
  color: #64748b;
}
.mes-attend-day-list {
  max-height: min(62vh, 560px);
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.mes-attend-day-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mes-attend-day-table-wide {
  min-width: 1100px;
}
.mes-attend-day-table th,
.mes-attend-day-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.mes-attend-day-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-weight: 500;
  color: #475569;
}
.mes-attend-day-table tr.is-sunday {
  background: #fff7ed;
}
.mes-attend-day-table tr.is-rest .col-flag {
  color: #b45309;
}
.mes-attend-day-table tr.is-work .col-flag {
  color: #0f766e;
}
.mes-attend-day-table tr.is-ot .col-ot {
  color: #c2410c;
  font-weight: 500;
}
.mes-attend-day-table tr.is-rest .col-slot {
  opacity: 0.45;
}
.mes-attend-day-table td.col-ot .mes-attend-toggle input:disabled + span {
  opacity: 0.55;
}
.mes-attend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.mes-attend-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
}
.mes-attend-slot {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.mes-attend-slot input[type="time"] {
  padding: 2px 3px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  background: #fff;
  width: 6.6em;
}
.mes-attend-slot .tilde,
.mes-attend-time-inputs .tilde {
  color: #94a3b8;
  font-size: 12px;
}
.mes-attend-time-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}
.mes-attend-time-row > span:first-child {
  font-size: 12px;
  color: var(--muted, #64748b);
}
.mes-attend-time-inputs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mes-attend-time-inputs input[type="time"] {
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  width: 7.2em;
}

/* ── BOM 管理：右侧表头+明细（对标桌面 GAK_bom_edit_window）── */
#page-module.is-mat-split-page[data-split-mode="bom"] #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom_list"] #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-edit-host {
  padding: 8px 10px 12px !important;
  background: #eef1f4 !important;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}
.bom-form-root {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}
.bom-form-root .desk-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin: 0;
  padding: 0 0 8px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden; /* 禁止被宽表明细撑破，横滚只在 .bom-detail-wrap */
  box-sizing: border-box;
}
.bom-form-root .desk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.bom-detail-cols-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.bom-no-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bom-no-label {
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}
.bom-no-input {
  width: 180px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  background: #fff;
}
.bom-no-input[readonly] {
  background: #f8fafc;
  color: #0f172a;
}
/* 可搜索下拉：分栏 BOM/工艺路线表单（不限 .modal 作用域） */
.bom-form-root .desk-combo,
.pr-form-root .desk-combo,
#page-module.is-mat-split-page .desk-combo {
  position: relative;
  display: flex;
  align-items: stretch;
  padding-right: 0;
}
.bom-form-root .desk-combo > input,
.pr-form-root .desk-combo > input,
#page-module.is-mat-split-page .desk-combo > input {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 28px;
}
.bom-form-root .desk-combo-toggle,
.pr-form-root .desk-combo-toggle,
#page-module.is-mat-split-page .desk-combo-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
/* BOM编号：原生 select（对标工艺路线物料代码）+ 自动生成 */
.bom-header-form .bom-no-field-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.bom-header-form .bom-no-field-wrap > select[data-bom-template-select] {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  box-sizing: border-box;
}
.bom-header-form .bom-no-gen-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 26px;
}
.bom-header-form.desk-form-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  row-gap: 8px;
  column-gap: 12px;
}
.bom-header-form .desk-cell > .desk-field > input,
.bom-header-form .desk-cell > .desk-field > select,
.bom-header-form .desk-cell > .desk-field > .bom-no-field-wrap {
  min-height: 28px;
  box-sizing: border-box;
}
.bom-header-form .desk-cell:not(.desk-span-full) input[data-mod-field="备注"],
.bom-header-form .desk-cell:not(.desk-span-full) textarea[data-mod-field="备注"] {
  min-height: 28px !important;
  height: 28px !important;
  max-height: 28px !important;
  line-height: 20px !important;
  resize: none !important;
  overflow: hidden;
  box-sizing: border-box;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout {
  align-items: stretch;
  align-content: start;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-main,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-main {
  display: block;
  min-height: 0;
  align-self: stretch;
}
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-main > .bom-header-card,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-main > .bom-header-card {
  flex: none;
}
.bom-detail-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  box-sizing: border-box;
}
.bom-detail-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0 8px 8px; /* 内边距代替 wrap 左右 margin，避免 100%+margin 撑破 */
}
.bom-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px 6px;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}
.bom-detail-tip {
  font-size: 12px;
  color: #64748b;
  flex: 1 1 100px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bom-detail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
}
/* 唯一允许横向滚动的容器：不撑破右侧面板 */
.bom-detail-wrap {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 6px;
  margin: 0; /* 左右边距改由 .bom-detail-body padding 承担 */
  max-height: min(48vh, 420px);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  position: relative;
}
.bom-detail-wrap.table-wrap {
  border-radius: 6px;
  max-height: min(48vh, 420px);
}
.bom-detail-table {
  width: max-content;
  max-width: none;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  margin: 0;
}
.bom-detail-table th,
.bom-detail-table td {
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 4px 6px;
  border-right: 1px solid #e8efee;
  border-bottom: 1px solid #e8efee;
  vertical-align: middle;
  font-size: 12px;
  white-space: nowrap;
  box-sizing: border-box;
}
.bom-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0f766e;
  color: #fff;
  font-weight: 500;
  text-align: center;
}
.bom-detail-table td {
  background: #fff;
  text-align: center;
}
.bom-detail-table td.left,
.bom-detail-table td.left .bom-detail-input {
  text-align: left;
}
.bom-mat-combo-cell {
  padding: 2px 4px !important;
  overflow: visible !important;
}
.bom-mat-combo {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  gap: 0;
}
.bom-mat-combo .bom-detail-input {
  flex: 1 1 auto;
  min-width: 0;
}
.bom-mat-combo-toggle {
  flex: 0 0 22px;
  width: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
}
.bom-mat-combo-toggle:hover {
  color: #0f766e;
  background: #f0fdfa;
}
.bom-mat-combo-panel {
  z-index: 14000;
}
.bom-detail-table tr.is-selected td {
  background: #d1fae5;
}
/* 替换料行：与桌面 bom_substitute 一致，红字；行号与主料相同 */
.bom-detail-table tr.is-bom-substitute td,
.bom-detail-table tr.is-bom-substitute .bom-detail-input {
  color: #d32f2f;
}
.bom-detail-table .bom-detail-idx {
  text-align: center;
  color: #475569;
}
.bom-detail-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 12px;
  padding: 3px 4px;
  box-sizing: border-box;
  text-align: inherit;
  color: inherit;
}
.bom-detail-input:focus {
  outline: none;
  border-color: #38bdf8;
  background: #f8fafc;
}
select.bom-detail-input {
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}
.bom-form-error {
  margin: 0 4px;
}
.bom-ctx-menu {
  position: absolute;
  z-index: 40;
  min-width: 140px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.bom-ctx-menu[hidden] {
  display: none !important;
}
.bom-ctx-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  color: #0f172a;
}
.bom-ctx-menu button:hover {
  background: #f1f5f9;
}

/* ── 新增首件检验：右侧表单区（对标桌面 IPQCFAIDialog）── */
#page-module.is-mat-split-page[data-split-mode="fai_new"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
}
/* ── 制程/出货/成品检验 列表与待审分栏：与首件检验(FAI)同式样 ──
   灰底画布 + 渐变绿标题栏（默认）+ 表单直接铺满（无 modal 白壳）── */
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
  /* 统一由内部 .desk-form-2 滚动，避免与最外层滚动条重复（最右边只留一条） */
  overflow-y: hidden;
  overflow-x: hidden;
  scrollbar-gutter: auto;
}
/* 白卡片画布（modal 壳同款 .desk-card 结构），撑满灰底，无卡片头 */
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .desk-card-qms-inspect {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .desk-card-qms-inspect .desk-form-2 {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  padding: 12px;
  /* 确保白色背景填满整个高度，内容少时不显灰底 */
  align-content: start;
}
/* IQC/OQC 整页表单在分栏视图跨满两列（与 modal 壳 #module-edit-form 同语义） */
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .desk-card-qms-inspect .desk-form-2 > .iqc-edit,
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .desk-card-qms-inspect .desk-form-2 > .iqc-edit + * {
  grid-column: 1 / -1;
}
/* 检验明细区在右侧拉高按内容展开（对齐 QMS 分栏），减少纵向滚动跳跃 */
#page-module.is-mat-split-page[data-split-mode="qms_inspect"] .qms-insp-wrap {
  max-height: none;
}
#page-module.is-mat-split-page .mat-split-right-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  background: #fff;
  /* 按钮区在顶部（标题头下）：分隔线放下方与表单区隔开 */
  border-bottom: 1px solid #e2e8f0;
  border-top: 0;
}
/* 按钮并入标题头动作区（与标题同一行）：取消独立行样式 */
#page-module.is-mat-split-page .mat-split-right-actions .mat-split-right-foot {
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  gap: 8px;
}
.fai-form-root {
  /* 顶部无标题栏：去除上内边距，基本信息卡片紧贴预览区顶部 */
  padding: 0 24px 32px;
  min-height: 100%;
  box-sizing: border-box;
}
.fai-card {
  margin-bottom: 12px;
}
.fai-card-body {
  padding: 10px 16px 14px;
}
.fai-grid {
  display: grid;
  gap: 6px 10px;
}
.fai-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.fai-cell {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fai-cell.fai-span-2 { grid-column: span 2; }
.fai-cell.fai-span-4,
.fai-cell.fai-span-full { grid-column: 1 / -1; }
.fai-label {
  text-align: left;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}
.fai-field { min-width: 0; }
.fai-field-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fai-input,
.fai-insp-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  min-height: 30px;
}
.fai-input[readonly] { background: #f8fafc; color: #475569; }
textarea.fai-input { resize: vertical; min-height: 48px; }
.fai-choice-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: stretch;
  width: 100%;
}
.fai-choice-btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
  min-height: 28px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fai-choice-btn.is-on {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  font-weight: 500;
}
.fai-judge-row { gap: 10px; }
.fai-insp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.fai-insp-tip {
  font-size: 12px;
  color: #64748b;
}
.fai-insp-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.fai-insp-wrap {
  overflow: auto;
  max-height: 340px;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  background: #fff;
}
.fai-insp-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 12px;
}
.fai-insp-table th,
.fai-insp-table td {
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #eef2f7;
  padding: 3px 5px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.fai-insp-table th {
  background: #0f766e;
  color: #fff;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 2;
}
.fai-insp-table th:last-child,
.fai-insp-table td:last-child { border-right: 0; }
.fai-insp-table td.fai-insp-idx { color: #94a3b8; width: 40px; min-width: 40px; }
.fai-insp-table tr.is-selected { background: #ecfdf5; }
.fai-insp-input {
  min-height: 26px;
  padding: 3px 6px;
  border-color: transparent;
  background: transparent;
  min-width: 60px;
}
.fai-insp-table tr:hover .fai-insp-input,
.fai-insp-table tr.is-selected .fai-insp-input {
  border-color: #cbd5e1;
  background: #fff;
}
.fai-conc-btn {
  min-width: 52px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 2px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  color: #64748b;
}
.fai-conc-btn.is-ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
  font-weight: 500;
}
.fai-conc-btn.is-ng {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
  font-weight: 500;
}
.fai-form-no {
  text-align: right;
  color: #94a3b8;
  font-size: 12px;
  padding: 4px 8px 8px;
}
.fai-form-root .iqc-form-no-bottom {
  margin-top: 4px;
  padding: 6px 8px 12px;
}
.fai-form-error {
  margin: 0 8px 8px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 2px;
  font-size: 13px;
}
.fai-muted {
  font-size: 12px;
  color: #94a3b8;
  padding: 4px 0;
}
@media (max-width: 1200px) {
  .fai-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fai-cell.fai-span-2 { grid-column: span 2; }
}

/* PLM 分栏右侧：与 BOM 新建同一套铺满链（明细吃剩余高度）
   根因：.bom-form-root .desk-card { flex:0 0 auto } 会压住明细；
   BOM 用 [data-split-mode=bom] 覆盖，工艺路线等须用 .is-plm-status-split 同等覆盖 */
#page-module.is-mat-split-page.is-plm-status-split .mat-split-right,
#page-module.is-mat-split-page.is-plm-status-split .mat-split-right-body {
  overflow-x: hidden !important;
  min-width: 0 !important;
  max-width: 100%;
}
#page-module.is-mat-split-page.is-plm-status-split .mat-split-right-body {
  overflow-y: hidden !important;
  scrollbar-gutter: stable;
}
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit.is-mat-split-page,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-card,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-card-desk,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-card-desk-mod-edit,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-card-split-fill,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-body-desk,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-body-desk > .desk-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-body-desk {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-body-desk > .desk-card {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit .modal-body-desk > .desk-card > .desk-card-head {
  display: none !important;
}
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page.is-plm-status-split #modal-module-edit #module-edit-form.pr-edit-host,
#page-module.is-mat-split-page.is-plm-status-split #module-edit-form.bom-edit-host,
#page-module.is-mat-split-page.is-plm-status-split #module-edit-form.pr-edit-host {
  background: #eef1f4 !important;
  padding: 8px 8px 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
#page-module.is-mat-split-page.is-plm-status-split .bom-form-root,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px;
  width: 100% !important;
  max-width: 100% !important;
}
#page-module.is-mat-split-page.is-plm-status-split .bom-form-root > .bom-header-card,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .pr-header-card,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root .product-edit-main > .pr-header-card {
  flex: 0 0 auto !important;
  width: 100%;
}
/* 工艺路线 / 测试标准：表头+附件对齐（对标 BOM，禁止附件 min-height 撑破底边） */
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 10px 12px;
  align-items: stretch;
  align-content: start;
  --product-head-h: auto;
  overflow: hidden;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-main {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  align-self: stretch !important;
  display: block !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-main > .pr-header-card {
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  height: auto !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach {
  align-self: stretch !important;
  height: var(--product-head-h) !important;
  min-height: var(--product-head-h) !important;
  max-height: var(--product-head-h) !important;
  overflow: hidden !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach .empty.small {
  padding: 6px 4px !important;
}
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach .attach-drop-hint {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}
#page-module.is-mat-split-page.is-plm-status-split .bom-form-root > .bom-detail-card,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .pr-detail-card {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  width: 100%;
}
#page-module.is-mat-split-page.is-plm-status-split .bom-detail-body,
#page-module.is-mat-split-page.is-plm-status-split .pr-detail-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#page-module.is-mat-split-page.is-plm-status-split .bom-detail-wrap,
#page-module.is-mat-split-page.is-plm-status-split .pr-detail-wrap {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  width: 100%;
  scrollbar-gutter: stable;
}

/* PLM 分栏表单（技术文档 / ECR / ECN / 项目 / 设计评审 / 问题追踪）：
   左侧字段 + 右侧标准附件；勿套产品头区 300px 拉伸；输入框 28px（textarea 除外） */
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-host,
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) #module-edit-form.product-edit-host {
  height: auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  background: #eef1f4 !important;
  padding: 8px !important;
  box-sizing: border-box !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout {
  align-items: stretch !important;
  align-content: start !important;
  height: auto !important;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 10px 12px;
  box-sizing: border-box;
  --product-head-h: auto;
  overflow: hidden;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-main {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
  align-self: stretch !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-main > .desk-form-2 {
  height: auto !important;
  min-height: 0 !important;
  flex: none !important;
  grid-auto-rows: auto !important;
  align-content: start !important;
  row-gap: 8px;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-main .desk-form-2 > .desk-cell {
  align-self: start !important;
  align-items: center !important;
  min-height: 32px !important;
  height: auto !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-main .desk-form-2 > .desk-cell > .desk-field:not(textarea) {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  align-self: center !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-main .desk-form-2 > .desk-cell > textarea.desk-field {
  height: auto !important;
  min-height: 64px !important;
  max-height: none !important;
  align-self: stretch !important;
  resize: vertical;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach {
  align-self: stretch !important;
  height: var(--product-head-h) !important;
  min-height: var(--product-head-h) !important;
  max-height: var(--product-head-h) !important;
  overflow: hidden !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach > .gak-std-attach {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach .empty.small {
  padding: 6px 4px !important;
}
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach .attach-drop-hint {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}

.pr-form-error {
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 2px;
  font-size: 13px;
}
.pr-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.pr-detail-table tbody tr.is-selected td {
  background: #e0e7ff;
}
.pr-detail-table tbody tr {
  cursor: pointer;
}
.pr-step-modal {
  position: fixed;
  inset: 0;
  z-index: 12050;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.pr-step-modal-card {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}
.pr-step-modal-head {
  padding: 12px 16px;
  font-weight: 500;
  border-bottom: 1px solid #e2e8f0;
}
.pr-step-modal-body {
  padding: 12px 16px;
}
.pr-step-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #e2e8f0;
}

/* ===== GAK-ATTACH-FIT-003：表头附件底边对齐（BOM/工艺路线/PLM 分栏表单）=====
   用 syncBomHeadHeightLock 量出的 --product-head-h 锁右侧高度；
   禁止 --product-head-h:auto !important（会盖住 JS inline 赋值导致永远不生效）。
   同时压过 #modal-module-edit .gak-std-attach { min-height:180px }。 */
#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach,
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach,
#modal-module-edit.is-mat-split-page .product-edit-layout > .product-edit-attach {
  height: var(--product-head-h, auto) !important;
  min-height: var(--product-head-h, auto) !important;
  max-height: var(--product-head-h, none) !important;
  overflow: hidden !important;
}

#page-module.is-mat-split-page[data-split-mode="bom"] .bom-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach,
#page-module.is-mat-split-page[data-split-mode="bom_list"] .bom-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach,
#page-module.is-mat-split-page.is-plm-status-split .pr-form-root > .product-edit-layout > .product-edit-attach > .gak-std-attach,
#page-module.is-mat-split-page.is-plm-status-split:not([data-split-mode="products"]):not([data-split-mode="products_list"]) .product-edit-layout > .product-edit-attach > .gak-std-attach,
#modal-module-edit.is-mat-split-page .product-edit-layout > .product-edit-attach > .gak-std-attach,
#modal-module-edit .product-edit-layout > .product-edit-attach > .gak-std-attach {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#page-module.is-mat-split-page .product-edit-layout > .product-edit-attach .attach-list,
#modal-module-edit.is-mat-split-page .product-edit-layout > .product-edit-attach .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

#page-module.is-mat-split-page .product-edit-layout > .product-edit-attach .empty.small,
#modal-module-edit.is-mat-split-page .product-edit-layout > .product-edit-attach .empty.small {
  padding: 4px !important;
}

#page-module.is-mat-split-page .product-edit-layout > .product-edit-attach .attach-drop-hint,
#modal-module-edit.is-mat-split-page .product-edit-layout > .product-edit-attach .attach-drop-hint {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  flex: 0 0 auto !important;
}

/* ── 认证管理：附件为主（上传 / 查看 / 下载）── */
.cert-edit-host {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 0 !important;
  overflow: hidden !important;
  background: #f1f5f9 !important;
}
.cert-edit-layout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 8px 10px 6px;
  box-sizing: border-box;
}
.cert-edit-meta {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px 8px;
}
.cert-edit-meta-head {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  margin: 0 0 6px;
}
.desk-form-cert {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
  align-content: start;
  padding: 0;
  --desk-label-w: 84px;
}
@media (max-width: 1100px) {
  .desk-form-cert {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* 标签与输入同一行，压矮基本信息 */
.desk-form-cert > .desk-cell {
  min-width: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 !important;
}
.desk-form-cert > .desk-cell > label {
  flex: 0 0 var(--desk-label-w) !important;
  width: var(--desk-label-w) !important;
  min-width: var(--desk-label-w) !important;
  max-width: var(--desk-label-w) !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #64748b !important;
  text-align: right !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
.desk-form-cert > .desk-cell > .desk-field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 28px !important;
  height: 28px !important;
}
.desk-form-cert > .desk-cell > .desk-field > input,
.desk-form-cert > .desk-cell > .desk-field > select {
  min-height: 26px !important;
  height: 26px !important;
  width: 100%;
  font-size: 12px !important;
  padding: 0 6px !important;
}
.cert-edit-vault {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
}
#modal-module-edit .cert-edit-vault > .gak-std-attach.is-cert-vault,
.cert-edit-vault > .gak-std-attach.is-cert-vault {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  padding: 12px 14px 10px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}
#modal-module-edit .cert-edit-vault > .gak-std-attach.is-cert-vault.is-dragover,
.cert-edit-vault > .gak-std-attach.is-cert-vault.is-dragover {
  border-color: #0d9488 !important;
  background: #f0fdfa !important;
  box-shadow: inset 0 0 0 1px #0d9488;
}
.cert-edit-vault .gak-std-attach-bar {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px;
  margin: 0 0 10px !important;
  padding: 0 0 10px !important;
  border-bottom: 1px solid #e2e8f0;
}
.cert-edit-vault .section-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
}
#modal-module-edit .cert-edit-vault .cert-upload-btn,
.cert-edit-vault .cert-upload-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: 34px;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  cursor: pointer;
  color: #fff !important;
  background: #0d9488 !important;
  border: 1px solid #0d9488 !important;
}
#modal-module-edit .cert-edit-vault .cert-upload-btn:hover,
.cert-edit-vault .cert-upload-btn:hover {
  background: #0f766e !important;
  border-color: #0f766e !important;
}
.cert-vault-dropcta {
  flex: 0 0 auto;
  margin: 0 0 10px;
  padding: 22px 14px;
  text-align: center;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
}
.cert-vault-dropcta:hover {
  border-color: #0d9488;
  background: #f0fdfa;
}
.cert-vault-dropcta-title {
  font-size: 15px;
  font-weight: 500;
  color: #0f766e;
  margin-bottom: 4px;
}
.cert-vault-dropcta-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
#modal-module-edit .cert-edit-vault .attach-list,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .cert-edit-vault .attach-list,
.cert-edit-vault .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 2px 0 8px !important;
}
/* 覆盖全局竖排大卡片：认证文件强制一条一行 */
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-item,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-item,
#modal-module-view .gak-std-attach.is-cert-vault .attach-item,
.cert-edit-vault .gak-std-attach.is-cert-vault .attach-item {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  min-height: 40px !important;
  max-height: none !important;
  height: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
}
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-preview,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-thumb,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-thumb-ph,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .cert-file-badge,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-preview,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-thumb,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-thumb-ph,
#modal-module-edit .gak-std-attach.is-cert-vault .cert-file-badge,
#modal-module-edit .mat-edit-attach.is-cert-vault .attach-thumb,
#modal-module-edit .mat-edit-attach.is-cert-vault .attach-thumb-ph,
.cert-edit-vault .attach-preview,
.cert-edit-vault .attach-thumb,
.cert-edit-vault .attach-thumb-ph,
.cert-edit-vault .cert-file-badge {
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 5px !important;
  object-fit: cover !important;
  overflow: hidden !important;
}
.cert-edit-vault .cert-file-badge,
#modal-module-edit .gak-std-attach.is-cert-vault .cert-file-badge {
  background: #ecfdf5 !important;
  color: #0f766e !important;
  border: 1px solid #99f6e4 !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em;
}
#modal-module-edit .gak-std-attach.is-cert-vault .attach-name-row,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-name-row,
.cert-edit-vault .attach-name-row {
  flex: 1 1 auto !important;
  min-width: 160px !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#modal-module-edit .gak-std-attach.is-cert-vault .attach-name-row > a,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-name-row > span,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-open,
#modal-module-edit .gak-std-attach.is-cert-vault .attach-name-plain,
.cert-edit-vault .attach-name-row > a,
.cert-edit-vault .attach-name-row > span,
.cert-edit-vault .attach-open,
.cert-edit-vault .attach-name-plain {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: none !important;
  color: #0f172a !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  text-decoration: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: hidden !important;
}
#modal-module-edit .gak-std-attach.is-cert-vault .attach-name,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .attach-name,
.cert-edit-vault .attach-name {
  display: inline !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  max-width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#modal-module-edit .gak-std-attach.is-cert-vault .attach-size,
.cert-edit-vault .attach-size {
  display: inline !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  margin-left: 4px;
}
/* 关键：禁止 width:100% 把文件名挤没 */
#modal-module-edit .gak-std-attach.is-cert-vault .attach-actions,
#modal-module-edit .gak-std-attach.is-cert-vault .cert-attach-actions,
#page-module.is-mat-split-page #modal-module-edit.is-mat-split-page .gak-std-attach.is-cert-vault .cert-attach-actions,
.cert-edit-vault .cert-attach-actions,
.cert-edit-vault .attach-actions {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  justify-content: flex-end !important;
}
#modal-module-edit .gak-std-attach.is-cert-vault .cert-attach-actions .tb-btn,
.cert-attach-actions .tb-btn {
  min-width: 48px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}
#modal-module-edit .gak-std-attach.is-cert-vault .cert-attach-actions .tb-btn.primary,
.cert-attach-actions .tb-btn.primary {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}
#modal-module-edit .gak-std-attach.is-cert-vault .cert-attach-actions .tb-btn.danger-text,
.cert-attach-actions .tb-btn.danger-text {
  color: #dc2626 !important;
  background: #fff;
  border: 1px solid #fecaca;
}
#modal-module-edit .gak-std-attach.is-cert-vault .attach-drop-hint,
.cert-edit-vault .attach-drop-hint {
  flex: 0 0 auto !important;
  margin: 4px 0 0 !important;
  padding: 8px !important;
  text-align: center;
  font-size: 12px !important;
  color: #94a3b8 !important;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px dashed #e2e8f0;
}
.cert-vault-empty {
  padding: 36px 12px !important;
  color: #94a3b8 !important;
  text-align: center;
}
#page-module.is-mat-split-page[data-split-mode^="cert_"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode^="cert_"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card,
#page-module.is-mat-split-page[data-split-mode="tech_document"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="tech_document"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card,
#page-module.is-mat-split-page[data-split-mode="tech_document_list"] #modal-module-edit.is-mat-split-page .modal-body-desk,
#page-module.is-mat-split-page[data-split-mode="tech_document_list"] #modal-module-edit.is-mat-split-page .modal-body-desk > .desk-card {
  overflow: hidden !important;
}
#page-module.is-mat-split-page[data-split-mode^="cert_"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host,
#page-module.is-mat-split-page[data-split-mode="tech_document"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host,
#page-module.is-mat-split-page[data-split-mode="tech_document_list"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host {
  height: 100%;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #f1f5f9 !important;
}
#page-module.is-mat-split-page[data-split-mode^="cert_"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host > .cert-edit-layout,
#page-module.is-mat-split-page[data-split-mode="tech_document"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host > .cert-edit-layout,
#page-module.is-mat-split-page[data-split-mode="tech_document_list"] #modal-module-edit.is-mat-split-page #module-edit-form.cert-edit-host > .cert-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
}
#page-module.is-mat-split-page[data-split-mode^="cert_"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="tech_document"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="tech_document_list"] .mat-split-right-body {
  overflow: hidden;
}
/* 弹窗态（非分栏）同样铺满 */
#modal-module-edit:not(.is-mat-split-page) #module-edit-form.cert-edit-host {
  min-height: 420px;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: #f1f5f9;
}
#modal-module-edit:not(.is-mat-split-page) #module-edit-form.cert-edit-host > .cert-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
}

/* ── 盘点计划：左侧输入框 + 右侧图片附件（左右分栏，专业排版）── */
#modal-module-edit #module-edit-form.stocktake-edit-host {
  height: 100%;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #f1f5f9 !important;
}
#modal-module-edit #module-edit-form.stocktake-edit-host > .stocktake-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
}
.stocktake-edit-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  height: 100%;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px 8px;
}
/* 左卡片：基本信息 */
.stocktake-edit-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px 12px;
  box-sizing: border-box;
  overflow: hidden;
}
/* 两列网格：标签在左锁宽，输入框对齐 */
.desk-form-stocktake {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  align-content: start;
  padding: 4px 0 0;
  --desk-label-w: 84px;
}
@media (max-width: 900px) {
  .desk-form-stocktake {
    grid-template-columns: 1fr;
  }
}
.desk-form-stocktake > .desk-cell {
  min-width: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 !important;
}
.desk-form-stocktake > .desk-cell > label {
  flex: 0 0 var(--desk-label-w) !important;
  width: var(--desk-label-w) !important;
  min-width: var(--desk-label-w) !important;
  max-width: var(--desk-label-w) !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #64748b !important;
  text-align: right !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desk-form-stocktake > .desk-cell > .desk-field {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 30px !important;
  height: 30px !important;
}
.desk-form-stocktake > .desk-cell > .desk-field > input,
.desk-form-stocktake > .desk-cell > .desk-field > select {
  min-height: 28px !important;
  height: 28px !important;
  width: 100%;
  font-size: 13px !important;
  padding: 0 8px !important;
}
/* 右卡片：图片附件定宽，与左卡片同高 */
.stocktake-edit-attach {
  flex: 0 0 300px;
  width: 300px;
  min-width: 260px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px 10px;
  box-sizing: border-box;
  overflow: hidden;
}
.stocktake-edit-attach > .gak-std-attach {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  width: 100% !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.stocktake-edit-attach .gak-std-attach-bar {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px;
  margin: 0 0 8px !important;
  padding: 0 0 8px !important;
  border-bottom: 1px solid #e2e8f0;
}
.stocktake-edit-attach .section-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  margin: 0 !important;
}
.stocktake-edit-attach .attach-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 2px 0 8px !important;
}
.stocktake-edit-attach .attach-drop-hint {
  flex: 0 0 auto !important;
  margin: 4px 0 0 !important;
  padding: 8px !important;
  text-align: center;
  font-size: 12px !important;
  color: #94a3b8 !important;
  background: #f8fafc;
  border-radius: 6px;
}
/* 物料管理/物料待审：预览区「基本信息 + 图片附件」由左右分栏改为上下排列
   （mat-edit-host 仅物料模块使用，不影响盘点计划等其它 stocktake-edit-host 页面） */
#module-edit-form.mat-edit-host.stocktake-edit-host > .stocktake-edit-layout {
  flex-direction: column;
  overflow-y: auto;
}
#module-edit-form.mat-edit-host.stocktake-edit-host > .stocktake-edit-layout > .stocktake-edit-meta {
  flex: 0 0 auto;
}
#module-edit-form.mat-edit-host.stocktake-edit-host > .stocktake-edit-layout > .stocktake-edit-attach {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}
/* 弹窗态（非分栏）同样铺满 */
#modal-module-edit:not(.is-mat-split-page) #module-edit-form.stocktake-edit-host {
  min-height: 420px;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: #f1f5f9;
}
#modal-module-edit:not(.is-mat-split-page) #module-edit-form.stocktake-edit-host > .stocktake-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
}
#page-module.is-mat-split-page[data-split-mode="stocktake_plans"] .mat-split-right-body {
  overflow: hidden;
}

/* ── 盘点执行/差异：右侧统一标准明细列表（实盘数量可录入 / 差异只读）── */
#modal-module-edit #module-edit-form.stocktake-edit-host > .stocktake-edit-layout.stocktake-edit-list-layout {
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 8px;
}
/* 明细列表卡片：仅作 flex 容器，边框交给内层 table-wrap（避免「框中框」） */
.stocktake-edit-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
/* 明细列表工具条：标题 + [重置] 重置 + [显隐] 显/隐 */
.stocktake-edit-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.stocktake-edit-tools .stocktake-edit-tools-title {
  margin-right: auto;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}
.stocktake-edit-tools .btn-text {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
/* 标准 table-wrap 容器（横向/纵向滚动） */
.stocktake-edit-list-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
/* 明细表：统一 data-table 网格（.data-table 基础样式已提供表头/交错/悬停） */
.stocktake-edit-table.data-table {
  width: max-content;
  min-width: 100%;
}
.stocktake-edit-table.data-table tbody tr {
  cursor: default;
}
/* 实盘数量 / 差异原因输入框：无边框透明样式，与普通单元格融为一体（悬停/聚焦才显边框） */
.stk-actual-input,
.stk-reason-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 26px;
  height: 26px;
  font-size: 13px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
}
.stk-actual-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stk-actual-input:hover,
.stk-reason-input:hover,
.stk-actual-input:focus,
.stk-reason-input:focus {
  border-color: #cbd5e1;
  background: #f5f8ff;
  outline: none;
}
#page-module.is-mat-split-page[data-split-mode="stocktake_execute"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="stocktake_diff"] .mat-split-right-body {
  overflow: hidden;
}

/* 盘点执行「[列表] 生成执行清单」弹窗：计划选择列表 */
.stocktake-genlist-plans {
  max-height: min(54vh, 380px);
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.stocktake-genlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
  font-size: 13px;
  color: #0f172a;
  transition: background 0.12s ease;
}
.stocktake-genlist-row:last-child {
  border-bottom: none;
}
.stocktake-genlist-row:hover {
  background: #f1f5ff;
}
.stocktake-genlist-row .sgr-no {
  min-width: 150px;
  font-weight: 500;
  color: #1e293b;
}
.stocktake-genlist-row .sgr-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
}
.stocktake-genlist-row .sgr-wh,
.stocktake-genlist-row .sgr-date {
  color: #94a3b8;
  white-space: nowrap;
}
.stocktake-genlist-row .sgr-st {
  min-width: 64px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f6ef7;
  font-size: 12px;
  white-space: nowrap;
}


/* ============================================================
 * 生产计划排程（APS）页面 — page-aps
 * 参照迈方正式排程甘特式样（mes-gantt）移植为 .aps-gantt
 * ============================================================ */
#page-aps .list-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
#page-aps .toolbar {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
/* 生产计划组 9 个标签 + 工具栏按钮单行放不下：标签栏独占一行、工具栏换到下一行且内部可换行 */
#page-aps > .page-header:has(.qms-insp-tabs-bar:not([hidden])) {
  flex-wrap: wrap;
}
#page-aps > .page-header:has(.qms-insp-tabs-bar:not([hidden])) .toolbar {
  flex: 1 1 100%;
  flex-wrap: wrap;
}
.aps-tool-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  white-space: nowrap;
}
.aps-tool-item input {
  height: 26px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
/* 操作反馈移到底部 footer 显示（列表上方保持干净） */
.aps-footer-hint {
  font-weight: 500;
}
.aps-footer-hint.is-error {
  color: #b91c1c;
}
.aps-footer-hint.is-ok {
  color: #15803d;
}
#aps-result-host {
  flex: 1 1 auto;
  min-height: 0;
}
.aps-empty.muted {
  text-align: center;
  padding: 28px 12px;
  color: #94a3b8;
}
.aps-op-cell .aps-unsched-btn {
  white-space: nowrap;
}
/* 操作列固定 3 个汉字宽度（42px）：压缩单元格内边距，避免 auto 布局被内容撑开 */
.aps-table thead th[data-col="操作"],
.aps-table tbody td.aps-op-cell {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  padding: 0 2px;
  text-align: center;
  overflow: hidden;
}
.aps-op-cell .aps-unsched-btn {
  padding: 0;
  font-size: 12px;
}
/* 生产计划表格：勾选列 + 拖拽排序 */
.aps-table thead th.aps-check-col,
.aps-table tbody td.aps-check-cell {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 2px;
  text-align: center;
  border: 0;
  background: transparent;
}
.aps-table thead th.aps-check-col input,
.aps-table tbody td.aps-check-cell input {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.aps-table tbody tr[data-wo] {
  cursor: grab;
}
.aps-table tbody tr[data-wo][draggable="false"] {
  cursor: default;
}
.aps-table tbody tr.aps-dragging {
  opacity: 0.45;
  outline: 1px dashed #94a3b8;
}
/* 生产计划：点击单元格编辑（平时纯文本，不显示输入框） */
.aps-table tbody td.aps-cell-edit {
  cursor: text;
}
.aps-table tbody td.aps-cell-edit:hover {
  background: #f0f9ff;
}
.aps-table tbody td.aps-cell-edit.aps-cell-editing {
  background: #fff;
  box-shadow: inset 0 0 0 1px #38bdf8;
}
.aps-table tbody td.aps-cell-edit .aps-edit-input {
  width: 100%;
  min-width: 56px;
  box-sizing: border-box;
}
.aps-table tbody td.aps-cell-edit .aps-edit-select {
  width: 100%;
  min-width: 88px;
  box-sizing: border-box;
}
/* 甘特图（参照迈方 mes-gantt） */
.aps-gantt {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}
.aps-gantt-host {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.aps-gantt-host .empty {
  color: #94a3b8;
  padding: 30px 12px;
  text-align: center;
}
.aps-gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 0 2px;
  color: #64748b;
}
.aps-gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.aps-gantt-hint {
  color: #94a3b8;
  margin-left: auto;
}
.aps-gantt-scroll {
  position: relative;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  flex: 1;
  min-height: 280px;
}
.aps-gantt-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  min-width: max-content;
}
.aps-gantt-corner {
  position: sticky;
  left: 0;
  z-index: 4;
  width: calc(var(--aps-col-drag, 36px) + var(--aps-col-line, 176px) + var(--aps-col-wo, 300px) + var(--aps-col-model, 260px) + var(--aps-col-mat, 130px));
  min-width: calc(var(--aps-col-drag, 36px) + var(--aps-col-line, 176px) + var(--aps-col-wo, 300px) + var(--aps-col-model, 260px) + var(--aps-col-mat, 130px));
  display: flex;
  align-items: stretch;
  padding: 0;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  color: #334155;
  box-sizing: border-box;
}
.aps-gantt-label {
  position: sticky;
  left: 0;
  z-index: 1;
  width: calc(var(--aps-col-drag, 36px) + var(--aps-col-line, 176px) + var(--aps-col-wo, 300px) + var(--aps-col-model, 260px) + var(--aps-col-mat, 130px));
  min-width: calc(var(--aps-col-drag, 36px) + var(--aps-col-line, 176px) + var(--aps-col-wo, 300px) + var(--aps-col-model, 260px) + var(--aps-col-mat, 130px));
  display: flex;
  align-items: stretch;
  padding: 0;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  box-sizing: border-box;
}
.aps-gantt-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3px 8px;
  box-sizing: border-box;
  border-right: 1px solid #e2e8f0;
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
.aps-gantt-col:last-child {
  border-right: none;
}
#app .aps-gantt-col.col-line {
  width: var(--aps-col-line, 176px);
  min-width: var(--aps-col-line, 176px);
  flex: 0 0 var(--aps-col-line, 176px);
  color: #0f766e;
  font-weight: 500 !important;
}
.aps-gantt-col.col-drag {
  width: var(--aps-col-drag, 36px);
  min-width: var(--aps-col-drag, 36px);
  flex: 0 0 var(--aps-col-drag, 36px);
  padding: 4px 2px;
  color: #94a3b8;
}
/* 电子看板：行号列（col-drag 槽位复用） */
#app .aps-gantt.is-board .aps-gantt-col.col-drag {
  color: #0f172a;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.aps-gantt-col.col-wo {
  width: var(--aps-col-wo, 300px);
  min-width: var(--aps-col-wo, 300px);
  flex: 0 0 var(--aps-col-wo, 300px);
  color: #0f172a;
}
.aps-gantt-col.col-model {
  width: var(--aps-col-model, 260px);
  min-width: var(--aps-col-model, 260px);
  flex: 0 0 var(--aps-col-model, 260px);
  color: #334155;
}
.aps-gantt-col.col-mat {
  width: var(--aps-col-mat, 130px);
  min-width: var(--aps-col-mat, 130px);
  flex: 0 0 var(--aps-col-mat, 130px);
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.aps-gantt-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 3;
  background: transparent;
}
.aps-gantt-col-resizer:hover {
  background: rgba(13, 148, 136, 0.35);
}
.aps-gantt-col {
  position: relative;
}
.aps-gantt-corner .aps-gantt-col {
  font-weight: 500;
  color: #334155;
  padding: 8px;
}
.aps-gantt-days {
  display: flex;
}
.aps-gantt-day-h {
  width: var(--aps-day-w, 88px);
  min-width: var(--aps-day-w, 88px);
  box-sizing: border-box;
  padding: 4px 0;
  text-align: center;
  border-right: 1px solid #f1f5f9;
  color: #475569;
  line-height: 1.2;
}
.aps-gantt-day-h small {
  display: block;
  color: #94a3b8;
  white-space: nowrap;
}
#app .aps-gantt-day-h small b.aps-gantt-day-h-hours {
  display: inline;
  font-size: 11px;
  font-weight: 400 !important;
  color: #64748b;
}
.aps-gantt-day-h.is-rest small b.aps-gantt-day-h-hours {
  color: #be123c;
}
.aps-gantt-day-h.is-rest {
  background: #fff1f2;
  color: #be123c;
}
.aps-gantt-day-h.is-today {
  background: #ecfdf5;
  color: #0f766e;
}
.aps-gantt-body {
  position: relative;
  min-width: max-content;
}
.aps-gantt-row {
  display: flex;
  min-height: 32px;
  border-bottom: 1px solid #f1f5f9;
}
.aps-gantt-row.is-line-first {
  border-top: 1px solid #cbd5e1;
}
.aps-gantt-row[data-wo] {
  cursor: grab;
}
.aps-gantt-row[data-wo].aps-dragging {
  opacity: 0.45;
  outline: 1px dashed #94a3b8;
}
.aps-gantt-row:hover {
  background: #f8fafc;
}
.aps-gantt-row:hover .aps-gantt-label {
  background: inherit;
}
.aps-gantt-label-main {
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aps-gantt-track {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  min-height: 32px;
}
.aps-gantt-cell {
  width: var(--aps-day-w, 88px);
  min-width: var(--aps-day-w, 88px);
  box-sizing: border-box;
  border-right: 1px solid #f8fafc;
}
.aps-gantt-cell.is-rest {
  background: rgba(255, 241, 242, 0.55);
}
.aps-gantt-cell.is-today {
  background: rgba(236, 253, 245, 0.7);
}
#app .aps-gantt-day-qty {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: auto;
  min-height: 0;
  border-radius: 0;
  background: transparent !important;
  color: #0f172a;
  text-align: center;
  line-height: 1.2;
  font-weight: 400 !important;
  font-variant-numeric: tabular-nums;
  z-index: 1;
  box-shadow: none !important;
  border: none !important;
  outline: none !important;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
#app .aps-gantt-day-qty.is-sum,
#app .aps-gantt-day-qty.is-sum.is-today-sum {
  background: transparent !important;
  color: #0f172a;
  font-weight: 500 !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
}
.aps-gantt-day-qty.is-sum.is-today-sum {
  color: #0f766e;
}
#app .aps-gantt-row.is-summary {
  background: #f8fafc;
  font-weight: 500 !important;
  pointer-events: none;
  user-select: none;
  border-bottom: 0; /* 组间边界由下一组 is-line-first 顶部边框承担，避免双线 */
}
/* 汇总行整行统一：日期列 cells 不再叠加休息日/今日底色，与左侧产线/工单/产品区同一浅灰 */
.aps-gantt-row.is-summary .aps-gantt-cell {
  background: transparent;
}
#app .aps-gantt-row.is-summary .aps-gantt-col {
  font-weight: 500 !important;
}
#app .aps-gantt-row.is-summary .aps-gantt-day-qty {
  font-weight: 500 !important;
}
.aps-gantt-row.is-summary .aps-gantt-label {
  background: #f8fafc;
  color: #0f172a;
}
.aps-gantt-row.is-summary .aps-gantt-col.col-wo {
  color: #0f766e;
}
.aps-gantt-row.is-summary .aps-gantt-col.col-model {
  color: #b45309;
  font-variant-numeric: tabular-nums;
}
/* 电子看板：日期列等分剩余宽度（flex 布局覆盖固定 day-w） */
#app .aps-gantt.is-board {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#app .aps-gantt.is-board .aps-gantt-head,
#app .aps-gantt.is-board .aps-gantt-body {
  min-width: 0;
  width: 100%;
}
#app .aps-gantt.is-board .aps-gantt-days {
  flex: 1 1 auto;
  min-width: 0;
}
#app .aps-gantt.is-board .aps-gantt-days .aps-gantt-day-h {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
#app .aps-gantt.is-board .aps-gantt-track {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
/* 日期列：等分 + 内容居中 + 网格线完整连贯（表头/数据行/汇总行同色） */
#app .aps-gantt.is-board .aps-gantt-days .aps-gantt-day-h {
  border-right: 1px solid #cbd5e1;
}
#app .aps-gantt.is-board .aps-gantt-cell {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #cbd5e1;
}
#app .aps-gantt.is-board .aps-gantt-cell:last-child {
  border-right: 1px solid #cbd5e1;
}
/* 日期区左缘：与左列(label)交界竖线，保证网格从第一列起完整 */
#app .aps-gantt.is-board .aps-gantt-track {
  border-left: 1px solid #cbd5e1;
}
/* 行间横线：统一可辨但不喧宾夺主 */
#app .aps-gantt.is-board .aps-gantt-row {
  border-bottom: 1px solid #e2e8f0;
}
/* 行内排产量(当天报工量)数字：静态居中，非绝对定位 */
#app .aps-gantt.is-board .aps-gantt-day-qty {
  position: static;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1.2;
  padding: 0 2px;
}
/* 电子看板：右侧报工入口列（sticky 固定最右，无边框） */
#app .aps-gantt.is-board .aps-gantt-ops {
  position: sticky;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 84px;
  min-width: 84px;
  padding: 0 6px;
  box-sizing: border-box;
  background: #fff;
  border-left: 0;
}
#app .aps-gantt.is-board .aps-gantt-head .aps-gantt-ops {
  background: #f8fafc;
  color: #334155;
  font-weight: 500;
  font-size: 13px;
}
#app .aps-gantt.is-board .aps-gantt-row:hover .aps-gantt-ops {
  background: #f8fafc;
}
#app .aps-gantt.is-board .aps-gantt-row.is-summary .aps-gantt-ops {
  background: #f8fafc;
  pointer-events: none;
}
#app .aps-gantt.is-board .aps-report-btn {
  width: 64px;
  height: 24px;
  line-height: 1;
  padding: 0;
  border: 1px solid #0d9488;
  border-radius: 6px;
  background: #fff;
  color: #0d9488;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
#app .aps-gantt.is-board .aps-report-btn:hover {
  background: #0d9488;
  color: #fff;
}
/* 汇总行在 flex 等分下保持统一背景与加粗 */
#app .aps-gantt.is-board .aps-gantt-row.is-summary .aps-gantt-cell {
  background: transparent;
  border-right-color: #cbd5e1;
}
#app .aps-gantt.is-board .aps-gantt-row.is-summary .aps-gantt-day-qty {
  font-weight: 500 !important;
}
/* 小时产能维护弹窗 */
.aps-capacity-card {
  width: min(760px, 94vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.aps-capacity-hint {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}
.aps-capacity-wrap {
  max-height: 56vh;
  overflow: auto;
}
.aps-capacity-table th,
.aps-capacity-table td {
  padding: 4px 8px;
}
.aps-capacity-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.aps-cap-input {
  width: 90px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
  text-align: right;
}
.aps-capacity-table .modal-foot .btn-text {
  min-width: 84px;
  justify-content: center;
}
/* 待排工单池（APS 生产计划页） */
.aps-pool-tools {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.aps-pool-tools .tb-btn {
  white-space: nowrap;
}
.aps-pool-sub {
  padding: 4px 0;
}
.aps-pool-sub b {
  color: #0f766e;
}
.aps-pool-check-th,
.aps-pool-check {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  text-align: center;
}
.aps-pool-check-th input,
.aps-pool-check input {
  margin: 0;
  cursor: pointer;
  accent-color: #0d9488;
}
.aps-pool-input {
  width: 76px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
  text-align: right;
}
.aps-pool-input:focus,
.aps-pool-select:focus {
  border-color: #0d9488;
  outline: none;
}
.aps-pool-select {
  width: 116px;
  height: 26px;
  padding: 0 4px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
.aps-pool-move-btn {
  white-space: nowrap;
}
.aps-result-wrap {
  display: flex;
  flex-direction: column;
}
.aps-result-wrap .aps-section {
  height: auto;
  min-height: 220px;
}
#aps-pool-section {
  min-height: 240px;
}
#aps-pool-section .aps-table-wrap {
  max-height: 42vh;
  overflow: auto;
}

/* ==================== 车间看板（墙挂大屏，对齐桌面 GAK_production_dashboard） ==================== */
#page-workshop.list-pane {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.workshop-board {
  --ws-bg: #04070d;
  --ws-card: #0b1220;
  --ws-card-alt: #0f172a;
  --ws-border: #1e293b;
  --ws-border-soft: #334155;
  --ws-header: #070b14;
  --ws-header-line: #0891b2;
  --ws-text: #f1f5f9;
  --ws-muted: #64748b;
  --ws-accent: #22d3ee;
  --ws-header-h: 56px;
  --ws-kpi-h: 118px;
  --ws-footer-h: 28px;
  background: var(--ws-bg);
  color: var(--ws-text);
  flex: 1;
  min-height: 0;
  padding: 10px;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "SimHei", sans-serif;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.workshop-board * { box-sizing: border-box; }
/* 顶栏：标题居中 + 右侧 ⛶ / 时间 */
#app .workshop-board .ws-header {
  position: relative;
  flex: 0 0 var(--ws-header-h);
  height: var(--ws-header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ws-header);
  border-top: 2px solid var(--ws-header-line);
  border-radius: 8px;
  padding: 0 20px;
  min-height: 0;
}
#app .workshop-board .ws-header-title { font-size: 19px !important; font-weight: 500 !important; letter-spacing: 2px; }
/* 左侧 [菜单] 菜单按钮（深色适配，导航入口） */
#app .workshop-board .ws-header-left {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
}
#app .workshop-board .ws-menu-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ws-muted);
  font-size: 18px !important;
  line-height: 1;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
}
#app .workshop-board .ws-menu-btn:hover,
#app .workshop-board .ws-menu-btn[aria-expanded="true"] {
  color: var(--ws-accent);
  background: var(--ws-card-alt);
  border-color: var(--ws-border);
}
#app .workshop-board .ws-header-actions {
  position: absolute;
  right: 20px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
/* 自动刷新控制（深色适配） */
#app .workshop-board .ws-refresh-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px !important;
  color: var(--ws-muted);
  white-space: nowrap;
}
#app .workshop-board .ws-refresh-ctl select {
  background: var(--ws-card-alt);
  color: var(--ws-text);
  border: 1px solid var(--ws-border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px !important;
  outline: none;
}
#app .workshop-board .ws-refresh-ctl select:focus { border-color: var(--ws-accent); }
#app .workshop-board .ws-fs-btn {
  background: transparent;
  border: none;
  color: var(--ws-muted);
  font-size: 16px !important;
  cursor: pointer;
  padding: 2px 6px;
}
#app .workshop-board .ws-fs-btn:hover { color: var(--ws-accent); }
#app .workshop-board .ws-header-time {
  font-size: 18px !important; font-weight: 500 !important; color: var(--ws-accent);
  font-variant-numeric: tabular-nums;
}
/* KPI 条：高度 118px */
#app .workshop-board .ws-kpi {
  flex: 0 0 var(--ws-kpi-h);
  height: var(--ws-kpi-h);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  min-height: 0;
}
#app .workshop-board .ws-kpi-tile {
  background: var(--ws-card); border: 1px solid var(--ws-border);
  border-radius: 8px; overflow: hidden; text-align: left;
  display: flex; flex-direction: column;
}
#app .workshop-board .ws-kpi-bar { height: 3px; background: var(--tile-accent, #22d3ee); flex: 0 0 auto; }
#app .workshop-board .ws-kpi-label { font-size: 13px !important; color: var(--ws-muted); padding: 14px 16px 4px; }
#app .workshop-board .ws-kpi-value {
  font-size: 44px !important; font-weight: 500 !important; font-variant-numeric: tabular-nums; line-height: 1.1;
  padding: 0 16px 8px;
}
/* 主区：左列 3/4 + 右列 1/4，左右严格同高 */
#app .workshop-board .ws-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: stretch;
}
#app .workshop-board .ws-col-left {
  flex: 3 1 0;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0;
}
#app .workshop-board .ws-col-right {
  flex: 1 1 0;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0;
}
/* 产线监控：高度按内容自适应，不向下拉伸（剩余空间给底行） */
#app .workshop-board .ws-card-lines { flex: 0 1 auto; }
#app .workshop-board .ws-bottom-row {
  flex: 1 1 0;
  min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
/* 右列：设备状态与产线监控同高（JS 对齐），实时异常撑满剩余与底行同高 → 三卡顶部对齐 */
#app .workshop-board .ws-card-equip { flex: 0 1 auto; }
#app .workshop-board .ws-card-alarm { flex: 1 1 0; min-height: 0; }
/* 卡片通用 */
#app .workshop-board .ws-card {
  background: var(--ws-card); border: 1px solid var(--ws-border); border-radius: 8px;
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  border-top-width: 3px;
}
#app .workshop-board .ws-card-lines { border-top-color: #22C55E; }
#app .workshop-board .ws-card-schedule { border-top-color: #22D3EE; }
#app .workshop-board .ws-card-defect { border-top-color: #FBBF24; }
#app .workshop-board .ws-card-equip { border-top-color: #22D3EE; }
#app .workshop-board .ws-card-alarm { border-top-color: #EF4444; }
#app .workshop-board .ws-card-head {
  flex: 0 0 auto;
  padding: 10px 14px; font-size: 17px !important; font-weight: 500 !important;  border-bottom: 1px solid var(--ws-border); background: var(--ws-card-alt);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
#app .workshop-board .ws-card-sub { font-size: 13px !important; font-weight: 400 !important; color: var(--ws-muted); }
#app .workshop-board .ws-card-body { padding: 10px; flex: 1; min-height: 0; overflow: auto; }
#app .workshop-board .ws-empty {
  color: var(--ws-muted); font-size: 13px !important; text-align: center; padding: 18px 8px; line-height: 1.8;
}

/* 产线监控网格：≤6 条横向等分单行，行高按内容自适应（不拉伸） */
#app .workshop-board .ws-card-lines .ws-card-body {
  display: grid; gap: 8px;
  grid-auto-rows: auto;
  align-content: start;
}
#app .workshop-board .ws-line-cell { min-width: 0; display: flex; }
#app .workshop-board .ws-line-shell {
  background: var(--ws-card-alt); border: 1px solid var(--ws-border);
  border-radius: 6px; display: flex; flex: 1; min-height: 0; overflow: hidden;
}
#app .workshop-board .ws-line-accent { width: 4px; flex: 0 0 auto; }
#app .workshop-board .ws-line-content { padding: 12px 14px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
#app .workshop-board .ws-line-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#app .workshop-board .ws-line-name { font-size: 17px !important; font-weight: 500 !important;}
#app .workshop-board .ws-fai-badge {
  font-size: 13px !important; font-weight: 500 !important; color: #fff; padding: 2px 8px; border-radius: 3px; white-space: nowrap;
}
#app .workshop-board .ws-bar-row { display: flex; align-items: center; gap: 10px; margin-top: auto; }
#app .workshop-board .ws-bar-bg { flex: 1; height: 12px; background: var(--ws-border-soft); border-radius: 6px; overflow: hidden; }
#app .workshop-board .ws-bar-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .4s ease; }
#app .workshop-board .ws-bar-pct {
  font-size: 32px !important; font-weight: 500 !important; width: 74px; text-align: right;
  font-variant-numeric: tabular-nums; flex: 0 0 auto; line-height: 1;
}
#app .workshop-board .ws-line-sub { margin-top: 8px; font-size: 13px !important; color: var(--ws-muted); }

/* 今日工单 */
#app .workshop-board .ws-card-schedule .ws-card-body {
  overflow: hidden; /* 无滚动条，靠 JS 自动向上循环滚动 */
}
#app .workshop-board .ws-sched-row {
  padding: 16px 2px; border-bottom: 1px solid rgba(30, 41, 59, .6);
  flex: 0 0 auto;
  display: flex; flex-direction: column; justify-content: center;
}
#app .workshop-board .ws-sched-row:last-child { border-bottom: none; }
#app .workshop-board .ws-sched-title {
  font-size: 16px !important; font-weight: 500 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#app .workshop-board .ws-sched-row .ws-bar-row { margin-top: 8px; }
#app .workshop-board .ws-sched-row .ws-bar-bg { height: 12px; }
#app .workshop-board .ws-sched-row .ws-bar-pct { font-size: 13px !important; width: 44px; }

/* 巡检不良 TOP */
#app .workshop-board .ws-card-defect .ws-card-body {
  display: flex; flex-direction: column;
}
#app .workshop-board .ws-card-defect .ws-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
#app .workshop-board .ws-defect-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px !important; }
#app .workshop-board .ws-defect-name {
  width: 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 0 auto;
}
#app .workshop-board .ws-defect-bar { flex: 1; height: 8px; background: var(--ws-border-soft); border-radius: 4px; overflow: hidden; }
#app .workshop-board .ws-defect-count {
  width: 30px; text-align: right; font-weight: 500 !important; font-variant-numeric: tabular-nums;
}

/* 设备状态 */
#app .workshop-board .ws-eq-kpi {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;
}
#app .workshop-board .ws-eq-kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
#app .workshop-board .ws-eq-kpi-block {
  background: var(--ws-card-alt); border: 1px solid var(--ws-border);
  border-radius: 6px; padding: 10px 4px; text-align: center;
}
#app .workshop-board .ws-eq-kpi-label { font-size: 22px !important; font-weight: 500 !important; color: var(--ws-muted); }
#app .workshop-board .ws-eq-kpi-value { font-size: 44px !important; font-weight: 500 !important; font-variant-numeric: tabular-nums; line-height: 1.1; }
#app .workshop-board .ws-card-equip .ws-card-body { overflow: hidden; }
#app .workshop-board .ws-eq-list {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 4px;
}
#app .workshop-board .ws-eq-list .ws-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
#app .workshop-board .ws-eq-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--ws-card-alt); border: 1px solid var(--ws-border);
  border-radius: 4px; padding: 6px 8px; font-size: 13px !important;
}
#app .workshop-board .ws-eq-dot { font-size: 10px !important; }
#app .workshop-board .ws-eq-name { flex: 1; font-weight: 500 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#app .workshop-board .ws-eq-status { color: var(--ws-muted); white-space: nowrap; }

/* 实时异常 */
#app .workshop-board .ws-card-alarm .ws-card-body {
  display: flex; flex-direction: column;
}
#app .workshop-board .ws-card-alarm .ws-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
#app .workshop-board .ws-alarm-row {
  display: flex; gap: 8px; padding: 8px 10px;
  background: var(--ws-card-alt); border: 1px solid var(--ws-border);
  border-radius: 6px; margin-bottom: 6px;
}
#app .workshop-board .ws-alarm-stripe { width: 3px; flex: 0 0 auto; border-radius: 2px; }
#app .workshop-board .ws-alarm-col { flex: 1; min-width: 0; }
#app .workshop-board .ws-alarm-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#app .workshop-board .ws-alarm-time { font-size: 13px !important; font-weight: 500 !important; color: var(--ws-accent); }
#app .workshop-board .ws-alarm-tag { font-size: 11px !important; color: #fff; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
#app .workshop-board .ws-alarm-text { margin-top: 4px; font-size: 13px !important; line-height: 1.5; word-break: break-all; }

/* 底栏：28px */
#app .workshop-board .ws-footer {
  flex: 0 0 var(--ws-footer-h);
  height: var(--ws-footer-h);
  padding: 4px 12px; font-size: 12px !important;
  color: var(--ws-muted); border-top: 1px solid var(--ws-border);
  display: flex; align-items: center;
  min-height: 0;
}

/* 全屏 */
#workshop-board:fullscreen { border-radius: 0; padding: 14px; }
#workshop-board:fullscreen .ws-header-title { font-size: 26px !important; }
#workshop-board:fullscreen .ws-kpi-value { font-size: 34px !important; }

@media (max-width: 1100px) {
  #app .workshop-board .ws-main { grid-template-columns: 1fr; overflow: auto; }
  #app .workshop-board .ws-kpi { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════ 检测数据页（inspection）—— Win11 文件管理器风格 ═══════════════ */
#page-inspection { display: flex; flex-direction: column; }

/* ===== 主体布局 ===== */
#page-inspection .insp-main {
  flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden;
}

/* 左侧导航窗格 */
#page-inspection .insp-side {
  flex: 0 0 200px; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border, #e5e7eb); background: #f9f9fa;
}
#page-inspection .insp-side-head {
  flex: 0 0 auto; padding: 8px 12px; font-size: 12px;
  color: #6b7280; border-bottom: 1px solid var(--border, #e5e7eb);
}
#page-inspection .insp-side-body {
  flex: 1 1 auto; overflow: auto; padding: 4px 0; min-height: 0;
}

/* 导航窗格：体系文件同款树（根 > 数据源 > 文件夹） */
#page-inspection .insp-nav-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px;
  cursor: pointer; font-size: 13px; color: #1f2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#page-inspection .insp-nav-item:hover { background: #f0f0f1; }
#page-inspection .insp-nav-item.active { background: #cce8ff; color: #0067c0; }
#page-inspection .insp-nav-chev {
  flex: 0 0 12px; width: 12px; height: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #6b7280; cursor: pointer;
}
#page-inspection .insp-nav-chev svg { transition: transform 0.15s ease; }
#page-inspection .insp-nav-chev.expanded svg { transform: rotate(90deg); }
#page-inspection .insp-nav-chev.empty { cursor: default; visibility: hidden; }
#page-inspection .insp-nav-ico {
  width: 16px; height: 16px; flex: 0 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
#page-inspection .insp-nav-label {
  flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis;
}
#page-inspection .insp-nav-count {
  font-size: 11px; color: #9ca3af; flex: 0 0 auto;
}
#page-inspection .insp-nav-children { padding-left: 16px; }

/* 右侧内容区 */
#page-inspection .insp-content {
  flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: #fff; position: relative;
}

/* ===== 文件列表视图 ===== */
#page-inspection .insp-list-view {
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
#page-inspection .insp-list {
  flex: 1 1 auto; overflow: auto;
}
/* 打开文件后：文件列表缩小到 38% */
#page-inspection .insp-content.has-open-file .insp-list-view {
  flex: 0 0 auto; max-height: 38%;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

/* 列表视图头部 */
#page-inspection .insp-list-header {
  display: flex; align-items: center; gap: 0;
  background: #fbfbfc; border-bottom: 1px solid var(--border, #e5e7eb);
  font-size: 12px; color: #6b7280; font-weight: 500;
  position: sticky; top: 0; z-index: 1;
}
#page-inspection .insp-list-header > div {
  padding: 8px 12px; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px;
}
#page-inspection .insp-list-header > div:hover { background: #f5f5f5; }
#page-inspection .insp-list-header .insp-col-name { flex: 1 1 auto; min-width: 0; }
#page-inspection .insp-list-header .insp-col-size { flex: 0 0 80px; text-align: right; }
#page-inspection .insp-list-header .insp-col-mtime { flex: 0 0 150px; }
#page-inspection .insp-sort-arrow { font-size: 10px; opacity: 0.5; }

/* 列表行 */
#page-inspection .insp-list-row {
  display: flex; align-items: center; gap: 0;
  cursor: pointer; font-size: 13px; color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
}
#page-inspection .insp-list-row:hover { background: #f5f5f5; }
#page-inspection .insp-list-row.selected { background: #cce8ff; }
#page-inspection .insp-list-row > div {
  padding: 6px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#page-inspection .insp-list-row .insp-col-name {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 8px;
}
#page-inspection .insp-list-row .insp-col-size { flex: 0 0 80px; text-align: right; color: #6b7280; }
#page-inspection .insp-list-row .insp-col-mtime { flex: 0 0 150px; color: #6b7280; }

/* 文件图标（列表视图） */
#page-inspection .insp-fico {
  width: 16px; height: 16px; flex: 0 0 16px;
  border-radius: 3px; font-size: 10px; line-height: 16px; text-align: center; color: #fff;
}
#page-inspection .insp-fico.ic-xls { background: #1d7a3e; }
#page-inspection .insp-fico.ic-mdb { background: #b45309; }
#page-inspection .insp-fico.ic-db { background: #0e7490; }
#page-inspection .insp-fico.ic-txt { background: #64748b; }
#page-inspection .insp-fico.ic-file { background: #94a3b8; }
#page-inspection .insp-fico.ic-folder { background: transparent; width: 18px; flex: 0 0 18px; }

/* ===== 大图标视图 ===== */
#page-inspection .insp-grid-view {
  flex: 1 1 auto; overflow: auto; padding: 12px;
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
}
#page-inspection .insp-grid-item {
  width: 80px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 8px 4px; border-radius: 4px; cursor: pointer;
  font-size: 11px; color: #1f2937; text-align: center;
}
#page-inspection .insp-grid-item:hover { background: #f5f5f5; }
#page-inspection .insp-grid-item.selected { background: #cce8ff; }
#page-inspection .insp-grid-ico {
  width: 40px; height: 40px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 500;
}
#page-inspection .insp-grid-ico.ic-xls { background: #1d7a3e; }
#page-inspection .insp-grid-ico.ic-mdb { background: #b45309; }
#page-inspection .insp-grid-ico.ic-db { background: #0e7490; }
#page-inspection .insp-grid-ico.ic-txt { background: #64748b; }
#page-inspection .insp-grid-ico.ic-file { background: #94a3b8; }
#page-inspection .insp-grid-ico.ic-folder { background: transparent; font-size: 32px; }
#page-inspection .insp-grid-name {
  max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== 数据表格视图 ===== */
#page-inspection .insp-table-view {
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
/* 未打开文件时表格区应整体隐藏（display:flex 优先级高于 UA 的 [hidden]，需显式覆盖） */
#page-inspection .insp-table-view[hidden] { display: none !important; }
#page-inspection .insp-table-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; min-height: 34px; border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fafafa;
}
#page-inspection .insp-table-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
}
#page-inspection .insp-sheet-label { font-size: 12px; color: #475569; }
#page-inspection .insp-sheet-select {
  border: 1px solid var(--border, #cbd5e1); border-radius: 4px;
  padding: 3px 6px; font-size: 12px; font-family: "Microsoft YaHei"; color: #0f172a;
  background: #fff; max-width: 320px;
}
#page-inspection .insp-meta {
  padding: 6px 12px 2px; font-size: 11px; color: #64748b;
}
#page-inspection .insp-wrap { margin: 4px 12px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 4px; }
#page-inspection .insp-empty {
  margin: 40px auto; text-align: center; color: #94a3b8; font-size: 13px; line-height: 1.8;
}
#page-inspection .insp-open-error {
  margin: 30px auto; max-width: 560px; text-align: center; color: #b45309;
  font-size: 13px; line-height: 1.7; padding: 16px; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px;
}
#page-inspection .insp-error-actions { text-align: center; margin: 8px 0 20px; }

/* 列表头/内容区表格 */
#page-inspection #inspection-table-host {
  flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
}
#page-inspection #inspection-table-host .insp-meta { flex: 0 0 auto; }
#page-inspection #inspection-table-host .table-wrap {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto;
}

/* ═══════════ QMS 检验明细（对齐桌面 IQC/OQC/IPQC/出厂检验）═══════════ */
.desk-card-qms-detail .desk-card-body { padding: 10px 12px 12px; }
.qms-detail { width: 100%; }
.qms-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.qms-tip { font-size: 12px; color: #64748b; }
.qms-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.qms-plan { font-size: 12px; color: #0f766e; font-weight: 500; }
.qms-method-group { display: inline-flex; gap: 2px; }
.qms-method-btn {
  min-width: 56px; padding: 3px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; cursor: pointer; border-radius: 2px;
}
.qms-method-btn.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 500; }
.qms-method-btn:disabled { cursor: not-allowed; opacity: .7; }
.qms-insp-wrap {
  overflow: auto; max-height: 340px; border: 1px solid #e2e8f0; border-radius: 2px; background: #fff;
}
.qms-insp-table {
  width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12px; table-layout: auto;
}
.qms-insp-table th,
.qms-insp-table td {
  border-bottom: 1px solid #e2e8f0; border-right: 1px solid #eef2f7;
  padding: 3px 5px; text-align: center; vertical-align: middle; white-space: nowrap;
}
.qms-insp-table th {
  background: #0f766e; color: #fff; font-weight: 500;
  position: sticky; top: 0; z-index: 2;
}
.qms-insp-table td.qms-idx { color: #94a3b8; width: 40px; min-width: 40px; }
.qms-insp-table th:last-child, .qms-insp-table td:last-child { border-right: 0; }
.qms-inp {
  min-height: 26px; padding: 3px 6px; border: 1px solid transparent; background: transparent;
  font-size: 12px; font-family: inherit; box-sizing: border-box; width: 100%; min-width: 60px;
}
.qms-inp.qms-num { width: 64px; }
.qms-insp-table tr:hover .qms-inp,
.qms-insp-table tr.is-selected .qms-inp,
.qms-insp-table .qms-inp:focus { border-color: #cbd5e1; background: #fff; }
.qms-insp-table tr.is-selected { background: #ecfdf5; }
.qms-insp-table .qms-def-cell.is-disabled { background: #f1f5f9; }
.qms-insp-table .qms-inp.qms-disabled { color: #b6c2cf; background: transparent; cursor: not-allowed; }
.qms-conc-btn {
  min-width: 52px; border: 1px solid #cbd5e1; background: #f8fafc; border-radius: 2px;
  padding: 3px 8px; cursor: pointer; font-size: 12px; font-family: inherit; color: #64748b;
}
.qms-conc-btn.is-ok { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 500; }
.qms-conc-btn.is-ng { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 500; }
.qms-conc-btn:disabled { cursor: not-allowed; }
/* IQC 合计/不良率行 */
.qms-insp-table tr.qms-sum-row { background: #f8fafc; font-weight: 500; }
.qms-insp-table tr.qms-sum-row td { border-top: 1px solid #dbe2ea; }
.qms-insp-table td.qms-sum-label { color: #0f766e; }
.qms-insp-table .qms-sum-cell { color: #334155; }
/* OQC 最大/最小列 */
.qms-insp-table td.qms-max, .qms-insp-table td.qms-min {
  background: #f8fafc; color: #0f766e; font-weight: 500; min-width: 46px;
}
/* IPQC Pcs 格 */
/* IPQC 巡检项目表：fixed 布局使列宽严格受 colgroup 控制（时段列拖拽即时生效，5 输入框等分渲染宽度）
   宽度须跟随列宽总和（覆盖全局 width:max-content + min-width:100%），否则多余空间被浏览器全部分配给时段列 */
.qms-ipqc-table { table-layout: fixed; width: auto; min-width: 0; }
.qms-ipqc-table col.ipqc-idx-col { width: 40px; }
.qms-ipqc-table col.ipqc-row-del-col { width: 30px; min-width: 30px; max-width: 30px; }
.qms-insp-table td.qms-pcs-cell { white-space: nowrap; }
.qms-pcs-btn {
  min-width: 26px; height: 22px; margin: 0 1px; padding: 0;
  border: 1px solid #e2e8f0; background: #fff; color: #94a3b8;
  font-size: 12px; font-family: inherit; cursor: pointer; border-radius: 2px;
}
.qms-pcs-btn.is-ok { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 500; }
.qms-pcs-btn.is-ng { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; font-weight: 500; }
.qms-pcs-btn:disabled { cursor: not-allowed; }

/* IPQC 巡检时段选择器（桌面 GAK_ipqc._build_time_slot_selector） */
.ipqc-slot-selector {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 8px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.ipqc-slot-label { font-size: 12px; font-weight: 500; color: #334155; white-space: nowrap; }
.ipqc-slot-btn {
  min-width: 44px; padding: 3px 10px; border: 1px solid #cbd5e1; background: #fff;
  color: #475569; font-size: 12px; font-family: inherit; border-radius: 2px; cursor: pointer;
}
.ipqc-slot-btn:hover { border-color: #0f766e; color: #0f766e; }
.ipqc-slot-btn.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 500; }
.ipqc-slot-btn:disabled { cursor: not-allowed; opacity: .7; }
/* IPQC 其它组 5Pcs/2h 输入格（桌面 _apply_slot_pcs_entry_style：√ 绿 / ╳ 红；随「时段」列宽等分） */
.ipqc-pcs-grid { display: flex; width: 100%; gap: 2px; align-items: center; }
.ipqc-pcs-inp {
  flex: 1 1 0; min-width: 0; width: auto; max-width: none; height: 22px; margin: 0; padding: 0;
  text-align: center; font-size: 12px; font-family: inherit; box-sizing: border-box;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; color: #0f766e;
}
.ipqc-pcs-inp:read-only { background: #f8fafc; color: #475569; }

/* ═══════════ QMS 多段落表单增强（NC/8D/CAPA/客诉，对齐桌面 GAK_nc_capa）═══════════ */
.desk-card-qms-sec .desk-card-body { padding: 10px 12px 12px; }
.qms-sec-fields {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px;
}
.qms-sec-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #334155; }
.qms-sec-field > span { min-width: 64px; color: #64748b; text-align: right; flex-shrink: 0; }
.qms-sec-field input, .qms-sec-field select {
  flex: 1; min-width: 0; min-height: 28px; padding: 3px 6px; font-size: 12px; font-family: inherit;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; box-sizing: border-box;
}
.qms-sec-field input:read-only { background: #f8fafc; color: #475569; }
.qms-sec-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.qms-check-btn {
  min-width: 56px; padding: 4px 10px; font-size: 12px; font-family: inherit;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; cursor: pointer; border-radius: 14px;
}
.qms-check-btn.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 500; }
.qms-check-btn:disabled { cursor: not-allowed; opacity: .7; }
.qms-sec-text {
  width: 100%; box-sizing: border-box; min-height: 60px; padding: 6px 8px; font-size: 12px;
  font-family: inherit; line-height: 1.6; border: 1px solid #dbe2ea; border-radius: 2px; resize: vertical;
}
.qms-sec-text:read-only { background: #f8fafc; color: #475569; }
.qms-sec-inline { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 8px; }
.qms-sec-inline .qms-sec-inline-field { flex: 1 1 200px; }
.qms-sec-inline .qms-sec-inline-field input { min-height: 26px; }

/* ═══════════ IQC 编辑四卡片（对齐桌面 GAK_iqc_inspection：基本信息/检验方式·抽样方案·AQL/检验项目·判断结果/采购部意见·处理结果·签核）═══════════ */
.iqc-edit { width: 100%; box-sizing: border-box; }
/* 表单壳 desk-form-2 为 2 列网格：IQC 整页跨满两列 */
#module-edit-form.desk-form-2 > .iqc-edit,
#module-edit-form.desk-form-2 > .iqc-edit + * {
  grid-column: 1 / -1;
}
.iqc-edit-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 8px;
}
.iqc-form-title { font-size: 15px; font-weight: 500; color: #1e293b; }
.iqc-form-no { font-size: 12px; color: #94a3b8; }
/* QMS 检验记录（OQC/IQC 等共用 iqc-edit）：标题居中显示 + 字号 20px（统一对标出货检验记录）
   注：#app 全局有 font-size:12px !important 强制字号，须以 #app 前缀 + !important 提权覆盖 */
.iqc-edit .iqc-edit-head {
  position: relative;
}
#app .iqc-edit .iqc-form-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px !important;
  white-space: nowrap;
  pointer-events: none;
}
.iqc-edit .iqc-form-no {
  margin-left: auto;
}
.iqc-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 4px;
  margin: 0 14px 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.iqc-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 12px; border-bottom: 1px solid #eef2f7;
  background: #f8fafc; border-radius: 4px 4px 0 0;
}
.iqc-card-title { font-size: 13px; font-weight: 500; color: #0f766e; }
.iqc-doc-no { font-size: 12px; color: #64748b; }
.iqc-doc-no b { color: #0f766e; font-weight: 500; }
.iqc-card-body { padding: 10px 12px 12px; }
.iqc-grid {
  /* 3 列排列（基本信息含 采购单号/工单编号/送货单号 等 12 项） */
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 18px; margin-bottom: 4px;
}
/* 2 列等分（检验设备/检验依据 同排占满，禁止留第三列空位） */
.iqc-grid.iqc-grid-2 { grid-template-columns: 1fr 1fr; }
/* 单列（MRB 评审：一行一个部门） */
.iqc-grid.iqc-grid-1 { grid-template-columns: 1fr; }
/* 4 列等分（基本信息合并网格：去组小标题，减少垂直占位） */
.iqc-grid.iqc-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
/* 按字段类型分组（OQC 基本信息：组小标题 + 3 列网格） */
.iqc-field-group { margin-bottom: 10px; }
.iqc-field-group:last-child { margin-bottom: 0; }
.iqc-field-group .iqc-grid { margin-bottom: 0; }
.iqc-group-title {
  font-size: 12px;
  font-weight: 500;
  color: #0f766e;
  padding: 2px 0 5px;
  margin-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
}
/* 时间选择器与文本/日期输入对齐 */
.iqc-f input[type="time"] { flex: 1; min-width: 0; }
.iqc-f { display: flex; align-items: center; gap: 6px; min-width: 0; }
.iqc-f .iqc-label { min-width: 62px; text-align: right; flex-shrink: 0; }
.iqc-f input, .iqc-f select {
  flex: 1; min-width: 0; min-height: 28px; padding: 3px 6px; font-size: 12px; font-family: inherit;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; box-sizing: border-box;
}
/* FAI/首件检验 工单编号·物料代码 可搜索下拉（对齐材料入库 GakInputCombo）：
   容器替代原生 input 占满网格单元，视觉与 ib-mat-combo 一致 */
.iqc-f .gak-input-combo {
  flex: 1; min-width: 0; min-height: 28px;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; box-sizing: border-box;
}
.iqc-f .gak-input-combo > input {
  height: 26px; line-height: 26px; padding: 0 6px; font-size: 12px; color: #334155;
  background: transparent; border: 0; outline: none; box-shadow: none;
}
/* IQC 物料/工单下拉：统一 GakInputCombo（单行格式「代码 | 名称 | 规格 | 供应商」） */
.iqc-f .gak-input-combo-item { white-space: nowrap; }
.iqc-f input:read-only { background: #f8fafc; color: #475569; }
.iqc-label { font-size: 12px; color: #64748b; }
.iqc-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.iqc-row > .iqc-label { min-width: 62px; text-align: right; flex-shrink: 0; }
/* 卡片2「检验方式/抽样方案/AQL 抽样」内容向右拉满：抽样方案文本占满整行并居中（对齐桌面 anchor=CENTER） */
.iqc-row .qms-plan { flex: 1 1 auto; text-align: center; }
.iqc-row .qms-method-group { flex: 0 0 auto; }
.iqc-row .qms-method-btn { flex: 0 0 auto; }
.iqc-row select { flex: 1 1 auto; min-width: 0; }
.iqc-label-level { margin-left: 8px; }
.iqc-row select {
  min-height: 28px; padding: 3px 6px; font-size: 12px; font-family: inherit;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff;
}
.iqc-divider { height: 1px; background: #eef2f7; margin: 8px 0; }
.iqc-aql-wrap { overflow: auto; }
.iqc-aql-table {
  width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 12px; border: 1px solid #dbe2ea;
}
.iqc-aql-table th, .iqc-aql-table td {
  border-bottom: 1px solid #eef2f7; border-right: 1px solid #eef2f7;
  padding: 4px 8px; text-align: center; white-space: nowrap;
}
.iqc-aql-table th:last-child, .iqc-aql-table td:last-child { border-right: 0; }
.iqc-aql-table thead th { background: #f1f5f9; color: #475569; font-weight: 500; }
.iqc-aql-table tbody th { background: #f8fafc; color: #64748b; font-weight: 500; }
.iqc-aql-inp {
  width: 64px; box-sizing: border-box; min-height: 24px; padding: 2px 4px;
  border: 1px solid transparent; background: transparent; text-align: center; font-size: 12px; font-family: inherit;
}
.iqc-aql-inp:focus, .iqc-aql-table tr:hover .iqc-aql-inp { border-color: #cbd5e1; background: #fff; }
.iqc-aql-inp:read-only { background: #f8fafc; color: #475569; }
.iqc-card-insp .qms-insp-wrap { max-height: none; }
/* 检验项目/判断结果 卡片：输入格可见边框（默认 qms-inp 透明，悬停才显边框，用户以为不能填） */
.iqc-card-insp .qms-inp {
  border: 1px solid #dbe2ea;
  background: #fff;
  border-radius: 2px;
}
.iqc-card-insp .qms-inp:read-only { background: #f8fafc; }
.iqc-card-insp tr:hover .qms-inp,
.iqc-card-insp tr.is-selected .qms-inp,
.iqc-card-insp .qms-inp:focus { border-color: #0f766e; }
/* 合规核查（3C/COA/RoHS）：3 列横排，每列 = 标签 + 紧凑按钮组（对齐桌面 compliance_card） */
.iqc-f-comp { align-items: center; }
.iqc-f-comp .qms-method-group { gap: 4px; }
.iqc-f-comp .qms-method-btn {
  min-width: 64px; padding: 4px 10px; font-size: 12px; font-family: inherit;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; cursor: pointer; border-radius: 3px;
  flex: none;
}
.iqc-f-comp .qms-method-btn.is-on { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 500; }
.iqc-f-comp .qms-method-btn:disabled { cursor: not-allowed; opacity: .7; }
.iqc-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.iqc-tip { font-size: 12px; color: #94a3b8; }
.iqc-actions { display: inline-flex; gap: 4px; margin-left: auto; }
.iqc-judge-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.iqc-judge-row > .iqc-label { min-width: 62px; text-align: right; }
.iqc-judge-group { display: inline-flex; gap: 6px; }
.iqc-judge-btn {
  min-width: 64px; padding: 5px 14px; font-size: 13px; font-family: inherit; font-weight: 500;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; cursor: pointer; border-radius: 3px;
}
.iqc-judge-btn.judge-ok.is-on { background: #16a34a; border-color: #16a34a; color: #fff; }
.iqc-judge-btn.judge-ng.is-on { background: #dc2626; border-color: #dc2626; color: #fff; }
.iqc-judge-btn:disabled { cursor: not-allowed; opacity: .7; }
.iqc-label-reason { margin-left: 10px; }
.iqc-defect-reason {
  flex: 1; min-width: 120px; min-height: 28px; padding: 3px 6px; font-size: 12px; font-family: inherit;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; box-sizing: border-box;
}
.iqc-defect-reason:read-only { background: #f8fafc; color: #475569; }
/* ── OQC 出货检验记录（对齐桌面 GAK_oqc_enhanced）── */
/* 基本信息：标签左对齐 + 输入框等分（用户要求「根据标签调整显示位置」） */
[data-qms-detail="oqc"] .iqc-f .iqc-label,
[data-qms-detail="oqc"] .iqc-f-comp .iqc-label,
[data-qms-detail="oqc"] .iqc-row > .iqc-label {
  text-align: left;
}
/* 通栏行（备注/检验依据等）：单独一行拉满整行宽度 —— 所有 QMS 检验表单共用（IQC/FQC/IPQC/FAI/OQC） */
.iqc-row-basis {
  display: flex;
  align-items: center;
  gap: 8px;
}
.iqc-label-basis {
  flex: 0 0 auto;
  min-width: 62px;
  text-align: right; /* 与 .iqc-f .iqc-label 默认右对齐一致 */
}
.iqc-basis-inp {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #dbe2ea;
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
.iqc-basis-inp:read-only { background: #f8fafc; color: #475569; }
[data-qms-detail="oqc"] .iqc-label-basis {
  text-align: left; /* OQC 用户要求标签左对齐 */
}
[data-qms-detail="oqc"] .iqc-basis-inp {
  text-align: center; /* OQC 检验依据内容水平居中（用户要求） */
}
/* 喷码/印刷 附件区（左） + 最终判定/检验员/审核状态（右）：列表下方左右分栏 */
[data-qms-detail="oqc"] .oqc-mark-judge-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
}
/* 标准图片附件面板（对标 buildMaterialAttachPanel / GAK-WEB-ATTACH-UI-001） */
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #E8EAED;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
  outline: none;
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .gak-std-attach-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .section-title {
  font-weight: 500;
  font-size: 13px;
  color: #1e293b;
  margin: 0;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-list {
  flex: 1 1 auto;
  min-height: 64px;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #eef1f4;
  border-radius: 4px;
  padding: 4px 6px;
  background: #fafbfc;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  display: block;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-name-row {
  flex: 1 1 auto;
  min-width: 0;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-name {
  font-size: 12px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .attach-drop-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #94a3b8;
}
[data-qms-detail="oqc"] .oqc-mark-panel.gak-std-attach .empty.small {
  font-size: 12px;
  color: #94a3b8;
  padding: 12px 0;
  text-align: center;
}
[data-qms-detail="oqc"] .oqc-judge-panel {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
[data-qms-detail="oqc"] .oqc-judge-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
[data-qms-detail="oqc"] .oqc-judge-item .iqc-label {
  min-width: 0;
  text-align: left;
}
[data-qms-detail="oqc"] .oqc-judge-item .iqc-defect-reason {
  flex: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* MRB 评审：意见输入 + 填写人/日期 同行显示（对齐桌面 footer_card 六部门签核） */
[data-qms-detail="oqc"] .oqc-mrb-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
[data-qms-detail="oqc"] .iqc-mrb-inp {
  flex: 1 1 0;
  width: auto;
  min-width: 60px;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #dbe2ea;
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
[data-qms-detail="oqc"] .iqc-mrb-inp:read-only { background: #f8fafc; color: #475569; }
[data-qms-detail="oqc"] .oqc-mrb-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
[data-qms-detail="oqc"] .oqc-mrb-meta-label {
  font-size: 11px;
  color: #94a3b8;
  flex: 0 0 auto;
}
[data-qms-detail="oqc"] .oqc-mrb-meta-inp {
  flex: 0 0 auto;
  width: 118px;
  min-height: 24px;
  padding: 2px 5px;
  font-size: 11px;
  font-family: inherit;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  background: #f8fafc;
  color: #475569;
  box-sizing: border-box;
}
/* 喷码/印刷行：行级图片附件（对齐桌面 oqc_marking_attach_display） */
.qms-insp-table td.oqc-mark-cell {
  text-align: left;
  white-space: normal;
  padding: 4px 6px;
  background: #fafdfc;
}
.qms-oqc-row.is-marking .qms-inp[data-qms-col="测量数据"] { display: none; }

/* ── OQC 检验项目表：行内删按钮 + 拖拽排序 + 列显/隐 ── */
.qms-insp-table td.oqc-row-del-cell {
  position: sticky;
  right: 0;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 2px;
  border: 0;
  background: #fff; /* 覆盖单元格底色，贴右不透明 */
  text-align: center;
  z-index: 5;
}
.qms-insp-table th:has(~ td.oqc-row-del-cell) { display: none; }
.qms-insp-table td.oqc-row-del-cell .btn-text {
  display: inline-block;
  visibility: hidden;
  width: 26px;
  height: 22px;
  line-height: 20px;
  box-sizing: border-box;
  padding: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  color: #dc2626;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.qms-insp-table tr.qms-oqc-row:hover td.oqc-row-del-cell .btn-text {
  visibility: visible;
}
/* 拖拽排序：行首（行号格）为拖拽手柄；行级禁止选中文本（输入框除外），拖起高亮 */
.qms-insp-table tr.qms-oqc-row {
  user-select: none;
  -webkit-user-select: none;
}
.qms-insp-table tr.qms-oqc-row td.qms-idx {
  cursor: grab;
}
.qms-insp-table tr.qms-oqc-row td.qms-idx:active {
  cursor: grabbing;
}
.qms-insp-table tr.qms-oqc-row input {
  user-select: text;
  -webkit-user-select: text;
}
.qms-insp-table tr.qms-oqc-row.is-dragging {
  opacity: .55;
  outline: 1px dashed #0f766e;
  outline-offset: -2px;
}
/* 拖拽放置位置指示线：上方（插到该行前）/ 下方（插到该行后） */
.qms-insp-table tr.qms-oqc-row.is-drag-over-before { box-shadow: inset 0 2px 0 #0f766e; }
.qms-insp-table tr.qms-oqc-row.is-drag-over-after { box-shadow: inset 0 -2px 0 #0f766e; }
/* 列显/隐：隐藏列（th + td 同步隐藏；走系统统一 GakColSettings 弹窗） */
.qms-insp-table .oqc-col-hidden { display: none; }

/* ── IQC / FQC(out) / IPQC / FAI 明细表：行内删按钮 + 拖拽排序 + 列显/隐（对齐 OQC）── */
.qms-insp-table td.iqc-row-del-cell,
.qms-insp-table td.out-row-del-cell,
.qms-insp-table td.ipqc-row-del-cell {
  position: sticky;
  right: 0;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 2px;
  border: 0;
  background: #fff;
  text-align: center;
  z-index: 5;
}
.qms-insp-table td.iqc-row-del-cell .btn-text,
.qms-insp-table td.out-row-del-cell .btn-text,
.qms-insp-table td.ipqc-row-del-cell .btn-text {
  display: inline-block;
  visibility: hidden;
  width: 26px;
  height: 22px;
  line-height: 20px;
  box-sizing: border-box;
  padding: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  color: #dc2626;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.qms-insp-table tr.qms-iqc-row:hover td.iqc-row-del-cell .btn-text,
.qms-insp-table tr.qms-out-row:hover td.out-row-del-cell .btn-text,
.qms-insp-table tr.qms-ipqc-row:hover td.ipqc-row-del-cell .btn-text {
  visibility: visible;
}
/* 合计/不良率行：对齐行删列的占位空 td 保持列数一致 */
.qms-insp-table td.iqc-sum-del-cell {
  border: 0;
  background: #f8fafc;
}
/* 拖拽排序：行首为拖拽手柄 */
.qms-insp-table tr.qms-iqc-row,
.qms-insp-table tr.qms-out-row,
.qms-insp-table tr.qms-ipqc-row {
  user-select: none;
  -webkit-user-select: none;
}
.qms-insp-table tr.qms-iqc-row td.qms-idx,
.qms-insp-table tr.qms-out-row td.qms-idx,
.qms-insp-table tr.qms-ipqc-row td.qms-idx {
  cursor: grab;
}
.qms-insp-table tr.qms-iqc-row td.qms-idx:active,
.qms-insp-table tr.qms-out-row td.qms-idx:active,
.qms-insp-table tr.qms-ipqc-row td.qms-idx:active {
  cursor: grabbing;
}
.qms-insp-table tr.qms-iqc-row input,
.qms-insp-table tr.qms-out-row input,
.qms-insp-table tr.qms-ipqc-row input {
  user-select: text;
  -webkit-user-select: text;
}
.qms-insp-table tr.qms-iqc-row.is-dragging,
.qms-insp-table tr.qms-out-row.is-dragging,
.qms-insp-table tr.qms-ipqc-row.is-dragging {
  opacity: .55;
  outline: 1px dashed #0f766e;
  outline-offset: -2px;
}
.qms-insp-table tr.qms-iqc-row.is-drag-over-before,
.qms-insp-table tr.qms-out-row.is-drag-over-before,
.qms-insp-table tr.qms-ipqc-row.is-drag-over-before {
  box-shadow: inset 0 2px 0 #0f766e;
}
.qms-insp-table tr.qms-iqc-row.is-drag-over-after,
.qms-insp-table tr.qms-out-row.is-drag-over-after,
.qms-insp-table tr.qms-ipqc-row.is-drag-over-after {
  box-shadow: inset 0 -2px 0 #0f766e;
}
/* 列显/隐 */
.qms-insp-table .iqc-col-hidden,
.qms-insp-table .out-col-hidden,
.qms-insp-table .ipqc-col-hidden { display: none; }

/* ── FAI 首件检验 检验项目表：行内删 + 拖拽 + 列显/隐（对齐 OQC）── */
.fai-insp-table td.fai-row-del-cell {
  position: sticky;
  right: 0;
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 2px;
  border: 0;
  background: #fff;
  text-align: center;
  z-index: 5;
}
.fai-insp-table td.fai-row-del-cell .btn-text {
  display: inline-block;
  visibility: hidden;
  width: 26px;
  height: 22px;
  line-height: 20px;
  box-sizing: border-box;
  padding: 0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  color: #dc2626;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.fai-insp-table tr[data-fai-insp-row]:hover td.fai-row-del-cell .btn-text {
  visibility: visible;
}
.fai-insp-table tr[data-fai-insp-row] {
  user-select: none;
  -webkit-user-select: none;
}
.fai-insp-table tr[data-fai-insp-row] td.fai-insp-idx {
  cursor: grab;
}
.fai-insp-table tr[data-fai-insp-row] td.fai-insp-idx:active {
  cursor: grabbing;
}
.fai-insp-table tr[data-fai-insp-row] input {
  user-select: text;
  -webkit-user-select: text;
}
.fai-insp-table tr[data-fai-insp-row].is-dragging {
  opacity: .55;
  outline: 1px dashed #0f766e;
  outline-offset: -2px;
}
.fai-insp-table tr[data-fai-insp-row].is-drag-over-before { box-shadow: inset 0 2px 0 #0f766e; }
.fai-insp-table tr[data-fai-insp-row].is-drag-over-after { box-shadow: inset 0 -2px 0 #0f766e; }
.fai-insp-table .fai-col-hidden { display: none; }

/* ── FAI 首件检验 基本信息对齐 OQC（复用 .iqc-grid/.iqc-f/.iqc-label 体系）── */
.fai-form-root[data-qms-detail="fai"] .iqc-f .iqc-label,
.fai-form-root[data-qms-detail="fai"] .iqc-f-comp .iqc-label,
.fai-form-root[data-qms-detail="fai"] .iqc-row > .iqc-label {
  text-align: right; /* 输入框标签右对齐 */
  white-space: nowrap;
}
.fai-form-root[data-qms-detail="fai"] .iqc-f .fai-field {
  flex: 1 1 auto;
  min-width: 0;
}
.fai-form-root[data-qms-detail="fai"] .iqc-f textarea {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 3px 6px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #dbe2ea;
  border-radius: 2px;
  background: #fff;
  box-sizing: border-box;
}
.fai-form-root[data-qms-detail="fai"] .iqc-f textarea:read-only {
  background: #f8fafc;
  color: #475569;
}
.fai-form-root[data-qms-detail="fai"] .iqc-f.iqc-span-2 { grid-column: span 2; }
.fai-form-root[data-qms-detail="fai"] .iqc-f.iqc-span-full { grid-column: 1 / -1; }

/* ── 喷码/印刷内容（左）与 首件生产记录（右）左右并列（对齐 OQC 喷码/印刷附件区）── */
.fai-form-root[data-qms-detail="fai"] .fai-prod-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.fai-form-root[data-qms-detail="fai"] .fai-prod-row > .iqc-card {
  min-width: 0;
  margin-bottom: 12px;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #E8EAED;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
  outline: none;
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .gak-std-attach-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .section-title {
  font-weight: 500;
  font-size: 13px;
  color: #1e293b;
  margin: 0;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-list {
  flex: 1 1 auto;
  min-height: 64px;
  max-height: 260px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #eef1f4;
  border-radius: 4px;
  padding: 4px 6px;
  background: #fafbfc;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  display: block;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-thumb-ph {
  width: 64px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #475569;
  background: #eef1f4;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  flex: 0 0 auto;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-name-row {
  flex: 1 1 auto;
  min-width: 0;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-name {
  font-size: 12px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .attach-drop-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: #94a3b8;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-panel.gak-std-attach .empty.small {
  font-size: 12px;
  color: #94a3b8;
  padding: 12px 0;
  text-align: center;
}

/* ── 喷码/印刷内容卡：内部附件面板边框向下拉满（与右侧「首件生产记录」卡等高）── */
.fai-form-root[data-qms-detail="fai"] .fai-mark-card {
  display: flex;
  flex-direction: column;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-card .iqc-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-card .fai-mark-panel {
  flex: 1 1 auto;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-card .attach-list {
  max-height: none;
}
.fai-form-root[data-qms-detail="fai"] .fai-mark-card .attach-list .empty.small {
  margin: auto 0; /* 空态提示在拉伸区域内垂直居中 */
}

/* ── FAI 检验项目表：列显/隐（GakColSettings 弹窗勾选后隐藏） + 列宽拖拽 ── */
.fai-form-root[data-qms-detail="fai"] .fai-insp-table th,
.fai-form-root[data-qms-detail="fai"] .fai-insp-table td {
  overflow: visible; /* 表头右侧列宽拖拽手柄需可点 */
}
.fai-form-root[data-qms-detail="fai"] .fai-insp-table .fai-col-hidden {
  display: none !important;
}

.oqc-mark-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 30px;
}
.oqc-mark-thumbs {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.oqc-mark-thumb {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #dbe2ea;
  border-radius: 3px;
  background: #fff;
  padding: 2px 4px;
  max-width: 180px;
}
.oqc-mark-thumb.is-img img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid #e2e8f0;
}
.oqc-mark-thumb .oqc-mark-name {
  font-size: 11px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}
.oqc-mark-thumb .oqc-mark-file-icon { font-size: 18px; }
.oqc-mark-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.oqc-mark-empty { font-size: 12px; color: #94a3b8; }
.oqc-mark-tools .oqc-mark-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid #0f766e;
  background: #fff;
  color: #0f766e;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.oqc-mark-tools .oqc-mark-upload:hover { background: #ecfdf5; }
.iqc-sign-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 10px;
}
.iqc-sign-pair {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
}
.iqc-sign-label { flex: 0 0 auto; font-size: 12px; color: #64748b; white-space: nowrap; }
.iqc-sign-inp {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 28px; padding: 3px 6px; font-size: 12px; font-family: inherit;
  border: 1px solid #dbe2ea; border-radius: 2px; background: #fff; box-sizing: border-box;
}
.iqc-sign-inp:read-only { background: #f8fafc; color: #475569; }
.iqc-final-tip { flex: 0 0 auto; margin-left: 10px; font-size: 12px; color: #34A853; white-space: nowrap; }
.iqc-purchase-grid {
  display: grid; grid-template-columns: 1fr 260px; gap: 14px; align-items: start;
}
.iqc-opinion { display: flex; flex-direction: column; gap: 4px; }
.iqc-opinion-text {
  width: 100%; box-sizing: border-box; min-height: 56px; padding: 6px 8px; font-size: 12px;
  font-family: inherit; line-height: 1.6; border: 1px solid #dbe2ea; border-radius: 2px; resize: vertical;
}
.iqc-opinion-text:read-only { background: #f8fafc; color: #475569; }
/* IPQC 备注 / 签核卡：底部备注说明（对齐桌面 IPQC_FOOTER_NOTES） */
.iqc-note-block { padding: 2px 0; }
.iqc-note-text {
  font-size: 12px; line-height: 1.8; color: #64748b; white-space: normal; word-break: break-all;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 2px; padding: 8px 10px;
}
.iqc-disposal-group { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.iqc-disposal-item { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #334155; cursor: pointer; }
.iqc-disposal-item input { accent-color: #0f766e; }
.iqc-form-no-bottom { text-align: right; font-size: 11px; color: #cbd5e1; padding: 2px 16px 10px; }
@media (max-width: 900px) {
  .iqc-grid { grid-template-columns: 1fr; }
  .iqc-purchase-grid { grid-template-columns: 1fr; }
}

/* IQC 模板选择弹窗（对齐桌面 open_inspection_template_picker_dialog） */
.iqc-tmpl-modal {
  position: fixed; inset: 0; z-index: 12000; background: rgba(15, 23, 42, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.iqc-tmpl-box {
  width: 520px; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 8px; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}
.iqc-tmpl-head {
  padding: 12px 16px; font-size: 14px; font-weight: 500; color: #1e293b;
  border-bottom: 1px solid #eef2f7; background: #f8fafc;
}
.iqc-tmpl-sub { font-size: 12px; color: #94a3b8; font-weight: 400; margin-top: 2px; }
.iqc-tmpl-search { padding: 8px 14px 0; }
.iqc-tmpl-search-input {
  width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: 13px;
  border: 1px solid #e2e8f0; border-radius: 6px; outline: none; color: #334155;
  background: #f8fafc;
}
.iqc-tmpl-search-input:focus { border-color: var(--primary, #16a34a); background: #fff; }
.iqc-tmpl-search-input::placeholder { color: #94a3b8; }
.iqc-tmpl-list { flex: 1 1 auto; overflow: auto; padding: 8px; }
.iqc-tmpl-item {
  display: flex; align-items: center; padding: 8px 12px; border-radius: 4px; cursor: pointer;
  font-size: 13px; color: #334155;
}
.iqc-tmpl-item:hover { background: #f0fdf4; }
.iqc-tmpl-label { flex: 1; }
.iqc-tmpl-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px;
  border-top: 1px solid #eef2f7; background: #f8fafc;
}

/* ── 模板管理弹窗 ── */
.gak-tmpl-mgr { width: 780px; }
.gak-tmpl-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid #eef2f7; background: #fff;
}
.gak-tmpl-list {
  flex: 1 1 auto; overflow: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.gak-tmpl-empty {
  text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 13px;
}
.gak-tmpl-card {
  border: 1px solid #e2e8f0; border-radius: 6px; background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.gak-tmpl-card:hover {
  border-color: var(--primary, #4F6EF7);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.gak-tmpl-system { background: #f8fafc; }
.gak-tmpl-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
}
.gak-tmpl-name {
  font-size: 14px; font-weight: 500; color: #1e293b;
  display: flex; align-items: center; gap: 8px;
}
.gak-tmpl-tag {
  font-size: 11px; font-weight: normal; padding: 2px 8px; border-radius: 10px;
  background: #e2e8f0; color: #64748b;
}
.gak-tmpl-tag-user { background: #dbeafe; color: #1d4ed8; }
.gak-tmpl-meta { font-size: 12px; color: #94a3b8; }
.gak-tmpl-card-body {
  padding: 10px 14px; font-size: 12px; color: #64748b;
  display: flex; flex-direction: column; gap: 4px;
}
.gak-tmpl-row-item { display: flex; align-items: baseline; gap: 6px; }
.gak-tmpl-tool { color: #1d4ed8; font-size: 12px; }
.gak-tmpl-std { color: #94a3b8; }
.gak-tmpl-more { color: #94a3b8; font-size: 11px; margin-top: 2px; }
.gak-tmpl-card-actions {
  display: flex; justify-content: flex-end; gap: 6px; padding: 8px 14px;
  border-top: 1px solid #f1f5f9; background: #f8fafc;
}
.gak-tmpl-card-actions .tb-btn { padding: 4px 10px; font-size: 12px; }

/* 模板编辑表单 */
.gak-tmpl-edit { width: 640px; max-height: 85vh; }
.gak-tmpl-close {
  position: absolute; right: 12px; top: 8px;
  width: 24px; height: 24px; border: none; background: transparent;
  font-size: 18px; color: #94a3b8; cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.gak-tmpl-close:hover { background: #f1f5f9; color: #1e293b; }
.gak-tmpl-edit .iqc-tmpl-head { position: relative; }
.gak-tmpl-edit-form {
  flex: 1 1 auto; overflow: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.gak-tmpl-field { display: flex; flex-direction: column; gap: 4px; }
.gak-tmpl-field label {
  font-size: 12px; color: #64748b; font-weight: 500;
}
.gak-tmpl-field input,
.gak-tmpl-field select {
  height: 32px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 13px; color: #334155; background: #fff; outline: none;
}
.gak-tmpl-field input:focus,
.gak-tmpl-field select:focus { border-color: var(--primary, #4F6EF7); }
.gak-tmpl-row { display: flex; gap: 10px; }
.gak-tmpl-row .gak-tmpl-field { flex: 1; }
.gak-tmpl-section-title {
  font-size: 13px; font-weight: 500; color: #1e293b;
  padding-top: 8px; border-top: 1px solid #eef2f7; margin-top: 4px;
}
.gak-tmpl-edit-rows {
  display: flex; flex-direction: column; gap: 6px;
}
.gak-tmpl-edit-row {
  display: flex; gap: 6px; align-items: center;
}
.gak-tmpl-row-drag {
  flex: 0 0 22px; width: 22px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; cursor: grab; user-select: none; -webkit-user-select: none;
}
.gak-tmpl-row-drag:hover { color: var(--primary, #4F6EF7); }
.gak-tmpl-row-drag:active { cursor: grabbing; }
.gak-tmpl-edit-row.gak-tmpl-dragging { opacity: 0.45; }
.gak-tmpl-edit-row.gak-tmpl-drag-over {
  box-shadow: 0 -2px 0 var(--primary, #4F6EF7), 0 2px 0 var(--primary, #4F6EF7);
}
.gak-tmpl-edit-row input {
  flex: 1; height: 30px; padding: 0 10px;
  border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 13px; color: #334155; outline: none;
}
.gak-tmpl-edit-row input:focus { border-color: var(--primary, #4F6EF7); }
.gak-tmpl-edit-item { flex: 0.8 !important; }
.gak-tmpl-edit-tool { flex: 0.55 !important; }
.gak-tmpl-edit-std { flex: 1.2 !important; }
.gak-tmpl-row-del {
  width: 28px; height: 28px; border: 1px solid #e2e8f0; border-radius: 4px;
  background: #fff; color: #94a3b8; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.gak-tmpl-row-del:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* 危险按钮 */
.tb-btn-danger {
  border-color: #fecaca; background: #fff; color: #dc2626;
}
.tb-btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }
.tb-btn-primary {
  border-color: var(--primary, #4F6EF7); background: var(--primary, #4F6EF7); color: #fff;
}
.tb-btn-primary:hover { opacity: 0.9; }

.iqc-report-page {
  height: 100%; overflow: auto; box-sizing: border-box; padding: 16px;
}
.iqc-report-toolbar {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; margin-bottom: 14px; flex-wrap: wrap; gap: 8px;
}
.iqc-report-title { font-size: 16px; font-weight: 500; color: #1e293b; }
.iqc-report-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 顶栏年月/周筛选（挂到「[刷新] 刷新」按钮左边） */
.iqc-report-toolbar-ctl { display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; }
.iqc-report-select {
  height: 30px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 13px; color: #334155; background: #fff; outline: none;
}
.iqc-report-select:focus { border-color: #4F6EF7; }
.iqc-week-nav {
  height: 30px; min-width: 30px; padding: 0 6px;
  border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 13px; line-height: 1; color: #334155; background: #fff;
  cursor: pointer; outline: none; display: inline-flex; align-items: center; justify-content: center;
}
.iqc-week-nav:hover { border-color: #4F6EF7; color: #4F6EF7; background: #f5f8ff; }
.iqc-week-no {
  height: 30px; min-width: 64px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 13px; color: #334155; background: #f8fafc; white-space: nowrap;
}
.iqc-report-week-label { font-size: 12px; color: #64748b; }
/* 周报左右区域：左栏加宽显示完整列，右栏收缩让出空间 */
.iqc-weekly-main {
  display: flex; align-items: stretch; gap: 14px; box-sizing: border-box;
}
.iqc-weekly-main .iqc-report-sec { margin-bottom: 0; }
.iqc-weekly-left {
  flex: 0 0 58%; min-width: 0; display: flex; flex-direction: column; gap: 14px;
  box-sizing: border-box;
}
.iqc-weekly-right {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
  box-sizing: border-box;
}
.iqc-weekly-right .iqc-report-sec {
  flex: 1 1 auto; display: flex; flex-direction: column; box-sizing: border-box;
}
.iqc-weekly-right .iqc-report-bars {
  flex: 1 1 auto; min-height: 260px; box-sizing: border-box;
}
/* 周报右下：不良情况明细表（滚动上限，避免撑高页面） */
.iqc-bad-sec .iqc-report-table-wrap { max-height: 300px; }
@media (max-width: 900px) {
  .iqc-weekly-main { flex-direction: column; }
  .iqc-weekly-left { flex: 1 1 auto; }
  .iqc-weekly-right .iqc-report-bars { min-height: 220px; }
}
/* 分析页左右区域：供应商汇总（左，列多）| 月度趋势（右） */
.iqc-stats-main {
  display: flex; align-items: flex-start; gap: 14px; box-sizing: border-box;
}
.iqc-stats-main .iqc-report-sec { margin-bottom: 0; }
.iqc-stats-left {
  flex: 0 0 58%; min-width: 0; box-sizing: border-box;
}
.iqc-stats-right {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box;
}
@media (max-width: 900px) {
  .iqc-stats-main { flex-direction: column; }
  .iqc-stats-left { flex: 1 1 auto; }
}
/* 周/月报左右分栏：40% 汇总 + 60% 明细（复制桌面 4:6 比例） */
.iqc-split-main {
  display: flex; align-items: stretch; gap: 14px; box-sizing: border-box;
}
.iqc-split-main .iqc-report-sec { margin-bottom: 0; }
.iqc-split-left {
  flex: 0 0 40%; min-width: 0; box-sizing: border-box;
}
.iqc-split-right {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 14px;
}
.iqc-detail-summary {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 10px 14px; font-size: 13px; color: #1e293b;
  white-space: nowrap; overflow-x: auto; line-height: 1.6;
}
@media (max-width: 900px) {
  .iqc-split-main { flex-direction: column; }
  .iqc-split-left { flex: 1 1 auto; }
}
.iqc-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.iqc-kpi-card {
  background: #fff; border: 1px solid #e2e8f0; border-top: 3px solid #4F6EF7;
  border-radius: 8px; padding: 12px 14px; box-sizing: border-box;
}
.iqc-kpi-title { font-size: 12px; color: #64748b; margin-bottom: 6px; text-align: center; }
.iqc-kpi-value { font-size: 24px; font-weight: 500; color: #1e293b; line-height: 1.1; text-align: center; }
.iqc-kpi-hint { font-size: 11px; color: #94a3b8; margin-top: 4px; text-align: center; }
.iqc-report-note {
  font-size: 12px; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1;
  border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; text-align: center;
}
.iqc-report-sec {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  margin-bottom: 14px; padding: 12px 16px 16px; box-sizing: border-box;
}
.iqc-report-sec h3 {
  font-size: 14px; font-weight: 500; color: #1e293b; margin: 0 0 10px;
  padding-left: 8px; border-left: 3px solid #4F6EF7; line-height: 1.3;
  text-align: center;
}
.iqc-report-table-wrap { overflow: auto; }
.iqc-report-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.iqc-report-table th {
  background: #f1f5f9; color: #334155; font-weight: 500; text-align: center;
  padding: 8px 10px; border: 1px solid #e2e8f0; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.iqc-weekly-right .iqc-report-table th::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 6px;
  cursor: col-resize;
}
.iqc-weekly-right .iqc-report-table th:last-child::after { display: none; }
.iqc-report-table td {
  padding: 7px 10px; border: 1px solid #e2e8f0; color: #334155;
  white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.iqc-report-table tbody tr:nth-child(even) { background: #fafbfc; }
.iqc-report-table tbody tr:hover { background: #eef6ff; }
.iqc-report-empty { text-align: center; color: #94a3b8; padding: 24px !important; }
.iqc-report-hl { color: #dc2626; font-weight: 500; }
/* 出货报表：汇总表可点击行 */
.iqc-report-row-clickable { cursor: pointer; }
/* 出货日报：收缩左侧按日期汇总，给右侧日期横轴柱状图腾位置 */
.ship-daily-stats .iqc-stats-left { flex: 0 0 40%; }
/* 每日完成率：日期横轴柱状图 */
.iqc-col-bar { fill: #4F6EF7; }
/* 本年完成率曲线图（SVG 折线 + 100% 目标线） */
.iqc-line-chart-wrap { width: 100%; overflow: hidden; }
.iqc-line-chart { width: 100%; height: auto; display: block; }
.iqc-line-grid { stroke: #e2e8f0; stroke-width: 1; }
.iqc-line-axis { fill: #94a3b8; font-size: 11px; }
.iqc-line-target { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 5 4; }
.iqc-line-target-label { fill: #b45309; font-size: 11px; font-weight: 500; }
.iqc-line-path { fill: none; stroke: #4F6EF7; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.iqc-line-dot { fill: #4F6EF7; }
.iqc-line-xlabel { fill: #64748b; font-size: 11px; }
.iqc-report-bars {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; box-sizing: border-box; overflow-x: auto;
}
.iqc-report-bar-row {
  display: flex; align-items: center; gap: 8px;
}
.iqc-report-bar-label {
  flex: 0 0 170px; max-width: 170px; box-sizing: border-box;
  font-size: 11px; color: #64748b; text-align: right; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.iqc-report-bar-track {
  flex: 1 1 auto; height: 18px; background: #eef2f7;
  border-radius: 3px; overflow: hidden;
}
.iqc-report-bar {
  height: 100%; background: linear-gradient(90deg, #4F6EF7, #3b5bdb);
  border-radius: 3px; min-width: 2px;
}
.iqc-report-bar-val {
  flex: 0 0 auto; min-width: 44px; text-align: left;
  font-size: 11px; color: #475569; font-weight: 500;
}
.iqc-deep-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
  background: #f1f5f9; border-radius: 8px; padding: 6px; box-sizing: border-box;
  justify-content: center;
}
.iqc-deep-tab {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 6px;
  font-size: 13px; color: #475569; cursor: pointer; font-family: inherit;
}
.iqc-deep-tab:hover { background: #e2e8f0; }
.iqc-deep-tab.is-on { background: #4F6EF7; color: #fff; font-weight: 500; }
.iqc-deep-body { min-height: 200px; }

/* ═══════════════════════════════════════════════════════════════════
   系统统一定义（GAK-INPUT-BLUE-001）：输入/选择控件文字统一蓝色
   ── 含「编辑态」与「只读态」（查看/审核：readonly input、disabled select）均蓝色
   ── 排除：复选框/单选框/文件/隐藏/按钮型/范围/取色器（无文字输入语义）
   ── -webkit-text-fill-color 确保 Chrome 对 readonly/disabled 控件也生效
   ═══════════════════════════════════════════════════════════════════ */
#app input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="range"]):not([type="color"]),
#app select,
#app textarea,
#app select option {
  color: #1a73e8 !important;
  -webkit-text-fill-color: #1a73e8 !important;
}
/* 输入框占位提示保持浅灰（提示语非内容，不随正文变蓝） */
#app input::placeholder,
#app textarea::placeholder {
  color: #a8b3c2 !important;
  -webkit-text-fill-color: #a8b3c2 !important;
}

/* ============================================
   模块切换加载微徽标：不替换现有列表 DOM，
   仅在右上角显示一个小角标，避免"旧行→空白→新行"闪跳
   ============================================ */
.gak-switching-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  z-index: 5;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 18px;
  color: #0f766e;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.15);
  pointer-events: none;
}
/* 开启绝对定位的徽标位置上下文 */
#module-list {
  position: relative;
}
/* 切换中旧表格轻微淡化，给"正在刷新"的软反馈但不完全空白 */
#module-list.gak-switching .table-wrap,
#module-list.gak-switching > table,
#module-list.gak-switching > .table-wrap {
  opacity: 0.72;
  transition: opacity 0.08s linear;
}
#module-list:not(.gak-switching) .table-wrap,
#module-list:not(.gak-switching) > table,
#module-list:not(.gak-switching) > .table-wrap {
  opacity: 1;
  transition: opacity 0.08s linear;
}

/* ===== 体系文件（ISO Docs）===== */
#page-iso-docs { position: relative; }
#page-iso-docs .page-header .toolbar { gap: 2px; flex-wrap: nowrap; overflow-x: auto; }
#page-iso-docs .tb-ico { display: inline-flex; width: 14px; height: 14px; align-items: center; justify-content: center; margin-right: 4px; color: var(--primary-dark, #0f766e); }
#page-iso-docs .tb-ico svg { width: 14px; height: 14px; }
#page-iso-docs .tb-btn .tb-ico { color: inherit; }
#page-iso-docs .tb-btn { display: inline-flex; align-items: center; white-space: nowrap; }
#page-iso-docs .tb-sep { width: 1px; height: 18px; background: #e2e8f0; flex-shrink: 0; margin: 0 4px; }

/* 工具栏：搜索框 / 排序 / 视图切换 */
.iso-docs-search-wrap {
  display: inline-flex; align-items: center; position: relative;
  flex-shrink: 0;
}
.iso-docs-search-ico {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: #94a3b8; pointer-events: none;
}
.iso-docs-search-ico svg { width: 14px; height: 14px; }
.iso-docs-search {
  height: 26px; width: 180px;
  padding: 0 8px 0 26px;
  font-size: 12px;
  border: 1px solid #e2e8f0; border-radius: 3px;
  background: #fff; color: #334155;
  outline: none;
}
.iso-docs-search:focus { border-color: var(--primary, #0d9488); }
.iso-docs-sort {
  height: 26px; font-size: 12px;
  border: 1px solid #e2e8f0; border-radius: 3px;
  background: #fff; color: #334155;
  padding: 0 6px; cursor: pointer;
}
.iso-docs-sort:focus { border-color: var(--primary, #0d9488); outline: none; }
.iso-docs-view-switch {
  display: inline-flex; border: 1px solid #e2e8f0; border-radius: 3px; overflow: hidden;
  flex-shrink: 0;
}
.iso-docs-view-btn {
  width: 28px; height: 24px;
  background: #fff; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: #64748b;
}
.iso-docs-view-btn svg { width: 14px; height: 14px; }
.iso-docs-view-btn:hover { background: #f1f5f9; }
.iso-docs-view-btn.active { background: var(--primary, #0d9488); color: #fff; }
#btn-iso-docs-multi.active { background: var(--primary, #0d9488); color: #fff; }

/* 主布局：左树 + 右内容 */
.iso-docs-main {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
}
.iso-docs-side {
  width: 220px;
  flex-shrink: 0;
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fcfcfd;
}
.iso-docs-splitter {
  width: 6px;
  flex-shrink: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  transition: background 0.15s ease;
}
.iso-docs-splitter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: var(--border, #e2e8f0);
  transition: width 0.15s ease, background 0.15s ease;
}
.iso-docs-splitter:hover::before,
.iso-docs-splitter.dragging::before {
  width: 3px;
  background: var(--primary, #0f766e);
}
.iso-docs-splitter.dragging {
  background: rgba(15, 118, 110, 0.05);
}
.iso-docs-splitter.dragging * {
  user-select: none !important;
}
.iso-docs-side-head {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--primary-dark, #0f766e);
  border-bottom: 1px solid #eef2f7;
  letter-spacing: 0.5px;
}
.iso-docs-side-body {
  flex: 1;
  overflow: auto;
  padding: 4px 0;
}
.iso-docs-tree-item {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  color: #334155;
}
.iso-docs-tree-item:hover { background: #f1f5f9; }
.iso-docs-tree-item.active { background: #ccfbf1; color: var(--primary-dark, #0f766e); }
.iso-docs-tree-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: var(--primary-dark, #0f766e); flex-shrink: 0; }
.iso-docs-tree-icon svg { width: 16px; height: 16px; }
.iso-docs-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.iso-docs-tree-arrow { color: #94a3b8; font-size: 10px; flex-shrink: 0; }
.iso-docs-tree-children { padding-left: 14px; }

/* 右侧内容 */
.iso-docs-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.iso-docs-breadcrumb {
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  background: #fafbfc;
}
.iso-docs-crumb {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary-dark, #0f766e);
  cursor: pointer;
  text-decoration: none;
  padding: 2px 4px; border-radius: 3px;
}
.iso-docs-crumb:hover { background: #e6f4f2; }
.iso-docs-crumb svg { width: 14px; height: 14px; }
.iso-docs-crumb-sep { color: #cbd5e1; margin: 0 2px; }
.iso-docs-crumb-current { color: #334155; }

/* 列表视图 */
.iso-docs-list {
  flex: 1;
  overflow: auto;
  padding: 0;
}
.iso-docs-head {
  display: flex; align-items: center;
  padding: 8px 14px;
  font-size: 12px; color: #475569; font-weight: 500;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 2;
}
.iso-docs-head [data-sort] { cursor: pointer; user-select: none; }
.iso-docs-head [data-sort]:hover { color: var(--primary-dark, #0f766e); }
.iso-docs-col-check { width: 32px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.iso-docs-col-icon { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.iso-docs-col-name { flex: 1; min-width: 0; }
.iso-docs-col-size { width: 80px; flex-shrink: 0; }
.iso-docs-col-mtime { width: 140px; flex-shrink: 0; }
.iso-docs-col-ops { width: 180px; flex-shrink: 0; text-align: right; }

.iso-docs-row {
  display: flex; align-items: center;
  padding: 9px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  cursor: default;
}
.iso-docs-row:nth-child(even) { background: #fafbfc; }
.iso-docs-row:hover { background: #f1f5f9; }
.iso-docs-row.selected { background: #ccfbf1; }
.iso-docs-row.selected:hover { background: #bae6fd; }
.iso-docs-row .iso-docs-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: #1e293b; }
.iso-docs-row .iso-docs-col-name:hover { color: var(--primary-dark, #0f766e); }
.iso-docs-col-size { color: #64748b; font-size: 12px; }
.iso-docs-col-mtime { color: #94a3b8; font-size: 12px; }
.iso-docs-col-ops { display: flex; gap: 2px; justify-content: flex-end; }

.iso-docs-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; color: var(--primary, #0d9488); }
.iso-docs-icon svg { width: 20px; height: 20px; }
.iso-docs-icon.lg { width: 48px; height: 48px; color: var(--primary, #0d9488); }
.iso-docs-icon.lg svg { width: 48px; height: 48px; }

/* 操作按钮 */
.iso-docs-act {
  display: inline-flex; align-items: center; gap: 3px;
  background: #fff; border: 1px solid #e2e8f0; cursor: pointer;
  font-size: 12px; padding: 3px 8px; border-radius: 3px;
  color: #475569;
}
.iso-docs-act svg { width: 13px; height: 13px; }
.iso-docs-act:hover { background: #f1f5f9; border-color: #cbd5e1; }
.iso-docs-act.danger { color: #b91c1c; }
.iso-docs-act.danger:hover { background: #fef2f2; border-color: #fecaca; }

/* 复选框 */
.iso-docs-cbx {
  display: inline-flex; width: 16px; height: 16px;
  border: 1.5px solid #cbd5e1; border-radius: 3px;
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
  color: transparent;
  transition: all 0.12s;
}
.iso-docs-cbx svg { width: 12px; height: 12px; }
.iso-docs-cbx:hover { border-color: var(--primary, #0d9488); }
.iso-docs-cbx.on { background: var(--primary, #0d9488); border-color: var(--primary, #0d9488); color: #fff; }

/* 网格视图 */
.iso-docs-list.is-grid { padding: 12px; }
.iso-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.iso-docs-card {
  position: relative;
  padding: 14px 10px 8px;
  border: 1px solid #e2e8f0; border-radius: 4px;
  background: #fff;
  display: flex; flex-direction: column; align-items: center;
  cursor: default;
  transition: all 0.12s;
}
.iso-docs-card:hover { border-color: var(--primary, #0d9488); box-shadow: 0 1px 4px rgba(13,148,136,0.08); }
.iso-docs-card.selected { border-color: var(--primary, #0d9488); background: #f0fdfa; }
.iso-docs-card-check { position: absolute; top: 6px; left: 6px; }
.iso-docs-card-icon { margin-bottom: 6px; }
.iso-docs-card-name {
  font-size: 12px; color: #334155; text-align: center;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.iso-docs-card-name:hover { color: var(--primary-dark, #0f766e); }
.iso-docs-card-meta { font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.iso-docs-card-acts { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.iso-docs-card-acts .iso-docs-act { padding: 1px 4px; font-size: 11px; }
.iso-docs-card-acts .iso-docs-act span { display: none; }
.iso-docs-card-acts .iso-docs-act { width: 24px; height: 22px; justify-content: center; }

/* 空态 */
.iso-docs-empty {
  padding: 60px 20px; text-align: center; color: #94a3b8; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.iso-docs-empty .iso-docs-icon.lg { color: #cbd5e1; }
.iso-docs-empty-text { font-size: 14px; color: #64748b; }
.iso-docs-empty-hint { font-size: 12px; color: #94a3b8; }

/* 拖拽上传提示：列表区中央浮动卡片（不遮蔽整个内容区） */
.iso-docs-drop-hint {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20; pointer-events: none;
}
.iso-docs-drop-hint-card {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: rgba(13, 148, 136, 0.96);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.28);
}
.iso-docs-drop-hint-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.iso-docs-drop-hint-icon svg { width: 20px; height: 20px; }

/* 上传进度面板 */
.iso-docs-upload-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 28px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex; align-items: center;
  gap: 10px; padding: 0 12px;
  z-index: 15;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.04);
}
.iso-docs-upload-bar-wrap {
  flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.iso-docs-upload-bar {
  height: 100%; width: 0; background: var(--primary, #0d9488);
  transition: width 0.2s ease;
}
.iso-docs-upload-text { font-size: 12px; color: #475569; flex-shrink: 0; min-width: 140px; }
.iso-docs-upload-cancel {
  background: none; border: 1px solid #e2e8f0; cursor: pointer;
  font-size: 12px; padding: 2px 8px; border-radius: 3px; color: #b91c1c;
}
.iso-docs-upload-cancel:hover { background: #fef2f2; border-color: #fecaca; }

/* 抽屉：文件预览 */
.iso-docs-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 60%; max-width: 800px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex; flex-direction: column;
  z-index: 30;
}
.iso-docs-drawer.open { transform: translateX(0); }
.iso-docs-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid #eef2f7;
  background: #fafbfc;
  flex-shrink: 0;
}
.iso-docs-drawer-title {
  font-size: 13px; color: #334155;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.iso-docs-drawer-actions { display: flex; gap: 4px; flex-shrink: 0; }
.iso-docs-drawer-body {
  flex: 1; overflow: auto; padding: 14px;
}
.iso-docs-drawer-loading { padding: 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.iso-docs-preview-img-wrap { text-align: center; }
.iso-docs-preview-img { max-width: 100%; border: 1px solid #e2e8f0; border-radius: 4px; }
.iso-docs-preview-text {
  font-size: 12px; white-space: pre-wrap; word-break: break-all;
  background: #f8fafc; padding: 10px; border-radius: 4px;
  border: 1px solid #eef2f7;
  font-family: "Consolas", "Microsoft YaHei", monospace;
  line-height: 1.5;
}
.iso-docs-preview-note { padding: 20px; text-align: center; color: #64748b; font-size: 13px; }
.iso-docs-preview-actions { text-align: center; margin-top: 12px; }

/* 多选批量操作栏 */
.iso-docs-multi-bar {
  position: absolute; bottom: 28px; left: 0; right: 0;
  height: 40px;
  background: var(--primary-dark, #0f766e);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  z-index: 25;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
}
.iso-docs-multi-info { font-size: 13px; }
.iso-docs-multi-info b { font-size: 14px; margin: 0 2px; }
.iso-docs-multi-acts { display: flex; gap: 6px; }
.iso-docs-multi-acts .tb-btn { color: #fff; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); }
.iso-docs-multi-acts .tb-btn:hover { background: rgba(255,255,255,0.22); }
.iso-docs-multi-acts .tb-btn.danger-text { color: #fecaca; }
.iso-docs-multi-acts .tb-ico { color: #fff; }

.win-multi-acts {
  display: flex;
  align-items: center;
  gap: 4px;
}
.win-multi-info {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  margin-right: 6px;
  white-space: nowrap;
}
.win-multi-info b { color: var(--primary, #0f766e); }

/* ===== Win11 文件资源管理器风格覆盖 ===== */
#page-iso-docs {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
#page-iso-docs .page-header,
#page-iso-docs > .page-footer { display: none !important; }
.win-title { font-size: 12px; color: #1a1a1a; margin-left: 8px; }

/* 命令栏 */
.win-cmdbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px;
  background: #f9f9fa;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
  gap: 8px;
}
.win-cmdbar-left { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.win-cmdbar-tools { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.win-cmdbar-right { display: flex; align-items: center; flex-shrink: 0; }
.win-cmd {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 8px;
  background: transparent; border: none; border-radius: 4px;
  font-size: 12px; color: #1a1a1a; cursor: pointer; white-space: nowrap;
  transition: background 0.08s;
}
.win-cmd svg { width: 16px; height: 16px; flex-shrink: 0; }
.win-cmd:hover { background: #ededed; }
.win-cmd:active { background: #e0e0e0; }
.win-cmd:disabled { color: #bbb; cursor: default; background: transparent; }
.win-cmd-sep { width: 1px; height: 18px; background: #e0e0e0; margin: 0 4px; flex-shrink: 0; }
#btn-iso-docs-multi.active { background: #e5f3ff; color: #0067c0; }

/* 排序下拉 */
.win-cmd-sort { position: relative; }
.win-cmd-caret { width: 12px !important; height: 12px !important; }
.win-sort-menu {
  position: absolute; top: 32px; left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: 100;
}
.win-sort-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; border: none; background: transparent;
  font-size: 12px; color: #1a1a1a; cursor: pointer; border-radius: 4px;
  text-align: left;
}
.win-sort-menu button:hover { background: #f5f5f5; }
.win-sort-check { width: 16px; color: #0067c0; font-size: 12px; text-align: center; }

/* 视图切换 */
.win-cmd-view { display: inline-flex; border: 1px solid #e5e5e5; border-radius: 4px; overflow: hidden; }
.win-view-btn { width: 32px; height: 26px; background: #fff; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #616161; }
.win-view-btn svg { width: 16px; height: 16px; }
.win-view-btn:hover { background: #f5f5f5; }
.win-view-btn.active { background: #e5f3ff; color: #0067c0; }

/* 搜索框 */
.win-search-wrap { display: inline-flex; align-items: center; position: relative; }
.win-search-ico { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: #8a8a8a; pointer-events: none; }
.win-search-ico svg { width: 14px; height: 14px; }
.win-search {
  height: 28px; width: 200px;
  padding: 0 10px 0 28px;
  font-size: 12px; color: #1a1a1a;
  border: 1px solid #e5e5e5; border-radius: 14px;
  background: #fff; outline: none;
  transition: border-color 0.1s;
}
.win-search:focus { border-color: #0067c0; border-width: 2px; padding-left: 27px; }

/* 地址栏 */
.win-navbar {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: #f9f9fa;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}
.win-nav-btns { display: flex; gap: 2px; flex-shrink: 0; }
.win-nav-btn {
  width: 30px; height: 28px;
  background: transparent; border: none; border-radius: 4px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: #1a1a1a;
  transition: background 0.08s;
}
.win-nav-btn svg { width: 16px; height: 16px; }
.win-nav-btn:hover:not(:disabled) { background: #ededed; }
.win-nav-btn:disabled { color: #bbb; cursor: default; }
.win-addr-bar {
  flex: 1; min-width: 0; height: 28px;
  background: #fff;
  border: 1px solid #e5e5e5; border-radius: 4px;
  display: flex; align-items: center;
  padding: 0 4px;
  overflow: hidden;
}
.win-addr-breadcrumb { display: flex; align-items: center; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.win-addr-breadcrumb::-webkit-scrollbar { display: none; }
.win-crumb {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; color: #1a1a1a; padding: 4px 6px; border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
}
.win-crumb:hover { background: #f5f5f5; color: #0067c0; }
.win-crumb-ico { display: inline-flex; width: 16px; height: 16px; }
.win-crumb-ico svg { width: 16px; height: 16px; }
.win-crumb-sep { display: inline-flex; align-items: center; color: #8a8a8a; flex-shrink: 0; }
.win-crumb-sep svg { width: 12px; height: 12px; }

/* 主体布局 */
.iso-docs-main {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 0;
  background: #fff;
}
.iso-docs-side {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fafafa;
}
.iso-docs-side-head {
  padding: 8px 12px;
  font-size: 11px;
  color: #616161;
  border-bottom: 1px solid #eee;
  letter-spacing: 0.3px;
}
.iso-docs-side-body { flex: 1; overflow: auto; padding: 2px 0; }
.iso-docs-tree-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 12px 4px 8px;
  font-size: 12px; color: #1a1a1a;
  cursor: pointer; white-space: nowrap;
}
.iso-docs-tree-item:hover { background: #f0f0f0; }
.iso-docs-tree-item.active { background: #e5f3ff; color: #0067c0; }
.iso-docs-tree-chev {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #999; flex-shrink: 0;
  cursor: pointer;
  border-radius: 3px;
  transition: background .15s, color .15s;
}
.iso-docs-tree-chev svg {
  width: 12px; height: 12px;
  transition: transform .15s ease;
  transform: rotate(0deg);
}
.iso-docs-tree-chev:hover { background: #e5e5e5; color: #333; }
.iso-docs-tree-chev:hover svg { color: #0067c0; }
.iso-docs-tree-chev.expanded svg { transform: rotate(90deg); }
.iso-docs-tree-chev.empty { cursor: default; }
.iso-docs-tree-chev.empty:hover { background: transparent; }
.iso-docs-tree-chev.empty:hover svg { color: #999; }
.iso-docs-tree-icon { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; flex-shrink: 0; }
.iso-docs-tree-icon svg { width: 18px; height: 18px; }
.iso-docs-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.iso-docs-tree-children { padding-left: 12px; }

/* 内容区 */
.iso-docs-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  background: #fff;
}
.iso-docs-list { flex: 1; overflow: auto; padding: 0; }
.iso-docs-list.is-grid { padding: 8px; overflow: auto; }

/* 列表视图 */
.win-list-head {
  display: flex; align-items: center;
  padding: 0 0 0 0;
  font-size: 12px; color: #616161;
  background: #fbfbfc;
  border-bottom: 1px solid #e5e5e5;
  position: sticky; top: 0; z-index: 5;
  height: 32px;
}
.win-list-head [data-sort] { cursor: pointer; user-select: none; display: flex; align-items: center; height: 100%; }
.win-list-head [data-sort]:hover { color: #0067c0; }
.win-sort-arrow { width: 12px !important; height: 12px !important; color: #0067c0; }
.win-col-check { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.win-col-name { flex: 1; min-width: 0; padding: 0 8px; display: flex; align-items: center; gap: 6px; }
.win-col-mtime { width: 160px; flex-shrink: 0; padding: 0 8px; }
.win-col-type { width: 120px; flex-shrink: 0; padding: 0 8px; }
.win-col-size { width: 100px; flex-shrink: 0; padding: 0 8px; text-align: right; }

/* 列宽调整手柄 */
.win-col-resizer {
  width: 5px;
  height: 100%;
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  margin: 0 -2px;
  z-index: 10;
}
.win-col-resizer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: transparent;
  transition: background 0.15s ease, width 0.15s ease;
}
.win-col-resizer:hover::before,
.win-col-resizer.dragging::before {
  width: 2px;
  background: #0078d4;
}
.win-col-resizer.dragging {
  background: rgba(0, 120, 212, 0.05);
}
.win-col-resizer.dragging * {
  user-select: none !important;
}
.win-list-body { }

.win-row {
  display: flex; align-items: center;
  height: 32px;
  font-size: 12px; color: #1a1a1a;
  border-bottom: 1px solid #f5f5f5;
  cursor: default;
}
.win-row:hover { background: #f5f5f5; }
.win-row.selected { background: #cce8ff; }
.win-row.selected:hover { background: #b3d7ff; }
.win-row .win-col-name { overflow: hidden; cursor: default; }
.win-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-file-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; flex-shrink: 0; }
.win-file-icon svg { width: 20px; height: 20px; }
.win-col-mtime { color: #616161; }
.win-col-type { color: #616161; }
.win-col-size { color: #616161; text-align: right; }

/* 复选框 */
.win-cbx {
  display: inline-flex; width: 16px; height: 16px;
  border: 1.5px solid #8a8a8a; border-radius: 3px;
  background: #fff; cursor: pointer;
  align-items: center; justify-content: center;
  color: transparent;
  transition: all 0.1s;
}
.win-cbx svg { width: 12px; height: 12px; }
.win-cbx:hover { border-color: #0067c0; }
.win-cbx.on { background: #0067c0; border-color: #0067c0; color: #fff; }

/* 网格视图 */
.win-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
}
.win-card {
  position: relative;
  padding: 10px 6px 6px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent;
  display: flex; flex-direction: column; align-items: center;
  cursor: default;
  transition: background 0.08s;
}
.win-card:hover { background: #f5f5f5; }
.win-card.selected { background: #cce8ff; }
.win-card.selected:hover { background: #b3d7ff; }
.win-card-check { position: absolute; top: 4px; left: 4px; }
.win-card-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; margin-bottom: 4px; }
.win-card-icon svg { width: 52px; height: 52px; }
.win-card-name {
  font-size: 12px; color: #1a1a1a; text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: default;
}

/* 空态 */
.iso-docs-empty {
  padding: 80px 20px; text-align: center; color: #8a8a8a; font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.iso-docs-empty-icon { opacity: 0.3; }
.iso-docs-empty-icon svg { width: 72px; height: 72px; }
.iso-docs-empty-text { font-size: 14px; color: #616161; }
.iso-docs-empty-hint { font-size: 12px; color: #8a8a8a; }

/* 拖拽上传提示 */
.iso-docs-drop-hint {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20; pointer-events: none;
}
.iso-docs-drop-hint-card {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: rgba(0, 103, 192, 0.95);
  color: #fff; border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,103,192,0.3);
}
.iso-docs-drop-hint-icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.iso-docs-drop-hint-icon svg { width: 20px; height: 20px; }

/* 上传进度面板 */
.iso-docs-upload-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 28px; background: #fff;
  border-top: 1px solid #e5e5e5;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  z-index: 15; box-shadow: 0 -2px 6px rgba(0,0,0,0.04);
}
.iso-docs-upload-panel[hidden] { display: none !important; }
.iso-docs-upload-bar-wrap { flex: 1; height: 4px; background: #e5e5e5; border-radius: 2px; overflow: hidden; }
.iso-docs-upload-bar { height: 100%; width: 0; background: #0067c0; transition: width 0.2s ease; }
.iso-docs-upload-text { font-size: 12px; color: #616161; flex-shrink: 0; min-width: 140px; }
.iso-docs-upload-cancel { background: none; border: 1px solid #e5e5e5; cursor: pointer; font-size: 12px; padding: 2px 8px; border-radius: 3px; color: #c42b1c; }
.iso-docs-upload-cancel:hover { background: #fef2f2; border-color: #fecaca; }

/* 右键上下文菜单 */
.win-ctx-menu {
  position: fixed;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 4px;
  z-index: 200;
}
.win-ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; border: none; background: transparent;
  font-size: 12px; color: #1a1a1a; cursor: pointer; border-radius: 4px;
  text-align: left;
}
.win-ctx-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.win-ctx-item:hover { background: #f5f5f5; }
.win-ctx-item.danger { color: #c42b1c; }
.win-ctx-item.danger:hover { background: #fef2f2; }
.win-ctx-sep { height: 1px; background: #f0f0f0; margin: 4px 0; }

/* 状态栏 */
.win-statusbar {
  display: flex; align-items: center;
  padding: 0 12px; height: 28px;
  background: #f9f9fa;
  border-top: 1px solid #e5e5e5;
  font-size: 12px; color: #616161;
  flex-shrink: 0; gap: 8px;
}
.win-status-sep { flex: 1; }
.win-status-msg { color: #616161; }
.win-status-msg.error { color: #c42b1c; }
.win-status-msg.warn { color: #b45309; }
.win-status-right { color: #8a8a8a; }

/* 抽屉覆盖 */
.iso-docs-drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 60%; max-width: 800px;
  background: #fff;
  border-left: 1px solid #e5e5e5;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex; flex-direction: column;
  z-index: 50;
}
.iso-docs-drawer.open { transform: translateX(0); }
.iso-docs-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  background: #f9f9fa;
  flex-shrink: 0; gap: 8px;
}
.iso-docs-drawer-title { font-size: 13px; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.iso-docs-drawer-actions { display: flex; gap: 4px; flex-shrink: 0; }
.iso-docs-drawer-body { flex: 1; overflow: auto; padding: 14px; }
.iso-docs-drawer-loading { padding: 20px; text-align: center; color: #8a8a8a; font-size: 13px; }
.iso-docs-preview-img-wrap { text-align: center; }
.iso-docs-preview-img { max-width: 100%; border: 1px solid #e5e5e5; border-radius: 4px; }
.iso-docs-preview-text { font-size: 12px; white-space: pre-wrap; word-break: break-all; background: #fafafa; padding: 10px; border-radius: 4px; border: 1px solid #eee; font-family: "Consolas", "Microsoft YaHei", monospace; line-height: 1.5; }
.iso-docs-preview-pdf { width: 100%; height: 100%; min-height: 420px; border: none; }
.iso-docs-preview-note { padding: 20px; text-align: center; color: #616161; font-size: 13px; }
.iso-docs-preview-actions { text-align: center; margin-top: 12px; }

/* 多选批量操作栏 */
.iso-docs-multi-bar {
  position: absolute; bottom: 28px; left: 0; right: 0;
  height: 40px;
  background: #0067c0; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 40;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}
.iso-docs-multi-info { font-size: 13px; }
.iso-docs-multi-info b { font-size: 14px; margin: 0 2px; }
.iso-docs-multi-acts { display: flex; gap: 6px; }
.iso-docs-multi-acts .win-cmd { color: #fff; background: rgba(255,255,255,0.15); border-radius: 4px; }
.iso-docs-multi-acts .win-cmd:hover { background: rgba(255,255,255,0.25); }
.iso-docs-multi-acts .win-cmd.danger-text { color: #ffd0cc; }

/* ===== 认证文件（cert_files）特有样式 ===== */
#page-cert-files {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
#page-cert-files > .page-footer { display: none !important; }

/* 列表视图：认证文件多列（统一 cf-list-col，宽度/顺序由 JS 控制） */
#cert-files-list .cf-list-col {
  box-sizing: border-box;
  padding: 0 8px;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  color: #616161;
}
#cert-files-list .win-list-head .cf-list-col {
  height: 100%;
  user-select: none;
}
#cert-files-list .win-list-head .cf-list-col[data-sort] { cursor: pointer; }
#cert-files-list .win-list-head .cf-list-col[data-sort]:hover { color: #0067c0; }
#cert-files-list .win-row .cf-list-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cert-files-list .cf-col-name { color: #1a1a1a; }
#cert-files-list .cf-col-size { justify-content: flex-end; text-align: right; }
/* 列宽拖拽手柄 */
.cf-col-resizer {
  position: absolute;
  right: 0; top: 0;
  width: 6px; height: 100%;
  cursor: col-resize;
  z-index: 3;
}
.cf-col-resizer:hover,
.cf-col-resizer:active {
  background: transparent;
  border-right: 2px solid #0067c0;
}
/* 列序拖拽 */
.cf-head-drag .cf-list-col {
  cursor: grab;
}
.cf-col-dragging {
  opacity: 0.5;
  background: #eaf4ff !important;
}
.cf-col-drop-before {
  box-shadow: inset 2px 0 0 #0067c0;
}
.cf-col-drop-after {
  box-shadow: inset -2px 0 0 #0067c0;
}
/* 按证书编号分组的组标题行 */
#cert-files-list .cf-group-head {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 8px;
  background: #f5f5f7;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #e5e5e5;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
#cert-files-list .cf-group-head:hover { background: #efeff2; }
#cert-files-list .cf-group-chev {
  display: inline-flex;
  width: 16px; height: 16px;
  align-items: center; justify-content: center;
  color: #8a8a8a;
  flex-shrink: 0;
}
#cert-files-list .cf-group-chev svg { width: 14px; height: 14px; }
#cert-files-list .cf-group-code {
  font-weight: 500;
  color: #1a1a1a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cert-files-list .cf-group-files { color: #8a8a8a; flex-shrink: 0; }
#cert-files-list .cf-group-meta {
  color: #616161;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#cert-files-list .cf-group-meta::before { content: "·"; margin-right: 10px; color: #c0c0c0; }

/* 上传弹窗 */
.cf-upload-dialog {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.cf-upload-dialog.open { display: flex; }
.cf-upload-dialog-card {
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cf-upload-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.cf-upload-dialog-title { font-size: 14px; color: #1a1a1a; }
.cf-upload-dialog-close {
  width: 28px; height: 28px;
  background: transparent; border: none; cursor: pointer;
  border-radius: 4px; color: #616161;
  display: inline-flex; align-items: center; justify-content: center;
}
.cf-upload-dialog-close svg { width: 16px; height: 16px; }
.cf-upload-dialog-close:hover { background: #f5f5f5; }
.cf-upload-dialog-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
}
.cf-uf-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.cf-uf-field { display: flex; flex-direction: column; gap: 4px; }
.cf-uf-label { font-size: 12px; color: #616161; }
.cf-uf-input {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  color: #1a1a1a;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  outline: none;
  transition: border-color 0.1s;
}
.cf-uf-input:focus { border-color: #0067c0; border-width: 2px; padding: 0 9px; }
.cf-uf-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9f9fa;
  border: 1px dashed #d0d0d0;
  border-radius: 6px;
}
.cf-uf-file-label { font-size: 12px; color: #616161; flex-shrink: 0; }
.cf-uf-file-pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.cf-uf-filename {
  font-size: 12px;
  color: #616161;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.cf-upload-dialog-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #f9f9fa;
}
.cf-upload-dialog-foot .win-cmd.primary {
  background: #0067c0;
  color: #fff;
}
.cf-upload-dialog-foot .win-cmd.primary:hover {
  background: #005a9e;
}



/* 分栏模式：打开右侧编辑表单后，由 JS 隐藏顶部工具栏的「新增/导出」（右侧头部已有相同功能按钮），关闭表单后由 JS 恢复显示（避免 empty 状态无新增入口） */

/* 样品待审/已审：标准分栏（对标样品入库/出库与材料管理）——左列表白卡 + 右预览灰底白卡 */
#page-module.is-mat-split-page[data-split-mode="sample_pending"] .mat-split-right-body,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] .mat-split-right-body {
  padding: 0;
  background: #eef1f4;
}
/* 左列表面板：移入 #module-list 后填满（modal 作用域样式失效） */
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-list-pane,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-list-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-list-pane .table-wrap,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-list-pane .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
/* 待审/已审表格：恢复固定布局 + 行样式（modal 作用域失效） */
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table {
  width: 100% !important;
  table-layout: fixed !important;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table th,
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table td,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table th,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table td {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table td:nth-child(3),
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table td:nth-child(3) {
  text-align: left;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table tr.so-pending-row,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table tr.so-pending-row {
  cursor: pointer;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table tr.so-pending-row:hover,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table tr.so-pending-row:hover {
  background: #ecfdf5;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-table tr.so-pending-row.is-selected,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-table tr.so-pending-row.is-selected {
  background: #e8f0fe;
}
/* 右侧预览面板：填满 mat-split-right-body */
#page-module.is-mat-split-page[data-split-mode="sample_pending"] #sa-pending-preview,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] #sa-pending-preview {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eef1f4;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] .so-pending-preview-empty,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] .so-pending-preview-empty {
  margin: auto;
  padding: 24px;
  text-align: center;
  font-size: 14px;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] .so-pending-preview-main,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] .so-pending-preview-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  box-sizing: border-box;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] .sa-pending-form-host,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] .sa-pending-form-host {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 8px;
  box-sizing: border-box;
}
#page-module.is-mat-split-page[data-split-mode="sample_pending"] .sa-pending-form-host .sa-sample-host,
#page-module.is-mat-split-page[data-split-mode="sample_approved"] .sa-pending-form-host .sa-sample-host {
  max-width: none;
}

/* ═══ 认证文件（台账表格版，桌面 GAK_certification 样式） ═══ */
#page-cert-files { display: flex; flex-direction: column; }
.cert-page-header { flex: none; }
.cert-search-wrap { margin-left: 12px; display: inline-flex; align-items: center; }
.cert-search-wrap .win-search { width: 240px; height: 30px; }

.cert-tabs {
  display: flex; flex: none; gap: 2px;
  padding: 0 8px;
  height: 32px;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}
.cert-tab {
  border: none; background: transparent;
  padding: 0 16px; height: 32px; line-height: 32px;
  font-size: 13px; color: #475569;
  cursor: pointer; border-radius: 4px 4px 0 0;
  position: relative; margin-top: 1px;
}
.cert-tab:hover { background: #f1f5f9; color: #0f766e; }
.cert-tab.active {
  color: #0f766e; background: #fff;
  border: 1px solid #e2e8f0; border-bottom-color: #fff;
}
.cert-tab.active::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: #0f766e; border-radius: 2px 2px 0 0;
}

.cert-table-wrap { flex: 1; overflow: auto; margin: 8px 10px; }
.cert-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
/* 冻结列（列设置勾选冻结后）：行号 + 左侧连续前缀 sticky 固定 */
.cert-table th.cert-fz,
.cert-table td.cert-fz { position: sticky; }
.cert-table thead th.cert-fz { z-index: 4; }
.cert-table tbody td.cert-fz { z-index: 2; background: #fff; }
.cert-table tbody tr:hover td.cert-fz { background: #f8fafc; }
.cert-table thead th {
  background: #0d9488; color: #fff;
  text-align: right;
  padding: 6px 10px; font-size: 12px;
  border-bottom: 1px solid #e2e8f0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cert-table thead th.col-idx { background: #0d9488; }
.cert-table tbody td {
  text-align: right; padding: 6px 10px; font-size: 12px; color: #1f2937;
  border-bottom: 1px solid #f1f5f9; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cert-table tbody tr:hover { background: #f8fafc; }
.cert-table th[data-col="操作"], .cert-table td.cert-op-cell { text-align: center; }
.cert-table th[data-col="附件"], .cert-table td { }
.cert-empty { text-align: center; color: #94a3b8; padding: 36px 0; }
.cert-statusbar { flex: none; }
.cert-op-cell .btn-text { margin: 0 3px; }
.btn-text.danger { color: #c42b1c; }
.cert-attach-btn { color: #0f766e; }
/* ── 台账表：覆盖全局 data-table 特化规则（操作列不贴右、无竖线强调、占位列跟随行色） ── */
.cert-table tbody tr { cursor: pointer; }
.cert-table tbody tr.cert-sel,
.cert-table tbody tr.cert-sel:hover { background: #d3f2ec; }
#page-cert-files .win-cmd.danger { color: #c42b1c; }
.cert-table th[data-col="操作"],
.cert-table td[data-col="操作"] {
  right: auto !important;
  box-shadow: none !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.cert-table th[data-col="操作"] {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  background: #0d9488; color: #fff;
}
.cert-table td[data-col="操作"] { position: static !important; z-index: auto !important; background: transparent; }
.cert-table tbody tr:nth-child(even) td[data-col="操作"],
.cert-table tbody tr:hover td[data-col="操作"],
.cert-table tbody tr.selected td[data-col="操作"] { background: transparent; }
.cert-table td[data-col="_ops_fill"] { background: transparent !important; }
.cert-table tbody tr:nth-child(even) td[data-col="_ops_fill"],
.cert-table tbody tr:hover td[data-col="_ops_fill"],
.cert-table tbody tr.selected td[data-col="_ops_fill"] { background: transparent !important; }
.cert-table thead th[data-col="_ops_fill"] { background: #0d9488 !important; }

/* 列设置弹窗：数据排序两个下拉框宽度统一（避免一宽一窄排版失衡） */
#gak-col-dialog .col-set-sort-fields .gak-searchable-select { width: 148px; }

/* 新建/编辑弹窗 */
#cert-files-edit-dialog .cf-upload-dialog-card, #hr-edit-dialog .cf-upload-dialog-card { width: 720px; border-radius: 4px; }
#cert-files-edit-dialog .cert-edit-body, #hr-edit-dialog .cert-edit-body { display: flex; gap: 16px; }
#cert-files-edit-dialog .cert-edit-main, #hr-edit-dialog .cert-edit-main { flex: 2; min-width: 0; }
#cert-files-edit-dialog .cert-edit-gallery, #hr-edit-dialog .cert-edit-gallery {
  flex: 1;
  min-width: 0;
  border-left: 1px solid #e8eaed;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
}
#cert-files-edit-dialog .cert-edit-gallery-title, #hr-edit-dialog .cert-edit-gallery-title { color: #0f766e; margin-bottom: 8px; }
#cert-files-edit-dialog .cert-edit-gallery-grid, #hr-edit-dialog .cert-edit-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
#cert-files-edit-dialog .cert-edit-gallery-grid img, #hr-edit-dialog .cert-edit-gallery-grid img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}
#cert-files-edit-dialog .cert-edit-gallery-empty, #hr-edit-dialog .cert-edit-gallery-empty { color: #94a3b8; padding: 18px 0; text-align: center; }
#cert-files-edit-dialog .cert-edit-gallery-files, #hr-edit-dialog .cert-edit-gallery-files { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
#cert-files-edit-dialog .cert-edit-gallery-file, #hr-edit-dialog .cert-edit-gallery-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  cursor: pointer;
}
#cert-files-edit-dialog .cert-edit-gallery-file:hover, #hr-edit-dialog .cert-edit-gallery-file:hover { background: #f0fdfa; }
#cert-files-edit-dialog .cert-edit-gallery-fname, #hr-edit-dialog .cert-edit-gallery-fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cert-files-edit-dialog .cert-edit-gallery-fsize, #hr-edit-dialog .cert-edit-gallery-fsize { flex: none; color: #94a3b8; }
#cert-files-edit-dialog .cert-edit-gallery-preview, #hr-edit-dialog .cert-edit-gallery-preview { margin-top: 8px; }
#cert-files-edit-dialog .cert-edit-gallery-prev-img img, #hr-edit-dialog .cert-edit-gallery-prev-img img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  display: block;
  border: 1px solid #e2e8f0;
}
#cert-files-edit-dialog .cf-upload-dialog-body, #hr-edit-dialog .cf-upload-dialog-body { padding-top: 16px; }
#cert-files-edit-dialog .cf-upload-dialog-head, #hr-edit-dialog .cf-upload-dialog-head { background: #fff; padding: 10px 16px; }
#cert-files-edit-dialog .cf-upload-dialog-title, #hr-edit-dialog .cf-upload-dialog-title { color: #0f766e; }
#cert-files-edit-dialog .cf-upload-dialog-close:hover, #hr-edit-dialog .cf-upload-dialog-close:hover { background: #f0fdfa; color: #0f766e; }
#cert-files-edit-dialog .cf-uf-form, #hr-edit-dialog .cf-uf-form { display: block; margin-bottom: 6px; } /* 单列：避免 grid 双列在窄卡中被裁剪 */
#cert-files-edit-dialog .cf-uf-form-row, #hr-edit-dialog .cf-uf-form-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
}
#cert-files-edit-dialog .cf-uf-form-label, #hr-edit-dialog .cf-uf-form-label {
  flex: 0 0 auto;
  min-width: 90px;
  text-align: right;
  color: #475569;
  white-space: nowrap;
}
#cert-files-edit-dialog .cf-uf-input, #hr-edit-dialog .cf-uf-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  color: #1a1a1a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
#cert-files-edit-dialog .cf-uf-input:focus, #hr-edit-dialog .cf-uf-input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.14);
}
#cert-files-edit-dialog .cf-uf-input::-webkit-calendar-picker-indicator, #hr-edit-dialog .cf-uf-input::-webkit-calendar-picker-indicator { cursor: pointer; }
#cert-files-edit-dialog .cf-upload-dialog-foot .win-cmd, #hr-edit-dialog .cf-upload-dialog-foot .win-cmd { height: 32px; padding: 0 20px; }
#cert-files-edit-dialog .cf-upload-dialog-foot, #hr-edit-dialog .cf-upload-dialog-foot { background: #fff; }
#cert-files-edit-dialog .cf-upload-dialog-foot .win-cmd.primary, #hr-edit-dialog .cf-upload-dialog-foot .win-cmd.primary { background: #0d9488; }
#cert-files-edit-dialog .cf-upload-dialog-foot .win-cmd.primary:hover, #hr-edit-dialog .cf-upload-dialog-foot .win-cmd.primary:hover { background: #0f766e; }
#cert-files-edit-dialog .cert-edit-dropzone, #hr-edit-dialog .cert-edit-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(13, 148, 136, 0.55);
  border-radius: 4px;
  background: #f0fdfa;
  color: #0f766e;
  cursor: pointer;
  user-select: none;
}
#cert-files-edit-dialog .cert-edit-dropzone svg, #hr-edit-dialog .cert-edit-dropzone svg { width: 18px; height: 18px; color: #0d9488; flex: none; }
#cert-files-edit-dialog .cert-edit-dropzone-over, #hr-edit-dialog .cert-edit-dropzone-over {
  border-color: #0d9488;
  background: #ecfdf5;
  color: #0f766e;
}
#cert-files-edit-dialog .cert-edit-file-item, #hr-edit-dialog .cert-edit-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid #f1f5f9;
}
#cert-files-edit-dialog .cert-edit-file-name, #hr-edit-dialog .cert-edit-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cert-files-edit-dialog .cert-edit-file-size, #hr-edit-dialog .cert-edit-file-size { flex: none; color: #94a3b8; }

/* ===== 全局 AI 助手（DeepSeek） ===== */
#ai-assistant { position: fixed; z-index: 9990; }
#ai-fab {
  position: fixed;
  right: 24px;
  bottom: calc(24px + var(--safe-bottom));
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
  transition: background 0.15s, transform 0.15s;
}
#ai-fab:hover { background: var(--primary-dark); transform: translateY(-2px); }
#ai-fab svg { width: 24px; height: 24px; }

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: calc(24px + var(--safe-bottom));
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 48px);
  min-width: 320px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.18);
  overflow: hidden;
}
.ai-panel[hidden] { display: none !important; }
/* 右下角拖拽调整尺寸手柄（JS 实现，pointer 事件，替代 CSS resize） */
.ai-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  z-index: 5;
  cursor: nwse-resize;
  opacity: 0.5;
  background: linear-gradient(135deg, transparent 50%, var(--primary) 50%);
  border-radius: 0 0 var(--radius) 0;
  transition: opacity 0.15s;
}
.ai-resize-handle:hover,
.ai-resize-handle.ai-resize-dragging { opacity: 1; }
.ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex: none;
  cursor: grab;
  user-select: none;
}
.ai-head.ai-head-dragging { cursor: grabbing; }
.ai-head-title { font-size: 14px; color: var(--text); }
.ai-head-sub { font-size: 11px; color: #94a3b8; }
.ai-head-sub.busy { color: var(--primary); }
.ai-head-sub.err { color: var(--danger); }
.ai-head-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.ai-head-btn:hover { color: var(--text); background: rgba(13, 148, 136, 0.08); }
.ai-head-btn svg { width: 16px; height: 16px; }
#ai-close { margin-left: auto; }

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f2f3f5; /* 微信聊天区灰底 */
}
.ai-msg { display: flex; align-items: flex-start; gap: 8px; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-ai { justify-content: flex-start; }
/* 微信模式头像 */
.ai-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.ai-avatar svg { width: 20px; height: 20px; }
.ai-avatar-ai { background: var(--primary); color: #fff; }
.ai-avatar-user { background: #9aa3b0; color: #fff; }
.ai-bubble-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: calc(86% - 44px);
  min-width: 0;
}
.ai-msg-user .ai-bubble-col { align-items: flex-end; }
.ai-msg-ai .ai-bubble-col { align-items: flex-start; }
.ai-msg-time { font-size: 10px; color: #b6b6b6; padding: 0 4px; }
.ai-bubble {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}
/* 微信原版配色：对方白色气泡、自己绿色气泡 */
.ai-msg-user .ai-bubble { background: #95ec69; color: #111; border-bottom-right-radius: 3px; }
.ai-msg-ai .ai-bubble { background: #fff; color: var(--text); border-bottom-left-radius: 3px; }
.ai-bubble.ai-typing { color: #94a3b8; }

.ai-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex: none;
  background: var(--card);
}
.ai-input {
  flex: 1;
  height: 36px;
  max-height: 120px;
  padding: 8px 10px;
  resize: none;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ai-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.14); }
.ai-send {
  flex: none;
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.ai-send:hover { background: var(--primary-dark); }
.ai-send:disabled { background: #99b8b3; cursor: not-allowed; }

/* ===== AI 助手悬浮面板 ===== */
.ai-status { font-size: 11px; color: #94a3b8; padding: 8px 14px 0; flex: none; }
.ai-status.err { color: var(--danger); }
.ai-bubble-html { max-width: 100%; padding: 4px; }
.ai-bubble-html .ai-query-table-wrap { max-height: 240px; }
.ai-ghost {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.ai-ghost:hover { color: var(--text); background: rgba(13, 148, 136, 0.08); }

/* 数据查询（表格回显在对话气泡内） */
.ai-query-summary { font-size: 12px; color: var(--text); margin-bottom: 8px; line-height: 1.6; }
.ai-query-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 2px;
  row-gap: 4px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-bg, #f0fdfa);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.ai-query-head-item { white-space: nowrap; }
.ai-query-table-wrap {
  overflow: auto;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ai-query-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.ai-query-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.ai-query-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.ai-query-table th {
  background: var(--bg);
  color: var(--text);
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ai-query-table td {
  text-align: right;
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f7;
  color: var(--text);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-query-table tbody tr:nth-child(even) td { background: rgba(15, 118, 110, 0.04); }
.ai-query-table tbody tr:last-child td { border-bottom: none; }
.ai-query-table tbody tr:hover td { background: rgba(13, 148, 136, 0.07); }
/* 序号列：窄列、弱化颜色，与业务列区分 */
.ai-query-table th.ai-query-th-idx,
.ai-query-table td.ai-query-td-idx { width: 44px; min-width: 44px; color: #94a3b8; font-size: 11px; }
.ai-query-table td.ai-query-empty { text-align: center; color: #94a3b8; padding: 14px 0; white-space: normal; }

/* 数据查询结果图表（柱状图/饼图切换，纯 SVG 本地渲染） */
.ai-chart { margin-top: 10px; }
.ai-chart-switch { display: flex; gap: 4px; margin-bottom: 6px; }
.ai-chart-sw {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ai-chart-sw.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.ai-chart-sw:not(.on):hover { color: var(--primary); border-color: var(--primary); }
.ai-chart-bar-wrap { overflow-x: auto; }
.ai-chart-svg { display: block; }
.ai-chart-val { fill: #475569; font-size: 10px; }
.ai-chart-xlabel { fill: #64748b; font-size: 10px; }
.ai-chart-pie { display: flex; align-items: center; gap: 12px; }
.ai-chart-pie-svg { flex: none; }
.ai-chart-pct { fill: var(--text); font-size: 16px; font-weight: 600; }
.ai-chart-pct-lab { fill: #94a3b8; font-size: 9px; }
.ai-chart-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.ai-chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text); }
.ai-chart-legend-item i { flex: none; width: 9px; height: 9px; border-radius: 2px; }
.ai-chart-legend-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chart-legend-item b { flex: none; font-weight: 600; }
.ai-chart-legend-item em { flex: none; font-style: normal; color: #94a3b8; min-width: 44px; text-align: right; }

/* 附件管理弹窗 */
#cert-files-attach-dialog .cf-upload-dialog-card { width: 580px; border-radius: 4px; }
#cert-files-attach-dialog .cf-upload-dialog-head { background: #fff; padding: 10px 16px; }
#cert-files-attach-dialog .cf-upload-dialog-title { color: #0f766e; }
#cert-files-attach-dialog .cf-upload-dialog-foot { background: #fff; }
#cert-files-attach-dialog .cf-upload-dialog-close:hover { background: #f0fdfa; color: #0f766e; }
.cert-attach-upload-row { margin-bottom: 10px; display: flex; align-items: center; }
.cert-attach-list { max-height: 320px; overflow: auto; }
.cert-attach-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #f1f5f9; }
.cert-attach-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #1f2937; }
.cert-attach-size { flex: none; font-size: 11px; color: #94a3b8; }
.cert-attach-actions { flex: none; }
.cert-attach-actions .btn-text { margin: 0 3px; }
.cert-attach-empty { padding: 24px 0; text-align: center; color: #94a3b8; font-size: 12px; }
.cert-preview { margin-top: 10px; border-top: 1px dashed #e2e8f0; padding-top: 10px; }
.cert-preview img { max-width: 100%; max-height: 300px; display: block; margin: 0 auto; }
.cert-preview-text pre { max-height: 260px; overflow: auto; font-size: 11px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.cert-preview-pdf iframe { width: 100%; height: 340px; border: 1px solid #e2e8f0; background: #fff; }
.cert-preview-hint { text-align: center; color: #94a3b8; padding: 20px 0; font-size: 12px; }

/* 人事管理：面板占位提示 */
#page-hr .hr-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#page-hr .hr-pane-placeholder { align-items: center; justify-content: center; }
#page-hr .hr-pane-hint { color: #94a3b8; font-size: 13px; }

/* 人事管理：员工档案表格行内控件 */
#page-hr .cert-table .row-ops .btn-text { margin: 0 3px; }
#page-hr .hr-staff-status { font-size: 12px; }
#page-hr .hr-staff-status.is-on { color: #0f766e; }
#page-hr .hr-staff-status.is-off { color: #94a3b8; }

/* 人事管理：编辑弹窗附件缩略图 */
#hr-edit-dialog .hr-att-thumb { position: relative; }
#hr-edit-dialog .hr-att-thumb img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  display: block;
}
#hr-edit-dialog .hr-att-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hr-edit-dialog .hr-att-del:hover { background: #c42b1c; }
#hr-edit-dialog .hr-att-ops { flex: none; }
#hr-edit-dialog .hr-att-ops .btn-text { margin: 0 3px; }

/* 人事管理：附件数量徽章 */
#page-hr .hr-att-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e6f4f3;
  color: #0f766e;
  font-size: 12px;
}
#page-hr .hr-att-count.is-empty { background: transparent; color: #cbd5e1; }

/* ═══ 人事管理：左侧功能导航树 + 内容区（整体重建） ═══ */
#page-hr { display: flex; flex-direction: column; }
.hr-shell { flex: 1; min-height: 0; display: flex; flex-direction: row; }
.hr-nav {
  flex: none; width: 110px; overflow-y: auto;
  padding: 8px 6px 12px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}
.hr-nav-group {
  padding: 10px 10px 4px;
  font-size: 12px; color: #94a3b8;
}
.hr-nav-item {
  padding: 6px 10px; margin: 1px 0;
  border-radius: 4px;
  font-size: 13px; color: #334155; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-nav-item:hover { background: #eef2f7; color: #0d9488; }
.hr-nav-item.active { background: #e6f4f3; color: #0f766e; }
.hr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hr-content-head {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; flex-wrap: wrap;
  border-bottom: 1px solid #eef2f7;
}
.hr-head-title { font-size: 14px; color: #1f2937; }
.hr-head-tools { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.hr-content-head .win-search { padding: 0 10px; }
.hr-content-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hr-content-body > .cert-table-wrap { flex: 1; min-height: 0; }

/* 组织架构：部门 / 岗位双栏 */
.hr-org-wrap { flex: 1; min-height: 0; display: flex; flex-direction: row; }
.hr-org-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hr-org-col + .hr-org-col { border-left: 1px solid #eef2f7; }
.hr-org-title { padding: 8px 12px; font-size: 13px; color: #334155; flex: none; }

/* 状态徽章 */
.hr-badge {
  display: inline-flex; align-items: center;
  padding: 1px 8px; height: 18px; border-radius: 9px;
  font-size: 12px; white-space: nowrap;
}
.hr-badge.is-on { background: #dcfce7; color: #166534; }
.hr-badge.is-try { background: #fef9c3; color: #854d0e; }
.hr-badge.is-wait { background: #fef3c7; color: #92400e; }
.hr-badge.is-off { background: #f1f5f9; color: #64748b; }

/* 工资条详情 */
.hr-ps-card .cf-upload-dialog-body { flex: 1; min-height: 0; }
.hr-ps-table { width: 100%; border-collapse: collapse; }
.hr-ps-table td { padding: 6px 8px; border-bottom: 1px dashed #e2e8f0; font-size: 12px; }
.hr-ps-k { color: #64748b; white-space: nowrap; text-align: right; width: 90px; }
.hr-ps-v { color: #1f2937; text-align: right; }
.hr-ps-total { color: #0f766e; font-size: 13px; }

/* ═══ 人事模块 UI 打磨：工具区 / 弹窗 / 表格 / 组织 / 导航统一 ═══ */
/* 工具区：筛选下拉限宽，与搜索框、按钮同排同高（30px、直角统一） */
.hr-content-head .gak-searchable-select { width: 130px; flex: none; }
.hr-content-head .gak-searchable-select .gak-searchable-input,
.hr-content-head .win-search,
.hr-content-head .win-cmd { height: 30px; border-radius: 4px; }
.hr-content-head .win-search { padding: 0 10px; }
.hr-content-head .win-cmd.primary { background: #0d9488; color: #fff; }
.hr-content-head .win-cmd.primary:hover { background: #0f766e; }

/* 表格：表头与数据行高统一 */
.hr-list-table thead th,
.hr-list-table tbody td { height: 31px; }

/* 修复列堆叠：全局 .data-table th/td max-width:0 会把 HR 表格内联列宽钳制为 0
   （其它模块靠 colgroup 定宽不受影响），此处放开让 th 内联宽度在 fixed 布局下生效 */
.hr-list-table thead th,
.hr-list-table tbody td,
.hr-org-table thead th,
.hr-org-table tbody td { max-width: none !important; }

/* 组织架构：左右两栏留出间距 */
.hr-org-wrap { gap: 14px; }
.hr-org-col + .hr-org-col { border-left: 1px solid #eef2f7; }

/* 子导航选中态圆角与主导航一致（直角） */
.hr-nav-item, .hr-nav-item.active { border-radius: 0; }

/* 编辑弹窗：加宽为「表单 + 附件」左右两栏，表单双列网格 */
#hr-edit-dialog .cf-upload-dialog-card { width: 980px; max-width: 96vw; }
#hr-edit-dialog .cert-edit-main { flex: 1; min-width: 0; display: flex; gap: 18px; align-items: flex-start; }
#hr-edit-dialog .cf-uf-form { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
#hr-edit-dialog #hr-edit-attach-wrap { flex: none; width: 320px; }
#hr-edit-dialog .gak-searchable-select .gak-searchable-input { height: 34px; }

/* 销售订单-列表（文件树）：左侧树撑满分栏 pane（原表格 wrap 隐藏后接管剩余高度） */
#modal-so-pending #so-orders-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  border: none;
  padding: 6px 8px;
}
/* 记录行在树内做“文件行”风格：单行省略、状态色块 */
#so-orders-tree .order-row {
  padding: 5px 10px;
  border-radius: 4px;
  line-height: 1.5;
  cursor: pointer;
}
#so-orders-tree .order-row:hover { background: #eef4f8; }
#so-orders-tree .order-row.selected { background: #e0f2f1; }

/* 销售订单文件树「新增订单」内嵌表单：铺满右侧预览区 + 旧详情隐藏必须生效 */
#so-pending-preview #modal-order.is-so-create-page {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
.modal.gak-desk .so-pending-preview-main[hidden] {
  display: none !important;
}
