/* ============================================================
   大砖头管理系统 - 公共左右布局样式（全站复用）
   结构：左侧 .sidebar 导航 + 右侧 .main 内容区
   侧栏风格对齐 hongyao/quality：白底 + 浅灰悬浮 + 蓝色渐变选中
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --side-bg: #ffffff;
  --side-bg-hover: #f1f5f9;
  --side-active: #2563eb;
  --side-text: #475569;
  --side-text-dim: #94a3b8;
  --side-border: #e2e8f0;
  --main-bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-dim: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --danger: #ef4444;
  --ok: #16a34a;
}

html, body { height: 100%; }

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', system-ui, sans-serif;
  background: var(--main-bg);
  color: var(--text);
  font-size: 14px;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- 左侧导航（白底，对齐 hongyao/quality） ---------- */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--side-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.sidebar .brand .logo { font-size: 30px; }
.sidebar .brand .sys-name {
  font-size: 17px; font-weight: 700; color: #1e293b; margin-top: 8px;
  letter-spacing: 1px;
}
.sidebar .brand .sys-en {
  font-size: 11px; color: var(--side-text-dim); margin-top: 3px;
}
.sidebar .nav { list-style: none; padding: 12px 10px; flex: 1; }
.sidebar .nav li { margin-bottom: 4px; }
.sidebar .nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--side-text); text-decoration: none;
  font-size: 14px; transition: background .15s, color .15s;
}
.sidebar .nav a .mi { font-size: 18px; width: 22px; text-align: center; }
.sidebar .nav a:hover { background: var(--side-bg-hover); color: #1e293b; }
.sidebar .nav a.active {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary); font-weight: 600;
}
.sidebar .foot {
  padding: 14px 20px; font-size: 11px; color: var(--side-text-dim);
  border-top: 1px solid #f1f5f9;
}

/* ---------- 右侧内容区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .top-actions { display: flex; gap: 10px; align-items: center; }
.content { padding: 24px; flex: 1; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.card h2 { font-size: 15px; margin-bottom: 14px; }
.card h3 { font-size: 14px; margin-bottom: 10px; color: var(--text-dim); }

/* ---------- 首页模块网格 ---------- */
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.module-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; text-decoration: none; color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.module-card:hover {
  transform: translateY(-3px); border-color: var(--primary);
  box-shadow: 0 8px 22px rgba(37,99,235,0.12);
}
.module-card .mi {
  font-size: 30px; width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #eef3ff; border-radius: 12px;
}
.module-card .info .name { font-size: 16px; font-weight: 700; }
.module-card .info .desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.module-card .arrow { margin-left: auto; color: var(--primary); font-size: 18px; }

/* ---------- 占位提示 ---------- */
.placeholder {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.placeholder .big { font-size: 56px; margin-bottom: 16px; }
.placeholder h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.placeholder p { font-size: 13px; }

/* ---------- 表单 / 按钮 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none; background: #fff;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.btn {
  padding: 9px 20px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 14px; background: var(--primary); color: #fff;
}
.btn:hover { opacity: .9; }
/* <a> 做成按钮时（如详情页「📄 生成标准书」）浏览器默认会加下划线，统一去掉 */
a.btn, a.btn:hover, a.btn:visited, a.btn:focus { text-decoration: none; }
.btn.ghost { background: #eef2f7; color: var(--text); }
.btn.danger { background: var(--danger); }

/* ---------- 状态条 ---------- */
.status-line { font-size: 13px; margin-top: 12px; padding: 10px 14px; border-radius: 8px; }
.status-line.ok  { background: #ecfdf3; color: var(--ok); border: 1px solid #bbf7d0; }
.status-line.err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* ---------- 响应式：窄屏折叠为顶部 ---------- */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--side-border);
  }
  .sidebar .brand { width: 100%; border-bottom: none; }
  .sidebar .nav { display: flex; flex-wrap: wrap; padding: 8px; }
  .sidebar .nav li { margin: 0; }
  .sidebar .foot { display: none; }
}

/* ---------- 设置子模块导航（水平 tab） ---------- */
.subnav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.subnav a {
  padding: 8px 18px; border-radius: 999px; text-decoration: none;
  background: #eef2f7; color: var(--text); font-size: 13px;
  border: 1px solid var(--border); transition: background .15s, color .15s;
}
.subnav a:hover { background: #e2e8f0; }
.subnav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 工具条（标题 + 右侧按钮） ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.toolbar h2 { font-size: 16px; }

/* ---------- 数据表格 ---------- */
.data-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: 10px; overflow: hidden; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { background: #f8fafc; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f9fbff; }

/* ---------- 徽章 / 角色 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 1.6; }
.badge.admin  { background: #fee2e2; color: #dc2626; }
.badge.editor { background: #fef3c7; color: #d97706; }
.badge.viewer { background: #dbeafe; color: #2563eb; }

/* ---------- 弹窗 ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 4000; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--card-bg); color: var(--text); border-radius: 14px; width: 440px; max-width: 100%; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 统计卡 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.stat-card .icon { font-size: 24px; margin-bottom: 6px; }
.stat-card .label { font-size: 12px; color: var(--text-dim); }
.stat-card .value { font-size: 18px; font-weight: 700; margin-top: 4px; }

/* ---------- 模块左侧栏：返回首页 + 模块名 + 菜单 ---------- */
.sidebar .back-home {
  display: flex; align-items: center; gap: 10px;
  margin: 16px; padding: 16px 18px;
  /* 淡灰底（**中性灰** R=G=B，避免冷灰 #f1f3f5 的轻微蓝调在部分屏上看着仍发蓝） */
  background: #ececec; color: var(--primary);
  border: 1px solid #dcdcdc;
  border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 17px;
  transition: background .15s, border-color .15s;
}
.sidebar .back-home .bh-ico { font-size: 22px; line-height: 1; }
.sidebar .back-home:hover { background: #e0e0e0; border-color: #cfcfcf; }
/* 模块名标题（.side-title）已按需求移除：菜单直接跟在「返回首页」下面 */
.set-nav { padding: 8px; }
.set-nav .menu-item > a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin: 2px 0; border-radius: 8px;
  color: var(--side-text); text-decoration: none; font-size: 14px;
  transition: background .15s, color .15s;
}
.set-nav .menu-item > a:hover { background: var(--side-bg-hover); color: #1e293b; }
.set-nav .menu-item.active > a {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--primary); font-weight: 600;
}
.set-nav .menu-item .mi { font-size: 18px; width: 24px; text-align: center; }
/* 二级菜单（children 非空时渲染）
   对齐做法：子项与一级菜单使用**完全相同的结构** —— 都留一个图标位、同样的 gap，
   所以文字天然对齐。不用 margin 硬凑数字：图标宽度会被 .sidebar .nav a .mi 覆盖成 22px、
   左内边距会被 .sidebar .nav 覆盖成 10px，写死的缩进早晚对不齐。 */
.set-nav .sub-menu { list-style: none; margin: 0 0 6px; padding: 0 0 0 16px; }
.set-nav .sub-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-radius: 8px;
  color: var(--side-text-dim); text-decoration: none; font-size: 13px;
}
/* 子项的占位图标位：空元素，仅用于和一级菜单的图标位等宽，保证文字左对齐 */
.set-nav .sub-menu .mi-ph { flex: none; }
.set-nav .sub-menu a:hover { background: var(--side-bg-hover); color: #1e293b; }
.set-nav .sub-menu a.active { color: var(--primary); font-weight: 600; }
/* 一级菜单手风琴折叠：同时只展开一支，箭头跟着转 */
.set-nav .menu-item.parent > a .caret,
.set-nav .menu-item.parent > .menu-group .caret { transition: transform .15s; }
.set-nav .menu-item.parent.closed > a .caret,
.set-nav .menu-item.parent.closed > .menu-group .caret { transform: rotate(-90deg); }
.set-nav .menu-item.parent.closed > .sub-menu { display: none; }
/* 设置专属侧栏不显示全站品牌与底部 */
#setSidebar .brand, #setSidebar .foot { display: none; }

/* 窄屏：返回首页按钮占满一行，菜单横向排布 */
@media (max-width: 768px) {
  #setSidebar .back-home { width: 100%; }
  .set-nav { display: flex; flex-wrap: wrap; padding: 8px 10px; }
  .set-nav .menu-item { margin: 0; }
  .set-nav .menu-item > a { margin: 2px; }
  /* 窄屏是横向排布；子项跟着一级菜单的 2px 外边距走，保持对齐 */
  .set-nav .sub-menu { margin-left: 2px; }
}

/* ---------- 右上角用户菜单（topbar.js 渲染进 #topbar） ---------- */
#topbar { display: inline-flex; }
.tb-login {
  display: inline-flex; align-items: center; padding: 8px 18px;
  background: #fff; color: var(--primary); border: 1px solid #c7d2fe;
  border-radius: 20px; text-decoration: none; font-size: 13px; font-weight: 600;
}
.tb-login:hover { background: #eef2ff; }
.tb-user { position: relative; }
.tb-user-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 22px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.tb-user-btn:hover { border-color: var(--primary); }
.tb-avatar { font-size: 15px; }
.tb-name { font-weight: 600; }
.tb-role { font-size: 11px; background: #eef2ff; color: var(--primary); padding: 1px 8px; border-radius: 12px; }
.tb-caret { font-size: 10px; color: var(--text-dim); }
.tb-menu {
  position: absolute; top: 46px; right: 0; background: #fff; color: var(--text);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.2); z-index: 300;
  min-width: 200px; overflow: hidden;
}
.tb-menu-info { padding: 14px 16px; background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; }
.tb-menu-name { font-weight: 700; font-size: 14px; }
.tb-menu-role { font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }
.tb-menu-divider { height: 1px; background: #e5e7eb; }
.tb-menu-item {
  display: block; width: 100%; padding: 12px 16px; border: none; background: none;
  text-align: left; font-size: 14px; color: #374151; cursor: pointer;
  transition: background .15s; text-decoration: none; font-family: inherit;
}
.tb-menu-item:hover { background: #f3f4f6; }

/* 门户深色顶栏（host） */
.topbar.dark { background: rgba(15,32,39,0.55); border-bottom: 1px solid rgba(255,255,255,0.12); color: #fff; backdrop-filter: blur(6px); }
.topbar.dark .page-title { color: #fff; }

/* 门户右上角用户浮层（替代原本与居中标题重复的顶部栏） */
.portal-user { position: fixed; top: 18px; right: 22px; z-index: 60; display: inline-flex; }
.portal-user #topbar { display: inline-flex; }
/* 门户主页已改为浅白底 → 右上角按钮同步走浅色（白底 + 浅灰描边） */
.portal-user .tb-login {
  background: #fff; color: var(--primary); border: 1px solid #c7d2fe;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.portal-user .tb-login:hover { background: #eef2ff; }
.portal-user .tb-user-btn {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.portal-user .tb-user-btn:hover { background: #fff; border-color: var(--primary); }
.portal-user .tb-name { color: var(--text); }
.portal-user .tb-role { background: #eef2ff; color: var(--primary); }
.portal-user .tb-caret { color: var(--text-dim); }
.portal-user .tb-avatar { filter: none; }

/* ---------- 一行多列表单（系统设置） ---------- */
.field-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 4px; }
@media (max-width: 900px) { .field-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- 上传（LOGO） ---------- */
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-row input[type="file"] { font-size: 13px; }
.logo-preview { max-height: 64px; max-width: 180px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: #fff; }

/* ---------- 侧栏：不可点击的分组标题 ----------
   内边距/外边距/圆角刻意与 .set-nav .menu-item > a 保持一致：
   否则分组行（如「工资条」，它本身没有页面可跳转）会比同级的链接行（如「员工档案」）
   左移 2px、行距也更宽，看起来就没对齐 */
.set-nav .menu-item > .menu-group {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; margin: 2px 0; border-radius: 8px;
  color: var(--side-text); font-size: 14px; cursor: default;
}
.set-nav .menu-item > .menu-group .mi { font-size: 18px; width: 22px; text-align: center; }
.set-nav .caret { margin-left: auto; font-size: 10px; color: var(--side-text-dim); }
/* 可折叠的分组标题（如「工资条」，本身无页面链接）悬停要显示手形，提示可点击 */
.set-nav .menu-item.parent > .menu-group { cursor: pointer; }
.set-nav .menu-empty { padding: 12px 16px; color: var(--side-text-dim); font-size: 13px; }

/* ---------- 权限树（用户管理弹窗） ---------- */
.perm-tree { max-height: 56vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.pt-mod { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.pt-mod:last-child { border-bottom: none; }
.pt-mod-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; padding: 4px 6px; }
.pt-body { display: flex; flex-direction: column; }
.pt-node { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 6px; }
.pt-node .pt-name { font-size: 13px; color: var(--text); }
.pt-mod-head select, .pt-node select {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; width: auto; min-width: 92px; outline: none;
}
.pt-mod-head select:focus, .pt-node select:focus { border-color: var(--primary); }

/* ============================================================
   用户管理页：内层「部门 + 用户」双栏 + 右侧角色权限表单
   ============================================================ */
.um-layout { display: flex; gap: 16px; align-items: flex-start; }
.um-side { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.um-main { flex: 1; min-width: 0; }

.side-sec { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-title { font-size: 14px; font-weight: 700; }
.mini-btn {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: #eef2f7; color: var(--primary); cursor: pointer; font-size: 15px;
  line-height: 1; transition: background .15s;
}
.mini-btn:hover { background: #dbeafe; }

.um-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; }
.um-list.tall { max-height: 340px; }
.um-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.um-item:hover { background: #f1f5f9; }
.um-item.active { background: #eff6ff; border-color: var(--primary); font-weight: 600; }
.um-item .it-left { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.um-item .it-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-size: 11px; color: var(--text-dim); background: #eef2f7; padding: 1px 8px; border-radius: 10px; flex-shrink: 0; }
.me-tag { font-size: 10px; background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 9px; flex-shrink: 0; }
.dept-del { border: none; background: transparent; color: #ef4444; cursor: pointer; font-size: 12px; display: none; padding: 0 2px; flex-shrink: 0; }
.um-item:hover .dept-del { display: inline-block; }
.um-empty { padding: 14px; text-align: center; color: var(--text-dim); font-size: 13px; }
.um-empty a { color: var(--primary); }

.card .card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.form-group input, .form-group select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: #fff; color: var(--text); outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.form-group input:disabled { background: #f3f4f6; color: var(--text-dim); }
.role-tip { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; align-items: center; }
.form-actions .btn-left { margin-right: auto; }
.perm-block { margin-top: 16px; }
.perm-block > label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.perm-block .perm-hint { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.perm-tree { max-height: 46vh; }

@media (max-width: 900px) {
  .um-layout { flex-direction: column; }
  .um-side { width: 100%; position: static; }
}
@media (max-width: 640px) {
  .form-row2 { grid-template-columns: 1fr; }
}

/* ============================================================
   业务模块通用页面件（人事 / 质量 / APS 等复用）
   ============================================================ */
/* ---------- 筛选工具条 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.filter-bar .grow { flex: 1; }
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; color: var(--text); font-family: inherit;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn.plain { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn.plain:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 表格容器 ---------- */
.table-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-card th, .table-card td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.table-card th { background: #f8fafc; font-weight: 600; color: var(--text-dim); font-size: 12px; position: sticky; top: 0; z-index: 1; }
.table-card tbody tr:hover { background: #f9fbff; }
.table-card tbody tr.row-link { cursor: pointer; }
.table-card tr:last-child td { border-bottom: none; }
.empty-cell { padding: 40px; text-align: center; color: var(--text-dim); font-size: 14px; }
.empty-cell a { color: var(--primary); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 16px; font-size: 13px; color: var(--text-dim); }
.cell-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 1px 9px; border-radius: 9px; font-size: 11px; line-height: 1.7; }
.tag-on { background: #dcfce7; color: #15803d; }
.tag-off { background: #f1f5f9; color: #64748b; }
.tag-warn { background: #fef3c7; color: #b45309; }

/* ---------- 宽弹窗（表单 / 详情） ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none;
  align-items: flex-start; justify-content: center; z-index: 1000;
  overflow-y: auto; padding: 24px 12px;
}
.mask.show { display: flex; }
.modal.wide { width: 100%; max-width: 940px; padding: 0; border-radius: 12px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.modal.narrow { width: 100%; max-width: 520px; padding: 0; border-radius: 12px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eef1f5; }
.modal-head h3 { font-size: 16px; color: var(--text); flex: 1; margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #eef1f5; background: #fafbfd; }
.sec { margin-bottom: 20px; }
.sec-title {
  font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 12px;
  padding-left: 9px; border-left: 3px solid var(--primary);
}
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.fg label .req { color: var(--danger); }
.fg input, .fg select, .fg textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; color: var(--text); font-family: inherit;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--primary); }
.fg .hint { font-size: 11px; color: var(--text-dim); }
.fg .ro { background: #f5f7fa; color: #64748b; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }

/* ---------- 一行多列表单（ERP 表单用：栅格列数由 cfg.formCols 决定，字段用 c1~c12 指定占几列） ---------- */
.form-grid { display: grid; gap: 12px 16px; align-items: start; }
.form-grid > .fg { grid-column: span 1; }
.form-grid > .fg.c2 { grid-column: span 2; }
.form-grid > .fg.c3 { grid-column: span 3; }
.form-grid > .fg.c4 { grid-column: span 4; }
.form-grid > .fg.c6 { grid-column: span 6; }
.form-grid > .fg.c12 { grid-column: span 12; }

/* 只读详情模式：整体灰显、去除交互 */
.mask.readonly .modal-body input,
.mask.readonly .modal-body select,
.mask.readonly .modal-body textarea {
  background: #f5f7fa; color: #334155; opacity: 1; border-color: #e8eef5;
}
.mask.readonly .upload-zone { pointer-events: none; background: #fafbfd; border-style: solid; border-color: #e8eef5; }
.mask.readonly .upload-zone .uz-del { display: none !important; }

/* ---------- 图片上传区 ---------- */
.photos { display: flex; flex-wrap: wrap; gap: 14px; }
.photo-slot { width: 150px; }
.photo-slot .ps-label { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 6px; }
.upload-zone {
  position: relative; width: 150px; height: 110px; overflow: hidden;
  border: 1.5px dashed #cbd5e1; border-radius: 8px; background: #fafbfd;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; color: #94a3b8; font-size: 12px; transition: all .15s;
}
.upload-zone:hover { border-color: var(--primary); color: var(--primary); background: #f5f9ff; }
.upload-zone img { width: 100%; height: 100%; object-fit: cover; }
.upload-zone .uz-del {
  position: absolute; top: 4px; right: 4px; display: none;
  background: rgba(220,38,38,.9); color: #fff; border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 12px; line-height: 1; cursor: pointer;
}
.upload-zone:hover .uz-del { display: block; }
.diploma-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: 11px 22px; border-radius: 8px;
  font-size: 13px; z-index: 2000; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { display: block; }

/* ---------- 角色权限提示条 ---------- */
.perm-banner {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
}

/* ============================================================
   工资条：设计器 + 录入表 + 打印条
   ============================================================ */
.sd-sec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.sd-sec-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #f8fafc; border-bottom: 1px solid var(--border);
}
.sd-sec-head .sd-sec-name { font-weight: 700; font-size: 14px; }
.sd-sec-head input {
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; font-family: inherit; outline: none; width: 160px;
}
.sd-sec-head input:focus { border-color: var(--primary); }
.sd-body { padding: 10px 14px; }
.sd-row {
  display: grid; grid-template-columns: 22px 1.1fr 1.1fr 96px 2fr 74px 62px 26px 74px 84px;
  gap: 8px; align-items: center; padding: 5px 0;
}
.sd-row.sd-head { font-size: 12px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.sd-row input, .sd-row select {
  width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 12px; outline: none; font-family: inherit; background: #fff; color: var(--text);
}
.sd-row input:focus, .sd-row select:focus { border-color: var(--primary); }
.sd-row input.mono { font-family: Consolas, Monaco, monospace; }
.sd-row .sd-sort { color: var(--text-dim); font-size: 12px; text-align: center; }
.sd-ops { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 24px; height: 24px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--text-dim); font-size: 12px; line-height: 1;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.sd-preview { background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; }

.salary-wrap { overflow-x: auto; }
.salary-table { border-collapse: collapse; font-size: 12px; }
.salary-table th, .salary-table td { border: 1px solid #e5e7eb; padding: 0; white-space: nowrap; }
.salary-table th {
  background: #f1f5f9; padding: 6px 8px; font-weight: 600; color: #334155;
  position: sticky; top: 0; z-index: 2;
}
.salary-table th.sec-h {
  background: #dbeafe; color: #1d4ed8; text-align: center; border-bottom: 2px solid #93c5fd;
}
.salary-table td.sticky-l, .salary-table th.sticky-l {
  position: sticky; left: 0; background: #fff; z-index: 3; padding: 5px 8px;
}
.salary-table th.sticky-l { background: #f1f5f9; z-index: 4; }
.salary-table td.sticky-l2, .salary-table th.sticky-l2 {
  position: sticky; left: 118px; background: #fff; z-index: 3; padding: 5px 8px;
}
.salary-table th.sticky-l2 { background: #f1f5f9; z-index: 4; }
.salary-table input.cell {
  width: 96px; padding: 6px 8px; border: none; outline: none; font-size: 12px;
  background: transparent; font-family: inherit; color: var(--text); text-align: right;
}
.salary-table input.cell:focus { background: #eff6ff; }
.salary-table input.cell.text { text-align: left; width: 110px; }
.salary-table td.calc { background: #f8fafc; color: #0f172a; text-align: right; padding: 6px 8px; font-weight: 600; }
.salary-table tr.row-saved td.sticky-l { background: #f0fdf4; }
.salary-table tr:hover td.sticky-l, .salary-table tr:hover td.sticky-l2 { background: #f9fbff; }
.salary-table td.info { color: #475569; text-align: left; }
.salary-table .col-hint { font-size: 10px; color: #64748b; font-weight: 400; }

/* 工资条打印 */
.slip {
  width: 760px; max-width: 100%; margin: 0 auto; background: #fff; color: #111;
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 18px 20px; font-size: 12px;
}
.slip h3 { font-size: 16px; text-align: center; margin: 0 0 4px; letter-spacing: 2px; }
.slip .slip-sub { text-align: center; color: #64748b; font-size: 11px; margin-bottom: 12px; }
.slip table { width: 100%; border-collapse: collapse; }
.slip td, .slip th { border: 1px solid #cbd5e1; padding: 4px 8px; }
.slip th { background: #f1f5f9; font-weight: 600; }
.slip .slip-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slip .num { text-align: right; font-family: Consolas, Monaco, monospace; }
.slip .sum { font-weight: 700; background: #f8fafc; }

@media (max-width: 900px) {
  .grid3 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: span 1; }
  /* 一行多列表单：窄屏收成两列，整行字段占满 */
  .form-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .form-grid > .fg { grid-column: span 1 !important; }
  .form-grid > .fg.c12 { grid-column: span 2 !important; }
  .modal.wide { max-width: 100%; }
  .sd-row { grid-template-columns: 22px 1fr 1fr; grid-auto-rows: auto; }
  .sd-row.sd-head { display: none; }
}

@media print {
  .sidebar, .topbar, .filter-bar, .no-print, .pager { display: none !important; }
  body { background: #fff; }
  .layout, .main, .content { display: block; padding: 0; }
  .slip { border: none; page-break-inside: avoid; }
}

/* ============================================================
   内容面板 / 按钮变体（PLM 等模块沿用 hongyao 命名的兼容件）
   ============================================================ */
.panel {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid #eef1f5;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.panel-header .role-hint { font-weight: 400; }
.panel-body { padding: 18px; }

.empty-tip {
  grid-column: 1 / -1; text-align: center; padding: 56px 20px;
  color: var(--text-dim); font-size: 14px;
}

/* 按钮尺寸 / 变体别名 */
.btn-xs { padding: 2px 8px; font-size: 11px; line-height: 1.7; border-radius: 6px; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); opacity: 1; }
.btn-ghost { background: #eef2f7; color: var(--text); }
.btn-ghost:hover { background: #e2e8f0; opacity: 1; }

/* 分页按钮 */
.page-btn {
  min-width: 32px; padding: 6px 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text); border-radius: 8px;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ============================================================
   质量管理模块（quality.js 引擎专用样式，前缀 q-）
   ============================================================ */
.q-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.q-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.q-input { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text); font-size: 13px; font-family: inherit; }
.q-input:focus { outline: none; border-color: var(--primary); }
.q-date { width: 150px; }
.q-tilde { color: var(--text-dim); padding: 0 2px; }
.q-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.q-btn { height: 36px; padding: 0 14px; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit; background: #eef2f7; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.q-btn:hover { opacity: .92; }
.q-btn-primary { background: var(--primary); color: #fff; }
.q-btn-danger { background: var(--danger); color: #fff; }
.q-btn-default { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); }
.q-btn-ghost { background: #eef2f7; color: var(--text); }
.q-btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.q-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.q-btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.q-summary-tag { margin-left: auto; font-size: 12px; color: #fff; background: var(--danger); padding: 4px 10px; border-radius: 20px; font-weight: 600; }

.q-table-wrap { overflow-x: auto; }
.q-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.q-table th, .q-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
/* 长文本列（异常信息/描述等，列定义 wrap:true）：允许自动断行，限宽防止把整行撑爆 */
.q-table td.q-td-wrap { white-space: normal; word-break: break-word; overflow-wrap: anywhere; min-width: 160px; max-width: 420px; }
.q-table th { background: #f5f7fa; color: var(--text-dim); font-weight: 600; position: sticky; top: 0; }
.q-table tbody tr { cursor: pointer; }
.q-table tbody tr:hover { background: #f8fafc; }
.q-col-img { width: 140px; }
/* 列表「附件」列：缩略图每行最多 3 张，>3 张自动换行；点缩略图看大图（灯箱） */
.q-table td.q-col-img, .q-table th.q-col-img { padding-left: 6px; padding-right: 6px; }
.q-list-imgs { display: flex; flex-wrap: wrap; gap: 4px; }
.q-list-imgs .q-list-thumb {
  width: calc((100% - 8px) / 3);   /* 一行 3 张（减去 2 个 4px 间隙） */
  height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  border: 1px solid var(--border); border-radius: 4px;
  cursor: zoom-in; display: block;
}.q-col-op { width: 130px; }
.q-muted { color: var(--text-dim); }

.q-badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.q-badge-ok { background: #dcfce7; color: #16a34a; }
.q-badge-danger { background: #fee2e2; color: #dc2626; }
.q-badge-warn { background: #fef3c7; color: #d97706; }
.q-badge-blue { background: #dbeafe; color: #2563eb; }
.q-badge-teal { background: #ccfbf1; color: #0d9488; }
.q-badge-purple { background: #ede9fe; color: #7c3aed; }
.q-badge-gray { background: #e5e7eb; color: #6b7280; }

.q-page { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.q-page-info { font-size: 13px; color: var(--text-dim); margin-right: 8px; }
.q-page-ellipsis { color: var(--text-dim); padding: 0 4px; }
.q-empty { text-align: center; color: var(--text-dim); padding: 48px 0; font-size: 14px; }

/* 表单弹窗（复用 .modal / .modal-head / .modal-body / .modal-foot 结构） */
.q-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 4000; padding: 20px; }
.q-modal-mask[style*="flex"] { display: flex; }
.q-modal { background: var(--card-bg); color: var(--text); border-radius: 12px; width: 640px; max-width: 100%; max-height: calc(100vh - 60px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.q-modal-head { display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; }
.q-modal-close { margin-left: auto; border: none; background: transparent; font-size: 18px; cursor: pointer; color: var(--text-dim); }
.q-modal-body { padding: 18px 20px; overflow-y: auto; }
.q-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 12px 12px; }

.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.q-field { display: flex; flex-direction: column; gap: 5px; }
.q-field.q-full { grid-column: 1 / -1; }
.q-field label { font-size: 12px; color: var(--text-dim); }
.q-req { color: var(--danger); margin-left: 2px; }
.q-field input, .q-field select, .q-field textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); color: var(--text); font-size: 13px; font-family: inherit; width: 100%; box-sizing: border-box; }
.q-field textarea { min-height: 72px; resize: vertical; }
.q-field input:focus, .q-field select:focus, .q-field textarea:focus { outline: none; border-color: var(--primary); }
.q-field input:disabled, .q-field select:disabled, .q-field textarea:disabled { background: #f3f4f6; color: var(--text-dim); cursor: not-allowed; }

.q-section-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.q-imgs-block { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.q-img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.q-img-grid .q-muted { font-size: 13px; }
.q-thumb { position: relative; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #f3f4f6; }
.q-thumb-img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; }
.q-thumb-del { position: absolute; top: 3px; right: 3px; border: none; background: rgba(0,0,0,.55); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; }
.q-thumb-pending { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(37,99,235,.85); color: #fff; font-size: 10px; text-align: center; padding: 2px 0; }
.q-upload-row { margin-top: 10px; }

.q-toast { position: fixed; left: 50%; top: 24px; transform: translateX(-50%) translateY(-20px); background: #333; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 5000; }
.q-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.q-toast.ok { background: #16a34a; }
.q-toast.err { background: #dc2626; }

.q-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: none; align-items: center; justify-content: center; z-index: 6000; flex-direction: column; }
.q-lightbox.open { display: flex; }
.q-lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.q-lightbox-tip { color: rgba(255,255,255,.7); font-size: 12px; margin-top: 12px; }

/* 表单分行（客诉记录等：字段带 row 时按行等宽排布） */
.q-modal-wide { width: 900px; }
.q-frow { display: grid; gap: 12px 16px; margin-bottom: 14px; }
.q-frow:last-child { margin-bottom: 0; }

/* ---- 表格录入（mode: entry：进入页面即在表格里直接多行录入） ---- */
.q-entry { margin-bottom: 16px; }
/* 录入表格撑满容器：table-layout:fixed + 每列 width 都是「百分比」（quality.js 的 colPlan() 算好，
   合计正好 100%）→ 表格宽度恒等于容器宽度，窗口变窄时所有输入框按同一比例一起缩小，
   不会出现横向滚动条，最右边的「附件 / 操作」两列因此永远留在可视区内。
   （实测 Chrome 的表格单元格 width 不认 calc(100% - 362px)，只认纯 px / 纯 %，所以必须用百分比。） */
.q-et { border-collapse: collapse; font-size: 13px; width: 100%; table-layout: fixed; min-width: 960px; }
.q-et th, .q-et td { padding: 5px 6px; border: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
.q-et th { background: #f5f7fa; color: var(--text-dim); font-weight: 600; font-size: 12px; }
.q-et-v { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); font-size: 13px; font-family: inherit; box-sizing: border-box; width: 140px; }
.q-et-v:focus { outline: none; border-color: var(--primary); }
.q-et-ta { width: 200px; min-height: 34px; height: 34px; resize: none; line-height: 1.35; overflow: hidden; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.q-et-prod { width: 150px; }
.q-et input[type="number"].q-et-v { width: 90px; }
.q-et select.q-et-v { width: 104px; }
.q-et input[type="date"].q-et-v { width: 140px; }
.q-et-idx { width: 36px; text-align: center; color: var(--text-dim); font-size: 12px; }
/* 附件列宽 = quality.js 的 IMG_COL_PX（88px，原 176 减半；省下的宽度给了 班次/生产人员/机台号） */
/* 附件 / 操作 两列钉在右侧：表格横向溢出时（容器 < 960px）也始终可见。
   附件列要贴在「操作」列左边，所以 right 用 JS 写进 .q-et 的 --q-op-w（= 操作列的百分比宽度），
   这样任何列数/任何窗口宽度下两者都严丝合缝。 */
.q-et-imgcol { position: sticky; right: var(--q-op-w, 84px); background: var(--card-bg); }
.q-et-opcol { width: 84px; position: sticky; right: 0; background: var(--card-bg); box-shadow: -6px 0 8px -6px rgba(0,0,0,.18); }
.q-et thead .q-et-imgcol, .q-et thead .q-et-opcol { background: #f5f7fa; }
.q-et-thumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.q-et-thumb { position: relative; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; display: inline-block; }
.q-et-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.q-et-thumb button { position: absolute; top: 0; right: 0; width: 15px; height: 15px; padding: 0; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 1; border-radius: 50%; cursor: pointer; }
.q-et-rowbtns { display: flex; gap: 2px; flex-wrap: wrap; }
/* 操作列在列数多的模块（来料 19 列）里可能只有 ~58px：收紧按钮内边距 + 允许换行，
   保证 ＋/－ 两个按钮不会被挤出列宽（否则会把表格的 scrollWidth 撑大，出现多余的横向滚动条） */
.q-et td.q-et-opcol .q-btn-xs { padding: 0 6px; }
/* 录入表格的额外列（如巡检录入「异常信息」后的「品质异常单」生成按钮） */
.q-et th.q-et-extracol, .q-et td.q-et-extracol { text-align: center; }
.q-et-tip { font-size: 12px; color: var(--text-dim); }
/* 指定列宽的录入列（如 班次3字 / 机台号4字 / 生产人员5字 / 判定3字）：列宽≈N个汉字，控件撑满列宽不被截断 */
.q-et th.q-et-wc, .q-et td.q-et-wc { padding: 4px 4px; }
.q-et td.q-et-wc input.q-et-v,
.q-et td.q-et-wc select.q-et-v,
.q-et td.q-et-wc textarea.q-et-v { width: 100%; min-width: 0; padding: 6px 4px; }
/* 窄列下拉框：原生箭头太占地方（约16px），换成 6px 自绘箭头，把宽度还给文字 */
.q-et td.q-et-wc select.q-et-v {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding: 6px 10px 6px 4px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0h8L4 5z' fill='%23909aa8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 3px center;
}

/* ERP 表单 number 字段（.erp-num，由 erp.js 渲染）：隐藏上下箭头（spinner），
   滚轮/上下键步进由 erp.js 的事件委托拦截 → 只允许键盘输入与粘贴 */
input[type="number"].erp-num::-webkit-outer-spin-button,
input[type="number"].erp-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"].erp-num { -moz-appearance: textfield; appearance: textfield; }

/* ERP 弹窗选择器（erp.js type:'picker'）：点击表单里的只读框弹出，盖在表单弹窗(.mask z-index:1000)之上 */
.erp-picker-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: flex-start; justify-content: center; z-index: 2000; padding-top: 96px; }
.erp-picker-mask.show { display: flex; }
.erp-picker-modal { background: var(--card-bg, #fff); color: var(--text, #111); border-radius: 12px; width: 100%; max-width: 420px; max-height: calc(100vh - 160px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.3); overflow: hidden; }
.erp-picker-modal .modal-head { padding: 14px 18px; border-bottom: 1px solid #eef1f5; }
.erp-picker-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.erp-picker-body input[type="text"] { padding: 8px 10px; border: 1.5px solid #d1d5db; border-radius: 6px; font-size: 13px; outline: none; }
.erp-picker-body input[type="text"]:focus { border-color: #2563eb; }
.erp-picker-actions { display: flex; justify-content: flex-end; }
.erp-picker-list { overflow-y: auto; min-height: 120px; max-height: 46vh; border: 1px solid #eef1f5; border-radius: 8px; }
.erp-picker-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f4f6f9; }
.erp-picker-item:last-child { border-bottom: none; }
.erp-picker-item:hover { background: #eff6ff; }
.erp-picker-item .v { color: #94a3b8; font-size: 12px; }
.erp-picker-empty { padding: 22px 12px; text-align: center; color: #94a3b8; font-size: 13px; }
input.erp-picker { cursor: pointer; background: #fbfcfe; }
input.erp-picker:focus { border-color: #2563eb; }

/* ===== 产品型号 模糊联想下拉（PLM 数据，quality.js 的 attachProductSuggest 渲染） =====
   挂在 body 上 + position:fixed：不能放进 .q-table-wrap（overflow:auto 会把下拉裁掉）。
   z-index 必须 > .q-modal-mask(4000)：弹窗里的联想下拉曾被遮罩盖住（3000<4000）看不到。 */
.q-psug {
  position: fixed;
  z-index: 4500;
  max-height: 264px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
  padding: 4px;
}
.q-psug-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.q-psug-item.on, .q-psug-item:hover { background: #eff6ff; }
.q-psug-model { font-size: 13px; font-weight: 700; color: var(--text); }
.q-psug-name { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }

/* ===== 巡检弹窗「异常单号」：输入 + ↗跳转 + 独立模糊联想下拉（quality.js attachAbnormalSuggest） ===== */
.q-abn-link { color: var(--primary); cursor: pointer; text-decoration: underline; word-break: break-all; }
.q-abn-link:hover { opacity: .8; }
.q-abn-wrap { display: flex; align-items: center; gap: 6px; }
.q-abn-wrap input { flex: 1; min-width: 0; }
.q-abn-jump { flex: none; white-space: nowrap; }
.q-absug {
  position: fixed;
  z-index: 4500;
  max-height: 220px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
  padding: 4px;
}
.q-absug-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.q-absug-item.on, .q-absug-item:hover { background: #eff6ff; }
.q-absug-no { font-size: 13px; font-weight: 700; color: var(--text); }
.q-absug-name { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 640px) {
  .q-grid { grid-template-columns: 1fr; }
  .q-modal { width: 100%; }
  .q-date { width: 130px; }
}

@media (max-width: 900px) {
  .q-modal-wide { width: 100%; }
  .q-frow { grid-template-columns: 1fr !important; }
  /* 单列堆叠时清掉行内 span 占位，避免 grid-column:span 2 溢出 */
  .q-frow .q-field { grid-column: auto !important; }
}
