:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e6e8eb;
  --border-strong: #d8dbe0;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }

.view { min-height: 100vh; }

/* ---------- 整站架子：上面一条顶栏，左边一列功能，右边是进去的内容 ----------
   跟项目报价系统那套一样（2026-11-13 用户口径）。登录页不进这个壳子，
   进站以后每一页都在右边那一列里显示 / 隐藏，左边的当前项点亮。 */
.app-shell { min-height: 100vh; }
.app-topbar { height: 66px; padding: 0 16px; }
.app-topbar .top-logo { height: 40px; }
.app-body { display: flex; align-items: flex-start; }
.sidebar {
  width: 224px; flex: 0 0 224px;
  position: sticky; top: 66px; height: calc(100vh - 66px);
  overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  padding: 12px 10px 18px;
  background: #fff; border-right: 1px solid var(--border);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-sep {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted);
  padding: 12px 10px 5px;
}
.side-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; border-radius: 9px; background: transparent;
  font-size: 14px; color: var(--text); cursor: pointer; font-family: inherit;
  line-height: 1.3; white-space: nowrap;
}
.side-item:hover { background: #f3f4f6; }
.side-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
/* 「BOM表导入及二维码生成」字多（2026-11-13 用户改的名），208px 一行放不下、折成两行又不好看——
   按 2026-11-13 用户口径「显示为一行」，左栏加宽到 224px 把这一行装下，别的菜单项不受影响 */
#mode-bom-stamp { letter-spacing: -0.2px; }
.side-ico { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.side-bottom { margin-top: auto; }
.app-main { flex: 1; min-width: 0; }
.app-main .view { min-height: calc(100vh - 66px); }
/* 右列里每一页自己的工具条（返回 / 保存 / 导出）：不再吸顶 —— 外面已经有一条吸顶顶栏了 */
.app-main .topbar { position: static; background: #fff; }

/* 手机上：顶栏收窄，公司名让位给「账号 / 退出」，别把退出挤出屏幕 */
@media (max-width: 560px) {
  .app-topbar { height: 58px; padding: 0 10px; }
  .app-topbar .top-logo { height: 30px; }
  .brand-name { font-size: 15px; }
  .brand-sub { font-size: 11px; }
  .app-topbar .topbar-right { gap: 4px; flex-shrink: 0; }
  .app-topbar .topbar-right .btn { padding: 6px 9px; font-size: 13px; }
}

/* 手机上左边那一列改成横条，横向滑，不占一屏高 */
@media (max-width: 820px) {
  .app-body { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; flex: none; height: auto;
    flex-direction: row; align-items: center;
    overflow-x: auto; overflow-y: hidden;
    gap: 6px; padding: 8px 10px;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .side-nav { flex-direction: row; align-items: center; gap: 6px; }
  .side-group { flex-direction: row; align-items: center; gap: 6px; }
  .side-sep { display: none; }
  .side-bottom { margin-top: 0; }
  .side-item { width: auto; padding: 7px 10px; font-size: 13px; }
  .side-ico { display: none; }
  /* 横条上不折行（折了整条变高、横向滑动也别扭）—— 名字长了就跟着横向滑 */
  #mode-bom-stamp { white-space: nowrap; }
}

/* ---------- 主页看板 ----------
   三大块：01 齐套总览（一排数 + 项目齐套率 + 可以安装的项目）、
   02 工序与欠料（各工序齐套率 + 欠料最多）、03 打包与发货（打包情况 + 项目装箱 + 增补件装箱）。
   块是一层很淡的底板，里面的卡半透明 —— 鼠标移上去稍微放大、变成实的（2026-11-13 口径）。
   条形图只用一种颜色（--primary）：条的长短已经表示大小，不按排名换色。 */
/* 主页自己铺满整个右列：不受 .container 那条 1320px 的限制（2026-11-13 用户口径：
   横向也尽量占满）。下面垫一层很淡的底色，卡片的半透明才看得出来。 */
#view-mode { background:
  radial-gradient(1200px 620px at 4% -12%, #dce8ff 0%, rgba(220, 232, 255, 0) 60%),
  radial-gradient(1000px 600px at 101% -6%, #d8f1e4 0%, rgba(216, 241, 228, 0) 56%),
  radial-gradient(900px 520px at 55% 108%, #e6edff 0%, rgba(230, 237, 255, 0) 62%),
  var(--bg); }
#view-mode .container.dash { max-width: none; padding: 18px 16px 24px; }
.dash { max-width: none; }
/* 手机上一个标题加一条刷新条挤不下，让它换行，别把刷新条挤出屏幕 */
#view-mode .page-head { flex-wrap: wrap; }
/* 右上角刷新信息：以前是灰字直接压在淡色渐变底上，看不清（2026-11-13 用户口径：
   时间用黑字、外面加框）。框一直延到「刷新」按钮 —— 左边是时间，右边是按钮，
   两块共用一条外框，看起来就是一根条。 */
.dash-refresh-bar {
  display: inline-flex; align-items: stretch; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; box-shadow: var(--shadow-sm);
}
.dash-refresh-bar #dash-updated {
  display: inline-flex; align-items: center;
  color: var(--text); font-size: 13px; white-space: nowrap;
  padding: 0 12px; border-right: 1px solid var(--border);
}
/* 按钮不另画边框，就跟时间框连成一条 */
.dash-refresh-bar .btn { border: 0; border-radius: 0; }
/* 手机上挤不下：整条铺满一行，时间那半截允许折成两行，别把「刷新」挤出屏幕 */
@media (max-width: 520px) {
  #view-mode .page-head .head-actions { width: 100%; }
  .dash-refresh-bar { width: 100%; }
  .dash-refresh-bar #dash-updated {
    flex: 1; min-width: 0; white-space: normal; padding: 6px 10px;
  }
}

/* 版式：左边一列上下两块方形，右边一块细长占满（2026-11-13 用户口径）。
   整块尽量铺满屏幕：宽到底、高三块一起撑开。 */
.dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-layout .dash-block { margin-bottom: 0; }
/* ★ 一屏装下，页面自己不滚（2026-11-13 用户口径：「系统看板太长了，改为不用滚动的」）：
   整页高度钉死成「屏幕高 - 顶上 66px 那条」，三块按比例分剩下的高度；
   装不下的长列表在**卡片里面**自己上下拉（.dash-scroll），不是整页往下拖。
   窄屏（<1101px）还是按老样子自然排 —— 手机上硬压成一屏反而看不清。 */
@media (min-width: 1101px) {
  #view-mode { height: calc(100vh - 66px); overflow: hidden; }
  #view-mode .container.dash {
    height: 100%; display: flex; flex-direction: column;
    padding-top: 14px; padding-bottom: 16px;
  }
  #view-mode .page-head { flex: 0 0 auto; }
  /* .dash-layout 吃掉整页剩下的高度；里面左列两块、右边细长一块都是 min-height:0，
     高度不够时缩的是卡里的列表（它们自己滚），不会把整页撑长 */
  /* ★ 行高必须钉成 minmax(0,1fr)：auto 行会被卡里的内容撑大（整页又变长、卡还会叠在一起），
     钉死之后三块才真的听外框的高度。 */
  .dash-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .dash-col { min-height: 0; }
  .dash-col .dash-block { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dash-col .dash-grid { flex: 1; min-height: 0; }
  .dash-block-tall { min-height: 0; }
  .dash-block-tall .dash-grid.dash-stack { min-height: 0; }
  .dash-card { min-height: 0; }
  .dash-card .dash-scroll { flex: 1 1 auto; min-height: 0; }
  /* 右边细长块：上面「打包情况」按内容撑死（别压扁，压扁字会叠到下一张卡上），
     剩下的高度全给下面两张装箱卡，装不下的在卡里自己滚 */
  .dash-block-tall .dash-grid.dash-stack > .dash-card:not(.dash-recent-card) { flex: 0 0 auto; }
  .dash-block-tall .dash-grid.dash-stack > .dash-card.dash-recent-card { flex: 1 1 0; min-height: 150px; }
  /* 屏幕太矮（比如 768）三张卡按最小高也放不下时，右边这一列自己滚一滚，
     别把卡压得只剩一条标题 */
  .dash-block-tall .dash-grid.dash-stack { overflow-y: auto; }
  /* 一屏布局里不再封 320px —— 高度听外框的，列表把剩下的吃满 */
  #dash-projects, #dash-ready, #dash-owed { max-height: none; }
}
.dash-block-tall { display: flex; flex-direction: column; }
/* 细长那块里的卡上下排，最后一张（最近装箱单）撑满剩下的高度 */
.dash-grid.dash-stack {
  display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0;
}
.dash-grid.dash-stack .dash-card { margin-bottom: 0; }
/* 下面两张「装箱」卡平分剩下的高度（2026-11-13 用户口径：项目装箱 / 增补件装箱
   分开显示）。用 auto 做底 + 一起放大，窄屏上块没有固定高度时也不会塌成一条。 */
.dash-grid.dash-stack .dash-card.dash-recent-card { flex: 1 1 auto; min-height: 0; }
.dash-block-tall .dash-packs { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.dash-block {
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(230, 232, 235, .85);
  border-radius: 18px;
  /* 底的留白跟左右一样宽：右边那块最后一张卡会撑到底，padding-bottom:0 会让白卡
     贴着大框的边（2026-11-13 用户口径） */
  padding: 14px 16px 16px;
  margin-bottom: 18px;
}
.dash-block-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 2px 2px 12px; }
.dash-block-no {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: var(--primary); background: var(--primary-soft);
  padding: 1px 7px; border-radius: 999px;
}
.dash-block-head h2 { margin: 0; font-size: 16px; }
.dash-block-head p { margin: 0; color: var(--muted); font-size: 12px; }

/* 左边的块没那么宽，五个数就排成一行（一行五个更像「方形块」里的表头） */
/* 2026-11-13 用户口径：「待发货」拆成 项目待发货 / 增补件待发货 → 一排 6 个数。
   列数由 app.js 按实际渲染个数写进 --kpi-cols（只有部分权限的账号不会空出半排）；
   6 个挤在 01 这一块里，格子比原来窄，所以内边距和字号都收了一档。 */
.dash-kpis { display: grid; grid-template-columns: repeat(var(--kpi-cols, 6), minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.dash-kpi {
  background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 11px 12px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.dash-kpi-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0; line-height: 1.3; }
.dash-kpi-num { margin: 4px 0 0; font-size: 24px; font-weight: 800; line-height: 1.15; }
.dash-kpi-num small { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.dash-kpi-sub { margin: 4px 0 0; font-size: 11px; line-height: 1.35; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
/* 卡里的小框铺满整张卡；标题和右边小字挤不下就换行，别压在一起 */
.dash-card { display: flex; flex-direction: column; }
.dash-card .section-head { flex-wrap: wrap; gap: 4px 10px; }
.dash-card .section-head h2 { min-width: 0; }
.dash-grid.dash-grid-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* .card 自带 margin-bottom:16px，在看板里会跟 .dash-block 的底部留白叠成 32px，
   跟上面/左右那 16px 不一样（2026-11-13 用户口径：四周留白要一样） */
.dash-grid .dash-card { margin-bottom: 0; }
.dash-block .dash-card {
  background: rgba(255, 255, 255, .62);
  border-color: rgba(255, 255, 255, .78);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.dash-card h2 { font-size: 15px; }

/* 只在真有鼠标的设备上放大：触屏点完不会「黏」在放大状态 */
@media (hover: hover) {
  .dash-kpi:hover {
    transform: translateY(-2px) scale(1.015);
    background: #fff; box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
  }
  .dash-block .dash-card:hover {
    transform: translateY(-2px) scale(1.012);
    background: #fff; box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
  }
}
@media (max-width: 1100px) { .dash-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 980px) {
  /* .dash-grid-even 的选择器权重比 .dash-grid 高，这里要一起写，否则窄屏还是两列、横向撑破 */
  .dash-grid, .dash-grid.dash-grid-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .dash-block { padding: 12px; border-radius: 16px; }
  .dash-block-head p { display: none; }
  /* 手机上一排五个字挤不下会横向撑破页面，改成两列 */
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-kpi { min-width: 0; }
  .dash-kpi-label { overflow-wrap: anywhere; }
}

/* 横向条：名字 | 轨道 | 百分比 | 明细
   名字（项目号 + 项目名）允许折成两行 —— 项目名长，挤一行会截成「GC26…」，
   用户 2026-11-13 口径：信息要显示全。 */
.dash-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 38px 68px; gap: 8px; align-items: center; padding: 6px 0; }
.dash-bar-name { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.dash-bar-name b { font-weight: 700; }
.dash-bar-name span { color: var(--muted); margin-left: 6px; }
.dash-bar-track { height: 8px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.dash-bar-pct { font-size: 13px; font-weight: 700; text-align: right; }
.dash-bar-num { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.dash-bar-row.is-ready .dash-bar-fill { background: var(--success); }
/* 这道工序这段时间**没有料**（不是「一件都没到」）：不画进度、百分比写「—」，
   整行压暗 —— 六道工序每行都占着，少一行会让人以为没导进来（用户 2026-11-13）。 */
.dash-bar-row.is-empty .dash-bar-track { background: transparent; }
.dash-bar-row.is-empty .dash-bar-pct,
.dash-bar-row.is-empty .dash-bar-num { color: var(--muted); font-weight: 600; }
/* 欠料最多那个卡最窄：项目名放一行占满，条 + 百分比 + 「还差 N 条」压到第二行，
   否则名字会被挤成一列竖排（2026-11-13 用户口径：信息要显示全）。 */
@media (min-width: 981px) {
  #dash-owed .dash-bar-row { grid-template-columns: minmax(0, 1fr) 38px 70px; }
  #dash-owed .dash-bar-name { grid-column: 1 / -1; }
}

/* 列表手动上下滚（2026-11-13 用户口径：不要自动滚，手动上下拉）：
   内容比这块高就出竖向滚动条，滚轮 / 拖动自己来；横向不滚。
   overscroll-behavior 防止拉到底以后把整页也带着滚。 */
.dash-scroll {
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: thin; flex: 1; min-height: 0;
}
#dash-projects, #dash-owed { max-height: 320px; }
#dash-ready { max-height: 320px; }
/* 项目装箱 / 增补件装箱两张卡在右边细长那块里平分剩下的高度，列表跟着卡走，
   不再单独封 360px —— 否则下面会剩一条空白（2026-11-13 用户口径：小框要占满） */
#dash-recent-device, #dash-recent-supp { max-height: none; }
.dash-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 999px; background: var(--success-soft); color: var(--success); margin-left: 6px;
}
.dash-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }
.dash-note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* 可以安装的项目：一行一个 */
/* 项目那一行：上面「项目号 + 名称 / 几条齐」，下面一条装箱进度（2026-11-13 用户口径：
   可实施安装项目也加进度条 —— 齐套都 100% 了，看的是装箱走到哪一步） */
.dash-ready-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 2px 10px; padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.dash-ready-item:last-child { border-bottom: none; }
.dash-ready-main { min-width: 0; }
.dash-ready-no { font-weight: 700; font-size: 14px; }
.dash-ready-name { color: var(--muted); font-size: 12px; margin-left: 6px; }
.dash-ready-sub { color: var(--muted); font-size: 12px; }
.dash-ready-prog {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px; align-items: center; margin-top: 3px;
  font-size: 11px; color: var(--muted);
}
.dash-ready-prog .dash-bar-track { height: 6px; }
.dash-ready-prog-num { white-space: nowrap; text-align: right; }

/* 打包情况：设备 / 增补件两栏（在右边那块细长的卡里改成上下两栏） */
.dash-packs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) {
  .dash-packs { grid-template-columns: 1fr; }
  .dash-block-tall .dash-packs { grid-template-columns: 1fr; }
}
.dash-pack { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.dash-pack-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dash-pack-head h3 { margin: 0; font-size: 14px; }
.dash-pack-head span { color: var(--muted); font-size: 12px; }
.dash-pack-nums { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.dash-pack-nums div { font-size: 12px; color: var(--muted); }
.dash-pack-nums b { display: block; font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.2; }

/* 项目装箱 / 增补件装箱：一行两条 —— 上面项目号 + 项目名 + 状态徽标，下面箱名 / 时间。
   这块比左边窄，横着排四项会把字截掉（2026-11-13 用户口径：信息要显示全）。 */
.dash-recent-row {
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; min-width: 0;
}
.dash-recent-row:last-child { border-bottom: none; }
.dash-recent-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* 状态徽标钉在这一行最右边（.badge 自带的 margin-left 在这里用不上，会跟 flex 的 gap 叠起来） */
.dash-recent-top .badge { margin-left: auto; flex-shrink: 0; }
.dash-recent-main { min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.dash-recent-main b { margin-right: 6px; }
.dash-recent-main span { color: var(--muted); }
.dash-recent-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px;
  margin-top: 3px; font-size: 12px; color: var(--muted); min-width: 0;
}
.dash-recent-sub > span { min-width: 0; overflow-wrap: anywhere; }
.dash-recent-time { margin-left: auto; text-align: right; white-space: nowrap; }

/* 项目装箱（2026-11-13 用户口径）：一个项目一行，下面两根基线 —— 装箱进度 / 发货进度。
   装箱 = （装箱完成 + 已发货）÷ 全部箱数；发货 = 已发货 ÷ 全部箱数。 */
.dash-proj-row { padding: 8px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.dash-proj-row:last-child { border-bottom: none; }
.dash-proj-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dash-proj-top .dash-recent-main { flex: 1; min-width: 0; }
.dash-proj-total { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dash-proj-prog {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px;
  align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted);
}
.dash-proj-prog .dash-bar-track { height: 7px; }
.dash-proj-prog .dash-bar-fill.is-ship { background: var(--success); }
.dash-proj-num { white-space: nowrap; text-align: right; }
@media (max-width: 720px) {
  .dash-bar-row { grid-template-columns: minmax(0, 1fr) 74px 40px; }
  .dash-bar-num { display: none; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 11px 16px;
}
.brand { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-logo { height: 46px; width: auto; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
/* 顶栏「公司名称 → 主页」：列表页（唯一显示公司名的一页）回首页的快捷入口 */
.brand-home { flex-shrink: 0; margin-left: 4px; }
@media (max-width: 560px) {
  /* 手机上公司名要截断，按钮也跟着缩一点，别把公司名挤没 */
  .brand-home { padding: 5px 8px; font-size: 13px; margin-left: 0; }
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-right .muted { white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.menu-wrap { position: relative; }
.menu-drop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.menu-item {
  display: flex; align-items: center; width: 100%; text-align: left; padding: 9px 12px;
  border: none; background: transparent; font-size: 14px; color: var(--text);
  border-radius: 8px; cursor: pointer;
}
.menu-item:hover { background: #f3f4f6; }
.btn.account { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container { max-width: 1040px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.head-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field.wide { grid-column: 1 / -1; }
input, select {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

/* 密码显示/隐藏 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 56px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 4px 6px; line-height: 1;
}
.pw-toggle:hover { color: var(--primary); }
.pw-toggle.on { color: var(--primary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f3f4f6; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; }

/* ---------- 登录 ---------- */
#view-login {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(160deg, #eef4ff 0%, #f4f5f7 45%, #eef7f1 100%);
}
.login-box {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 36px 28px 28px;
}
.login-logo { width: 250px; max-width: 78%; height: auto; margin: 0 0 16px; }
.login-company { margin: 0 0 2px; font-size: 19px; font-weight: 700; color: var(--text); }
.login-app { margin: 0 0 6px; font-size: 15px; color: var(--muted); }
.login-box p.muted { margin: 0 0 22px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; text-align: left; }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 16px;
}
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-draft .stat-value { color: var(--warning); }
.stat-done .stat-value { color: var(--success); }
.stat-rows .stat-value { color: var(--primary); }
.stat-shipped .stat-value { color: #7c3aed; }

/* ---------- 出入库台账 ---------- */
.ledger-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.ledger-filters .field { margin: 0; min-width: 190px; }
/* 箱号、长宽高内容短，别占一整格宽度，一行能放下 */
.ledger-filters .field.narrow { min-width: 104px; }
.ledger-filters .field.narrow input { text-align: center; }
/* 说明默认收起：这一颗按钮紧跟「重置筛选」排在右边（用户 2026-11-13 口径） */
.ledger-filters .ledger-help-btn { margin-left: auto; }
.ledger-help { margin: 4px 0 2px; padding: 10px 14px; background: #fafbfc;
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ledger-help .muted { margin: 0 0 6px; }
.ledger-help .muted:last-child { margin-bottom: 0; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.ledger-table th, .ledger-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* ---------- 台账：一列一个筛选（表头下面那行） ----------
   两行表头都是 sticky：第一行钉在顶 0，第二行钉在 32px（第一行的高度写死，
   不然第二行会盖在第一行上）。 */
#view-ledger .ledger-table thead tr:first-child th { height: 32px; padding-top: 0; padding-bottom: 0; }
#view-ledger .ledger-table thead tr.ledger-filter-row th {
  top: 32px; padding: 4px 6px; background: #fff; z-index: 2;
}
#view-ledger .ledger-table thead tr.ledger-filter-row th { min-width: 92px; }
/* 日期两列是一对日历框（上「从」下「到」），一列放得下，点一下弹日历 */
#view-ledger .ledger-table thead tr.ledger-filter-row th.ld-date-cell { min-width: 160px; }
#view-ledger .ledger-table thead tr.ledger-filter-row .ld-date-pair { display: flex; flex-direction: column; gap: 3px; }
#view-ledger .ledger-table thead tr.ledger-filter-row .ld-date-pair input { min-width: 0; }
/* 日期旁边那个 ×（app.js 动态加的）：选了日期才露出来，点一下整格清空。
   空着时只是 visibility: hidden，位置照占 —— 不然清掉一个日期整格会跳一下。 */
#view-ledger .ledger-filter-row .ld-date-box { display: flex; align-items: center; gap: 3px; width: 100%; min-width: 0; }
#view-ledger .ledger-filter-row .ld-date-box input { flex: 1 1 auto; width: auto; min-width: 0; }
#view-ledger .ledger-filter-row .ld-date-clear {
  flex: 0 0 auto; width: 20px; height: 26px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; background: #fff;
  color: var(--muted); font-size: 14px; line-height: 1; visibility: hidden;
}
#view-ledger .ledger-filter-row .ld-date-clear.show { visibility: visible; }
#view-ledger .ledger-filter-row .ld-date-clear:hover {
  color: #b91c1c; border-color: #fca5a5; background: #fef2f2;
}
#view-ledger .ledger-table thead tr.ledger-filter-row input,
#view-ledger .ledger-table thead tr.ledger-filter-row select {
  width: 100%; min-width: 72px; padding: 4px 6px; font-size: 12px;
  border-radius: 4px; height: 26px;
}
/* ---------- 台账：按项目归类 ---------- */
#view-ledger .ledger-table tbody tr.ledger-group { cursor: pointer; user-select: none; background: #f8fafc; }
#view-ledger .ledger-table tbody tr.ledger-group:hover { background: #eff6ff; }
#view-ledger .ledger-table tbody tr.ledger-group td {
  padding: 8px 10px; border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--primary); white-space: nowrap;
}
.ledger-group .g-chevron { display: inline-block; margin-right: 4px; color: var(--muted); transition: transform .15s; }
.ledger-group.open .g-chevron { transform: rotate(90deg); }
.ledger-group .g-stats { margin-left: 12px; font-weight: 400; font-size: 12px; color: var(--muted); }
/* 组头上「未打包」：有没打包的量就标橙，收起来时一眼看得出哪个项目还欠货 */
#view-ledger .ledger-group .g-unpacked.has-left { color: #b45309; font-weight: 700; }
.ledger-group .g-name { font-weight: 400; color: var(--muted); }
/* 增补件跟踪：也按项目折叠，组头样式跟设备台账一致 */
.pt-table tbody tr.pb-track-group { cursor: pointer; user-select: none; background: #f8fafc; }
.pt-table tbody tr.pb-track-group:hover { background: #eff6ff; }
.pt-table tbody tr.pb-track-group td {
  padding: 8px 10px; border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--primary); white-space: nowrap;
}
/* 一周内到货：逾期的红底、两天内到期的黄底 */
.pt-table tbody tr.pb-due-late { background: #fef2f2; }
.pt-table tbody tr.pb-due-soon { background: #fffbeb; }
/* 表头固定在顶上：往下翻行的时候，表头一直留在原处。
   ★ 光写 position: sticky 没用 —— 外面那层 .table-wrap 只要带 overflow，
     它自己就是个滚动容器，可高度又是「跟内容一样高」永远滚不动，
     表头就跟着整页一起滚走了（这就是以前的表现）。
     所以往下滚到表格贴住顶栏时给它封个顶（一屏高），让表身自己滚，
     粘住的表头才有地方粘。封顶这件事由 app.js 的 pinLedgerTables 加类来控制 ——
     刚进台账时先别封顶，整页照常滚，免得一上来就在半截高的框里滚。 */
#view-ledger .table-wrap,
#view-bom-ledger .table-wrap { overflow: auto; }
#view-ledger .table-wrap.ld-pinned,
#view-bom-ledger .table-wrap.ld-pinned {
  max-height: calc(100vh - 76px);      /* 老浏览器兜底 */
  max-height: calc(100dvh - 76px);     /* 手机地址栏收起/展开时不跳 */
}
.ledger-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; z-index: 2; }
/* border-collapse 下粘住的表头，底下那条线有时会跟着内容滚走 —— 用内阴影再画一条同色的线钉住 */
.ledger-table thead th { box-shadow: inset 0 -1px 0 var(--border); border-bottom-color: transparent; }
.ledger-table tbody tr:hover { background: #f8fafc; }
/* 「未装箱」的行（导入进来还没装箱的料）：淡黄底 + 灰字，一眼跟真实入库行分开。
   hover 的浅蓝要盖得住它，所以这条排在 hover 后面。 */
.ledger-table tbody tr.ledger-pending { background: #fffdf5; color: #6b7280; }
.ledger-table tbody tr.ledger-pending:hover { background: #fdf6e3; }
/* 2026-11-13 用户口径：台账里「装箱完成、还没确认发货」的行高亮 —— 淡蓝底，
   跟上面「未装箱」的淡黄底一眼分得清；左边加一条蓝线，滚到哪都看得见。 */
.ledger-table tbody tr.ledger-wait-ship { background: #eff6ff; }
.ledger-table tbody tr.ledger-wait-ship:hover { background: #e0edff; }
.ledger-table tbody tr.ledger-wait-ship td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}
/* 作废的料（2026-11-26 用户口径）：行照常列着，但整行灰掉 + 名称旁红「已作废」，
   不用横向拉到最右边的备注列才看得见 */
.ledger-table tbody tr.ledger-void { background: #fafafa; color: #9ca3af; }
.ledger-table tbody tr.ledger-void:hover { background: #f3f4f6; }
.ledger-table tbody tr.ledger-void td:first-child {
  box-shadow: inset 3px 0 0 var(--danger, #dc2626);
}
.ledger-photos, .ledger-ship { display: flex; gap: 5px; align-items: center; }
.ledger-thumb {
  width: 56px; height: 48px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); background: #f6f8fa; cursor: zoom-in;
  transition: transform .12s, box-shadow .12s;
}
.ledger-thumb:hover { transform: scale(1.06); box-shadow: var(--shadow); }
/* 台账照片列里的「发货照片（N）」入口：跟缩略图并排，别把列撑宽 */
.ledger-ship-btn {
  align-self: center; white-space: nowrap; cursor: pointer;
  padding: 4px 8px; border-radius: 4px; font-size: 12px;
  border: 1px solid var(--border); background: #fff; color: #2563eb;
}
.ledger-ship-btn:hover { background: #eff6ff; border-color: #93c5fd; }
/* 2026-11-27：照片列改成链接，点开才加载原图（不再一开台账拉几千张图） */
.ledger-photo-link {
  border: 0; background: transparent; padding: 0; margin-right: 7px;
  cursor: pointer; color: #2563eb; font-size: 12px;
  text-decoration: underline; white-space: nowrap;
}
.ledger-photo-link:hover { color: #1d4ed8; }
/* 台账列多（14 列），页面占满整屏，别挤在 1040px 里；窄屏仍可横向滚动 */
#view-ledger .container { max-width: none; }

/* ---------- 列表页布局 ---------- */
.list-layout { display: flex; align-items: flex-start; gap: 18px; }
.list-side {
  width: 240px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: 86px;
}
.list-layout .list { flex: 1; min-width: 0; }

.filter-tabs { display: flex; background: #eceef1; border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.filter-tabs button {
  flex: 1; padding: 7px 0; font-size: 13px; font-weight: 600; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.filter-tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* 「扫码打包」下面那句提示：手机上点它是开相机、电脑上是挑照片，不说一句会有人以为点了没反应。
   窄屏那一行是横排的，让它跟筛选页签一样另起一行占满，别挤在两个按钮中间。 */
.scan-hint { margin: 0; }

/* ---------- 打包类型选择页 ---------- */
/* 六张卡片并排一行
   （设备打包 / 增补件打包 / 设备台账 / 增补件台账 / BOM表二维码 / 物料交接） */
#view-mode .container { max-width: 1320px; }
/* 卡片整体下移，避开背景照片里「北自科技」的 logo（logo 大约在视口 15%~24% 高度处） */
.mode-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-top: clamp(70px, 28vh, 340px); }
.mode-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; padding: 30px 10px; background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer; color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.mode-icon { font-size: 34px; }
.mode-title { font-size: 17px; font-weight: 700; }
.mode-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }
/* 查看权限账号看不到台账和增补单卡片，此时只排两列并居中，避免留空位 */
.mode-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; margin-left: auto; margin-right: auto; }
/* 只有一张卡（比如装配员只给了「物料交接」）：居中放，别贴在六列网格最左边 */
.mode-grid.one-col { grid-template-columns: minmax(0, 320px); max-width: 320px; margin-left: auto; margin-right: auto; }
/* 窄屏：五列放不下就退三列，再窄两列 / 单列 */
@media (max-width: 1180px) { .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .mode-grid, .mode-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .mode-grid, .mode-grid.two-col { grid-template-columns: 1fr; } }

/* ---------- 列表页页面标题 ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
/* 列表页工具栏右边的「台账 / 刷新」：靠右摆，跟左边的「← 主页」分开 */
.page-head .head-actions { margin-left: auto; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; }

@media (max-width: 720px) {
  .list-layout { flex-direction: column; }
  .list-side { width: 100%; position: static; flex-direction: row; align-items: center; }
  .list-side input { flex: 1; }
  .list-side .btn { flex-shrink: 0; width: auto; }
  .filter-tabs { order: 3; width: 100%; }
  .scan-hint { order: 4; width: 100%; }
}

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.sheet-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px 16px; transition: box-shadow .15s, border-color .15s;
}
.sheet-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.sheet-main { flex: 1; min-width: 0; }
.sheet-title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-meta { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sheet-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* 项目BOM表导入记录：一份导入出两个单子 —— 打包单 / 物料交接单。
   2026-11-13 用户口径：按钮太乱，**横排放在卡片下面**：
     标题那一行照旧，按钮条整条铺在下面一行（放不下就自动折到下一行）。
     每段前面那三个字就是「这是哪个单子」。 */
.sheet-card.doc-card { flex-wrap: wrap; align-items: flex-start; }
.sheet-card.doc-card .sheet-main { flex: 1 1 100%; }
.sheet-card.doc-card .sheet-actions.doc-actions {
  width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center;
  justify-content: flex-start; gap: 8px 18px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
}
.doc-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
/* 这一条上按钮多（两个单子各三个），比列表里别的按钮收小一号，1024 的屏也排得下 */
/* line-height 必须写死：删除按钮带 .small，那个类会把行高撑到 1.6，跟旁边的按钮差 5px */
.doc-line .btn { padding: 6px 12px; font-size: 13px; line-height: 1.2; }
.doc-name { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; margin-right: 2px; }
.doc-line-aux { margin-left: auto; }     /* 标记已下载 / 删除 靠右，跟两个单子分开 */
.empty { text-align: center; color: var(--muted); padding: 56px 0; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); margin-left: 8px; vertical-align: 2px; }
.badge.done { background: var(--success-soft); color: var(--success); }
.badge.shipped { background: var(--primary-soft); color: var(--primary-dark); }
.badge.admin { background: var(--primary-soft); color: var(--primary-dark); }
.badge.edit { background: #eef2ff; color: #4338ca; }
.badge.del-req { background: var(--danger-soft); color: var(--danger); }
/* 人工标记已发货。特意用中性灰而不是绿色：这行不是真发过货，
   只是人工结掉的，颜色上不能跟「已发货」混成一样。 */
.badge.manual { background: #f1f5f9; color: #475569; }
.sheet-card.del-req { border-color: #fca5a5; }

/* 项目分组 */
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; padding: 14px 4px 8px; border-bottom: 2px solid var(--border); }
.group-head:first-child { padding-top: 4px; }
.group-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 0 1 auto; }
.group-no { font-weight: 700; font-size: 15px; color: var(--primary); }
.group-name { font-size: 13px; color: var(--muted); }
.group-stats { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.group-side { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.group-side .btn { flex-shrink: 0; }
/* 窄屏才允许折行，桌面端所有项目组头长得一样（2026-11-28 用户口径） */
@media (max-width: 900px) { .group-head { flex-wrap: wrap; } .group-side { flex-wrap: wrap; } }
.group-head { cursor: pointer; user-select: none; }
.group-head:hover { background: #f8fafc; }
.group-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.group-chevron { flex-shrink: 0; color: var(--muted); font-size: 13px; transition: transform .15s; }
.group-head.open .group-chevron { transform: rotate(90deg); }
.group-info .group-name { padding-left: 20px; }
.group-body { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }

/* 生成记录的搜索框：单独一行，跟下面按项目折叠的组头隔开一点 */
.qr-rec-search { margin: 12px 0 4px; }

/* ---------- 步骤指示 ---------- */
.stepper { display: flex; gap: 8px; margin-bottom: 16px; }
.step {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.step .dot {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #eceef1; color: var(--muted); font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.step.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.step.active .dot { background: var(--primary); color: #fff; }

/* ---------- 拍照格子 ---------- */
.export-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .export-photos { grid-template-columns: repeat(2, 1fr); } }

.photo-slot { display: flex; flex-direction: column; gap: 6px; }
.photo-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.thumb-wrap { position: relative; }
.thumb {
  height: 96px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fafbfc;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.thumb:hover { border-color: var(--primary); background: var(--primary-soft); }
.thumb img { max-width: 100%; max-height: 100%; object-fit: cover; }
.thumb .ph { color: var(--muted); font-size: 13px; }
.photo-actions { display: flex; gap: 6px; }
.photo-actions .btn { flex: 1; padding-left: 4px; padding-right: 4px; }
.photo-input { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }
/* 图纸识别要好几秒，盖住缩略图提示一下，别让人以为卡死了 */
.thumb-busy {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .88); color: var(--primary); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px dashed var(--primary);
}
/* 拍照提示：只有图纸格子挂得出来。认得出认不出，八成取决于这一步拍得怎么样 */
.photo-hint {
  margin: 0; padding: 5px 8px; font-size: 12px; line-height: 1.45; color: var(--muted);
  background: #f6f8fa; border-left: 3px solid var(--primary); border-radius: var(--radius-sm);
}
/* 图纸识别自动填进来的格子：标黄提醒核对，工人一改就自动去掉 */
.field input.auto-filled { background: #fffbe6; border-color: #f0c36d; }
.field input.auto-filled:focus { background: #fff; }

/* ---------- 明细行卡片 ---------- */
.item-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  background: #fafbfc;
}
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; user-select: none; }
.item-card.collapsed .item-head { margin-bottom: 0; }
.item-chevron { flex-shrink: 0; color: var(--muted); font-size: 13px; transition: transform .15s; }
.item-card:not(.collapsed) .item-chevron { transform: rotate(90deg); }
.item-summary { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-summary.empty { color: var(--muted); font-weight: 500; }
.seq { font-weight: 800; color: var(--primary); font-size: 14px; flex-shrink: 0; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 14px; }
@media (max-width: 640px) { .item-grid { grid-template-columns: repeat(2, 1fr); } }
.item-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
@media (max-width: 640px) { .item-photos { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 编辑器底部 ---------- */
.editor-actions { margin: 4px 0 24px; display: flex; flex-direction: column; gap: 10px; }
#btn-to-header { margin-bottom: 12px; }
#btn-to-items { margin: 4px 0; }
.done-tip { font-weight: 700; margin-bottom: 10px; color: var(--success); }

/* ---------- 用户管理 ---------- */
#user-form .btn { margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.user-table th, .user-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.user-table thead th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.user-table tbody tr:hover { background: #f8fafc; }
.user-ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; z-index: 100; box-shadow: var(--shadow-lg); max-width: 90%;
}
.toast.ok { background: var(--success); }

/* ---------- 导出进度条（2026-11-27） ---------- */
.export-progress {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(17, 24, 39, .28);
  display: flex; align-items: center; justify-content: center;
}
.export-progress-box {
  width: min(420px, 86vw); background: #fff; border-radius: 14px;
  padding: 22px 24px; box-shadow: var(--shadow-lg);
}
.export-progress-title { font-size: 15px; font-weight: 700; color: var(--text); }
.export-progress-bar {
  height: 8px; margin: 14px 0 8px; border-radius: 999px;
  background: #eef2f7; overflow: hidden;
}
.export-progress-bar span {
  display: block; height: 100%; width: 35%; border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  animation: export-slide 1.1s ease-in-out infinite;
}
@keyframes export-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}
.export-progress-sub { font-size: 12px; color: var(--muted); }
body.is-exporting { cursor: progress; }

/* ---------- 增补单 ---------- */
/* 表单详情页的表头信息（项目号、收货人这些），一行一项，窄屏也不会挤成一团 */
.meta-table { border-collapse: collapse; font-size: 13.5px; width: 100%; }
.meta-table th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 5px 12px 5px 0; white-space: nowrap; vertical-align: top; width: 1%;
}
.meta-table td { padding: 5px 16px 5px 0; }
.meta-table tr + tr th, .meta-table tr + tr td { border-top: 1px solid var(--border); }

/* 二维码那一块 */
.qr-flex { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qr-img {
  width: 150px; height: 150px; padding: 4px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; flex-shrink: 0;
}
.qr-side { flex: 1; min-width: 220px; }
.qr-side p { margin: 0 0 6px; }
.qr-url {
  font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px;
  word-break: break-all; background: #f6f8fa; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; margin: 4px 0 10px; color: var(--text);
}
.small { font-size: 12px; line-height: 1.6; }
code {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  background: #f0f2f5; border-radius: 4px; padding: 1px 5px;
}

/* 勾选打包 */
.pack-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 6px; }
.pack-head .field { flex: 1; min-width: 190px; }
.pack-head .field.narrow { flex: 0 0 150px; }
#bom-pack-hint { margin: 0 0 12px; }
.bom-row {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
  transition: border-color .15s, background .15s;
}
/* 勾中的行标出来 —— 用 JS 加类，不用 :has()，老手机浏览器不一定支持 */
.bom-row.picked { border-color: var(--primary); background: var(--primary-soft); }
.bom-row-head {
  display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
}
.bom-pick { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.bom-row-title { font-weight: 700; font-size: 15px; }
.bom-row-name { font-size: 13.5px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bom-row-body { padding-left: 30px; }
.bom-row-body p { margin: 8px 0 10px; }
.bom-row-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.bom-row-fields .field { flex: 1; min-width: 140px; }
.bom-row-fields .field.narrow { flex: 0 0 130px; }
/* 「标记已发货」那一行：不装箱的行（外购件之类）人工结掉用的 */
.bom-row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pack-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  position: sticky; bottom: 0; background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px); padding: 12px 0; margin-top: 14px;
  border-top: 1px solid var(--border);
}
.pack-sum { color: var(--muted); font-size: 13.5px; }

/* ---------- BOM表二维码生成 ---------- */
/* 入口小卡片：首页那张卡点进来先看这个 */
.qr-entries { display: grid; grid-template-columns: 1fr; gap: 14px; }
.qr-entries .mode-card { margin: 0; }
.stamp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.stamp-table thead th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  padding: 0 10px 6px 0; white-space: nowrap;
}
.stamp-table td {
  padding: 7px 10px 7px 0; vertical-align: middle;
  border-top: 1px solid var(--border); word-break: break-all;
}
/* 尺寸（长/宽/高）和数量这类数字**不许换行** —— 手机上「1900」被 break-all 劈成
   「190」「0」两行，工人认不出来是多少。设备清单那几栏就是靠这一条撑开的。 */
.stamp-table .num { white-space: nowrap; }
/* 扫进来的码里带了行号时，把对应的那一条料标出来（不然几十行里找不到刚扫的是哪条） */
.stamp-table tr.focus td { background: var(--primary-soft); font-weight: 600; }

/* 生成记录：一批一行，带「已下载/未下载」。
   增补单页和二维码那两页共用这一套（app.js 里的 recordCard()），别只改一边。 */
.qr-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-rec-main { flex: 1; min-width: 200px; }
.qr-rec-title { font-weight: 700; font-size: 14.5px; }
.qr-rec-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- 物料交接（装配车间来料确认） ---------- */
/* 齐套横幅：绿=齐套（可以组织装配）、橙=部分到货、灰=一件没到。
   车间看一眼就知道今天能不能开工，所以放在整页最上面、字要大。 */
.hv-banner {
  font-size: 17px; font-weight: 700; padding: 10px 14px; border-radius: var(--radius-sm);
  background: #f3f4f6; color: var(--muted);
}
.hv-banner.ready { background: var(--success-soft); color: var(--success); }
.hv-banner.partial { background: var(--warning-soft); color: var(--warning); }
.hv-banner.none { background: #f3f4f6; color: var(--muted); }
.hv-bar {
  height: 10px; border-radius: 999px; background: #eef0f3; margin: 12px 0 8px; overflow: hidden;
}
.hv-bar > span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--success); transition: width .2s;
}
#hv-status-hint { margin: 0; }

/* ---------- 物料交接：交接总表（跟设备台账那张表刻意做成两样） ----------
   台账是「筛选卡 + 四张数字卡 + 20 列全宽大表」；
   这一页是「合并过的总览条 + 8 列全宽大表」：设备名称 / 配件名称 / 图号 / 数量 /
   收到数量 / 未收到数量 / 到齐 / 未到齐。采购 / 喷塑 / 镀锌 / 无需表面处理
   全部并进这一张表（用户 2026-11-12 口径），横着铺满整屏，搜索在顶栏里。 */
.hv-container { max-width: none; }
.hv-search {
  width: 250px; padding: 8px 12px; font-size: 13.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); outline: none;
}
.hv-search:focus { border-color: var(--primary); }
.hv-table-wrap {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow-sm);
}
.hv-table {
  width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 13px;
  table-layout: fixed;              /* 列宽按下表定死，别让 12 列自己乱抢 */
}
/* 12 列的宽度分配（项目号 / 项目名称 / 设备名称 / 类别 / 配件名称 / 图号 /
   数量 / 收到数量 / 未收到数量 / 到齐 / 未到齐 / 收到·到齐）：
   文字列给够、数字列压窄、最后勾选那列按内容定宽 */
.hv-table thead tr:first-child th:nth-child(1) { width: 104px; }  /* 项目号 */
.hv-table thead tr:first-child th:nth-child(2) { width: 136px; }  /* 项目名称 */
.hv-table thead tr:first-child th:nth-child(3) { width: 116px; }  /* 设备名称 */
.hv-table thead tr:first-child th:nth-child(4) { width: 96px; }   /* 类别 */
.hv-table thead tr:first-child th:nth-child(5) { width: 190px; }  /* 配件名称 */
.hv-table thead tr:first-child th:nth-child(6) { width: 120px; }  /* 图号 */
.hv-table thead tr:first-child th:nth-child(7) { width: 60px; }   /* 数量 */
.hv-table thead tr:first-child th:nth-child(8) { width: 72px; }   /* 收到数量 */
.hv-table thead tr:first-child th:nth-child(9) { width: 84px; }   /* 未收到数量 */
.hv-table thead tr:first-child th:nth-child(10) { width: 74px; }  /* 到齐 */
.hv-table thead tr:first-child th:nth-child(11) { width: 74px; }  /* 未到齐 */
.hv-table thead tr:first-child th:nth-child(12) { width: 210px; } /* 收到 / 到齐 */
.hv-table thead th {
  position: sticky; top: 0; z-index: 1; background: #f8fafc; color: var(--muted);
  font-weight: 600; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
/* 表头两行都粘住：第一行钉顶 0，筛选行钉在第一行下面（高度写死，别让两行叠一起） */
.hv-table thead tr:first-child th {
  height: 34px; padding-top: 0; padding-bottom: 0;
  box-shadow: inset 0 -1px 0 var(--border);
}
.hv-filter-row th {
  top: 34px; z-index: 2; background: #fff; padding: 4px 6px;
  border-bottom: 1px solid var(--border);
}
.hv-filter-row input, .hv-filter-row select {
  width: 100%; min-width: 0; height: 26px; padding: 4px 6px;
  font-size: 12px; border: 1px solid var(--border-strong);
  border-radius: 4px; background: #fff; color: var(--text); outline: none;
}
.hv-filter-row input:focus, .hv-filter-row select:focus { border-color: var(--primary); }
/* 类别小标签：跟工序的先后顺序一个颜色，扫一眼分得开 */
.hv-cat-tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; white-space: nowrap;
  background: #eef4ff; color: #1d4ed8;
}
.hv-cat-tag[data-gx="喷塑"] { background: #fff7e6; color: #b45309; }
.hv-cat-tag[data-gx="镀锌"] { background: #e6faf6; color: #0f766e; }
.hv-cat-tag[data-gx="发黑"] { background: #f3f4f6; color: #4b5563; }
.hv-cat-tag[data-gx="镀铬"] { background: #f5f0ff; color: #6d28d9; }
.hv-cat-tag[data-gx="无需表面处理"] { background: #ecfdf3; color: #15803d; }
/* 项目号 / 项目名称拆成两列之后设备名称只剩一行，行高可以压矮（2026-11-13 用户口径） */
.hv-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hv-table tbody tr:last-child td { border-bottom: 0; }
/* 料行本身不跳清单（点物料不用跳转了）；只有最后那个「清单」小字进得去 */
.hv-table tbody tr.hv-item { cursor: default; }
.hv-table tbody tr:hover { background: #f8fafc; }
/* 交接总表按项目分组：组头跟设备台账一个样子（▸ 收起 / 转 90° 展开），点一下切换 */
.hv-table tbody tr.hv-group { cursor: pointer; user-select: none; background: #f8fafc; }
.hv-table tbody tr.hv-group:hover { background: #eff6ff; }
.hv-table tbody tr.hv-group td {
  padding: 6px 10px; border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--primary); white-space: nowrap;
}
.hv-table tbody tr.hv-group .g-chevron {
  display: inline-block; margin-right: 4px; color: var(--muted); transition: transform .15s;
}
.hv-table tbody tr.hv-group.open .g-chevron { transform: rotate(90deg); }
.hv-table tbody tr.hv-group .g-name { font-weight: 400; color: var(--muted); }
.hv-table tbody tr.hv-group .g-stats {
  margin-left: 12px; font-weight: 400; font-size: 12px; color: var(--muted);
}
/* 最后一列直接勾「收到 / 到齐」：勾完就存，不用点进清单 */
.hv-tick { white-space: nowrap; }
.hv-tick label {
  display: inline-flex; align-items: center; gap: 3px; margin-right: 8px;
  font-size: 12px; cursor: pointer;
}
.hv-tick label:last-child { margin-right: 0; }
.hv-tick input { margin: 0; cursor: pointer; }
/* 导出弹窗：搜项目 → 勾选 → 已选小条 */
.hv-exp-search {
  width: 100%; margin-top: 10px; padding: 9px 12px; font-size: 14px;
}
.hv-exp-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 12px 0 6px; font-size: 13px; font-weight: 600;
}
.hv-exp-tools { display: flex; gap: 6px; }
.hv-exp-projects {
  max-height: 230px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 8px; padding: 2px 10px; background: #fff;
}
.hv-exp-p {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px dashed var(--border); cursor: pointer; font-size: 13px;
}
.hv-exp-p:last-child { border-bottom: 0; }
/* ★ 全局那条 `input, select { width:100%; padding:10px 12px }` 会把勾选框撑得老大，
   这里显式定死 16px（跟 .item-check / .perm-item 的处理一个道理） */
.hv-exp-p input[type="checkbox"] {
  flex: 0 0 auto; width: 16px; height: 16px; margin: 0; padding: 0;
  cursor: pointer; accent-color: var(--primary);
}
.hv-exp-p .hv-exp-no {
  flex: 0 0 auto; min-width: 88px; font-weight: 700; font-size: 14.5px;
}
.hv-exp-p .hv-exp-name {
  flex: 1 1 auto; min-width: 0; font-size: 13px; color: #333;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hv-exp-p .hv-exp-num { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.hv-exp-p.on { background: #f3f7ff; border-radius: 6px; }
.hv-exp-picked {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 40px; padding: 8px 10px; border: 1px dashed var(--border);
  border-radius: 8px; background: #fafbfc;
}
.hv-exp-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 4px 3px 10px; border: 1px solid #c9dbff; border-radius: 999px;
  background: #eef4ff; font-size: 13px; font-weight: 600;
}
.hv-exp-chip-name {
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 400; color: #555;
}
.hv-exp-chip button {
  flex: 0 0 auto; width: 18px; height: 18px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: #777; font-size: 14px;
  line-height: 18px; cursor: pointer;
}
.hv-exp-chip button:hover { background: #d8e6ff; color: #1d4ed8; }
.hv-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 项目号 / 项目名称各占一列，设备名称那格就只剩机型一行了 */
.hv-pno { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hv-pname { min-width: 96px; }
.hv-dev { min-width: 120px; }
.hv-dev-name { font-weight: 600; }
.hv-code { word-break: break-all; }   /* 列宽定死以后图号太长就折行，别顶到隔壁列 */
.hv-tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; white-space: nowrap;
}
.hv-tag.ok { background: var(--success-soft); color: var(--success); }
.hv-tag.owe { background: var(--warning-soft); color: var(--warning); }
.hv-empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.hv-hint { margin: 10px 2px 0; }
@media (max-width: 820px) {
  .hv-search { width: 150px; }
}

/* 扫项目BOM表的码进来：这张表拆出的几张工序清单，横着排一排切换 */
.hv-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
}
.hv-tab {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: #fff; color: var(--text); font-size: 13px; cursor: pointer;
}
.hv-tab b { font-size: 13.5px; font-weight: 600; }
.hv-tab span { font-size: 11.5px; color: var(--muted); }
.hv-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.hv-tab.on span { color: #e5edff; }
/* 「已到齐 N 条不显示了」那一行（手机上勾完就收起来） */
.hv-done-line { margin: 2px 2px 8px; }

/* 一行料：左边数量圆牌（绿=到齐、橙=只收到、灰=没到），右边两个勾 */
.hv-rows { margin: 6px 0 14px; }
.hv-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: #fff;
}
.hv-row.got { border-left-color: var(--success); background: var(--success-soft); }
.hv-row.part { border-left-color: var(--warning); background: var(--warning-soft); }
.hv-qty {
  flex-shrink: 0; min-width: 54px; text-align: center;
  font-weight: 700; font-size: 15px; padding: 4px 8px; border-radius: 999px;
  background: #eef0f3; color: var(--muted);
}
.hv-row.got .hv-qty { background: var(--success); color: #fff; }
.hv-row.part .hv-qty { background: var(--warning); color: #fff; }
.hv-main { flex: 1; min-width: 160px; }
.hv-no { font-weight: 700; font-size: 14.5px; word-break: break-all; }
.hv-name { font-size: 13.5px; }
.hv-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
/* 「收到」「到齐」两个勾并排；到齐那个勾橙色一点，跟横幅呼应 */
.hv-checks { display: flex; gap: 12px; flex-shrink: 0; }
.hv-check {
  display: flex; align-items: center; gap: 5px; font-size: 13.5px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.hv-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.hv-check input:disabled { cursor: default; }
/* 「部分收到」要填的到货数量：只在勾了「部分收到」、还没到齐时才露出来 */
.hv-recv-qty {
  width: 62px; height: 26px; padding: 2px 6px; font-size: 12.5px;
  border: 1px solid var(--border-strong); border-radius: 4px;
  background: #fff; color: var(--text); outline: none;
}
.hv-recv-qty:focus { border-color: var(--primary); }
.hv-recv-qty.off { display: none; }
.hv-checks .hv-recv-qty { width: 70px; }

/* 交接记录：一条一次提交（谁、哪个部门、当时收到/到齐多少、备注） */
.hv-receipt { padding: 10px 0; border-top: 1px solid var(--border); }
.hv-receipt:first-child { border-top: 0; }
.hv-receipt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* 手机上：两个勾换到第二行，别把料号挤成一条细缝 */
@media (max-width: 560px) {
  .hv-checks { width: 100%; justify-content: flex-end; }
}

/* ---------- 增补单打印版 ---------- */
.print-sheet {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 14mm 12mm; max-width: 210mm; margin: 0 auto;
}
.print-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  border-bottom: 2px solid #111827; padding-bottom: 10px; margin-bottom: 12px;
}
.print-head-text { flex: 1; min-width: 0; }
.print-company { font-size: 13px; color: #374151; }
.print-title { font-size: 26px; font-weight: 800; letter-spacing: 8px; margin: 2px 0 10px; }
.print-meta { border-collapse: collapse; font-size: 12.5px; }
.print-meta th {
  text-align: left; color: #4b5563; font-weight: 600;
  padding: 2px 8px 2px 0; white-space: nowrap; vertical-align: top;
}
.print-meta td { padding: 2px 18px 2px 0; }
.print-qr-wrap { text-align: center; flex-shrink: 0; }
.print-qr { width: 30mm; height: 30mm; display: block; }
.print-qr-tip { font-size: 10px; color: #4b5563; margin-top: 2px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.print-table th, .print-table td { border: 1px solid #9ca3af; padding: 5px 8px; }
.print-table thead th { background: #f3f4f6; font-weight: 700; }
.print-table .c-seq { width: 14mm; text-align: center; }
.print-table .c-no { width: 56mm; }
.print-table .c-cz { width: 26mm; }        /* 项目BOM表那份多一列「材质」 */
.print-table .c-yj { width: 24mm; }        /* 物料交接单多一列「预计到货」 */
.print-table .c-qty { width: 20mm; text-align: right; }

/* 物料交接单：一个工序一张纸。屏幕上用虚线隔开，打印时每张从新的一页开始。 */
.hv-print-page + .hv-print-page {
  margin-top: 18px; padding-top: 18px; border-top: 2px dashed var(--border);
}
.print-foot { margin-top: 8px; font-size: 12px; color: #4b5563; }

/* ---------- 装箱单打印版 ----------
   跟 Excel 那张「打印版」同口径：只印 A～I（表头 + 明细），照片和出口附件不印。
   版式照 templates/qingdan_template.xlsx 的打印区域摆，用 mm/pt 写，打印出来尺寸才稳。 */
.pl-print { color: #111; font-size: 10pt; }
/* 抬头那一行：logo 在左、收货信息在右（规则4.0）。没有收货信息时就只剩 logo，
   版式跟以前一模一样。 */
.pl-print .bp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6mm; }
.pl-print .bp-logo { display: block; height: 14mm; width: auto; margin-bottom: 1mm; }
.pl-print .bp-recv {
  font-size: 9pt; line-height: 1.6; text-align: left;
  min-width: 50mm; max-width: 95mm; overflow-wrap: anywhere;
}
.pl-print .bp-title {
  text-align: center; font-size: 22pt; font-weight: 800;
  letter-spacing: 6px; margin: 1mm 0 3mm;
}
.pl-print .bp-info { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pl-print .bp-info th, .pl-print .bp-info td { border: 1px solid #555; padding: 1.6mm 2mm; }
.pl-print .bp-info th {
  background: #f3f4f6; text-align: center; font-weight: 700; white-space: nowrap;
}
.pl-print .bp-info td { text-align: center; }
.pl-print .bp-info td.big { font-size: 14pt; font-weight: 800; }
.pl-print .bp-info td.boxno { font-size: 20pt; font-weight: 800; }
.pl-print .bp-notice {
  border: 1px solid #555; border-top: none; margin-top: -1px;
  padding: 2mm; font-size: 8pt; line-height: 1.55; white-space: pre-line;
}
.pl-print .bp-section { text-align: center; font-weight: 700; padding: 2.4mm 0 1.4mm; font-size: 11pt; }
.pl-print .bp-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10pt; }
.pl-print .bp-table th, .pl-print .bp-table td {
  border: 1px solid #555; padding: 1.4mm 1.6mm; word-break: break-all;
}
/* 列宽由后端按内容算好（跟 PDF 同一套）：放得下的列走 .nw 强制一行，
   放不下的列才折行 —— 老板要的「格子自动调整、尽量不要换行」。 */
.pl-print .bp-table th, .pl-print .bp-table td.nw { white-space: nowrap; }
.pl-print .bp-table thead th { background: #f3f4f6; text-align: center; }
.pl-print .bp-table .c-seq, .pl-print .bp-table .c-size,
.pl-print .bp-table .c-qty, .pl-print .bp-table .c-wt { text-align: center; }

/* ---------- 打印 ----------
   原来整个项目一条打印样式都没有，直接 Ctrl+P 打出来是带顶栏和按钮的一团。
   这里只做两件事：正在看打印版时，只印那张纸；其它页把顶栏和按钮去掉。 */
@media print {
  /* 整页统一 7mm：装箱单打印版跟导出 PDF 用同一条边（PDF 页边距 56px@200dpi ≈ 7mm），
     这样打印出来的可印宽度、列宽比例跟 PDF 一模一样。
     ★ 以前这里用的是「命名分页」（@page boxlist + page: boxlist）单给装箱单设 7mm，
       那是 Chromium 分页引擎里最不稳的一块：不同版本对命名页的处理不一样，
       有的版本会干脆印出一张全白的纸（车间遇到的就是这个）。
       现在不用命名页了 —— 整份统一 7mm，增补单那张靠 .print-sheet 的 5mm 内边距补回 12mm，
       两边版式跟以前一模一样。 */
  @page { size: A4 portrait; margin: 7mm; }
  /* 增补单打印版原来吃的是 12mm 页边距；现在页边距 7mm，这里补 5mm 内边距，
     可印区域还是 186mm 宽、273mm 高，跟改之前同一份版式。 */
  body.printing-bom #view-bom-print .print-sheet { padding: 5mm; }
  body { background: #fff; }
  .topbar, .toast, .preview, .modal, .pack-actions, .no-print,
  #btn-bom-do-print, .sidebar { display: none !important; }
  /* 打印时别让「左列 + 右内容」那套弹性布局把纸挤窄 */
  .app-body, .app-main { display: block !important; }
  .view { min-height: 0; }
  .container { max-width: none; padding: 0; margin: 0; }
  .print-sheet {
    border: none; border-radius: 0; padding: 0; margin: 0;
    box-shadow: none; max-width: none;
  }
  /* 表头每页重复，行不要被切成两半 */
  .print-table thead { display: table-header-group; }
  .print-table tr { break-inside: avoid; page-break-inside: avoid; }
  .pl-print .bp-table thead { display: table-header-group; }
  .pl-print .bp-table tr { break-inside: avoid; page-break-inside: avoid; }
  /* 在打印版这一页时，只印它自己（.hidden 是 !important，得用同样强的规则盖掉） */
  body.printing-bom .view { display: none !important; }
  body.printing-bom #view-bom-print { display: block !important; }
  /* 物料交接单：每个工序一张纸（第一张不用加分页） */
  .hv-print-page + .hv-print-page {
    break-before: page; page-break-before: always;
    margin-top: 0; padding-top: 0; border-top: 0;
  }
  body.printing-box .view { display: none !important; }
  body.printing-box #view-box-print { display: block !important; }
}

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.modal-box { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin: 0 0 14px; font-size: 16px; }
.modal-box.wide { max-width: 720px; }
.modal-box.xwide { max-width: 1240px; }
/* 编辑账号：权限一大堆，440px 太挤（2026-11-20 用户口径：加大、加宽） */
.modal-box.user-edit-box { max-width: 980px; max-height: 92vh; padding: 24px 26px; }
@media (min-width: 900px) {
  .user-edit-box .perm-grid { grid-template-columns: 1fr 1fr 1fr; gap: 12px 18px; }
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- 物料明细：勾选表 ---------- */
/* 明细上面那条：搜索框 + 「全勾」。 */
.item-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-bar input { flex: 1; min-width: 0; }
.item-bar .btn { flex: none; width: auto; }
.items-count { margin-bottom: 10px; }
.items-empty { padding: 12px 2px; }
.pick-group { padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  background: #f5f8fc; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* 勾选框（卡片头上的、候选行上的都是它）。全局那条 `input { width: 100% }` 要盖掉，
   不然勾选框会被拉成一整行宽。 */
.item-check { display: flex; align-items: center; flex: none; cursor: pointer; }
.item-check input[type="checkbox"] { width: 20px; height: 20px; margin: 0; padding: 0;
  flex: none; accent-color: var(--primary); cursor: pointer; }

/* 还没勾的候选行：单子上的料、全库搜出来的。点这一行就勾上（变回卡片）。
   勾选框本身不接鼠标事件 —— 点哪儿都走整行那一下，省得勾了又取消。 */
.cand-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.cand-row:hover { background: #eef4fb; border-color: var(--border-strong); }
.cand-row > .item-check { pointer-events: none; }
.cand-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cand-main b { font-size: 14.5px; font-weight: 600; }
.cand-where { flex: none; text-align: right; }

/* ---------- 装箱清单预览 ---------- */
/* 按 templates/qingdan_template.xlsx 的版式还原：18 列表格，表头 9 行 + 明细行 */
.pl-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.pl-meta b { color: var(--text); }
.pl-sheet { border-collapse: collapse; table-layout: fixed; font-size: 15.5px; background: #fff; }
.pl-sheet td { border: 1px solid #9fb3c8; padding: 4px 5px; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
.pl-blank { border: none !important; }
.pl-title-cell { font-size: 24px; font-weight: 700; letter-spacing: 6px; height: 54px; }
.pl-hdr { background: #eef4fb; font-weight: 600; }
.pl-label { background: #f5f8fc; font-weight: 600; color: #33475b; }
.pl-value { font-weight: 600; }
.pl-value-big { font-size: 17.5px; }
.pl-notice { text-align: left; font-size: 14px; line-height: 1.5; color: #33475b; white-space: pre-line; padding: 6px 8px; }
.pl-req { font-size: 13px; line-height: 1.35; color: #5b6b7c; padding: 4px 3px; }
.pl-left { text-align: left; }
.pl-photo-cell { padding: 2px; }
.pl-photo-cell img { max-width: 100%; max-height: 120px; display: block; margin: 0 auto; cursor: zoom-in; }
.pl-none { color: #b6c2cf; font-size: 13px; }

/* ---------- 照片预览 ---------- */
.preview { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.preview-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.9); }
.preview img { position: relative; max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 6px; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6); }
#preview-close { position: absolute; top: 14px; right: 14px; }

/* ---------- 主页背景图（公司实景，登录页 + 打包类型选择页） ---------- */
/* 上面叠一层很淡的白色渐变，保证照片上的白色卡片和文字依然清晰（压太厚会把照片洗淡、显糊） */
#view-login, #view-mode {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.30) 100%),
    url("/img/background.jpg?v=20261018");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* ---------- 账号权限勾选（账号管理页 / 编辑账号弹窗） ---------- */
/* 4 个权限组成 4 张小组卡，两列铺开；一屏能看全 24 项，勾错了一眼看得见 */
.perm-block { margin-top: 6px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 8px 0 10px; }
.perm-group { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.perm-group-name { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.perm-item { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; padding: 3px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; }
.perm-item span { flex: 1 1 auto; min-width: 0; }
.perm-item:hover { background: rgba(37, 99, 235, 0.05); }
/* 勾上的那一行淡蓝底，一眼看出选了哪些（老浏览器不认 :has 就只是没底色，不影响功能） */
.perm-item:has(input:checked) { background: rgba(37, 99, 235, 0.09); }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0 2px; cursor: pointer; }
.check-line span { flex: 1 1 auto; min-width: 0; }
/* ★ 复选框必须显式定尺寸：全局那条 `input, select { width: 100%; padding: 10px 12px }`
   对 checkbox 一样生效，会把方框撑满整行、把右边的文字挤成一列（竖排）。
   写法跟明细行的 .item-check、BOM 表的 .bom-pick 保持一致。 */
.perm-item input[type="checkbox"], .check-line input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; padding: 0;
  flex: none; accent-color: var(--primary); cursor: pointer;
}
/* 16px 的框对着 13px 的文字（行高 1.5≈19.5px），往下挪 2px 跟第一行文字对齐 */
.perm-item input[type="checkbox"] { margin-top: 2px; }
@media (max-width: 720px) { .perm-grid { grid-template-columns: 1fr; } }

.perm-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

/* ---------- 确认发货：快递单号 + 照片（可多张） ---------- */
/* 列表卡片上那行留底信息（只在「已发货」且有单号/照片时才画出来） */
.sheet-ship { color: var(--muted); font-size: 12px; margin-top: 4px; }
.sheet-ship b { color: var(--text); font-weight: 600; }
/* 卡片上的文字按钮：看着像链接，点着还是按钮 */
.link-btn {
  background: none; border: 0; padding: 0; margin: 0 0 0 8px;
  color: var(--primary); font-size: 12px; cursor: pointer; text-decoration: underline;
}
.link-btn:hover { color: var(--primary-dark); }

/* ---------- 多箱发货（2026-11-28） ---------- */
.modal-box.extra-wide { max-width: 1180px; width: 97vw; }
.ms-tabs { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.ms-tabs #ms-search { flex: 0 1 230px; min-width: 180px; max-width: 230px; }
.ms-tabs #ms-vehicle {
  width: 128px; min-width: 128px; max-width: 128px; flex: 0 0 128px;
  height: 36px; padding: 0 10px; font-size: 14px;
}
.ms-list {
  max-height: 70vh; min-height: 420px; overflow: auto; border: 1px solid var(--border);
  border-radius: 10px; background: #fbfcfe;
}
.ms-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ms-head-row, .ms-row {
  display: grid; align-items: center; gap: 10px; padding: 8px 14px;
  grid-template-columns: 26px 150px 1.1fr 1fr 70px 120px 120px 96px 190px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.ms-head-row {
  position: sticky; top: 0; z-index: 2; background: #f1f5f9;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.ms-row { cursor: pointer; }
.ms-row.shipped { background: #fafafa; color: var(--muted); }
.ms-row:last-child { border-bottom: 0; }
.ms-row:hover { background: #f3f7ff; }
.ms-no { font-weight: 700; white-space: nowrap; }
.ms-proj { color: var(--text); white-space: nowrap; }
.ms-dev { color: var(--muted); white-space: nowrap; }
.ms-meta { color: var(--muted); margin-left: auto; white-space: nowrap; }
.ms-plate {
  background: #eff6ff; color: #1d4ed8; border-radius: 6px;
  padding: 1px 8px; font-size: 12px; white-space: nowrap;
}
.ms-plate.none { background: #f3f4f6; color: var(--muted); }
.ms-tag.done {
  background: var(--success-soft); color: var(--success);
  border-radius: 999px; padding: 1px 8px; font-size: 12px;
}
.ms-tag.wait {
  background: var(--warning-soft); color: var(--warning);
  border-radius: 999px; padding: 1px 8px; font-size: 12px;
}
.ms-hint { margin: 6px 0 0; }
.ms-foot { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; }
.ms-foot .field { flex: 0 0 260px; margin: 0; }
.ms-foot .field input { height: 38px; font-size: 15px; }
.ms-foot .ship-photo-block { margin-top: 0; flex: 1; }

.ship-photo-block { margin-top: 14px; }
.ship-photo-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ship-photo-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 8px; }
.ship-photo-item {
  position: relative; width: 88px; height: 88px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border); background: #fafbfc;
}
.ship-photo-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ship-photo-del {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; line-height: 18px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 16px; cursor: pointer; padding: 0;
}
.ship-photo-del:hover { background: rgba(220, 38, 38, 0.9); }
/* 编辑页「已发货」横幅里的单号那行 */
.ship-info { font-size: 14px; margin: 0 0 10px; }
.ship-info b { font-weight: 600; }

/* =====================================================================
   生产异常（问题手机上报） 2026-11-16
   台账 / 记录单详情 / 手机提报页 / A4 打印版
   ===================================================================== */
.an-container { padding-bottom: 40px; }
.an-filters {
  display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin: 14px 0; box-shadow: var(--shadow-sm);
}
.an-filters label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--muted);
}
.an-filters input, .an-filters select { width: auto; min-width: 140px; }
.an-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-table th, .an-table td { border-bottom: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; }
.an-table thead th { position: sticky; top: 0; background: #f8fafc; font-weight: 700; white-space: nowrap; z-index: 1; }
.an-table tbody tr:hover { background: var(--primary-soft); }
.an-row { cursor: pointer; }
.an-table .num { text-align: center; }
.an-desc { max-width: 220px; white-space: pre-wrap; word-break: break-all; }
.an-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; }
.an-corr { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.an-corr.ok { background: var(--success-soft); color: var(--success); }
.an-corr.no { background: var(--danger-soft); color: var(--danger); }
.an-ops { white-space: nowrap; }
.an-hint { margin-top: 12px; }

.an-sheet { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: 16px 0 60px; }
.an-sheet-main { min-width: 0; }
.an-form {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.an-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.an-form label.an-wide { grid-column: span 4; }
.an-form input, .an-form select, .an-form textarea { width: 100%; }
.an-form textarea { resize: vertical; }
.an-photo-block {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 14px; box-shadow: var(--shadow-sm);
}
.an-photo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.an-photo-head .btn.small { width: auto; }
.an-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.an-photo-item { position: relative; display: inline-block; }
.an-photo-item img {
  width: 112px; height: 84px; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--border-strong); cursor: zoom-in;
}
.an-photo-del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; line-height: 20px;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: 15px; cursor: pointer; padding: 0;
}
.an-photo-del:hover { background: rgba(220, 38, 38, 0.9); }
.an-readonly .an-photo-del { display: none; }

.an-qr-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-align: center; position: sticky; top: 88px; box-shadow: var(--shadow-sm);
}
.an-qr-card img { width: 180px; height: 180px; display: block; margin: 10px auto; }
.an-qr-box { max-width: 380px; text-align: center; }
.an-qr-box img { width: 240px; height: 240px; display: block; margin: 6px auto 10px; }

.an-mobile { max-width: 640px; padding: 14px 14px 70px; }
.an-m-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.an-m-row > span { width: 100px; flex: none; font-size: 13px; color: var(--muted); }
.an-m-row input { flex: 1; min-width: 0; }
.an-m-block { flex-direction: column; align-items: stretch; }
.an-m-block > span { width: auto; margin-bottom: 4px; }
.an-m-block textarea { width: 100%; }
.an-dept-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.an-dept-chip {
  flex: 1 1 28%; min-width: 90px; padding: 10px 8px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; cursor: pointer; font-size: 16px;
  background: #fff; border: 1px solid var(--border-strong); border-radius: 12px;
}
.an-dept-chip small { color: var(--muted); font-size: 12px; }
.an-dept-chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.an-dept-chip.on small { color: var(--primary-dark); }
.an-submit { width: 100%; margin-top: 16px; padding: 13px; font-size: 17px; }

/* 打印版：照文档那张 13 行的表 */
.an-print-sheet { background: #fff; }
.an-p-title { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 8px; margin: 4px 0 12px; }
.an-p-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.an-p-table th, .an-p-table td { border: 1px solid #333; padding: 6px 8px; vertical-align: middle; word-break: break-all; }
.an-p-table th { background: #f3f4f6; font-weight: 700; text-align: center; width: 84px; white-space: nowrap; }
.an-p-tall { height: 54px; white-space: pre-wrap; vertical-align: top; }
.an-p-photos { height: 190px; vertical-align: top; }
.an-p-photo { height: 84px; width: auto; max-width: 30%; object-fit: contain; margin: 3px; border: 1px solid #999; vertical-align: top; }

@media (max-width: 860px) {
  .an-sheet { grid-template-columns: 1fr; }
  .an-form { grid-template-columns: 1fr 1fr; }
  .an-form label.an-wide { grid-column: span 2; }
  .an-qr-card { position: static; }
  .an-filters input, .an-filters select { min-width: 120px; }
}

@media print {
  body.printing-anomaly .view { display: none !important; }
  body.printing-anomaly #view-anomaly-print { display: block !important; }
  body.printing-anomaly .topbar { display: none !important; }
  body.printing-anomaly .container { max-width: none; padding: 0; margin: 0; }
  body.printing-anomaly .an-print-sheet { margin: 0; padding: 0; box-shadow: none; border: none; }
  .an-p-table tr { break-inside: avoid; page-break-inside: avoid; }
}

/* 问题提交：照文档「生产异常记录单」一模一样排的那张表（10 列网格，合并跟 docx 一样） */
.an-form-page { padding: 18px 0 70px; }
.an-doc-title { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 8px; margin: 4px 0 14px; }
.an-doc-wrap {
  overflow-x: auto; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px;
}
.an-doc-table { width: 100%; min-width: 860px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.an-doc-table th, .an-doc-table td { border: 1px solid #4b5563; padding: 0; vertical-align: middle; }
.an-doc-table th {
  background: #f3f4f6; font-weight: 700; text-align: center;
  padding: 7px 4px; font-size: 13px; line-height: 1.3;
}
.an-doc-table td input, .an-doc-table td textarea {
  width: 100%; border: 0; outline: none; background: transparent;
  padding: 8px; font: inherit; color: inherit; display: block;
}
.an-doc-table td textarea { resize: vertical; min-height: 52px; }
.an-doc-table td input:focus, .an-doc-table td textarea:focus { background: var(--primary-soft); }
.an-doc-table td input[readonly] { color: var(--muted); }
.an-doc-dept, .an-doc-kind {
  text-align: center; cursor: pointer; padding: 8px 4px !important;
  user-select: none; line-height: 1.4;
}
.an-doc-dept:hover, .an-doc-kind:hover { background: #f8fafc; }
.an-doc-dept.on, .an-doc-kind.on {
  background: var(--primary-soft); color: var(--primary-dark); font-weight: 700;
}
.an-doc-corr { text-align: center; white-space: nowrap; }
.an-corr-btn {
  border: 1px solid transparent; background: transparent; font: inherit;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; color: inherit;
}
.an-corr-btn.on { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.an-doc-photos { vertical-align: top; padding: 8px !important; }
.an-doc-photos .an-photo-head { margin-bottom: 6px; }
@media (max-width: 860px) {
  .an-doc-wrap { padding: 8px; }
  .an-doc-title { font-size: 20px; letter-spacing: 4px; }
  .an-doc-table { min-width: 760px; font-size: 13px; }
}

/* 生产异常记录单上的公司 LOGO（提交页 + 打印页，2026-11-16 用户口径） */
.an-doc-head, .an-p-head {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin: 4px 0 14px;
}
.an-doc-head img { height: 46px; width: auto; }
.an-p-head .an-p-logo { height: 46px; width: auto; }
.an-doc-head .an-doc-title { margin: 0; }
.an-p-head .an-p-title { margin: 0; }
@media print {
  .an-p-head { justify-content: flex-start; gap: 14px; margin: 0 0 10px; }
  .an-p-head .an-p-logo { height: 42px; }
  .an-p-head .an-p-title { flex: 1; text-align: center; }
}
@media print {
  /* 打印时 LOGO 钉左上，标题在整页居中（不跟着 LOGO 往右偏） */
  .an-p-head { position: relative; display: block; min-height: 46px; margin: 0 0 10px; }
  .an-p-head .an-p-logo { position: absolute; left: 0; top: 2px; height: 42px; }
  .an-p-head .an-p-title { margin: 0; text-align: center; line-height: 46px; }
}

/* 问题台账：全屏宽，只留表格 + 表头一行筛选（2026-11-16 用户口径） */
.container.an-container { max-width: none; padding-left: 16px; padding-right: 16px; }
.an-filter-row th { position: static; background: #fff; padding: 3px 4px; }
.an-filter-row input, .an-filter-row select {
  width: 100%; min-width: 0; font-size: 12px; padding: 3px 5px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: #fff;
}
.an-filter-row input:focus, .an-filter-row select:focus {
  outline: none; border-color: var(--primary);
}
.an-empty-row { text-align: center; color: var(--muted); padding: 30px 0 !important; }

/* 问题提交单头：LOGO 钉在表格左上角，标题整宽居中（2026-11-16 用户口径） */
.an-doc-head { display: block; position: relative; min-height: 46px; margin: 4px 0 14px; }
.an-doc-head img { position: absolute; left: 0; top: 0; height: 46px; width: auto; }
.an-doc-head .an-doc-title { margin: 0; text-align: center; line-height: 46px; }

/* 响应部门 / 异常类型每一格前面的小勾选框（2026-11-16 用户口径：每个单独勾） */
.an-doc-dept .an-check, .an-doc-kind .an-check {
  display: inline-block; margin-right: 5px; font-size: 15px; line-height: 1;
  color: var(--muted);
}
.an-doc-dept.on .an-check, .an-doc-kind.on .an-check { color: var(--primary-dark); }

/* 只读（没有回填权限的人打开这张单）：勾选框和格子不让点 */
.an-readonly .an-doc-dept, .an-readonly .an-doc-kind, .an-readonly .an-corr-btn {
  pointer-events: none; opacity: 0.75;
}

/* Excel 式表头筛选（2026-11-16 用户口径：上面不再摆一行输入框） */
.an-cf-btn {
  margin-left: 6px; padding: 1px 5px; border: 0; border-radius: 4px;
  background: transparent; color: var(--muted); font-size: 10px;
  cursor: pointer; vertical-align: middle;
}
.an-cf-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.an-cf-btn.on { background: var(--primary); color: #fff; }
.an-cf-pop {
  position: absolute; z-index: 120; width: 250px; padding: 10px;
  background: #fff; border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow-lg);
}
.an-cf-pop-head { margin-bottom: 6px; font-size: 13px; }
#an-cf-pop-search {
  width: 100%; margin-bottom: 8px; padding: 5px 7px;
  border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px;
}
.an-cf-pop-actions { display: flex; gap: 8px; margin-bottom: 6px; }
.an-cf-pop-actions .btn, .an-cf-pop-foot .btn { width: auto; }
.an-cf-pop-list {
  max-height: 240px; overflow-y: auto; padding: 4px 0; margin-bottom: 8px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.an-cf-item { display: flex; align-items: center; gap: 6px; padding: 3px 4px; font-size: 13px; cursor: pointer; }
.an-cf-item:hover { background: #f8fafc; }
.an-cf-item input { width: 14px; height: 14px; margin: 0; flex: none; }
.an-cf-pop-foot { display: flex; justify-content: space-between; gap: 8px; }

/* 项目问题台账两个页签：未纠正 / 已纠正 */
.an-tabs { display: flex; gap: 8px; margin: 12px 0 10px; }
.an-tab {
  padding: 7px 16px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: #fff; color: inherit; font-size: 14px; cursor: pointer;
}
.an-tab span { margin-left: 5px; color: var(--muted); font-size: 13px; }
.an-tab:hover { border-color: var(--primary); }
.an-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.an-tab.on span { color: #fff; opacity: 0.85; }
/* 导出范围那几个单选 */
.an-radio { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; cursor: pointer; }
.an-radio input { width: 16px; height: 16px; margin: 0; }

/* 打印版收尾（2026-11-16 用户口径）：
   ① LOGO 挪到右上角（标题仍整宽居中）；
   ② 文字一律折行，长串（项目号 / 描述 / 处理人）不再顶出格子。 */
.an-p-head { position: relative; display: block; min-height: 46px; margin: 4px 0 14px; }
.an-p-head .an-p-logo { position: absolute; left: auto; right: 0; top: 0; height: 46px; width: auto; }
.an-p-head .an-p-title {
  margin: 0; text-align: center; line-height: 46px;
  white-space: normal; overflow-wrap: anywhere;
}
.an-p-table { table-layout: fixed; }
.an-p-table th, .an-p-table td {
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
}
.an-p-table th { white-space: normal; width: auto; }
.an-p-tall, .an-p-photos { height: auto; min-height: 44px; }
.an-p-photo { max-width: 45%; height: auto; max-height: 76px; }

@media print {
  .an-p-head { margin: 0 0 10px; }
  .an-p-head .an-p-logo { right: 0; left: auto; height: 42px; }
  .an-p-table { font-size: 12px; }
  .an-p-table th, .an-p-table td { padding: 4px 6px; }
  .an-p-tall { min-height: 50px; }
}

/* 打印版 LOGO 改回左上角（2026-11-16 用户口径），标题仍整宽居中 */
.an-p-head .an-p-logo { left: 0; right: auto; }
@media print {
  .an-p-head .an-p-logo { left: 0; right: auto; }
}

/* 作废（2026-11-16 用户口径）：不删行，只标出来、不能再选 */
.badge.void { background: var(--danger-soft); color: var(--danger); }
.bom-row.void { opacity: 0.78; }
.bom-row.void .bom-row-title, .bom-row.void .bom-row-name { color: var(--muted); text-decoration: line-through; }
.bom-void {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 13px; color: var(--danger); cursor: pointer;
}
.bom-void input { width: 16px; height: 16px; margin: 0; flex: none; }
.hv-row.void { background: #fafafa; opacity: 0.85; }
.hv-row.void .hv-no, .hv-row.void .hv-name { color: var(--muted); text-decoration: line-through; }
.hv-void-wrap { color: var(--danger); }
.hv-tag.void { background: var(--danger-soft); color: var(--danger); }
.hv-item.void td { background: #fafafa; }
.hv-item.void .hv-dev-name, .hv-item.void .hv-code { color: var(--muted); }

@media print {
  /* 问题提交时拍的照片：印在记录单下半部分，看得清就行 */
  .an-p-photos { min-height: 96px; }
  .an-p-photo { max-height: 100px; }
}

/* ===================== 现场增补件跟踪（2026-11-20） ===================== */
.pb-container { padding-bottom: 40px; }
/* 表头总览（2026-11-26 用户口径）：照项目跟踪系统「项目情况」顶上那排统计卡 */
.pb-summary {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.pb-sum-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-sm);
  padding: 10px 14px 12px;
}
.pb-sum-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pb-sum-value { font-size: 24px; line-height: 1.15; font-weight: 700; color: #2563eb; }
.pb-sum-value.ok { color: #15803d; }
.pb-sum-value.warn { color: #d97706; }
.pb-sum-value.danger { color: #dc2626; }
.pb-sum-sub { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
/* 项目问题 / 增补件跟踪 / 一周内到货：表头不动（2026-11-20 用户口径）——
   表身自己在卡里滚，表头钉在上面 */
#view-problems .pb-table-wrap,
#view-problem-tracking .pb-table-wrap,
#view-problem-due .pb-table-wrap {
  max-height: calc(100vh - 160px);
  overflow: auto;
}
/* 三个页面都多了上面那排统计卡，表格再让出它的高度 */
#view-problems .pb-table-wrap,
#view-problem-tracking .pb-table-wrap,
#view-problem-due .pb-table-wrap { max-height: calc(100vh - 270px); }
#view-problems .pb-table thead th,
#view-problem-tracking .pb-table thead th,
#view-problem-due .pb-table thead th { z-index: 3; }
.pb-table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-top: 14px;
}
.pb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pb-table th, .pb-table td {
  border-bottom: 1px solid var(--border); padding: 8px 10px;
  text-align: left; vertical-align: middle;
}
.pb-table thead th {
  position: sticky; top: 0; background: #f8fafc; white-space: nowrap; z-index: 1;
}
.pb-table tbody tr:hover { background: var(--primary-soft); }
.pb-row { cursor: pointer; }
.pb-table .num { text-align: center; }
.pb-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; background: #f3f4f6; color: var(--muted); white-space: nowrap;
}
/* 项目台账：列宽按内容自动调（2026-11-20 用户口径：尽量一行放下、不要显示两行） */
.pb-projects-table { width: auto; min-width: 100%; table-layout: auto; }
.pb-projects-table th, .pb-projects-table td { white-space: nowrap; }
.pb-projects-table td.pb-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.pb-projects-table td.pd-ellipsis { max-width: 240px; }
/* 项目台账「问题数」：总共 / 已下图 / 未下图 / 已发货 / 未发货（一行五个小标签）
   2026-11-20 用户口径：跟两边的格子对齐 —— 小标签用**行内元素**，
   跟文字一个基线、同一行高，不再用 flex（flex 会跟旁边文字错开一截） */
.pb-projects-table td.pb-counts {
  text-align: center; vertical-align: middle; white-space: nowrap;
}
.pb-counts span {
  display: inline; padding: 1px 6px; border-radius: 999px;
  font-size: 12px; line-height: inherit; white-space: nowrap;
  margin: 0 1px;
}
.pb-counts span {
  background: #f3f4f6; border-radius: 999px; padding: 2px 8px;
  font-size: 12px; white-space: nowrap; color: var(--muted);
}
.pb-counts span.ok { background: var(--success-soft); color: var(--success); }
.pb-counts span.warn { background: var(--warning-soft); color: var(--warning); }
/* 2026-11-26 用户口径：未下图高亮（红）、已装箱高亮（橙） */
.pb-counts span.no { background: var(--danger-soft); color: var(--danger); }
/* 2026-11-28：问题数拆成六列后的颜色（未下图红、已装箱/未发货橙、已下图/已发货绿） */
.pb-projects-table td.ok { color: var(--success); }
.pb-projects-table td.no { color: var(--danger); }
.pb-projects-table td.warn { color: var(--warning); }
.g-stats b.pb-hl-no { color: var(--danger); }
.g-stats b.pb-hl-warn { color: #b45309; }
.pb-badge.ok { background: var(--success-soft); color: var(--success); }
.pb-badge.warn { background: var(--warning-soft); color: var(--warning); }
.pb-badge.no { background: var(--danger-soft); color: var(--danger); }
.pd-ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 项目下展开的问题列表：所有格子居中显示（2026-11-20 用户口径） */
.pb-issues-table th, .pb-issues-table td { text-align: center; }
/* 单条问题的「问题原因 / 增补内容及数量」：格子拉高、文字折行（2026-11-20 用户口径） */
/* 行高跟着内容走：一行就一行高，折行了才变高（2026-11-20 用户口径） */
.pb-issues-table td.pb-multiline {
  white-space: normal; word-break: break-word; vertical-align: middle;
  min-width: 160px; max-width: 320px; line-height: 1.4; padding-top: 6px; padding-bottom: 6px;
}
.pb-multiline-in { min-height: 0; }
.pb-select { width: auto; min-width: 120px; }
.pb-hint { margin-top: 12px; }
/* 从现场增补问题点「绑定 BOM 表」过来挑增补单时的提示条 */
.pb-bind-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--primary-soft); border: 1px solid var(--primary);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px;
}
.pb-bind-banner .btn { width: auto; }

.pd-container { padding: 14px 0 60px; display: flex; flex-direction: column; gap: 14px; }
.pd-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px;
}
.pd-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pd-card-head .btn { width: auto; }
.pd-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.pd-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pd-form .pd-wide { grid-column: span 4; }
.pd-form input, .pd-form textarea { width: 100%; }
.pd-parts-wrap { overflow-x: auto; }
.pd-parts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-parts-table th, .pd-parts-table td { border-bottom: 1px solid var(--border); padding: 6px 8px; }
.pd-parts-table th { background: #f8fafc; white-space: nowrap; }
.pd-parts-table input, .pd-parts-table select { width: 100%; min-width: 80px; }
.pd-part-bind { min-width: 220px !important; }
.pd-boms { display: flex; flex-direction: column; gap: 8px; }
.pd-bom-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: #fff; }
.pd-bom-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-bom-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f3f4f6; border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.pd-bom-unbind { border: 0; background: transparent; cursor: pointer; color: var(--danger); font-size: 16px; line-height: 1; }
.pd-bom-detail { margin-top: 8px; }
.pd-bom-detail summary { cursor: pointer; color: var(--primary-dark); font-size: 13px; user-select: none; }
.pd-bom-rows-wrap { max-height: 340px; overflow: auto; margin-top: 6px; }
.pd-bom-rows { width: 100%; font-size: 13px; }
.pd-bom-rows th, .pd-bom-rows td { padding: 5px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pd-bom-rows th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.pd-bom-rows tr.void td { color: #9ca3af; background: #fafafa; }
.pd-bom-empty { display: inline-block; margin-top: 6px; }
.pd-bind-list {
  max-height: 320px; overflow-y: auto; padding: 6px 0; margin: 8px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.pd-bind-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; font-size: 13px; cursor: pointer; }
.pd-bind-item.same { background: var(--primary-soft); border-radius: 6px; }
.pd-bind-item small { color: var(--muted); margin-left: 6px; }
@media (max-width: 860px) {
  .pd-form { grid-template-columns: 1fr 1fr; }
  .pd-form .pd-wide { grid-column: span 2; }
}

/* 项目问题 / 增补件跟踪：跟台账一样全屏宽（2026-11-20 用户口径） */
.container.pb-container,
.container.pd-container {
  max-width: none;
  padding-left: 16px;
  padding-right: 16px;
}

/* 现场增补：项目卡片 + 项目信息（2026-11-20） */
.pb-projects { display: flex; gap: 10px; overflow-x: auto; padding: 12px 0 4px; }
.pb-project-card {
  flex: 0 0 auto; min-width: 180px; max-width: 260px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  cursor: pointer; box-shadow: var(--shadow-sm);
}
.pb-project-card.on { border-color: var(--primary); background: var(--primary-soft); }
.pb-project-all { display: flex; align-items: center; justify-content: center; font-weight: 600; }
.pbpc-code { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.pbpc-edit { border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.pbpc-edit:hover { color: var(--primary); }
.pbpc-name { margin-top: 2px; }
.pbpc-meta {
  color: var(--muted); font-size: 12px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px;
}
.pbpc-count { margin-top: 6px; font-size: 12px; color: var(--primary-dark); }
.pd-project-info {
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted);
  background: #f8fafc; border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 8px 10px;
}
.pd-project-info b { color: var(--text); }

/* 项目台账（2026-11-20：新建项目后列在下面的表里） */
.pb-section-head { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pb-section-head .btn { width: auto; }
.pb-project-row { cursor: pointer; }
.pb-project-row.on td { background: var(--primary-soft); }
.pb-projects-table .pd-ellipsis { max-width: 320px; }
.pd-actions { white-space: nowrap; }

/* 项目问题：上面筛选卡（像设备台账）+ 项目行展开问题 */
.pb-filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-top: 14px; box-shadow: var(--shadow-sm);
}
.pb-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.pb-filters input, .pb-filters select { width: auto; min-width: 130px; }
.pb-filters .btn { width: auto; }
.pb-issues-row td { background: #fafbfc; padding: 0 0 0 28px; }
.pb-issues-box { padding: 10px 12px; }
.pb-issues-head { font-weight: 600; margin-bottom: 6px; }
.pb-issues-table { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.pb-issues-table th, .pb-issues-table td { padding: 6px 8px; }

/* 生产异常记录单：物料信息多行（2026-11-21） */
.an-sec-row th { background: #eef2f7; text-align: left; }
.an-sec-row .btn { width: auto; margin-left: 10px; }
.an-items-cell { padding: 8px !important; }
.an-items-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.an-items-table th, .an-items-table td {
  border: 1px solid var(--border); padding: 4px 6px; vertical-align: top;
}
.an-items-table th { background: #f8fafc; white-space: nowrap; }
.an-items-table input, .an-items-table textarea, .an-items-table select {
  width: 100%; font-size: 12px; padding: 4px 6px; min-width: 60px;
}
.an-p-sec { background: #eef2f7; text-align: left; }
.an-p-items-cell { padding: 0 !important; }
.an-p-items { width: 100%; border-collapse: collapse; font-size: 10px; }
.an-p-items th, .an-p-items td {
  border: 1px solid #7a7a7a; padding: 2px 3px; vertical-align: top;
}

/* 生产异常记录单右上角二维码（2026-11-21） */
.an-doc-head { position: relative; }
.an-doc-head.has-qr { min-height: 176px; padding-right: 180px; }
.an-doc-qr {
  position: absolute; right: 0; top: -6px; text-align: center;
  font-size: 11px; line-height: 1.2; color: var(--muted);
}
.an-doc-head .an-doc-qr img { width: 160px; height: 160px; }
.an-p-head { position: relative; }
.an-p-head.has-qr { min-height: 132px; padding-right: 136px; }
.an-p-head .an-p-qr { position: absolute; right: 0; top: 0; width: 120px; height: 120px; }
@media print {
  .an-p-head .an-p-qr { width: 110px; height: 110px; }
}

/* 生产异常记录单：格子里的字居中（2026-11-21 用户口径） */
.an-doc-table th, .an-doc-table td { text-align: center; }
.an-doc-table input, .an-doc-table select, .an-doc-table textarea {
  text-align: center;
}
.an-doc-table .an-doc-photos, .an-doc-table .an-photo-head { text-align: center; }
.an-doc-table .an-doc-corr { justify-content: center; }
.an-p-table th, .an-p-table td { text-align: center; }
.an-items-table th, .an-items-table td { text-align: center; }
.an-items-table input { text-align: center; }

/* 打印记录单整张居中 + 格子字居中（2026-11-21 用户口径：打印没居中） */
.an-p-table { margin: 0 auto; }
.an-p-table th, .an-p-table td, .an-p-table .an-p-tall {
  text-align: center !important;
}
.an-p-table .an-p-items th, .an-p-table .an-p-items td { text-align: center !important; }
.an-p-table .an-p-photos { text-align: center; }
.an-doc-table th, .an-doc-table td { text-align: center !important; }

/* 记录单标题真正居中：LOGO 钉左、码钉右，标题按整页宽居中（2026-11-21 用户口径） */
.an-p-head, .an-doc-head {
  display: block; position: relative; min-height: 96px;
  padding: 0 0 6px; margin: 4px 0 12px;
}
.an-p-head .an-p-logo, .an-doc-head > img:first-child {
  position: absolute; left: 0; top: 6px; height: 46px; width: auto;
}
.an-p-head .an-p-qr, .an-doc-qr { position: absolute; right: 0; top: 0; }
.an-p-head .an-p-title, .an-doc-head .an-doc-title {
  text-align: center; margin: 6px 0 0; width: 100%;
}
.an-p-head.has-qr, .an-doc-head.has-qr {
  min-height: 168px; padding-right: 0;
}
@media print {
  .an-p-head { display: block; min-height: 132px; margin: 0 0 10px; }
  .an-p-head .an-p-logo { position: absolute; left: 0; top: 4px; height: 42px; }
  .an-p-head .an-p-title { margin: 4px 0 0; text-align: center; }
}

/* 生产异常台账：列多了，表格给个最小宽度、在卡片里横向滚（2026-11-21） */
.an-table { min-width: 2400px; }
.an-table th, .an-table td { white-space: nowrap; }
.an-table .an-desc { white-space: pre-wrap; min-width: 140px; max-width: 240px; }

/* 台账「物料信息」列：内容多行全显示（2026-11-21） */
.an-table .an-items-text {
  min-width: 240px; max-width: 380px; white-space: pre-wrap; line-height: 1.5;
}

/* 设备出入库表：整页拉宽（2026-11-21 用户口径） */
#view-device-inout .container {
  max-width: none; padding-left: 16px; padding-right: 16px;
}
#view-device-inout .ledger-table th, #view-device-inout .ledger-table td {
  padding: 10px 14px; font-size: 14px;
}

/* 设备出入库表：表头 / 合计行钉住，表身在卡里滚（2026-11-21） */
#view-device-inout .table-wrap {
  max-height: calc(100vh - 240px); overflow: auto;
}
#view-device-inout .ledger-table thead th {
  position: sticky; top: 0; z-index: 2; background: #f8fafc;
}
#view-device-inout .ledger-table tfoot th,
#view-device-inout .ledger-table tfoot td {
  position: sticky; bottom: 0; z-index: 2; background: #f8fafc;
  font-weight: 700; border-top: 2px solid var(--border);
}
