/* 百应订单管理系统 · 全局样式（清爽蓝白 · 白卡片 + 浅灰底，移动优先） */
:root {
  --primary: #1677ff;
  --primary-d: #0958d9;
  --bg: #f2f3f5;
  --card: #ffffff;
  --fill: #f7f8fa;
  --line: #e9ebef;
  --line-soft: #f0f1f4;
  --field: #d9dfe6;
  --text: #1f2329;
  --muted: #86909c;
  --ink2: #4e5969;
  --ok: #009a26;   --ok-bg: #e8ffea;
  --warn: #c25e00; --warn-bg: #fff7e8;
  --info: #1677ff; --info-bg: #eaf3ff;
  --err: #cb2634;  --err-bg: #ffece8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(29,43,58,.045);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text); }
.brand img { height: 26px; width: auto; }
.brand .logo-fallback {
  width: 26px; height: 26px; border-radius: 7px; background: var(--primary);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 13px;
}
.nav a.on, .nav a:hover { background: var(--info-bg); color: var(--primary); }
.user { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }

main { max-width: 1360px; margin: 0 auto; padding: 16px; }
/* 工单工作台等「列表 + 详情」两栏页：铺满可用宽度 */
main.wide { max-width: none; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 28px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* auto-fit：项目少时把剩余宽度全给它们（原来 auto-fill 会切出一堆 120px 窄列，金额直接压出卡外） */
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* 财务总览 6 指标：固定 2 行 × 3 列，窄屏降为单列 */
.grid.fin6 { grid-template-columns: repeat(3, 1fr); }
/* 财务总览扩到八格（工单 / 销售各自的营收、成本、利润、应收）：
   默认两列，工单一行两格、销售一行两格；模块拉宽后自动变四列，工单一行、销售一行 */
.card.fin-mod { container-type: inline-size; }
.grid.fin8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 700px) { .grid.fin8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid.fin6 { grid-template-columns: 1fr; } }

/* 指标卡 */
.metric { background: var(--fill); border-radius: 8px; padding: 12px 14px; container-type: inline-size; }
.metric .m-label { font-size: 12px; color: var(--muted); }
/* 金额字号随卡片宽度缩放：卡窄就缩，别再撑出卡外；不支持 cqw 的老浏览器退回 24px */
.metric .m-value {
  font-size: 24px;
  font-size: clamp(15px, 11.5cqw, 24px);
  font-weight: 600; margin-top: 2px;
  letter-spacing: -.3px; font-variant-numeric: tabular-nums;
}
.metric .m-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.m-ok { color: var(--ok); } .m-warn { color: var(--warn); } .m-err { color: var(--err); }

/* 指标卡彩色顶边（语义配色，便于快速区分） */
.metric.acc-blue   { border-top: 3px solid #1677ff; }
.metric.acc-green  { border-top: 3px solid #00b42a; }
.metric.acc-teal   { border-top: 3px solid #0fc6c2; }
.metric.acc-orange { border-top: 3px solid #ff7d00; }
.metric.acc-red    { border-top: 3px solid #f53f3f; }
.metric.acc-purple { border-top: 3px solid #722ed1; }
.metric.acc-gray   { border-top: 3px solid #86909c; }

/* 工作台指标数字可点击跳转明细 */
.metric .m-value.m-link { color: inherit; text-decoration: none; cursor: pointer;
  display: inline-block; }
.metric .m-value.m-link:hover { text-decoration: underline;
  filter: brightness(0.85); }

/* 状态徽章 */
.badge { display: inline-block; font-size: 11.5px; border-radius: 4px; padding: 1px 7px; white-space: nowrap; font-weight: 500; }
.b-gray { background: #f2f3f5; color: #4e5969; }
.b-ok   { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-red    { background: var(--err-bg); color: var(--err); }
.b-purple { background: #f5e8ff; color: #722ed1; }
.b-teal   { background: #e6fffb; color: #0b9e9a; }

/* 筛选栏：PC 一行排开，手机自动换行 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .f { margin-bottom: 0; }
/* 日期区间（起 至 止）作为一组，手机端再改成整行 */
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range > i { font-style: normal; font-size: 12px; color: var(--muted); }
.quick-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* 类型统计色点 */
.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* ── 工作台自定义布局（12 列栅格，模块可拖拽/隐藏/调宽窄） ── */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.dash-module { grid-column: span 12; min-width: 0; }
/* 模块卡片竖向弹性：图表 / 表格区吃掉剩余高度，底边不留空 */
.dash-module .card { margin-bottom: 0; height: 100%; display: flex; flex-direction: column; }
.dash-module .card > .chart-wrap { flex: 1 1 auto; }
@media (min-width: 720px) {
  .dash-module[data-size="s"] { grid-column: span 4; }
  .dash-module[data-size="m"] { grid-column: span 6; }
  .dash-module[data-size="l"] { grid-column: span 12; }
}
.dash-module.mod-hidden { display: none; }
.dash-module.dragging { opacity: .45; }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mod-tools { display: none; align-items: center; gap: 4px; flex-shrink: 0; }
.mod-grip { cursor: grab; color: var(--muted); font-size: 15px; padding: 0 4px; user-select: none; }
.mod-bar { display: none; justify-content: flex-end; }
body.layout-editing .mod-bar { display: flex; margin-bottom: 8px; }
body.layout-editing .dash-module { outline: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 4px; border-radius: 4px; cursor: grab; }
body.layout-editing .dash-module .mod-tools { display: inline-flex; }
body.layout-editing .dash-module.mod-hidden { display: block; opacity: .45; }
body.layout-editing .dash-module .card { min-height: 50px; }

/* ── 工作台柱状图：柱宽 / 高度随卡片自适应，日期轴贴卡片底部 ── */
.chart-wrap { display: flex; min-height: 190px; }
.bc { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bc-plot { flex: 1 1 auto; display: flex; gap: 8px; padding-top: 18px; min-height: 110px; }
.bc-y { position: relative; width: 52px; flex: 0 0 52px; }
.bc-y span { position: absolute; right: 4px; transform: translateY(-50%);
  font-size: 11px; line-height: 1; color: var(--muted); white-space: nowrap; }
.bc-area { position: relative; flex: 1 1 auto; min-width: 0; }
.bc-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #dde2e8; }
.bc-line.bc-base { border-top: 1px solid #9aa3ad; }
.bc-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 10px; }
.bc-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex;
  flex-direction: column; justify-content: flex-end; }
.bc-bar { position: relative; width: 100%; max-width: 54px; margin: 0 auto;
  background: #a9c7e8; border-radius: 5px 5px 0 0; }
.bc-col.today .bc-bar { background: var(--primary); }
.bc-val { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  margin-bottom: 4px; font-size: 12px; font-weight: 600; line-height: 1;
  color: #5f6368; white-space: nowrap; }
.bc-col.today .bc-val { color: var(--primary); }
.bc-x { display: flex; gap: 10px; padding: 6px 0 0 60px; }
.bc-x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px;
  color: #8a929b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-x span.today { color: var(--primary); font-weight: 600; }
@media (max-width: 430px) {
  .chart-wrap { min-height: 160px; }
  .bc-plot { padding-top: 14px; }
  .bc-y { width: 42px; flex-basis: 42px; }
  .bc-x { padding-left: 50px; gap: 6px; }
  .bc-bars { gap: 6px; }
  .bc-x span, .bc-y span { font-size: 10px; }
  .bc-val { font-size: 10px; margin-bottom: 3px; }
}

/* 表格（手机端横向滚动） */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; color: var(--muted); font-weight: 500; padding: 9px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--fill);
}
.tbl th:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.tbl th:last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); }
.tbl tr:hover td { background: #fafbfc; }

/* 表单 */
label.f { display: block; margin-bottom: 10px; }
label.f span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=color], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: 6px;
  font: inherit; background: var(--card); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #d5d9e0; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,119,255,.12);
}

/* 按钮 */
.btn {
  display: inline-block; border: 1px solid var(--line); background: var(--card);
  color: var(--text); border-radius: 6px; padding: 8px 14px; font: inherit; font-size: 13px;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { background: var(--card); border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: none; background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.block { display: block; width: 100%; }

/* 提示条 */
.flash { border-radius: 6px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #b7ebc6; }
.flash.error { background: var(--err-bg); color: var(--err); border-color: #ffcdc7; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #ffe0b8; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.bars .bar i { display: block; background: var(--info-bg); border-radius: 4px 4px 0 0; }
.bars .bar.today i { background: var(--primary); }
.bars .bar b { font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* 占比条 */
.dist { margin-bottom: 10px; font-size: 12px; }
.dist .d-top { display: flex; justify-content: space-between; margin-bottom: 3px; }
.dist .d-bar { height: 6px; background: var(--bg); border-radius: 3px; }
.dist .d-bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; }
.login-logo { text-align: center; margin-bottom: 20px; }
.login-logo img { height: 48px; }

/* 粘贴解析框 */
.paste-box textarea { min-height: 70px; }
.paste-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 录单页客户检索联想 */
.cust-search { position: relative; }
.cust-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10); max-height: 260px; overflow-y: auto;
}
.cust-item { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line); }
.cust-item:last-child { border-bottom: none; }
.cust-item:hover { background: var(--info-bg); }
.cust-item .ci-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.cust-item.ci-none { cursor: default; color: var(--muted); }
.cust-item.ci-none:hover { background: none; }
.cust-item.ci-add { color: var(--primary); }
#newCustBox { border-style: dashed; }

/* 工单卡片列表（手机端友好） */
.order-item { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; color: var(--text); }
.order-item:hover { border-color: var(--primary); }
.order-item .o-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.order-item .o-no { font-weight: 600; font-size: 13px; }
.order-item .o-sub { font-size: 12px; color: var(--muted); }
.order-item .o-money { font-size: 13px; }

.section-title { font-size: 13px; color: var(--muted); margin: 18px 0 8px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 12px; margin: 0 6px 6px 0; cursor: pointer; }
.chip input { display: none; }
.chip.checked { background: var(--info-bg); border-color: var(--primary); color: var(--primary); }
/* 用 button 做可点标签时抹掉按钮默认外观（解决方案快捷标签） */
button.sol-chip { background: transparent; color: inherit; font: inherit;
                  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button.sol-chip.checked { background: var(--info-bg); }
.tag-list { font-size: 12px; color: var(--muted); }
.tag-list span { margin-right: 10px; }
.log-line { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.log-line b { color: var(--text); font-weight: 500; }

@media (min-width: 720px) {
  main { padding: 20px; }
  .tbl td { white-space: nowrap; }
}

/* ═══════════════════ 左侧导航 + 多标签页外壳 ═══════════════════ */
html.wm-shell, html.wm-shell body { height: 100%; }
html.wm-shell body { display: flex; overflow: hidden; background: var(--bg); }
.main-col { flex: 1 1 auto; min-width: 0; position: relative; }
html.wm-shell .main-col { display: flex; flex-direction: column; }

/* 左侧菜单 */
.shell-side {
  width: 176px; flex: 0 0 176px; background: #1d2b3a; color: #c2ccda;
  display: flex; flex-direction: column;
}
.side-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
  height: 48px; flex: 0 0 48px;
  color: #fff; font-weight: 600; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand img { height: 24px; width: auto; max-width: 100%; }
.side-brand .logo-fallback {
  width: 24px; height: 24px; border-radius: 6px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 24px;
}
.side-brand .brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { flex: 1 1 auto; overflow-y: auto; padding: 2px 6px 10px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.side-group { margin-top: 3px; }
.side-group .g-label { font-size: 11px; color: #6b7b91; letter-spacing: .6px; padding: 8px 8px 4px; }
.side-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px;
  color: #c2ccda; font-size: 13px; line-height: 1.4;
}
.side-item .si { width: 16px; height: 16px; flex: 0 0 16px; opacity: .88; }
.side-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-item.on { background: var(--primary); color: #fff; }
.side-item.on .si { opacity: 1; }
/* @我 未读红点：贴在菜单文字右侧，数字超过 99 显示 99+ */
.side-item .nav-dot {
  margin-left: auto; flex: 0 0 auto; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #d64545; color: #fff; font-size: 11px; font-style: normal;
  line-height: 17px; text-align: center; font-weight: 700;
}
.side-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.side-foot .avatar {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: rgba(255,255,255,.14);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.side-foot .u-meta { min-width: 0; line-height: 1.3; }
.side-foot .u-meta b {
  display: block; color: #e8eef6; font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-foot .u-meta small { color: #7d8ba1; font-size: 11px; }
button.side-logout { border: 0; background: none; cursor: pointer; font-family: inherit; line-height: 1.4; }
.side-logout { margin-left: auto; color: #93a3b8; font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.side-logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-mask { display: none; }

/* 标签条 / 顶部工具栏 */
.tabbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  min-height: 52px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: relative; z-index: 6;
}
/* 系统名：放最左侧，与左侧栏 LOGO 同一行；字色取 LOGO 的青蓝 #00A5E6 */
.tabbar-title {
  flex: 0 0 auto; display: flex; align-items: center;
  padding-right: 12px; margin-right: 2px;
  border-right: 1px solid var(--line); white-space: nowrap;
}
.tb-name {
  font-size: 16px; font-weight: 700; color: #00a5e6;
  letter-spacing: .5px;
}
.tb-user { display: inline-flex; align-items: center; gap: 7px; padding-left: 10px; border-left: 1px solid var(--line); }
.tb-user .avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  background: var(--info-bg); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
.tb-u-meta { display: flex; flex-direction: column; line-height: 1.15; }
.tb-u-meta b { font-size: 12.5px; font-weight: 600; }
.tb-u-meta small { font-size: 11px; color: var(--muted); }
@media (max-width: 900px) {
  .tb-user .tb-u-meta { display: none; }
  .tb-user { border-left: 0; padding-left: 0; }
}
@media (max-width: 720px) { .tabbar-title { display: none; } }
.tabs { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.tabs::-webkit-scrollbar { height: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 7px 0 11px;
  border-radius: 6px; background: var(--fill); color: #4e5969; font-size: 13px; cursor: pointer;
  white-space: nowrap; max-width: 190px; border: 1px solid transparent; user-select: none;
}
.tab:hover { background: #eef0f4; }
.tab.on { background: var(--info-bg); color: var(--primary); border-color: #cfe4ff; box-shadow: none; font-weight: 500; }
.tab .t-title { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.tab .t-x {
  width: 17px; height: 17px; flex: 0 0 17px; border: 0; padding: 0; background: transparent;
  border-radius: 50%; color: #8a97ab; font-size: 14px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tab .t-x:hover { background: var(--err-bg); color: var(--err); }
.tab-tools { flex: 0 0 auto; display: flex; gap: 4px; }
.tool-btn {
  width: 30px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 7px;
  color: #5a6779; font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.tool-btn svg { width: 17px; height: 17px; display: block; }
.tool-btn:hover { background: var(--fill); color: var(--primary); }
.side-toggle { display: none; }

/* 面板 */
.panels { position: relative; flex: 1 1 auto; min-height: 0; background: var(--bg); }
.panel { position: absolute; inset: 0; display: none; background: var(--bg); }
.panel.on { display: block; }
.panel iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.panel.empty { align-items: center; justify-content: center; text-align: center; color: #8a94a6; font-size: 13px; }
.panel.empty.on { display: flex; }

/* 外壳模式下顶层内容由 iframe 承载，隐藏服务端渲染的那份 */
.wm-content { min-width: 0; }
/* 外壳模式下，工作区里除标签条/提示/面板以外的东西都不显示。
   用 :not() 兜底：某些页面模板 </div> 多写了，内容会溢出 .wm-content 变成兄弟节点 */
html.wm-shell .main-col > *:not(.tabbar):not(.tabbar-title):not(.flash-host):not(.panels):not(.m-title):not(.ios-tabbar) { display: none !important; }

/* 提示条 */
html.wm-shell .flash-host {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 70%; pointer-events: none;
}
html.wm-shell .flash-host .flash {
  margin: 0; pointer-events: auto; cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(16,24,40,.45);
}
html.wm-bare .flash-host {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 60;
  width: min(560px, 92vw); padding-top: 14px;
}
html.wm-bare .flash-host .flash { box-shadow: 0 10px 26px -12px rgba(16,24,40,.35); }

/* 嵌入模式（iframe 内）：只留页面本体 */
html.wm-embed body { display: block; height: auto; overflow: visible; background: #fff; }
html.wm-embed .shell-side,
html.wm-embed .tabbar,
html.wm-embed .tabbar-title,
html.wm-embed .panels,
html.wm-embed .side-mask { display: none !important; }
html.wm-embed .main-col { display: block; }
html.wm-embed main { max-width: none; margin: 0; padding: 18px 18px 24px; }
html.wm-embed .footer { display: none; }
/* 提示条在 iframe 里浮在内容上方（临时提醒）：不占文档流，几秒后自动淡出，
   消失后页面立刻回到原位，不会把标签行和卡片顶下去 */
html.wm-embed .flash-host {
  position: fixed; top: 8px; left: 0; right: 0; z-index: 80;
  display: flex; justify-content: center; padding: 0 12px;
  pointer-events: none;
}
html.wm-embed .flash-host .flash {
  width: 100%; max-width: 560px; margin: 0; pointer-events: auto;
  box-shadow: 0 10px 26px -12px rgba(16,24,40,.35);
}

@media (max-width: 900px) {
  .shell-side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 200;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: 6px 0 26px rgba(15,23,42,.3);
  }
  body.side-open .shell-side { transform: none; }
  body.side-open .side-mask { display: block; position: fixed; inset: 0; z-index: 190; background: rgba(15,23,42,.38); }
  .side-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    flex: 0 0 30px; border: 1px solid #d6dde7; background: #fff; border-radius: 7px;
    cursor: pointer; color: #46536a; font-size: 14px; padding: 0;
  }
  .side-toggle svg { width: 18px; height: 18px; display: block; }
  .tab { max-width: 150px; }
  .tab .t-title { max-width: 106px; }
}

/* ═══════════════════════════════════════════════════════════════
   iOS 风格移动端（≤720px）
   目标：贴近 iPhone 原生 App —— 分组白卡 + 灰底、44px 触控区、
   系统色、底部标签栏、半透明顶栏、安全区适配
   ═══════════════════════════════════════════════════════════════ */

/* 仅手机出现的外壳元素：默认隐藏 */
.m-title { display: none; }
.ios-tabbar { display: none; }
.m-list { display: none; }

@media (max-width: 720px) {
  :root {
    --radius: 14px;
    --line: rgba(60, 60, 67, .16);
    --muted: #8e8e93;
  }
  html { -webkit-text-size-adjust: 100%; }
  body {
    font: 15px/1.5 -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue",
          "Microsoft YaHei", sans-serif;
    background: #f2f2f7; color: #1c1c1e;
    -webkit-font-smoothing: antialiased;
  }
  a, button, .chip, .order-item, .tab { -webkit-tap-highlight-color: transparent; }
  main { max-width: none; padding: 16px 16px 28px; }
  .footer { font-size: 11px; padding: 16px 0 22px; color: #a1a1a6; }

  /* ── 卡片：白底、无边框、轻投影（iOS 分组卡片） ── */
  .card {
    border: 0; border-radius: 16px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
  }
  .card h3 { font-size: 17px; font-weight: 600; letter-spacing: -.2px; margin: 0 0 10px; }
  /* 卡片内的操作条：标题可收缩、按钮不溢出、说明文字独占整行 */
  .card .row-actions { flex-wrap: wrap; gap: 8px; align-items: center; }
  .card .row-actions > h3 { flex: 1 1 auto; min-width: 0; margin: 0; }
  .card .row-actions > .btn, .card .row-actions > a.btn { flex: 0 0 auto; white-space: nowrap; }
  .card .row-actions > p, .card .row-actions > span.tag-list,
  .card .row-actions > .paste-hint { flex: 1 1 100%; }
  /* 卡片标题行（标题 + 右侧按钮）：不让长标题把按钮顶出卡片 */
  .card .card-head { flex-wrap: wrap; gap: 8px; align-items: center; }
  .card .card-head > h3 { flex: 1 1 auto; min-width: 0; }
  .card .card-head > .btn, .card .card-head > a.btn { flex: 0 0 auto; white-space: nowrap; }
  /* 卡片内的行内表单：两列网格，控件不再挤成一团 */
  .card > form.row-actions:not(.filter-bar) {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .card > form.row-actions:not(.filter-bar) > input[type=hidden] { display: none; }
  .card > form.row-actions:not(.filter-bar) > input[type=text],
  .card > form.row-actions:not(.filter-bar) > input[type=file],
  .card > form.row-actions:not(.filter-bar) > textarea,
  .card > form.row-actions:not(.filter-bar) > label.f,
  .card > form.row-actions:not(.filter-bar) > .paste-hint { grid-column: 1 / -1; }
  .card > form.row-actions:not(.filter-bar) > input,
  .card > form.row-actions:not(.filter-bar) > select { width: 100% !important; }
  .card > form.row-actions:not(.filter-bar) > .btn { width: 100%; }
  .card > form.row-actions:not(.filter-bar) > .btn + .btn { margin-left: 0; }
  .section-title { font-size: 13px; font-weight: 600; color: #8e8e93; margin: 20px 4px 8px; }

  /* ── 栅格：默认单列，指标块两列 ── */
  .grid, .grid.c2, .grid.c3, .grid.c4, .grid.fin6, .grid.fin8 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .grid.c4, .grid.c2.tiles2, .grid.fin6, .grid.fin8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* ── 指标卡：数字放大、语义配色移到数字上 ── */
  .metric {
    background: #fff; border-radius: 12px; padding: 12px 14px;
    border: 1px solid rgba(60, 60, 67, .07);
    display: flex; flex-direction: column;
  }
  .metric.acc-blue, .metric.acc-green, .metric.acc-teal, .metric.acc-orange,
  .metric.acc-red, .metric.acc-purple, .metric.acc-gray { border-top: 1px solid rgba(60, 60, 67, .07); }
  .metric .m-label { font-size: 12px; color: #8e8e93; }
  .metric .m-value {
    font-size: 22px;
    font-size: clamp(17px, 12cqw, 22px);
    font-weight: 700; letter-spacing: -.6px; margin-top: 2px;
    font-variant-numeric: tabular-nums;
  }
  /* 说明统一预留两行，避免同一行卡片一高一矮、底部大块空白 */
  .metric .m-sub { font-size: 11px; color: #a1a1a6; line-height: 1.4; margin-top: 4px; min-height: 2.8em; }
  .metric.acc-blue   .m-value { color: #0a84ff; }
  .metric.acc-green  .m-value { color: #1d8a3c; }
  .metric.acc-teal   .m-value { color: #0d8a8a; }
  .metric.acc-orange .m-value { color: #c26a00; }
  .metric.acc-red    .m-value { color: #d70015; }
  .metric.acc-purple .m-value { color: #8a3ab5; }
  .metric.acc-gray   .m-value { color: #6c6c70; }
  /* 数字本身有语义色（利润正负）时以它为准 */
  .metric .m-value.m-ok { color: #1d8a3c; }
  .metric .m-value.m-err { color: #d70015; }

  /* ── 徽章：胶囊 + 系统色淡底 ── */
  .badge { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
  .b-gray   { background: rgba(120, 120, 128, .14); color: #5f6368; }
  .b-ok     { background: rgba(52, 199, 89, .16);   color: #1d8a3c; }
  .b-warn   { background: rgba(255, 149, 0, .18);   color: #a05a00; }
  .b-info   { background: rgba(0, 122, 255, .14);   color: #0071e3; }
  .b-red    { background: rgba(255, 59, 48, .14);   color: #d70015; }
  .b-purple { background: rgba(175, 82, 222, .16);  color: #8a3ab5; }

  /* ── 表单：44px 高、灰底内嵌、16px 字号（iOS 聚焦不放大） ── */
  label.f { margin-bottom: 12px; }
  label.f span { font-size: 13px; color: #6c6c70; margin-bottom: 6px; }
  input[type=text], input[type=password], input[type=number], input[type=date],
  input[type=color], select, textarea {
    font-size: 16px; min-height: 44px; padding: 10px 12px; border: 0;
    background: #f2f2f7; border-radius: 10px; color: #1c1c1e;
    -webkit-appearance: none; appearance: none;
  }
  select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.4 6 8.4l4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
  }
  textarea { min-height: 120px; padding: 11px 12px; }
  /* 单行输入框文字超长时用省略号，别硬切一半 */
  input[type=text], input[type=password], input[type=number] { text-overflow: ellipsis; }
  input:focus, select:focus, textarea:focus {
    outline: none; border-color: transparent;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, .18);
  }

  /* ── 按钮：圆角实心/淡底，带按压反馈 ── */
  .btn {
    border: 0; background: #ececef; color: #007aff; border-radius: 10px;
    min-height: 40px; padding: 0 16px; font-size: 16px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  .btn:hover { background: #ececef; }
  .btn.primary { background: #007aff; border: 0; color: #fff; }
  .btn.primary:hover { background: #007aff; filter: none; }
  .btn.danger { background: rgba(255, 59, 48, .12); color: #ff3b30; }
  .btn.small { min-height: 32px; font-size: 14px; padding: 0 12px; border-radius: 8px; }
  .btn.block { width: 100%; min-height: 50px; font-size: 17px; font-weight: 600; border-radius: 12px; }
  .btn:active { opacity: .55; }
  .btn + .btn { margin-left: 8px; }
  .row-actions { gap: 8px; }
  .row-actions .btn + .btn { margin-left: 0; }

  /* ── 表格：细线分隔、表头灰底 ── */
  .table-wrap { border-radius: 12px; -webkit-overflow-scrolling: touch; }
  table.tbl { font-size: 14px; }
  .tbl th {
    font-size: 12px; font-weight: 500; color: #8e8e93; padding: 9px 10px;
    background: #f9f9fb; border-bottom: .5px solid rgba(60, 60, 67, .16);
  }
  .tbl td { padding: 11px 10px; border-bottom: .5px solid rgba(60, 60, 67, .13); }
  /* 表格在手机上横向滚动，单元格不再折成一字一行 */
  .table-wrap .tbl th, .table-wrap .tbl td { white-space: nowrap; }
  .table-wrap .tbl td input, .table-wrap .tbl td select { min-width: 72px; }
  .tbl tr:hover td { background: transparent; }
  .tbl tr:last-child td { border-bottom: 0; }

  /* ── 列表项 / 标签 / 提示 ── */
  .order-item {
    background: #fff; border: 0; border-radius: 12px; padding: 14px 16px;
    margin-bottom: 8px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
  }
  .order-item:hover { border-color: transparent; }
  .order-item:active { background: #f2f2f7; }
  .order-item .o-no { font-size: 15px; }
  .order-item .o-sub { font-size: 13px; color: #8e8e93; }
  .tag-list { font-size: 14px; color: #3c3c43; }
  .tag-list > div { padding: 4px 0; }
  /* 卡片里的说明性段落用小一号的灰字（iOS 脚注） */
  .card > p.tag-list { font-size: 12px; color: #9a9aa0; line-height: 1.55; }
  .log-line { font-size: 13px; padding: 8px 0; }
  .chip {
    border: 0; background: #fff; box-shadow: inset 0 0 0 1px rgba(60, 60, 67, .12);
    border-radius: 10px; padding: 8px 14px; font-size: 14px; margin: 0 8px 8px 0;
  }
  .chip.checked { background: rgba(0, 122, 255, .12); color: #007aff; box-shadow: none; }
  .flash { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
  .flash.ok    { background: rgba(52, 199, 89, .14); color: #1d8a3c; }
  .flash.error { background: rgba(255, 59, 48, .12); color: #d70015; }
  .flash.warn  { background: rgba(255, 149, 0, .14); color: #a05a00; }
  .paste-hint { font-size: 12px; color: #a1a1a6; }
  .quick-links .btn { min-height: 34px; font-size: 14px; }

  /* 嵌在 iframe 里（手机上的内容区） */
  html.wm-embed body, html.wm-bare body { background: #f2f2f7; }
  html.wm-embed main { padding: 16px 16px 28px; }
  html.wm-shell .main-col { background: #f2f2f7; }
  /* iframe 里不显示底部导航与顶栏（外壳在外层，避免出现两条） */
  html.wm-embed .ios-tabbar, html.wm-embed .tabbar { display: none !important; }

  /* 筛选栏：手机端单列排布。两列会把「起 / 止」日期与查询按钮拆散、错位 */
  .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  /* 控件多的页面（工单、应收）用两列，短控件并排、长控件整行 */
  .filter-bar.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar > * { min-width: 0; width: 100% !important; }
  .filter-bar > input[type=hidden] { display: none; }
  .filter-bar > input[type=text], .filter-bar > .date-range,
  .filter-bar > .quick-links, .filter-bar > .btn.primary { grid-column: 1 / -1; }
  .filter-bar.cols2 > select[name=dby] { grid-column: 1 / -1; }
  .filter-bar > select, .filter-bar > input:not([type=hidden]),
  .filter-bar > .btn, .filter-bar > button { width: 100% !important; }
  .filter-bar > .btn, .filter-bar > button[type=submit] { min-height: 44px; font-size: 16px; }
  .filter-bar > span.tag-list { display: none; }
  .filter-bar > label.f { margin-bottom: 0; }
  /* 应收：工单类型多选整行，别和查询/导出按钮挤在同一格 */
  .filter-bar > .recv-typewrap { grid-column: 1 / -1; }
  /* 日期区间：起 至 止 挤在同一行，语义清楚 */
  .date-range {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center; gap: 8px;
  }
  .date-range > i { font-style: normal; font-size: 13px; color: #8e8e93; }
  /* 快捷区间：四等分，像分段控件 */
  .quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .quick-links .btn { width: 100%; min-height: 34px; font-size: 14px; }

  /* 文本框不显示滚动条；说明文字单独一行 */
  textarea { overflow: auto; }
  textarea::-webkit-scrollbar { width: 0; height: 0; }
  .paste-hint { display: block; margin-top: 6px; }
  /* 原生文件选择按钮改胶囊 */
  input[type=file] { font-size: 14px; color: #6c6c70; }
  input[type=file]::file-selector-button {
    border: 0; background: #007aff; color: #fff; border-radius: 9px;
    padding: 9px 14px; margin-right: 10px; font-size: 15px; font-weight: 500;
  }

  /* ── 顶栏：44px 内容 + 安全区（高度必须把安全区算进去，否则内容被挤扁） ── */
  .tabbar {
    min-height: calc(44px + env(safe-area-inset-top));
    height: calc(44px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0;
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: .5px solid rgba(60, 60, 67, .22);
  }
  .tabbar .tabs { display: none; }
  .side-toggle, .tool-btn {
    width: 40px; height: 40px; flex: 0 0 40px; border: 0; background: transparent;
    color: #007aff; border-radius: 10px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .side-toggle svg, .tool-btn svg { width: 22px; height: 22px; display: block; }
  .side-toggle:active, .tool-btn:active { background: rgba(120, 120, 128, .12); }
  .tool-btn:hover { background: transparent; }
  .m-title {
    display: flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 3px;
    min-width: 0; height: 44px; border: 0; background: transparent; padding: 0;
    font-size: 17px; font-weight: 600; color: #1c1c1e; letter-spacing: -.2px;
  }
  .m-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-title-chev { width: 11px; height: 11px; flex: 0 0 11px; fill: none; stroke: #8e8e93; stroke-width: 1.8; }
  .m-title:active { opacity: .45; }

  /* 提示条落在顶栏下方 */
  html.wm-shell .flash-host { top: calc(50px + env(safe-area-inset-top)); max-width: 92%; }
  html.wm-bare .flash-host { width: auto; left: 12px; right: 12px; transform: none; }
  html.wm-embed .flash-host { padding: 0 8px; }

  /* ── 底部标签栏 ── */
  .ios-tabbar {
    display: flex; flex: 0 0 auto;
    height: calc(50px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(249, 249, 249, .96);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid rgba(60, 60, 67, .29);
  }
  .tb-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    border: 0; background: transparent; color: #8e8e93;
    font-size: 10px; line-height: 1.1; padding: 0; cursor: pointer;
  }
  .tb-item svg { width: 24px; height: 24px; }
  .tb-item.on { color: #007aff; }
  .tb-item:active { opacity: .45; }
  .tb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* 底部标签浮层（已打开页面） */
  .sheet-mask {
    position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .3);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .sheet-mask.on { opacity: 1; pointer-events: auto; }
  .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 310; max-height: 72vh;
    background: #f9f9f9; border-radius: 16px 16px 0 0;
    padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
    transform: translateY(102%); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    overflow: auto; -webkit-overflow-scrolling: touch;
  }
  .sheet.on { transform: none; }
  .sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: #c7c7cc; margin: 6px auto 8px; }
  .sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 16px 10px; font-size: 13px; color: #8e8e93; font-weight: 600;
  }
  .sheet-head button { border: 0; background: transparent; color: #007aff; font-size: 15px; font-weight: 600; }
  .sheet-row {
    display: flex; align-items: center; gap: 10px; padding: 13px 16px;
    background: #fff; border-bottom: .5px solid rgba(60, 60, 67, .13);
    font-size: 16px; color: #1c1c1e;
  }
  .sheet-row:first-of-type { border-top: .5px solid rgba(60, 60, 67, .13); }
  .sheet-row.on { color: #007aff; font-weight: 600; }
  .sheet-row .s-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet-row .s-x {
    width: 26px; height: 26px; flex: 0 0 26px; border: 0; border-radius: 50%;
    background: rgba(120, 120, 128, .14); color: #8e8e93; font-size: 15px;
    line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  }
  .sheet-row .s-x:active { background: rgba(120, 120, 128, .26); }

  /* ── 工单列表：手机上用卡片行代替横向滚动表格 ── */
  .hide-m { display: none !important; }
  .m-list { display: block; }
  .list-card { background: transparent; box-shadow: none; padding: 0; }
  .m-cell {
    display: flex; align-items: center; gap: 10px; background: #fff;
    border-radius: 12px; padding: 13px 14px; margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05); color: #1c1c1e;
  }
  .m-cell:active { background: #f2f2f7; }
  .m-cell-main { flex: 1 1 auto; min-width: 0; }
  .m-cell-title {
    display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600;
    letter-spacing: -.2px; margin-bottom: 3px;
  }
  .m-cell-title .no { color: #007aff; }
  .m-cell-sub { font-size: 14px; color: #3c3c43; margin-bottom: 2px; }
  .m-cell-meta { font-size: 12px; color: #8e8e93; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-chev {
    width: 8px; height: 8px; flex: 0 0 8px; border-right: 1.6px solid #c7c7cc;
    border-bottom: 1.6px solid #c7c7cc; transform: rotate(-45deg); margin-left: 2px;
  }

  /* ── 抽屉菜单 ── */
  .shell-side {
    width: 300px; flex-basis: 300px;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 0 18px 18px 0;
    box-shadow: 10px 0 34px rgba(15, 23, 42, .34);
  }
  .side-brand {
    height: 52px; flex-basis: 52px; padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  .side-brand img { height: 26px; }
  .side-nav { padding: 4px 10px 18px; overscroll-behavior: contain; }
  .side-group { margin-top: 0; }
  .side-group .g-label {
    font-size: 11px; font-weight: 500; letter-spacing: .6px; color: #75859b;
    padding: 15px 10px 5px;
  }
  .side-item {
    gap: 12px; padding: 11px 10px; border-radius: 9px; font-size: 15.5px;
  }
  .side-item .si { width: 19px; height: 19px; flex-basis: 19px; }
  .side-item:active { background: rgba(255, 255, 255, .12); }
  .side-foot {
    padding: 10px 14px; gap: 10px;
    background: rgba(0, 0, 0, .18);
    border-top: 1px solid rgba(255, 255, 255, .07);
  }
  .side-foot .avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; }
  .side-foot .u-meta b { font-size: 15px; }
  .side-foot .u-meta small { font-size: 11px; color: #8695a9; }
  .side-logout {
    font-size: 13px; padding: 7px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: #d7e1ee;
  }
  button.side-logout { background: rgba(255, 255, 255, .1); }
  .side-logout:active { background: rgba(255, 255, 255, .2); }

  /* 登录页 */
  .login-wrap { align-items: center; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); }
  .login-box { max-width: 400px; }
  .login-logo { margin-bottom: 26px; }
  .login-logo img { height: 62px; }
  .login-logo h2 { font-size: 26px; font-weight: 700; letter-spacing: -.6px; }
  .login-box .card { padding: 18px; }
}

/* ══════════════════════════════════════════════════════
   统一确认框（替代浏览器原生 confirm / alert）
   居中卡片 + 取消/确认两个按钮；危险操作确认键变红
   ══════════════════════════════════════════════════════ */
/* 注意：这里刻意不做「打开弹窗就锁滚动」。锁滚动会让遮罩一旦出问题就整页死掉
   （看不见弹窗 + 滑不动 + 点不动）。遮罩本身铺满屏幕，无需再锁。 */

.wm-alert-mask {
  position: fixed; inset: 0; z-index: 2147483000;
  /* 默认 display:none —— 未打开时绝不占位、绝不拦截点击 */
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .42);
  /* 不用 backdrop-filter：全屏固定层再叠一层高斯模糊，部分安卓内核会卡合成层 */
  -webkit-tap-highlight-color: transparent;
}
.wm-alert-mask[hidden] { display: none !important; }
/* 遮罩不做透明度动画：只要显隐依赖 opacity 过渡，动画没跑完/被系统禁用时
   就会停在全透明状态 —— 看不见弹窗，却挡住整页点击。这里改成瞬间出现 */
.wm-alert-mask.on { display: flex; opacity: 1; }
@keyframes wmAlertPop { from { transform: scale(.94); } }

.wm-alert {
  width: min(320px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .26);
  overflow: hidden;
}
.wm-alert-mask.on .wm-alert { animation: wmAlertPop .22s cubic-bezier(.32, .72, 0, 1); }

.wm-alert-body { padding: 22px 20px 18px; text-align: center; }
.wm-alert-title {
  font-size: 17px; font-weight: 600; color: #1c1c1e;
  letter-spacing: -.2px; line-height: 1.35;
}
.wm-alert-title[hidden] { display: none; }
.wm-alert-msg {
  font-size: 13.5px; line-height: 1.6; color: #3c3c43;
  margin-top: 8px; word-break: break-word; white-space: pre-line;
}
.wm-alert-title[hidden] + .wm-alert-msg { margin-top: 0; }
.wm-alert-msg[hidden] { display: none; }
/* wmPrompt 的输入框：跟卡片同风格，聚焦一圈淡蓝 */
.wm-alert-input {
  display: block; width: 100%;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid #d1d1d6; border-radius: 10px;
  font-size: 15px; font-family: inherit; color: #1c1c1e;
  background: #f7f7fa; text-align: left;
  box-sizing: border-box;
}
.wm-alert-input:focus { outline: 0; border-color: #007aff; background: #fff; box-shadow: 0 0 0 3px rgba(0, 122, 255, .18); }
.wm-alert-input[hidden] { display: none; }

.wm-alert-btns {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 16px 16px;
}
.wm-alert.single .wm-alert-btns { grid-template-columns: 1fr; }
.wm-alert-btns > .wm-alert-btn[hidden] { display: none; }
.wm-alert-btn {
  height: 46px; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform .1s ease, filter .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.wm-alert-btn:focus { outline: 0; }
.wm-alert-btn:focus-visible { box-shadow: 0 0 0 3px rgba(0, 122, 255, .3); }
.wm-alert-ok.danger:focus-visible { box-shadow: 0 0 0 3px rgba(255, 59, 48, .3); }
.wm-alert-btn:active { transform: scale(.97); filter: brightness(.94); }
.wm-alert-cancel { background: #f2f2f7; color: #1c1c1e; }
.wm-alert-ok { background: #007aff; color: #fff; }
.wm-alert-ok.danger { background: #ff3b30; }

/* ══════════════════════════════════════════════════════
   无外壳模式（手机 / 窄窗口：html.wm-nosh）
   内容直接按文档流渲染，滚动和点击都是浏览器原生行为。
   iframe 外壳只在宽屏桌面保留 —— 个别安卓浏览器（一加自带等）
   对 iframe 尺寸、固定层的处理不一致，会出现「整页滑不动、点不动」，
   这条路从根上绕开它。
   ══════════════════════════════════════════════════════ */
html.wm-nosh, html.wm-nosh body { height: auto; }
html.wm-nosh body {
  display: block; overflow: visible; background: #f2f2f7;
  padding-bottom: calc(52px + env(safe-area-inset-bottom));
}
html.wm-nosh .main-col { display: block; }
html.wm-nosh #wmPanels, html.wm-nosh #wmTabs { display: none !important; }

/* 顶栏吸顶、底栏固定；不用半透明模糊，避开安卓合成层毛病 */
html.wm-nosh .tabbar {
  position: sticky; top: 0; z-index: 50;
  -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff;
}
html.wm-nosh .ios-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  -webkit-backdrop-filter: none; backdrop-filter: none; background: #f9f9f9;
}
/* 提示条走文档流：紧跟吸顶栏之后占位，不再浮在卡片上把工单号/状态盖住 */
html.wm-nosh .flash-host {
  position: static; left: auto; right: auto; top: auto;
  width: auto; transform: none; padding: 0 16px; z-index: auto;
}
html.wm-nosh .flash-host .flash { margin: 12px 0 0; box-shadow: none; }
html.wm-nosh .m-title, html.wm-nosh .m-title-chev { pointer-events: none; }
html.wm-nosh .m-title-chev { display: none; }

/* 抽屉菜单：宽屏手机 / 平板也一律按抽屉处理 */
html.wm-nosh .shell-side {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 200;
  width: 280px; flex-basis: 280px;
  transform: translateX(-100%); transition: transform .18s ease;
  box-shadow: 6px 0 26px rgba(15, 23, 42, .3);
}
html.wm-nosh body.side-open .shell-side { transform: none; }
html.wm-nosh .side-mask { display: none; }
html.wm-nosh body.side-open .side-mask {
  display: block; position: fixed; inset: 0; z-index: 190; background: rgba(15, 23, 42, .38);
}
html.wm-nosh .side-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px; border: 0; background: transparent;
  border-radius: 10px; color: #007aff; padding: 0;
}
html.wm-nosh .side-toggle svg { width: 22px; height: 22px; display: block; }

/* ══════════════════════════════════════════════════════
   登录页：IP 锁定提示 / 图形验证码
   ══════════════════════════════════════════════════════ */
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row input { flex: 1; min-width: 0; }
.code-row img {
  height: 46px; width: 108px; flex: none; background: #fff;
  border: 1px solid #dfe3e8; border-radius: 10px; cursor: pointer;
}
.login-lock {
  background: #fdeceb; border: 1px solid #f6cfca; border-radius: 12px;
  padding: 14px 16px; color: #a53226;
}
.login-lock b { font-size: 15px; }
.login-lock p { margin: 8px 0 0; font-size: 13px; line-height: 1.75; color: #8c3b31; }
.login-lock-tip { color: #9a6b64 !important; font-size: 12px !important; }
.login-lock code {
  background: #fff; padding: 1px 5px; border-radius: 5px; font-size: 12px;
}
.login-warn {
  font-size: 12.5px; color: #8a5a00; background: #fff8e6;
  border-radius: 9px; padding: 8px 12px; margin: 2px 0 12px; line-height: 1.6;
}

/* ── 窄屏防横向溢出（360px 级手机）──────────────────────────
   原生 date 输入框有「最小内容宽度」（Chrome 约 130–150px），
   minmax(0,1fr) 的轨道能缩，但输入框自身 min-width:auto 缩不下去，
   结果整行撑破卡片 → 页面横向溢出、右侧内容被切掉。
   给这一行里的控件显式 min-width:0，让它们真正跟着轨道缩。 */
@media (max-width: 720px) {
  .date-range > input,
  .date-range > input[type=date],
  .date-range > input[type=text] { min-width: 0 !important; width: 100% !important; }
  .date-range > i { white-space: nowrap; }
  /* 极窄屏（≤380px）把「至」竖排会让行高变大，这里改为缩小字号而不是换行 */
  @media (max-width: 380px) {
    .date-range > input { font-size: 13px !important; padding-left: 6px; padding-right: 2px; }
    .date-range { gap: 5px; }
  }
  /* 注意：这里刻意不给 html/body 加 overflow-x:hidden —— 那会让吸顶顶栏失效
     （overflow 会把滚动容器从视口换到 body 上）。撑宽的元素交给页面自检上报定位。 */
}

/* ── 工单附件（图片 / PDF） ── */
.att-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.att-count { display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
             padding: 0 5px; border-radius: 9px; background: var(--primary);
             color: #fff; font-size: 11px; text-align: center; vertical-align: 2px; }
.att-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.att-pick { position: relative; display: inline-flex; align-items: center; gap: 8px;
            height: 38px; padding: 0 12px; border: 1px dashed #c7d0dc; border-radius: 9px;
            background: #fafbfd; color: var(--muted); font-size: 13px;
            cursor: pointer; overflow: hidden; max-width: 100%; }
.att-pick input { position: absolute; inset: 0; width: 100%; height: 100%;
                  opacity: 0; cursor: pointer; }
.att-pick-btn { color: var(--primary); white-space: nowrap; flex: none; }
.att-submit { height: 38px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px; margin-top: 10px; }
.att-item { border: 1px solid #e4e9f0; border-radius: 10px; padding: 6px;
            background: #fff; overflow: hidden; min-width: 0; }
.att-thumb { display: flex; align-items: center; justify-content: center; width: 100%;
             aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; background: #f2f5f9; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-pdf { font-size: 12px; font-weight: 600; color: var(--err); letter-spacing: .5px; }
.att-name { font-size: 12px; margin-top: 6px; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 11px; color: var(--muted); overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }
.att-ops { display: flex; align-items: center; gap: 8px; margin-top: 4px;
           font-size: 12px; flex-wrap: wrap; }
.att-ops a { color: var(--primary); text-decoration: none; }
.att-del { border: 0; background: none; padding: 0; color: var(--err);
           font-size: 12px; cursor: pointer; }

@media (max-width: 720px) {
  .att-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
  .att-form { gap: 6px; flex-wrap: nowrap; }
  .att-pick { flex: 1 1 auto; min-width: 0; }
  .att-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .att-submit { flex: 0 0 88px; }
  /* 窄屏一格只有 90 多像素：操作行缩小一点，保证「查看 下载 删除」排得下不断行 */
  .att-ops { gap: 5px; font-size: 11px; flex-wrap: nowrap; }
  .att-ops a, .att-del { font-size: 11px; }
}

/* ── 录单页：客户信息 / 历史工单 左右各半（窄屏上下堆叠）── */
.cust-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px; align-items: stretch; margin-bottom: 16px;
}
.cust-split > .card { margin-bottom: 0; }
.hist-card { display: flex; flex-direction: column; }
.hist-body { font-size: 13px; flex: 1; min-height: 0; }
.hist-empty { color: var(--muted); margin: 4px 0; line-height: 1.7; }
.hist-note {
  background: var(--warn-bg); color: var(--warn); border-radius: 8px;
  padding: 7px 10px; margin-bottom: 8px; font-size: 12.5px; line-height: 1.55;
}
.hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.hist-row {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: var(--card); color: var(--text);
}
.hist-row:hover { border-color: var(--primary); background: #f6fbff; }
.hist-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-no { font-weight: 600; font-size: 13px; letter-spacing: .2px; }
.hist-fee { margin-left: auto; color: var(--err); font-weight: 600; font-size: 13px; }
.hist-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.hist-fault { color: #4b5563; }
@media (max-width: 900px) {
  .cust-split { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hist-list { max-height: none; }
}

/* ── 录单页：该客户已登记设备（点一台自动填入）── */
.dev-pick {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; background: #fafcff;
}
.dev-pick-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.dev-pick-title { font-size: 13px; font-weight: 600; }
.dev-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-chip {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; padding: 7px 12px; max-width: 100%;
}
.dev-chip b { font-weight: 600; font-size: 13px; }
.dev-sub { font-size: 11.5px; color: var(--muted); }
.dev-chip:hover { border-color: var(--primary); }
.dev-chip.on {
  border-color: var(--primary); background: var(--info-bg);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.dev-chip.on b { color: var(--primary); }
.dev-chip-new { border-style: dashed; }
.dev-picked { margin: 8px 0 0; font-size: 12px; color: var(--ok); }
.dev-empty {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.6;
  color: var(--warn); background: var(--warn-bg);
  border-radius: 8px; padding: 7px 10px;
}
@media (max-width: 720px) {
  .dev-list { flex-direction: column; }
  .dev-chip { width: 100%; padding: 10px 12px; }
  .dev-chip b { font-size: 14px; }
  .dev-sub { font-size: 12px; }
}

/* ── 维修中状态徽章 + 检测信息展示 ── */
.detect-box {
  margin-top: 10px; padding: 8px 12px;
  background: var(--fill); border: 1px solid var(--line); border-radius: 8px;
}
.detect-row {
  display: flex; gap: 10px; padding: 2px 0;
  font-size: 13px; line-height: 1.65;
}
.detect-k { flex: 0 0 62px; color: var(--muted); }
.detect-v { flex: 1 1 auto; min-width: 0; white-space: pre-line; word-break: break-word; }
.detect-view { margin-top: 8px; }
@media (max-width: 720px) {
  .detect-row { font-size: 13.5px; }
  .detect-k { flex: 0 0 56px; }
}

/* ── 工单详情：客户信息 / 设备信息严格左右各半（窄屏上下堆叠）── */
.grid.c2eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid.c2eq { grid-template-columns: minmax(0, 1fr); }
}

/* ── 工单详情：客户信息 / 设备信息卡内两列三行（手机单列）── */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin-top: 2px;
}
.kv-grid > div { min-width: 0; }
.kv-k {
  display: block; font-size: 12px; line-height: 1.5; color: var(--muted);
}
.kv-v {
  display: block; margin-top: 2px;
  font-size: 13.5px; line-height: 1.6; color: var(--text);
  white-space: pre-line; word-break: break-word;
}
.kv-grid > .kv-span { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .kv-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .kv-grid > .kv-span { grid-column: auto; }
  .kv-k { font-size: 12px; }
  .kv-v { font-size: 14px; }
}

/* ══════════ 工单工作台：左列表 + 右详情（宽屏两栏，窄屏单列） ══════════ */
.wb-tip {
  background: var(--info-bg); color: #0b4fae; border: 1px solid #cfe4ff;
  border-radius: 6px; padding: 7px 12px; font-size: 12.5px; margin-bottom: 10px;
}
.wb-tip a { margin-left: 8px; font-weight: 500; }

.wb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px;
      height: calc(100vh - 64px); min-height: 500px; }
.wb-side {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.wb-filter { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.wb-filter input[type=text], .wb-filter select, .wb-filter input[type=date] {
  height: 32px; padding: 0 10px; font-size: 13px;
}
.wb-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wb-f3 { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-f3 .btn { flex: 1 1 auto; padding: 0 8px; height: 30px; font-size: 12.5px; }
.wb-count {
  padding: 8px 12px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line-soft); display: flex; gap: 6px; align-items: center;
}
.wb-count b { color: var(--text); font-size: 13px; }
.wb-count .wb-dby { margin-left: auto; }
.wb-list { flex: 1 1 auto; overflow: auto; min-height: 0; }
.wb-item {
  display: block; padding: 10px 12px 9px 14px; position: relative;
  border-bottom: 1px solid var(--line-soft); color: var(--text);
}
.wb-item:hover { background: #fafbfc; }
.wb-item.on { background: var(--info-bg); }
.wb-item.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.wb-r1 { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.wb-no { font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.wb-r2 { font-size: 13px; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.wb-r2 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-r2 span { font-size: 12px; color: var(--ink2); white-space: nowrap; }
.wb-r3 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wb-r3 em { font-style: normal; float: right; color: var(--ink2); font-variant-numeric: tabular-nums; }
.wb-r4 { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; }
.wb-none { padding: 18px 14px; color: var(--muted); font-size: 13px; }
.wb-nonebig { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.wb-pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px; border-top: 1px solid var(--line); }
.wb-main { min-height: 0; display: flex; min-width: 0; }
.wb-main iframe {
  flex: 1 1 auto; width: 100%; height: 100%; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .wb { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .wb-main { display: none; }
  .wb-side { border: 0; box-shadow: none; background: transparent; overflow: visible; }
  .wb-filter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
               box-shadow: var(--shadow); margin-bottom: 10px; }
  .wb-count { padding: 4px 2px 8px; border-bottom: 0; }
  .wb-list { overflow: visible; }
  .wb-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
             margin-bottom: 10px; box-shadow: var(--shadow); padding: 12px 14px; }
  .wb-item.on::before { display: none; }
  .wb-item.on { border-color: var(--primary); background: var(--card); }
  .wb-pager { border-top: 0; }
}

/* ══════════ 工单列表栏顶部的四块统计 ══════════ */
.wb-head { padding: 12px 12px 0; }
.wb-h-title { display: flex; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 700;
              margin-bottom: 8px; letter-spacing: .2px; }
.wb-h-title > span { margin-right: auto; }
.wb-h-link { font-size: 12px; font-weight: 400; color: var(--muted); }
.wb-h-link:hover { color: var(--primary); }
.wb-stats { display: flex; gap: 5px; margin-bottom: 10px; }
.wb-stat {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 1px 5px; border-radius: 6px; background: var(--fill);
  border: 1px solid transparent; transition: border-color .12s, background .12s;
  color: var(--text); min-width: 0; flex: 1 1 0;
}
.wb-stat b { font-size: 16px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.wb-stat span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wb-stat:hover { border-color: var(--line); background: #fff; }
.wb-stat.on { background: var(--info-bg); border-color: #cfe4ff; }
.wb-stat.on b, .wb-stat.on span { color: var(--primary); }
.wb-stat.st-gray b   { color: #5f6672; }
.wb-stat.st-warn b   { color: #d46b08; }
.wb-stat.st-teal b   { color: #0e7490; }
.wb-stat.st-info b   { color: var(--primary); }
.wb-stat.st-purple b { color: #7d3ac1; }
.wb-stat.st-ok b     { color: #0f9d6e; }
.wb-stat.st-red b    { color: #d4380d; }

/* ══════════ 工单详情：单据式抬头 + 标签页 ══════════ */
.dt-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.dt-head-l { min-width: 0; }
.dt-no {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 17px; font-weight: 700; letter-spacing: .3px; color: var(--primary);
}
.dt-meta { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.dt-assignee { color: var(--primary); }
/* 详情页顶部动作条：不套卡片，只把按钮排到右边 */
.dt-bar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.dt-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* 抬头动作下拉：改派 / 打印 / 撤单 —— 默认收起，点开才占用视觉 */
.act-dd { position: relative; }
.act-dd > summary { list-style: none; }
.act-dd > summary::-webkit-details-marker { display: none; }
.act-dd[open] > summary { border-color: var(--primary); color: var(--primary); }
.act-dd-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 900;
  min-width: 250px; max-width: min(360px, 90vw); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .16); text-align: left; }
.act-dd-list { padding: 6px; }
.act-dd-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink2); }
.act-dd-list a:hover { background: var(--line-soft); color: var(--primary); }
/* 抬头里的说明文字：单独占一行、灰一点，别跟按钮挤成一排 */
.dt-acts .paste-hint { flex: 1 0 100%; margin: 0; font-size: 11.5px; color: var(--muted); }
/* 窄屏：下拉改成「就地展开」，撑满一行；否则绝对定位会被屏幕左/右边裁掉 */
@media (max-width: 720px) {
  .act-dd[open] { flex: 0 0 100%; }
  .act-dd-body { position: static; right: auto; top: auto; width: 100%;
    min-width: 0; max-width: none; margin-top: 8px; box-shadow: none; }
}

.dt-tabs {
  display: flex; gap: 2px; padding: 0 6px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto; box-shadow: var(--shadow);
}
.dt-tabs::-webkit-scrollbar { height: 0; }
/* 标签页与右侧动作按钮（改派 / 打印 / 撤单 / 修改工单）排在同一行 */
.dt-tabrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.dt-tabrow > .dt-tabs { flex: 1 1 auto; min-width: 0; margin: 0; }
.dt-tabrow > .dt-bar { margin: 0; flex: 0 0 auto; }
@media (max-width: 860px) {
  .dt-tabrow { flex-wrap: wrap; gap: 8px; }
  .dt-tabrow > .dt-tabs { flex: 1 1 100%; }
  .dt-tabrow > .dt-bar { flex: 1 1 100%; }
}
.dt-tab {
  padding: 11px 14px; font: inherit; font-size: 13.5px; color: var(--ink2);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  white-space: nowrap; transition: color .12s;
}
.dt-tab:hover { color: var(--primary); }
.dt-tab.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.dt-pane { display: none; }
.dt-pane.on { display: block; }
.dt-pane > .card:last-child { margin-bottom: 0; }
.dt-link { font-size: 12.5px; }

/* 时效条 */
.sla-num { margin-top: 10px; font-size: 14px; }
.sla-num b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sla-bar { height: 8px; margin: 8px 0 2px; background: #eef0f4; border-radius: 4px; overflow: hidden; }
.sla-bar i { display: block; height: 100%; border-radius: 4px;
             background: linear-gradient(90deg, #1677ff, #52c41a); }
.sla-bar.over i { background: linear-gradient(90deg, #fa8c16, #f5222d); }

/* 五步时间线 */
.tl { display: flex; margin: 10px 0 2px; }
.tl-step { flex: 1 1 0; position: relative; text-align: center; padding-top: 20px; min-width: 0; }
.tl-step::before {
  content: ""; position: absolute; top: 5px; left: -50%; right: 50%;
  height: 2px; background: #e6e8eb;
}
.tl-step:first-child::before { display: none; }
.tl-step.done::before { background: #52c41a; }
.tl-dot {
  position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid #d9dde3; box-sizing: border-box;
}
.tl-step.done .tl-dot { background: #52c41a; border-color: #52c41a; }
.tl-step.doing .tl-dot { background: var(--primary); border-color: var(--primary);
                         box-shadow: 0 0 0 4px rgba(22,119,255,.14); }
.tl-n { font-size: 12.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-step.doing .tl-n { color: var(--primary); font-weight: 600; }
.tl-step.todo .tl-n { color: var(--muted); }
.tl-t { font-size: 11px; color: var(--muted); margin-top: 1px;
        font-variant-numeric: tabular-nums; white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis; }

/* 工单进程：节点名可点开改内容（时间 / 环节文本 / 节点说明） */
.tl-n-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit;
  color: inherit; cursor: pointer; max-width: 100%; }
.tl-n-btn:hover { color: var(--primary); text-decoration: underline dotted; }
.tl-pen { font-style: normal; font-size: 10px; color: var(--muted); margin-left: 3px; }
.tl-note { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.25;
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
/* 节点编辑浮层：默认 display:none，加了 .on 才显示（遮罩绝不能靠 opacity 过渡） */
.tl-edit { display: none; position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%); width: min(440px, 92vw); max-height: 86vh;
  overflow: auto; z-index: 940; background: var(--card); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 18px 48px rgba(16, 24, 40, .22); text-align: left; }
.tl-edit.on { display: block; }
/* 「维修中」节点弹窗要放配件 / 人工两张小表，比其它节点宽一档 */
.tl-edit.wide { width: min(660px, 94vw); }
.tl-edit .table-wrap { max-height: 172px; overflow: auto; }
.tl-edit .tbl th, .tl-edit .tbl td { padding: 6px 8px; font-size: 12.5px; }
.tl-edit .cust-list { max-height: 210px; overflow: auto; }
/* 保存 / 取消：内容长的节点（维修中）滚到哪都够得着 */
.tl-edit-acts { margin-top: 12px; position: sticky; bottom: 0;
  background: var(--card); padding: 10px 0 2px;
  box-shadow: 0 -8px 10px -8px rgba(16, 24, 40, .16); }
.tl-edit-h { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; font-size: 14px; margin-bottom: 12px; }
/* 弹窗头：跟进程里这一步一样 —— 节点名 + 状态 + 时间 + 操作人 */
.tl-edit-tt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-edit-tt b { font-size: 15px; color: var(--ink2); }
.tl-edit-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-edit-st { font-style: normal; font-size: 11px; line-height: 1.6; padding: 0 7px;
  border-radius: 20px; background: #f2f4f7; color: var(--muted); }
.tl-edit-st.done { background: #eaf7e6; color: #3f9e2b; }
.tl-edit-st.doing { background: rgba(22, 119, 255, .1); color: var(--primary); }
/* 没有可编辑字段的节点（维修完成 / 待取机）：只读展示这一步记录了什么 */
.tl-edit-ro { margin-top: 2px; }
.tl-edit-ro span { font-size: 12px; color: var(--muted); }
.tl-edit-ro p { margin: 4px 0 0; font-size: 13px; color: var(--ink2);
  line-height: 1.6; white-space: pre-line; word-break: break-word; }
/* 没勾「需要预定配件」时配件说明不可填（灰显） */
.tl-edit .tl-pnote:disabled { background: #f4f5f7; color: #9aa0a6; }
/* 维修完成弹窗：配件 / 人工明细（与进程行同顺序） */
.tl-edit-kv { display: grid; gap: 7px; }
.tl-edit-kv span { font-size: 12px; color: var(--muted); }
.tl-edit-kv p { margin: 2px 0 0; font-size: 13px; color: var(--ink2);
  line-height: 1.6; word-break: break-word; }
.tl-edit-x { background: none; border: 0; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px; }
html.tl-edit-open::after { content: ""; position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(16, 24, 40, .35); z-index: 930; }

/* 顶部动作弹窗（改派 / 撤单）：同样是 display:none → .on 才显示 */
.dt-modal { display: none; position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%); width: min(420px, 92vw); max-height: 86vh;
  overflow: auto; z-index: 960; background: var(--card); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 18px 48px rgba(16, 24, 40, .22); text-align: left; }
.dt-modal.on { display: block; }
.dt-modal-h { display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; margin-bottom: 14px; }
.dt-modal-x { background: none; border: 0; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px; }
.dt-modal-f { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.dt-modal .req { color: #c0392b; font-style: normal; }
html.dt-modal-open::after { content: ""; position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(16, 24, 40, .35); z-index: 950; }

/* 工单进程（竖排）：一步一行 —— 时间 + 节点名 + 操作人 + 内容，最新一步带撤销 */
.pflow { list-style: none; margin: 10px 0 0; padding: 0; }
.pf { position: relative; padding: 0 0 16px 22px; margin-left: 6px;
  border-left: 2px solid var(--line); }
.pf:last-child { border-left-color: transparent; padding-bottom: 2px; }
.pf-dot { position: absolute; left: -7px; top: 3px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 2px solid #d9dde3; box-sizing: border-box; }
.pf.done .pf-dot { background: #52c41a; border-color: #52c41a; }
.pf.doing .pf-dot { background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .14); }
.pf-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 20px; }
.pf-t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-n { font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.pf-n-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit;
  font-size: 13.5px; font-weight: 600; color: inherit; cursor: pointer; }
.pf-n-btn:hover { color: var(--primary); text-decoration: underline dotted; }
.pf.doing .pf-n, .pf.doing .pf-n-btn { color: var(--primary); }
.pf.todo .pf-n { color: var(--muted); font-weight: 400; }
.pf-by { font-size: 11.5px; color: var(--muted); }
.pf-undo { margin-left: auto; }
.pf-d { font-size: 12.5px; color: var(--ink2); margin-top: 3px;
  word-break: break-word; white-space: pre-line; }
.pf-note { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 工单信息：两列紧凑键值行 */
.kv-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 6px; }
.kv-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { flex: 0 0 76px; color: var(--muted); }
.kv-row .v { flex: 1 1 auto; min-width: 0; word-break: break-word; white-space: pre-line; }
.kv-row.kv-full { grid-column: 1 / -1; }

@media (max-width: 900px) {
  .kv-rows { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv-row.kv-full { grid-column: auto; }
  .dt-no { font-size: 15px; }
  .dt-tab { padding: 10px 10px; font-size: 12.5px; }
  .tl-note { display: none; }      /* 手机上时间线太窄，节点说明在编辑框里看 */
  .tl-n { font-size: 11.5px; }
  .tl-t { font-size: 10px; white-space: normal; line-height: 1.25; }  /* 六步时窄屏允许「日期 / 时间」折两行 */
}

/* ══════════ 工单列表：只剩一个搜索框 + 底部「工单明细」入口 ══════════ */
.wb-filter { padding: 10px 12px; }
.wb-search { display: flex; gap: 6px; align-items: center; }
.wb-search .wb-q { height: 32px; padding: 0 10px; font-size: 13px; }
.wb-go {
  flex: 0 0 34px; width: 34px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.wb-go svg { width: 15px; height: 15px; }

.wb-foot {
  flex: 0 0 auto; padding: 8px; border-top: 1px solid var(--line);
  background: var(--card);
}
.wb-ledger {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--fill);
  color: var(--text);
}
.wb-ledger:hover { border-color: var(--primary); background: var(--info-bg); }
.wb-ledger-ico {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 6px;
  background: #fff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.wb-ledger-ico svg { width: 15px; height: 15px; }
.wb-ledger-txt { min-width: 0; line-height: 1.3; }
.wb-ledger-txt b { display: block; font-size: 13px; font-weight: 600; }
.wb-ledger-txt small { display: block; font-size: 11px; color: var(--muted);
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-chev { margin-left: auto; color: var(--muted); font-size: 16px; line-height: 1; }

/* ══════════ 工单明细页：筛选 + 汇总 + 预览 ══════════ */
.lg-head { display: flex; justify-content: space-between; align-items: flex-start;
           gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lg-title { margin: 0; font-size: 16px; font-weight: 700; }
.lg-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.lg-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.lg-f { display: block; margin: 0; }
.lg-f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.lg-f-kw { grid-column: span 2; }
/* 工单类型：多选标签（点选高亮，勾几类就查几类） */
.lg-f-types { grid-column: span 2; }
.lg-f-hint { font-style: normal; font-size: 11px; color: var(--muted); opacity: .85; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lg-chip { position: relative; display: inline-flex; cursor: pointer; }
.lg-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.lg-chip > span {
  display: inline-block; padding: 5px 11px; line-height: 1.35; font-size: 13px;
  border: 1px solid var(--field); border-radius: 999px; color: var(--ink2);
  background: var(--card); user-select: none; transition: background .12s, color .12s, border-color .12s;
}
.lg-chip:hover > span { border-color: var(--primary); color: var(--primary); }
.lg-chip input:checked + span {
  border-color: var(--primary); background: var(--info-bg);
  color: var(--primary); font-weight: 600;
}
.lg-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
/* 应收管理：工单细分类多选整行 */
.recv-typewrap { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.recv-typelabel { font-size: 12.5px; color: var(--ink2); }
.recv-typewrap.off { opacity: .45; }
.recv-typewrap.off .lg-chip { cursor: not-allowed; }
@media (max-width: 560px) {
  .recv-typewrap { gap: 5px; }
}
.lg-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.lg-export { display: inline-flex; align-items: center; gap: 6px; }
.lg-export svg { width: 15px; height: 15px; }
.lg-sum { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.lg-sum-item {
  flex: 1 1 140px; min-width: 0; padding: 10px 12px;
  background: var(--fill); border: 1px solid var(--line-soft); border-radius: 6px;
}
.lg-sum-item span { display: block; font-size: 12px; color: var(--muted); }
.lg-sum-item b { font-size: 19px; font-variant-numeric: tabular-nums; }
.lg-sum-item i { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 2px; }
.lg-note, .lg-empty { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .lg-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-f-kw { grid-column: 1 / -1; }
  .lg-f-types { grid-column: 1 / -1; }
  .lg-sum-item { flex: 1 1 45%; }
}
@media (max-width: 560px) {
  .lg-form { grid-template-columns: minmax(0, 1fr); }
  .lg-f-kw { grid-column: auto; }
  .lg-f-types { grid-column: auto; }
  .lg-chip > span { padding: 6px 12px; }
  .lg-acts .btn { flex: 1 1 auto; }
}

/* 窄屏：列表变卡片流时，工单明细入口跟着变卡片 */
@media (max-width: 1100px) {
  .wb-foot { padding: 0; margin-top: 10px; border-top: 0; background: transparent; }
  .wb-ledger { padding: 12px 14px; background: var(--card); box-shadow: var(--shadow); }
}

/* 工单详情 · 关联单据：宽屏用表格，窄屏换卡片（手机上 7 列塞不下） */
.rel-cards { display: none; }
.rel-card {
  display: block; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--fill); color: var(--text); text-decoration: none;
}
.rel-card:last-child { margin-bottom: 0; }
.rel-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rel-card-top b { font-size: 14px; letter-spacing: .2px; word-break: break-all; }
.rel-card-meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.rel-card-line { margin-top: 3px; font-size: 13px; color: var(--ink2); word-break: break-word; }
.rel-card-line.muted { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .rel-tbl-wrap { display: none; }
  .rel-cards { display: block; }
}
/* 表格里的内联展开面板（应付改已付、流水手工调整）：不能用绝对定位，会被 table-wrap 裁掉 */
.pay-dd { display: inline-block; }
.pay-dd > summary { list-style: none; display: inline-flex; align-items: center; cursor: pointer; }
.pay-dd > summary::-webkit-details-marker { display: none; }
.pay-dd[open] > summary { border-color: var(--primary); color: var(--primary); }
.pay-panel { margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--fill); min-width: 236px; text-align: left; }
.pay-form { display: flex; flex-direction: column; gap: 7px; }
.pay-form + .pay-form { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line); }
.pay-form .pay-t { font-size: 12.5px; font-weight: 700; color: var(--ink2); line-height: 1.5; }
.pay-form .pay-t span { font-weight: 400; color: var(--muted); }
.pay-form input, .pay-form select { width: 100%; box-sizing: border-box; }
.pay-form .pay-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
/* 部分退货：一行一个配件 + 数量输入（放表格内联面板里） */
.ret-row { display: flex; align-items: center; gap: 7px; }
.ret-row .ret-name { flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ret-row .tag-list { white-space: nowrap; font-size: 11.5px; }
.ret-row input[type="number"] { width: 62px !important; flex: 0 0 62px; }
/* 付款流水：已付单元格里的可展开小清单 */
.pay-log { margin-top: 3px; }
.pay-log > summary { font-size: 11.5px; color: var(--primary); cursor: pointer; list-style: none; }
.pay-log > summary::-webkit-details-marker { display: none; }
.pay-log > summary::after { content: ' ▾'; font-size: 10px; }
.pay-log[open] > summary::after { content: ' ▴'; }
.pay-log-list { margin-top: 5px; padding: 7px 8px; border-radius: 8px;
  background: var(--fill); border: 1px solid var(--line); min-width: 190px; }
.pay-log-row { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
  font-size: 11.5px; line-height: 1.6; }
.pay-log-row + .pay-log-row { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 3px; }
/* 操作后定位到的那一行：短暂高亮，眼睛能立刻接上「刚才改的是哪条」 */
.wm-anchor-hit > td, .wm-anchor-hit > th { animation: wmHit 2.4s ease-out 1; }
@keyframes wmHit {
  0%   { background: rgba(255, 193, 7, .42); }
  55%  { background: rgba(255, 193, 7, .22); }
  100% { background: transparent; }
}

/* ── 应收账龄（2026-11-14）：四档汇总条，点一档只看那一档 ── */
.age-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.age-cell { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--fill);
  color: inherit; text-decoration: none; }
.age-cell b { font-size: 16.5px; letter-spacing: -.2px; }
.age-cell span { font-size: 12px; color: var(--ink2); }
.age-cell em { font-size: 11.5px; color: var(--muted); font-style: normal; }
.age-cell:hover { border-color: var(--primary); }
.age-cell.on { border-color: var(--primary); background: var(--info-bg); }
.age-cell.on b { color: var(--primary); }
.age-cell.zero b { color: var(--muted); }
@media (max-width: 720px) { .age-bar { grid-template-columns: repeat(2, 1fr); } }

/* 行内账龄徽章：1 个月内绿、2-3 个月橙、超 3 个月红 */
.age-tag { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 6px;
  font-size: 11.5px; line-height: 17px; white-space: nowrap; }
.age-ok { background: var(--ok-bg); color: var(--ok); }
.age-warn { background: var(--warn-bg); color: var(--warn); }
.age-err { background: var(--err-bg); color: var(--err); }

/* 催收小面板（和退货面板同款折叠） */
.dun-row { margin-top: 5px; }
.dun-row > summary { font-size: 11.5px; color: var(--primary); cursor: pointer; list-style: none; }
.dun-row > summary::-webkit-details-marker { display: none; }
.dun-row > summary::after { content: ' ▾'; font-size: 10px; }
.dun-row[open] > summary::after { content: ' ▴'; }
.dun-form { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--fill); }
.dun-form input[name="note"] { flex: 1 1 170px; min-width: 110px; }
.dun-form .dun-date { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink2); }
.dun-form .dun-date input { width: 130px; }

/* ── 扫码进单（2026-11-14）：手机对准二维码直接进单，省掉手动搜单号 ── */
.scan-card { max-width: 560px; margin: 0 auto; }
.scan-stage { position: relative; margin: 12px 0; border-radius: 12px; overflow: hidden;
  background: #0d1117; aspect-ratio: 4 / 3; display: flex; align-items: center;
  justify-content: center; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 16% 18%; border: 2px solid rgba(255,255,255,.86);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.34); pointer-events: none; }
.scan-frame::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: rgba(37, 185, 122, .9); }
.scan-tip { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center;
  font-size: 12.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); padding: 0 10px; }
.scan-tip.err { color: #ffb4ab; }
.scan-manual { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ── 运行状态页（2026-11-14）：巡检行 + 错误堆栈 ── */
.health-line { font-size: 12.5px; color: var(--ink2); }
.err-blk { border: 1px solid var(--line); border-radius: 8px; background: var(--fill);
  padding: 7px 10px; margin-top: 8px; }
.err-blk > summary { font-size: 12.5px; cursor: pointer; color: var(--err);
  list-style: none; word-break: break-all; }
.err-blk > summary::-webkit-details-marker { display: none; }
.err-blk > summary::after { content: ' ▾'; color: var(--muted); font-size: 10px; }
.err-blk[open] > summary::after { content: ' ▴'; }
.err-blk pre { margin: 8px 0 0; padding: 8px; border-radius: 6px; background: var(--card);
  border: 1px solid var(--line); font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; max-height: 340px; overflow: auto; }

/* ── 重复维修单（2026-11-14）：同手机号 + 同 SN，90 天内又回来修，整行淡橙底 ── */
.badge.b-repeat { background: #ffe9d1; color: #b45309; border: 1px solid #f3c795; font-weight: 600; }
.tbl tr.repeat-row td { background: #fff8f0; }
.tbl tr.repeat-row:hover td { background: #fdf0df; }
.tbl tr.repeat-row td:first-child { box-shadow: inset 3px 0 0 #e8890c; }
.m-cell.repeat-item { background: #fff8f0; }
.wb-item.repeat-item { background: #fff8f0; }
.wb-item.repeat-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #e8890c;
}
.wb-item.repeat-item.on { background: var(--info-bg); }
.m-cell.repeat-item .m-cell-title .no { color: #b45309; }
