:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --hint: #9ca3af;
  --brand: #0f6e56;
  --brand-soft: #e1f5ee;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #eaf5f0 0%, #f5f6f8 55%, #e6f1ec 100%);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px;
  width: 340px;
}
.login-card h1 { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.login-card p { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 188px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand { font-size: 15px; font-weight: 500; padding: 0 10px 16px; }
.brand small { display: block; color: var(--hint); font-size: 12px; font-weight: 400; margin-top: 3px; }
/* 版本号：比厂名再淡一档，别抢视线（客户报障时才要它） */
.brand small#ver { font-size: 11px; margin-top: 1px; opacity: .75; }
/* 品牌名＝工厂名称，只占一行：高度固定，导航不会因为厂名长短上下跳。
   字号由 setBrandName() 按实际宽度逐档缩（15 → 13.5 → 12.5），最小档还放不下才出省略号，
   鼠标悬停 title 看全名。 */
.brand #brand {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.35;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 13.5px;
}
.nav-item:hover { background: #f3f4f6; }
.nav-item.on {
  background: var(--brand-soft); color: var(--brand); font-weight: 500;
  box-shadow: inset 2.5px 0 0 var(--brand);   /* 左侧品牌绿竖条：当前页一眼定位 */
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; }
.nav-item.on .nav-dot { opacity: 1; }

.main { flex: 1; padding: 22px 26px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { font-size: 17px; font-weight: 600; margin: 0; }
.topbar .who { color: var(--muted); font-size: 13px; }
.topbar .who b { color: var(--text); font-weight: 500; }

/* ---------- 组件 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 14px; font-weight: 600; margin: 0 0 12px; }

/* 折叠卡片（云端备份）：点标题展开/收起，右侧一个小箭头指示状态 */
details.card { padding: 0; }
details.card > summary { padding: 16px 18px; cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3 { display: flex; align-items: center; margin: 0; }
details.card > summary h3::after {
  content: ""; margin-left: auto; flex-shrink: 0;
  width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s;
}
details.card[open] > summary h3::after { transform: rotate(45deg); }
/* 展开后的内容块各自左右缩进，最后一块负责底部留白。
   2026-10-30 老板反馈「展开后显示不全」：原来只给 summary 后的第一个兄弟
   加了内边距，后面的输入框、按钮、说明全贴在卡片边框上，右边一列像是被切掉了。 */
details.card > summary + * { padding: 0 18px; }
details.card > *:not(summary) { padding-left: 18px; padding-right: 18px; }
details.card > *:not(summary):last-child { padding-bottom: 16px; }
details.card > summary + * .grid2 { margin-top: 0 !important; }

/* 使用说明书：全屏弹窗（设置页嵌卡片太挤，2026-10-30 老板反馈改的） */
.mask.manual-mask { padding: 18px; }
.manual-panel {
  background: var(--panel); border-radius: 12px; width: 100%; max-width: 1280px;
  height: 100%; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .16);
}
.manual-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.manual-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.manual-head .hint { margin-right: auto; }
.manual-panel iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1000px) { .grid4 { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 500; margin-top: 6px; letter-spacing: -.4px; }
.stat .s { color: var(--hint); font-size: 12px; margin-top: 4px; }
.stat.alert { background: var(--danger-soft); border-color: #fecaca; }
.stat.alert .v { color: var(--danger); }

.btn {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 500;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.danger { background: var(--danger); }
.btn.wide { width: 100%; padding: 10px; }
/* 明细表尾的「加一行」：贴着表格底线，顺着录入方向往下长 */
.btn.add-row {
  width: 100%; margin-top: 8px; padding: 9px;
  border: 1px dashed #c9d3de; background: #f1f5f8;
  color: var(--brand); font-size: 13px; font-weight: 500; border-radius: 8px;
}
.btn.add-row:hover {
  border-color: var(--brand); border-style: solid;
  color: #fff; background: var(--brand);
}

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 110, 86, .10);   /* 淡绿聚焦环：键盘 Tab 到哪格都看得见 */
}
input[type="checkbox"] { width: auto; }

/* 密码框小眼睛：点击切换明文/密文 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 36px; }
/* Edge/Chrome 在 password 框右侧自带一个揭示按钮，和自定义眼睛重复，隐藏之 */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }
.pw-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  border: none; background: none; cursor: pointer; padding: 2px 4px;
  font-size: 15px; line-height: 1; color: var(--muted); user-select: none;
}
.pw-eye:hover { color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; background: #fafafa; white-space: nowrap; }
tbody tr:hover { background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; background: #f3f4f6; color: var(--muted); }
.tag.green { background: var(--brand-soft); color: var(--brand); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.blue { background: #eef2ff; color: #3730a3; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.hint { color: var(--hint); font-size: 12px; }
.dim { color: var(--muted); opacity: .4; }
.empty { padding: 26px; text-align: center; color: var(--hint); }
/* 产品拖动排序：行首手柄 + 拖动中的行 */
.drag-handle {
  cursor: grab;
  color: var(--hint);
  letter-spacing: 1px;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
}
.drag-handle:hover { color: var(--brand); background: var(--brand-soft); }
.drag-handle:active { cursor: grabbing; }
tr.dragging { opacity: .45; }
tr.dragging td { background: var(--brand-soft); }

/* 客户搜索选择器：输入即筛 + 最近使用置顶 */
.cust-pick { position: relative; }
.cust-input { width: 100%; }
.cust-list {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .16);
  max-height: 260px;
  overflow: auto;
}
.cust-pick.open .cust-list { display: block; }
.cust-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 8px 11px; cursor: pointer; font-size: 13px;
}
.cust-item:hover, .cust-item.active { background: var(--brand-soft); }
.cust-name {
  color: var(--text);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cust-meta {
  color: var(--hint); font-size: 12px; white-space: nowrap;
  flex-shrink: 0; max-width: 60%;
  overflow: hidden; text-overflow: ellipsis;
}
.cust-empty { padding: 12px; color: var(--hint); font-size: 12.5px; text-align: center; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .35);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50;
  overflow: auto;
}
.modal { background: var(--panel); border-radius: 12px; width: 560px; max-width: 100%; padding: 20px 22px; box-shadow: 0 18px 44px rgba(16, 24, 40, .16); }
.modal.wide { width: 860px; }
/* 出库开单这种「明细列特别多」的弹窗再放宽一档；手机上不生效（下面 @media 会兜回整屏） */
@media (min-width: 721px) { .modal.wide-lg { width: 1000px; } }
.modal h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.form-row label .hint { margin-left: 6px; font-size: 11.5px; color: var(--muted); opacity: .75; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
.modal-actions .kbd-hint { margin-right: auto; font-size: 12px; color: var(--hint); }
kbd {
  display: inline-block; padding: 1px 5px; margin: 0 1px;
  font-family: inherit; font-size: 11px; line-height: 15px;
  color: var(--muted); background: #f9fafb;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}
.err { color: var(--danger); font-size: 12.5px; margin-top: 8px; min-height: 16px; }

/* ---------- 出库开单 ---------- */
.items-table th, .items-table td { padding: 7px 8px; }
.items-table input, .items-table select { padding: 6px 8px; }

/* 出库明细列宽（2026-11-03）：改固定布局 + 逐列定宽。
   原来是表格自动布局，每个 number 输入框都按自身固有宽度（约 170px）参与列的「最小宽度」，
   于是「单价」「空桶回收」「破损」「出库损坏」这些只填几位数的框全被撑到一样宽，
   真正要宽度的「产品」反而被挤到最窄。改成：窄列给够用的固定宽度，剩下的全给产品列。
   手机上这一套会被下面的 @media 改回平分（.ob-grid .c-* { width:auto }）。 */
.items-table.ob-grid { table-layout: fixed; }
.ob-grid .c-dept  { width: 104px; }
.ob-grid .c-qty   { width: 68px; }
.ob-grid .c-batch { width: 114px; }
.ob-grid .c-price { width: 80px; }
.ob-grid .c-qt    { width: 70px; }   /* 空桶回收 / 破损 / 出库损坏 三列同宽 */
.ob-grid .c-sub   { width: 88px; }
.ob-grid .c-del   { width: 40px; }
/* 回执面板：实收空桶要填得下「12」这种两位数，给宽一点；破损一位数就够 */
.rt-grid .c-ret   { width: 100px; }
/* 数字框保持左对齐（2026-11-03 老板定）：右对齐虽然和表头对得齐，但录数时看着别扭 */
/* 产品列在固定布局里宽度有限：名字长的下拉框裁掉尾巴，别撑破格子（点开下拉仍有全名） */
.ob-grid select { text-overflow: ellipsis; }
.total-bar {
  display: flex; gap: 22px; justify-content: flex-end; padding: 12px 2px 0;
  border-top: 1px solid var(--line); margin-top: 10px; font-size: 13px;
}
.total-bar b { font-size: 17px; font-weight: 500; }

/* 开单页的当场收款行 */
.pay-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: #f8fafb; border: 1px solid var(--line); border-radius: 8px;
}
.pay-row .pay-label { font-size: 13px; color: var(--muted); }
.pay-row input { width: 150px; }
.pay-row select { width: 110px; }

/* 报表：占比条 */
.bar { height: 6px; background: #eef0f2; border-radius: 3px; min-width: 70px; }
.bar i { display: block; height: 6px; background: var(--brand); border-radius: 3px; }

/* 对账单 */
.stmt-head { display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.stmt h4 { font-size: 13px; font-weight: 500; color: var(--muted); }
.stmt .grid4 { gap: 10px; }
.stmt .stat { padding: 10px 12px; }
.stmt .stat .v { font-size: 19px; }

/* ---------- 记录浏览器（生产/出库/回款/损耗/流水共用） ---------- */
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.rec-title { font-size: 14px; font-weight: 500; }
.rec-actions { display: flex; gap: 8px; }
.rec-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rec-bar .grow { flex: 1; min-width: 8px; }
.rec-bar .rec-q { width: 210px; }
.chip {
  padding: 4px 11px; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); border-radius: 999px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rec-custom { display: none; gap: 6px; align-items: center; margin-bottom: 10px; }
.rec-custom input { width: 150px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brand); }
.sorti { font-style: normal; margin-left: 3px; font-size: 10px; color: #c8d0d9; }
.sorti.on { color: var(--brand); }
tr.day-row td { background: #f8fafb; padding: 6px 10px; }
tr.day-row:hover { background: #f8fafb; }
.day-cell { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.day-cell > span:first-child { font-weight: 500; color: var(--text); }
.day-sum { font-variant-numeric: tabular-nums; }
/* 工时记录合并行里的「时段」：一段一行，竖着排 */
.seg-list { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.seg-list > span { font-size: 12.5px; white-space: nowrap; }
/* 改时段弹窗里的每一段 */
.seg-edit-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.seg-edit-row > b { flex: none; font-size: 13px; }
.seg-edit-row .seg-time { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.seg-edit-row .seg-act { flex: none; display: flex; gap: 6px; }

.rec-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.rec-sum { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-sum b { color: var(--text); font-weight: 500; }

/* 记录浏览器：日历选时间 */
.rec-date {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; font-size: 13px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.rec-date:hover { border-color: var(--brand); color: var(--brand); }
.rec-date svg { flex: none; opacity: .75; }

.datepop {
  position: fixed; z-index: 900; width: 286px; padding: 9px 11px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 38px rgba(16, 24, 40, .16);
  user-select: none;
}
.dp-head { display: flex; align-items: center; gap: 3px; margin-bottom: 5px; }
.dp-head b { flex: 1; text-align: center; font-size: 13.5px; font-weight: 500; }
.dp-nav {
  width: 26px; height: 26px; border: none; background: transparent;
  color: var(--muted); font-size: 17px; line-height: 1; border-radius: 6px; cursor: pointer;
}
.dp-nav:hover { background: var(--brand-soft); color: var(--brand); }
.dp-today {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 12px; padding: 2px 8px; border-radius: 6px; cursor: pointer;
}
.dp-today:hover { border-color: var(--brand); color: var(--brand); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-week span { text-align: center; font-size: 11px; color: var(--hint); padding: 3px 0; }
.dp-d {
  position: relative; height: 31px; border: none; background: transparent; border-radius: 7px;
  font-size: 12.5px; color: var(--text); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dp-d.pad { visibility: hidden; }
.dp-d:hover { background: var(--brand-soft); }
.dp-d.in { background: var(--brand-soft); border-radius: 0; }
.dp-d.has { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.dp-d.has.edge { background: var(--brand); color: #fff; }
.dp-d.edge { background: var(--brand); color: #fff; border-radius: 7px; }
.dp-d.anchor { box-shadow: inset 0 0 0 1.5px var(--brand); }
.dp-d.today::after {
  content: ""; position: absolute; left: 50%; bottom: 3px;
  width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%;
  background: var(--brand);
}
.dp-d.today.edge::after { background: #fff; }
.dp-foot {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--line);
}
.dp-tip {
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 148px;
}
.dp-tip b { color: var(--brand); font-weight: 500; }
.dp-foot .grow { flex: 1; }
.dp-link {
  border: none; background: transparent; color: var(--muted);
  font-size: 12px; padding: 3px 5px; border-radius: 5px; cursor: pointer;
}
.dp-link:hover { color: var(--brand); background: var(--brand-soft); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 90; font-size: 13px;
}
.toast.bad { background: var(--danger); }

/* 桌面/手机两套版式：默认走桌面，720px 以下才切成手机那套（见下方 media query） */
.only-pc { display: block; }
.only-m { display: none; }

@media (max-width: 720px) {
  /* 手机：导航收成底部标签栏（拇指好够），弹窗改底部抽屉 */
  .layout { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    padding: 0 6px;
    border-right: none; border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(17, 24, 39, .06);
    z-index: 80;
  }
  #nav {
    display: flex; overflow-x: auto; gap: 2px; padding: 5px 0;
    -webkit-overflow-scrolling: touch;
  }
  .brand, .nav-group { display: none; }
  .nav-item {
    flex-direction: column; gap: 3px; white-space: nowrap;
    font-size: 11px; padding: 5px 9px; margin-bottom: 0; border-radius: 8px;
  }
  .main { padding: 14px 14px 74px; }
  .topbar h2 { font-size: 16px; }
  /* 弹窗变底部抽屉：从下往上弹，占满宽度，里面自己滚。
     弹窗打开期间底部标签栏整个收起来（body.modal-open，见 core.js），
     抽屉就能贴死屏幕底边——不留缝、不悬浮，按钮也不会被标签栏盖住。 */
  .mask { padding: 0; align-items: flex-end; }
  /* 说明书弹窗在手机上就是整屏：不留边距、上方不圆角 */
  .mask.manual-mask { padding: 0; align-items: stretch; }
  .manual-panel { border-radius: 0; max-width: 100%; }
  body.modal-open .side { display: none; }
  .modal {
    width: 100%; max-width: 100%; border-radius: 14px 14px 0 0;
    max-height: 88vh; overflow: auto; padding: 16px 14px;
  }
  .form-grid { grid-template-columns: 1fr; }
  /* 保存/取消不悬浮：跟在表单后面正常排（滚到底就是按钮），
     上面加一条分隔线让按钮区看起来是表单的一部分 */
  .modal-actions { position: static; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .modal-actions .kbd-hint { display: none; }   /* 手机没有键盘，快捷键提示无意义 */
  /* 触屏输入加大 */
  input, select, textarea { padding: 10px 11px; font-size: 15px; }
  .btn { padding: 10px 16px; }
  /* 出库开单明细：固定列宽 + 输入框撑满格子，不再有的宽有的窄 */
  .items-table { table-layout: fixed; width: 100%; }
  .items-table th:first-child { width: 21%; }
  /* 列多每列很窄：表头允许换行、缩小字距，否则"单价(元)空桶回收"挤成一串 */
  .items-table th, .items-table td { padding: 6px 2px; }
  .items-table th { white-space: normal; font-size: 11px; line-height: 1.35; }
  .items-table input, .items-table select {
    width: 100%; min-width: 0; box-sizing: border-box; padding: 8px 5px; font-size: 14px;
  }
  /* 出库明细：桌面上按像素定死的列宽在手机上会挤成一团，回到「首列 21% + 其余平分」 */
  .ob-grid .c-dept, .ob-grid .c-qty, .ob-grid .c-batch,
  .ob-grid .c-price, .ob-grid .c-qt, .ob-grid .c-sub,
  .ob-grid .c-del, .rt-grid .c-ret { width: auto; }
  .rec-bar .rec-q { width: 100%; }
  /* 手机上把「桌面才显示 / 手机才显示」两种版式切开：
     表格列多的时候按钮挤到最右边滑不到，就改成卡片列表（耗材库存就是这套） */
  .only-pc { display: none !important; }
  .only-m { display: block; }
  /* 记录列表里次要列（单价/金额/来源这类）在手机上收起来，剩下的列才排得开 */
  th.hide-m, td.hide-m { display: none; }
  /* 手机卡片列表：一屏一张卡，名字大、数字大、按钮等宽一整排，拇指都够得到 */
  .mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 12px; margin-bottom: 9px; }
  .mcard.off { background: #fbf4f4; }
  .mcard.off .mc-name { color: #9ca3af; text-decoration: line-through; }
  .mc-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
  .mc-name { font-size: 15.5px; font-weight: 600; }
  .mc-num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 3px; }
  .mc-num b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
  .mc-num .u { font-size: 12.5px; color: var(--muted); }
  .mc-sub { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
  .mc-btns { display: flex; gap: 6px; flex-wrap: wrap; }
  .mc-btns .btn { flex: 1 1 62px; margin: 0; padding: 9px 4px; font-size: 13.5px; }
}

/* 已撤销的记录：勾「含已撤销」才露出来，灰掉划一道，一眼看出是废单 */
tr.row-void { background: #fbf4f4; }
tr.row-void td { color: #9ca3af; }
tr.row-void td:nth-child(2) { text-decoration: line-through; }

/* 停用的档案（产品/耗材）：灰底划掉名字，跟「已撤销的单据」区分开——
   单据划第二列（单号/产品），档案划第一列（名字本身） */
tr.row-off { background: #fbf4f4; }
tr.row-off td { color: #9ca3af; }
tr.row-off td:first-child { text-decoration: line-through; }

/* 批量选择：勾了才冒出来的操作条，不勾的时候不占地方 */
th.selcol, td.selcol { width: 34px; text-align: center; padding-left: 8px; padding-right: 0; }
th.selcol input, td.selcol input { width: 15px; height: 15px; cursor: pointer; accent-color: #b91c1c; }
.rec-bulk { display: none; align-items: center; gap: 10px; margin: -4px 0 10px;
  padding: 9px 12px; border: 1px solid #f3d6d6; background: #fdf6f6; border-radius: 8px; }
.rec-bulk.on { display: flex; }
.rec-bulk span { font-size: 13px; color: #7f1d1d; }
.rec-bulk span b { font-size: 15px; }
.rec-bulk #rec-sel-clear { margin-left: auto; }
.btn.danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.btn.danger:hover { background: #991b1b; }
.btn.danger:disabled { opacity: .6; cursor: default; }
/* 行内的删除：白底红字，别做成实心红把人的手指头吸过去 */
.btn.ghost.danger { background: #fff; color: #b91c1c; border-color: #f0c9c9; }
.btn.ghost.danger:hover { background: #fdf3f3; border-color: #e3a8a8; }

/* ---------- 单号链接：所有页面的出库单号都可点开看明细 ---------- */
.order-link {
  color: var(--brand);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.order-link:hover { text-decoration-style: solid; }
.order-link.voided { color: var(--danger); text-decoration: line-through; }

/* 客户选择器尾部的「新建客户」入口 */
.cust-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--brand);
  border-top: 1px solid var(--line);
  background: var(--brand-soft);
}
.cust-new:hover { filter: brightness(0.97); }
.cust-new .cust-name { font-weight: 500; }

/* ---------- 字段级报错：红字落在字段下面，出错字段描红 ---------- */
.ferr {
  color: var(--danger);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.4;
}
.mbody .bad {
  border-color: var(--danger) !important;
  background: #fef2f2;
}
.mbody .bad:focus { outline-color: var(--danger); }

/* 今天页驾驶舱：大数字卡可点击直达 */
.stat.click { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.stat.click:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); transform: translateY(-1px); }

/* ---------- 导航分组：日常 / 账目 / 档案 ---------- */
.nav-group {
  font-size: 11px; color: var(--hint); letter-spacing: 1px;
  padding: 12px 10px 5px; user-select: none;
}
.nav-group:first-child { padding-top: 2px; }

/* ---------- 常开客户一键开单条 ---------- */
.quick-cust {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.quick-cust .qk { font-size: 12px; color: var(--hint); }
.quick-cust .chip { font-size: 13px; padding: 5px 13px; color: var(--text); }

/* ================= 界面打磨（2026-10-21）：只动观感，不动任何功能 ================= */

/* 交互反馈：所有可点的东西统一过渡，按钮按下轻轻一缩 */
.btn, .chip, .nav-item, .rec-date, .cust-item, .cust-new, .dp-d, .dp-nav,
.dp-link, .dp-today, .order-link, .drag-handle, .tag {
  transition: background-color .15s ease, border-color .15s ease,
              color .15s ease, box-shadow .15s ease;
}
.btn { transition: background-color .15s ease, border-color .15s ease,
                   color .15s ease, box-shadow .15s ease, transform .1s ease; }
.btn:not(:disabled):active { transform: scale(.97); }

/* 键盘 Tab 聚焦环：鼠标点的不画（不打扰），键盘走的才画 */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 斑马纹：极淡隔行底色，流水长表不串行。
   排除 已撤销/停用/日分组 行（它们有自己的底色语义），开单明细表不铺（输入框太密） */
tbody tr:nth-child(even):not(.row-void):not(.row-off):not(.day-row) { background: #fbfcfd; }
tbody tr:hover:not(.day-row):not(.row-void):not(.row-off) { background: #f3f7f5; }
.items-table tbody tr:nth-child(even):not(.row-void):not(.row-off) { background: transparent; }

/* 滚动条细化：Windows 默认的太粗太突兀 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d3d9df; border-radius: 6px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #b6bec7; border: 2px solid transparent; background-clip: padding-box; }
* { scrollbar-width: thin; scrollbar-color: #d3d9df transparent; }

/* 弹窗动效：遮罩淡入、面板从下轻轻浮上来（手机抽屉同样适用） */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }
.mask { animation: fadeIn .15s ease-out; }
.modal { animation: riseIn .18s ease-out; }
.datepop { animation: riseIn .12s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .mask, .modal, .datepop { animation: none; }
  .stat.click, .btn { transition: none; }
}

/* 空状态：统一加一枚淡灰水滴，别只是一行孤零零的灰字 */
.empty { line-height: 1.5; }
.empty::before {
  content: "";
  display: block;
  width: 32px; height: 32px;
  margin: 0 auto 8px;
  opacity: .6;
  background: center / contain no-repeat
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23c2cad2" d="M12 2.6C12 2.6 5.6 10.2 5.6 15a6.4 6.4 0 0 0 12.8 0C18.4 10.2 12 2.6 12 2.6Z"/></svg>');
}

/* ---------- 事件提醒框（右下角） ---------- */
#remindbox {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 310px;
  background: var(--panel); border: 1px solid #f0d9a8; border-left: 4px solid #d97706;
  border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 24, 39, .18); font-size: 13px;
}
.rb-head { padding: 9px 12px; font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; user-select: none; }
.rb-hint { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.rb-list { max-height: 320px; overflow-y: auto; }
.rb-item { padding: 8px 12px; border-top: 1px dashed var(--line); cursor: pointer; }
.rb-item:hover { background: #fdf9f0; }
.rb-line1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rb-exp { color: #b91c1c; font-size: 12px; font-weight: 600; flex: none; }
.rb-soon { color: #b45309; font-size: 12px; flex: none; }
.rb-line2 { color: var(--muted); font-size: 12px; margin-top: 2px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rb-ok { cursor: pointer; color: #0f6e56; flex: none; }
.rb-ok:hover { text-decoration: underline; }

/* 手机端：提醒框挪到标签栏上方，别被盖住 */
@media (max-width: 720px) {
  #remindbox { right: 8px; left: 8px; width: auto; bottom: 64px; }
}

/* ---------- 工厂订货页（page-fx）的订单行 / 底部下单条 ---------- */
.fx-order { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fx-order:last-child { border-bottom: 0; }
.fx-order .l1 { display: flex; justify-content: space-between; font-size: 14px; }
.fx-order .l2 { font-size: 13px; color: var(--muted); margin-top: 3px; }
.fx-foot { position: fixed; left: 0; right: 0; bottom: 0; background: var(--panel);
  border-top: 1px solid var(--line); padding: 10px 16px; display: flex;
  align-items: center; gap: 12px; z-index: 40; }
.fx-foot .grow { flex: 1; }

/* 数字输入框去掉上下小箭头：方向键留给「跳格」（页面级/弹窗级方向键导航），不再改数值 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* 日历里未来日期锁死（点不了），淡化显示 */
.dp-d:disabled { color: var(--muted); opacity: .45; cursor: default; }
