:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e3e8f0;
  --text: #1f2733;
  --muted: #7a8699;
  --primary: #2f6bff;
  --primary-dark: #1f55d8;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --blue: #2563eb;
  --sidebar: #1b2433;
  --sidebar-text: #c3ccda;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5;
}

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1b2433 0%, #24344d 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { font-size: 44px; text-align: center; }
.login-logo-img { display: block; width: 230px; max-width: 100%; margin: 0 auto 10px; }
.login-card h1 { font-size: 18px; text-align: center; margin: 10px 0 4px; }
.login-card .muted { text-align: center; margin: 0 0 20px; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.login-hint code { background: #f0f2f7; padding: 1px 5px; border-radius: 4px; }
.error-tip { color: var(--red); font-size: 12px; min-height: 18px; margin: 4px 0; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 220px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; flex-shrink: 0; user-select: none; -webkit-user-select: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { font-size: 26px; }
.brand-logo-img { width: 46px; height: 38px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 4px; flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: 600; color: #fff; }
.brand-sub { font-size: 11px; opacity: .7; }
#nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--sidebar-text); margin-bottom: 2px; transition: background .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .ico { width: 20px; text-align: center; }
/* 管家婆式分组菜单 */
.nav-group { margin-bottom: 2px; user-select: none; -webkit-user-select: none; }
.nav-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--sidebar-text); transition: background .15s; user-select: none; -webkit-user-select: none; overflow: hidden; }
.nav-group-head:hover { background: rgba(255,255,255,.06); }
.nav-group.open > .nav-group-head { color: #fff; }
.nav-group-head .ico { width: 24px; flex-shrink: 0; text-align: center; font-size: 15px; line-height: 1.2; display: inline-block; }
.nav-group-head .lbl, .nav-sub-head .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-head .arrow { flex-shrink: 0; margin-left: 0; font-size: 10px; opacity: .6; transition: transform .18s; }
.nav-group.open .nav-group-head .arrow { transform: rotate(90deg); }
.nav-children { display: none; padding: 2px 0 6px 0; }
.nav-group.open .nav-children { display: block; }
.nav-child { display: block; padding: 7px 12px 7px 42px; border-radius: 7px; font-size: 13px; color: #9fb0c8; cursor: pointer; border-left: 2px solid transparent; user-select: none; -webkit-user-select: none; }
.nav-child:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-child.active { background: rgba(47,107,255,.22); color: #fff; border-left-color: var(--primary); }
.sep-v { width: 1px; height: 20px; background: var(--border); display: inline-block; margin: 0 6px; }
.color-chip { display: inline-block; width: 15px; height: 15px; border-radius: 4px; margin-right: 7px; vertical-align: -3px; border: 1px solid rgba(0,0,0,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* ===== 单据填单界面（管家婆风格） ===== */
.doc-toolbar { display: flex; align-items: center; gap: 2px; padding: 7px 10px; background: #f2f5fa; border: 1px solid var(--border); border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.doc-toolbar .tb { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 9px; border-radius: 6px; cursor: pointer; font-size: 11px; color: #4a5a72; border: 1px solid transparent; user-select: none; }
.doc-toolbar .tb:hover { background: #e3ebf8; border-color: #c9d8ef; }
.doc-toolbar .tb .ic { font-size: 15px; line-height: 1; }
.doc-toolbar .tb.primary { color: var(--primary); font-weight: 600; }
.doc-toolbar .sep { width: 1px; height: 26px; background: #d5dfec; margin: 0 5px; }
.doc-toolbar .spacer { flex: 1; }
.doc-toolbar .who { font-size: 12px; color: #6b7b93; }
.doc-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 16px; padding: 13px 14px; background: #fff; border: 1px solid var(--border); border-top: none; }
.doc-head .f { display: flex; align-items: center; gap: 7px; min-width: 0; }
.doc-head .f.wide { grid-column: span 2; }
.doc-head .f.full { grid-column: 1 / -1; }
.doc-head .f > label { flex-shrink: 0; width: 104px; text-align: right; font-size: 12.5px; color: #5a6a80; }
.doc-head .f > input, .doc-head .f > select { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; font-size: 13px; background: #fff; }
.doc-head .f > input:focus, .doc-head .f > select:focus { border-color: var(--primary); outline: none; }
.doc-head .f > input[readonly] { background: #f6f8fb; color: #6b7b93; }
.doc-grid { border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; background: #fff; overflow: auto; max-height: 46vh; }
.doc-grid table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.doc-grid th { background: #eaf1fb; border: 1px solid #dbe4f0; padding: 7px 8px; font-weight: 600; color: #3d5170; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.doc-grid td { border: 1px solid #e4eaf4; padding: 0; }
.doc-grid td input { width: 100%; border: none; padding: 7px 6px; font-size: 12.5px; background: transparent; }
.doc-grid td input:focus { background: #fffbe6; outline: 1px solid var(--primary); }
.doc-grid td.num input { text-align: right; }
.doc-grid .idx { text-align: center; color: #8a97a8; background: #fafcff; width: 42px; padding: 7px 0; }
.doc-grid .op { text-align: center; width: 52px; }
.doc-grid .op button { border: none; background: transparent; cursor: pointer; font-size: 14px; color: #b04a4a; }
.doc-grid tr.total td { background: #f4f8fe; font-weight: 700; padding: 7px 8px; }
.doc-grid tr.total td.num { text-align: right; }

/* 三级菜单（财务管理 → 往来资金 → 收款单） */
.nav-sub { margin: 1px 0; }
.nav-sub-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 36px; border-radius: 7px; font-size: 13px; color: #8ea3bd; cursor: pointer; transition: background .15s; overflow: hidden; user-select: none; -webkit-user-select: none; }
.nav-sub-head:hover { background: rgba(255,255,255,.05); color: #dbe6f5; }
.nav-sub.open > .nav-sub-head { color: #fff; }
.nav-sub-head .arrow { flex-shrink: 0; margin-left: 0; font-size: 9px; opacity: .5; transition: transform .18s; }
.nav-sub.open .nav-sub-head .arrow { transform: rotate(90deg); }
.nav-grandchildren { display: none; }
.nav-sub.open .nav-grandchildren { display: block; }
.nav-grandchildren .nav-child { padding-left: 56px; font-size: 12.5px; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-name { color: #fff; font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; opacity: .7; margin-bottom: 8px; }
.pub-url { font-size: 11px; color: #8fd0a0; word-break: break-all; margin-bottom: 8px; line-height: 1.4; border-radius: 6px; padding: 4px 6px; transition: background .15s; }
.pub-url:hover { background: rgba(255,255,255,.08); }
.pub-url b { color: #a7e6b4; }
.pub-url .pub-copy { color: #ffd76e; font-weight: 600; }

.main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px; scrollbar-gutter: stable; }
/* 滚动条（常显，清晰可见） */
.main::-webkit-scrollbar { width: 12px; }
.main::-webkit-scrollbar-track { background: #eef2f7; }
.main::-webkit-scrollbar-thumb { background: #b9c6d6; border-radius: 6px; border: 3px solid #eef2f7; }
.main::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
#nav::-webkit-scrollbar { width: 8px; }
#nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
.view-title { font-size: 20px; font-weight: 700; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
@media print {
  body { background: #fff; }
  .sidebar, .view-head, .toolbar, .btn, .tabs, .modal-mask, .toast, button { display: none !important; }
  .main { padding: 0; overflow: visible; }
  #main-content { padding: 0; }
  .card, .table-wrap { border: 1px solid #ccc; box-shadow: none; }
  table { width: 100%; border-collapse: collapse; }
  th, td { border: 1px solid #ccc; }
}

/* ---------- 卡片 / 通用 ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 14px; }
/* 线径记录：每台设备单独卡片 */
.diam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.diam-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px 11px; display: flex; flex-direction: column; }
.diam-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.diam-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.diam-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.diam-val { font-size: 24px; font-weight: 700; line-height: 1; }
.diam-val small { font-size: 12px; font-weight: 500; color: var(--muted); }
.diam-meta { font-size: 12px; color: var(--muted); margin: 6px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.diam-card canvas { width: 100%; height: 110px; display: block; }
.diam-foot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.diam-alarm { color: var(--red); font-weight: 600; }
.diam-gap { font-size: 11px; color: var(--red); margin-top: 4px; background: rgba(220, 38, 38, .07); border-radius: 6px; padding: 3px 7px; }
/* 数据缺失（采集断档）汇总条 */
.diam-gaps { margin-top: 12px; font-size: 13px; }
.diam-gaps .gap-ok { color: var(--green); font-size: 12px; }
.diam-gaps .gap-head { background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .28); color: var(--red); border-radius: 8px; padding: 8px 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.diam-gaps .gap-head span { font-weight: 500; font-size: 12px; color: var(--muted); }
.diam-gaps ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow: auto; }
.diam-gaps li { display: flex; align-items: center; gap: 10px; font-size: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; }
.diam-gaps li b { min-width: 90px; font-weight: 600; }
.diam-gaps .gap-time { color: var(--muted); }
.diam-gaps .gap-len { margin-left: auto; color: var(--red); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--muted); }

/* ---------- 按钮 / 表单 ---------- */
button { cursor: pointer; border: none; border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c1c1; }
.btn-danger:hover { background: #fef2f2; }
.btn-success { background: var(--green); color: #fff; }
.block { width: 100%; display: block; }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12px; }
tr:hover td { background: #fafbfd; }
td .actions { display: flex; gap: 6px; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge.gray { background: #eef1f6; color: #5b6577; }
.badge.blue { background: #e6efff; color: var(--blue); }
.badge.green { background: #e5f7ec; color: var(--green); }
.badge.red { background: #fdeaea; color: var(--red); }
.badge.yellow { background: #fdf3e3; color: var(--yellow); }
.badge.purple { background: #f0e9fd; color: #7c3aed; }

/* ---------- 统计卡片 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .lbl { font-size: 12px; color: var(--muted); }
.stat .num.green { color: var(--green); }
.stat .num.red { color: var(--red); }
.stat .num.blue { color: var(--blue); }
.stat .num.yellow { color: var(--yellow); }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,28,40,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.modal-close { background: none; font-size: 18px; color: var(--muted); }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 20px; right: 20px; background: #1b2433; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; display: none; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { display: block; animation: fadein .2s; }
.toast.err { background: var(--red); }
@keyframes fadein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 其他 ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kv { background: #f7f9fc; border-radius: 8px; padding: 10px 12px; }
.kv .k { font-size: 11px; color: var(--muted); }
.kv .v { font-size: 14px; font-weight: 600; word-break: break-all; }
.trace-chain { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.trace-node { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; min-width: 140px; }
.trace-node .t { font-size: 11px; color: var(--muted); }
.trace-node .n { font-weight: 700; margin-top: 2px; }
.trace-arrow { color: var(--muted); font-size: 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
@media (max-width: 720px) {
  .form-row, .form-row.three { grid-template-columns: 1fr; }
}

/* ================= 大屏看板（多主题可切换） ================= */
body.bs-mode { background: #05060a; }
body.bs-mode .sidebar { display: none; }
body.bs-mode .main { padding: 0; overflow: hidden; }
body.bs-mode .view-title { display: none; }
body.bs-mode #btn-print { display: none; }
body.bs-mode .view-head { display: none; }

/* ---- 主题变量（默认：暖橙工业） ---- */
.bs {
  --bg1: #1d1209; --bg2: #090502;
  --glow1: rgba(249,115,22,.20); --glow2: rgba(251,191,36,.10);
  --grid: rgba(251,146,60,.055);
  --accent: #fb923c; --accent2: #FFC53D; --glow-a: rgba(251,146,60,.65);
  --border: rgba(251,146,60,.24);
  --head-bg: linear-gradient(90deg, rgba(120,53,15,0), rgba(154,52,18,.55), rgba(120,53,15,0));
  --head-line: rgba(251,146,60,.34);
  --panel: linear-gradient(180deg, rgba(58,32,14,.55), rgba(26,15,6,.55));
  --text: #f6e7d6; --muted: #c9a882; --val: #fdba74; --val-glow: rgba(253,186,116,.5);
  --cell: rgba(58,32,14,.62); --cell-line: rgba(251,146,60,.18);
  --radius: 12px; --radius-sm: 8px;
}
/* ---- 科技蓝 ---- */
.bs.t-blue {
  --bg1: #04182f; --bg2: #020b16;
  --glow1: rgba(34,211,238,.16); --glow2: rgba(59,130,246,.14);
  --grid: rgba(64,158,255,.06);
  --accent: #22d3ee; --accent2: #3b82f6; --glow-a: rgba(34,211,238,.7);
  --border: rgba(64,158,255,.26);
  --head-bg: linear-gradient(90deg, rgba(10,60,110,0), rgba(22,96,168,.55), rgba(10,60,110,0));
  --head-line: rgba(64,158,255,.35);
  --panel: linear-gradient(180deg, rgba(14,54,96,.55), rgba(7,28,54,.55));
  --text: #bfe3ff; --muted: #7fb6e8; --val: #4fe3ff; --val-glow: rgba(79,227,255,.55);
  --cell: rgba(12,44,80,.66); --cell-line: rgba(64,158,255,.2);
  --radius: 4px; --radius-sm: 3px;
}
/* ---- 翡翠绿 ---- */
.bs.t-green {
  --bg1: #05170f; --bg2: #020904;
  --glow1: rgba(16,185,129,.18); --glow2: rgba(52,211,153,.10);
  --grid: rgba(52,211,153,.055);
  --accent: #34d399; --accent2: #10b981; --glow-a: rgba(52,211,153,.7);
  --border: rgba(52,211,153,.24);
  --head-bg: linear-gradient(90deg, rgba(6,78,59,0), rgba(6,95,70,.55), rgba(6,78,59,0));
  --head-line: rgba(52,211,153,.32);
  --panel: linear-gradient(180deg, rgba(8,58,44,.55), rgba(4,26,20,.55));
  --text: #d3f5e6; --muted: #86c9b0; --val: #6ee7b7; --val-glow: rgba(110,231,183,.5);
  --cell: rgba(8,58,44,.62); --cell-line: rgba(52,211,153,.18);
  --radius: 10px; --radius-sm: 7px;
}
/* ---- 星云紫 ---- */
.bs.t-purple {
  --bg1: #1a0f2e; --bg2: #0a0616;
  --glow1: rgba(168,85,247,.20); --glow2: rgba(96,165,250,.14);
  --grid: rgba(168,85,247,.06);
  --accent: #c084fc; --accent2: #818cf8; --glow-a: rgba(192,132,252,.7);
  --border: rgba(168,85,247,.26);
  --head-bg: linear-gradient(90deg, rgba(76,29,149,0), rgba(109,40,217,.55), rgba(76,29,149,0));
  --head-line: rgba(168,85,247,.35);
  --panel: linear-gradient(180deg, rgba(52,28,94,.55), rgba(22,12,42,.55));
  --text: #e6dcff; --muted: #b4a3e0; --val: #d8b4fe; --val-glow: rgba(216,180,254,.55);
  --cell: rgba(52,28,94,.62); --cell-line: rgba(168,85,247,.2);
  --radius: 14px; --radius-sm: 9px;
}

.bs { height: 100vh; width: 100vw; display: flex; flex-direction: column; position: relative; overflow: hidden;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text);
  background:
    radial-gradient(1400px 620px at 50% -8%, var(--glow1), transparent 68%),
    radial-gradient(900px 520px at 6% 100%, var(--glow2), transparent 70%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%); }
.bs::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px; }

.bs-head { height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2;
  background: var(--head-bg); border-bottom: 1px solid var(--head-line); }
.bs-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: 6px;
  background: linear-gradient(180deg, #ffffff 8%, var(--accent) 96%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px var(--glow-a)); }
.bs-head .bs-logo { height: 36px; background: #fff; border-radius: 6px; padding: 2px 6px; margin-right: 14px; flex-shrink: 0;
  box-shadow: 0 0 18px var(--glow-a); }
.bs-head .hbar { position: absolute; top: 50%; width: 170px; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--accent)); }
.bs-head .hbar.l { left: 26px; }
.bs-head .hbar.r { right: 26px; transform: translateY(-50%) scaleX(-1); }
.bs-head .bs-time { position: absolute; right: 210px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.bs-head .bs-exit, .bs-head .bs-theme { position: absolute; left: 26px; z-index: 3; }
.bs-head .bs-theme { left: auto; right: 26px; }
/* 大屏内的按钮：深色玻璃风，避免白底刺眼 */
.bs .btn-ghost, .bs .btn-primary { background: rgba(255,255,255,.07); color: var(--text); border: 1px solid var(--border);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.bs .btn-ghost:hover, .bs .btn-primary:hover { background: rgba(255,255,255,.16); color: var(--accent); border-color: var(--accent); }

.bs-body { flex: 1; min-height: 0; z-index: 2; display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; padding: 12px; }
/* 三栏：产线卡片 · 3D 数字孪生 · KPI/图表 */
.bs-body.bs-3col { grid-template-columns: 1fr 1.62fr 1fr; }
.bs-3col .bs-lines { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(0, 1fr); }
/* 窄屏（<1500px）卡片改 3 列，避免行高不够导致文字溢出 */
@media (max-width: 1500px) {
  .bs-body.bs-3col { grid-template-columns: 1.15fr 1.5fr 1fr; }
  .bs-3col .bs-lines { grid-template-columns: repeat(3, 1fr); }
  .bs-3col .bs-line .g2 .r:nth-child(2) { display: none; }
  .bs-3col .bs-line .g2 .r.full { display: none; }
}
.bs-3col .bs-line { padding: 4px 6px; gap: 0; overflow: hidden; justify-content: flex-start; }
.bs-3col .bs-line .n { font-size: 11.5px; }
.bs-3col .bs-line .g2 .r:nth-child(3),
.bs-3col .bs-line .g2 .r:nth-child(5),
.bs-3col .bs-line .g2 .r:nth-child(6) { display: none; }
.bs-3col .bs-line .g2 { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
.bs-3col .bs-line .g2 .r { font-size: 9.5px; line-height: 1.35; }
.bs-3col .bs-line .g2 .r.full { border-top: 0; margin-top: 0; padding-top: 0; }
.bs-3col .bs-line .g2 .r.full b { font-size: 10.5px; }
.bs-line.active { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--glow-a) !important; }
/* 3D 数字孪生面板 */
.bs-panel.bs-3d { padding: 0; overflow: hidden; flex: 1; }
.bs-3d-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.bs-3d-head h4 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 1px; color: var(--accent); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.bs-3d-head h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent2)); box-shadow: 0 0 8px var(--glow-a); }
.bs-3d-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: nowrap; }
.bs3d-btn { font: inherit; font-size: 11px; line-height: 1; padding: 5px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  color: var(--text); background: rgba(255,255,255,.06); border: 1px solid var(--border); backdrop-filter: blur(4px); transition: .18s; }
.bs3d-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,.14); }
.bs3d-btn.on { color: #0b1118; background: var(--accent); border-color: var(--accent); }
.bs-3d-wrap { position: relative; flex: 1; min-height: 0; background: #05080d; }
.bs-3d-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.bs-3d-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px;
  font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }
.bs-3d-foot #bs-3d-focus { color: var(--accent); font-weight: 600; white-space: nowrap; }
.bs-panel.bs-3d:fullscreen { width: 100vw; height: 100vh; border-radius: 0; border: 0; padding: 0; background: #05070c; }
.bs-panel.bs-3d:fullscreen .bs-3d-head { padding: 10px 16px; }
.bs-panel.bs-3d:fullscreen .bs-3d-foot { padding: 6px 16px; }
.bs-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.bs-panel { position: relative; min-height: 0; display: flex; flex-direction: column; padding: 8px 12px 10px;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05); }
.bs-panel::before, .bs-panel::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 2px; }
.bs-panel::before { left: -1px; top: -1px; border-left: 2px solid var(--accent); border-top: 2px solid var(--accent); }
.bs-panel::after { right: -1px; bottom: -1px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.bs-panel > h4 { margin: 0 0 8px; flex-shrink: 0; font-size: 13.5px; font-weight: 600; letter-spacing: 1px; color: var(--accent); display: flex; align-items: center; gap: 7px; }
.bs-panel > h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent2)); box-shadow: 0 0 8px var(--glow-a); }
.bs-panel .grow { flex: 1; min-height: 0; overflow: auto; }
.bs-panel canvas { display: block; width: 100%; }
.bs-panel .grow::-webkit-scrollbar { width: 5px; }
.bs-panel .grow::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.bs-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bs-kpi { position: relative; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--cell); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.bs-kpi .v { font-size: 31px; font-weight: 700; line-height: 1.05; color: var(--val); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px var(--val-glow); }
.bs-kpi .v small { font-size: 13px; color: var(--muted); margin-left: 3px; text-shadow: none; }
.bs-kpi .l { margin-top: 3px; font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.bs-kpi.g .v { color: #2BD46B; text-shadow: 0 0 18px rgba(74,222,128,.5); }
.bs-kpi.y .v { color: #FFC53D; text-shadow: 0 0 18px rgba(255,179,0,.5); }
.bs-kpi.r .v { color: #FF6A55; text-shadow: 0 0 18px rgba(215,38,30,.5); }

.bs-lines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; height: 100%; grid-auto-rows: minmax(0, 1fr); }
.bs-line { padding: 7px 9px; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; border-radius: var(--radius-sm); font-size: 11px;
  background: var(--cell); border: 1px solid var(--cell-line); transition: transform .15s, box-shadow .15s; }
.bs-line:hover { transform: translateY(-1px); }
.bs-line.on { border-color: rgba(0,174,66,.8); box-shadow: inset 0 0 12px rgba(0,174,66,.22); }
.bs-line.idle { border-color: rgba(255,179,0,.62); box-shadow: inset 0 0 10px rgba(255,179,0,.16); }
.bs-line.warn { border-color: rgba(215,38,30,.88); box-shadow: inset 0 0 14px rgba(215,38,30,.26); }
.bs-line .n { display: flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; font-size: 12.5px; }
.bs-line .d { margin-top: 1px; font-size: 14px; font-weight: 700; color: var(--val); font-variant-numeric: tabular-nums; }
.bs-line .d.bad { color: #FF6A55; }
.bs-line .o { font-size: 10px; color: var(--muted); }
.bs-line .c { margin-top: 2px; font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.bs-line .c .cchip { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.bs-line .c i { font-style: normal; opacity: .75; margin-left: 1px; }
/* 产线格子里的数据网格（同步看板数据） */
.bs-line .cap { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.bs-line .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px; margin-top: 2px; min-width: 0; }
.bs-line .g2 .r { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: 10px; line-height: 1.5; color: var(--muted); min-width: 0; overflow: hidden; }
.bs-line .g2 .r.full { grid-column: 1 / -1; margin-top: 2px; padding-top: 2px; border-top: 1px dashed rgba(255,255,255,.1); }
.bs-line .g2 .r.full b { font-size: 11.5px; }
.bs-line .g2 .r.full b.cl { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; }
.bs-line .g2 .r b { color: var(--val); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bs-line .g2 .r b.bad { color: #FF6A55; }
.bs-line .g2 .r b.cl { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; }
.bs-line .g2 .r b.cl .cchip { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.bs-line .g2 .r b.cl i { font-style: normal; opacity: .75; overflow: hidden; text-overflow: ellipsis; }
.bs-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.bs-dot.g { background: #00AE42; box-shadow: 0 0 6px #00AE42; }
.bs-dot.y { background: #FFB300; box-shadow: 0 0 6px #FFB300; }
.bs-dot.r { background: #D7261E; box-shadow: 0 0 6px #D7261E; }
.bs-dot.gray { background: #5A646E; }

/* ===== 工厂实时生产效果 ===== */
.bs-dot.g { animation: bsBreathe 2.4s ease-in-out infinite; }
@keyframes bsBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.bs-line { position: relative; }
.bs-line.warn { animation: bsAlarm 1.1s ease-in-out infinite; }
@keyframes bsAlarm { 0%, 100% { box-shadow: inset 0 0 16px rgba(239,68,68,.3); } 50% { box-shadow: inset 0 0 4px rgba(239,68,68,.1); } }
.bs-line.on::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(0,174,66,.9), transparent); background-size: 32px 100%; background-repeat: no-repeat; animation: bsFlow 1.2s linear infinite; }
@keyframes bsFlow { 0% { background-position: -32px 0; } 100% { background-position: calc(100% + 32px) 0; } }
.val-flash { animation: bsFlash .9s ease-out; }
@keyframes bsFlash { 0% { color: #fff !important; text-shadow: 0 0 14px currentColor; } }
/* 告警滚动条 */
.bs-alertbar { flex-shrink: 0; height: 26px; display: flex; align-items: center; gap: 12px; padding: 0 14px; z-index: 2; border-bottom: 1px solid var(--border); overflow: hidden; }
.bs-alertbar .tick { flex: 1; height: 100%; display: flex; align-items: center; overflow: hidden; position: relative; }
.bs-alertbar .tick span { position: absolute; white-space: nowrap; color: #FF6A55; animation: bsTicker 22s linear infinite; }
.bs-alertbar .tick span.ok { color: #2BD46B; animation: none; }
.bs-alertbar .upd { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes bsTicker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

.bs-list { display: flex; flex-direction: column; gap: 7px; }
.bs-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bs-row .t { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-row .v { color: var(--val); font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--cell-line); overflow: hidden; }
.bs-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bs-bar i.warn { background: linear-gradient(90deg, #FFC53D, #f97316); }
.bs-bar i.bad { background: linear-gradient(90deg, #FF6A55, #dc2626); }
.bs-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.bs-legend span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 1100px) {
  .bs-body { grid-template-columns: 1fr; overflow: auto; }
  .bs-head h1 { font-size: 17px; letter-spacing: 3px; }
}

/* ===== 移动端适配（手机 APP / PWA） ===== */
.nav-toggle { display: none; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 8px; padding: 7px 12px; font-size: 14px; cursor: pointer; flex-shrink: 0; user-select: none; -webkit-user-select: none; outline: none; }
.nav-mask { display: none; }
@media (max-width: 900px) {
  html, body { height: 100%; }
  .app { height: 100vh; height: 100dvh; }
  .nav-toggle { display: inline-block; -webkit-tap-highlight-color: transparent; }
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; z-index: 110; width: 240px; display: flex; flex-direction: column; transition: left .25s; box-shadow: 4px 0 24px rgba(0,0,0,.45); padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.nav-open .sidebar { left: 0; }
  body.nav-open .nav-mask { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 105; background: rgba(0,0,0,.5); -webkit-tap-highlight-color: transparent; }
  .main { padding: 12px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .view-head { flex-wrap: wrap; gap: 8px; }
  .view-title { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toolbar { flex-wrap: wrap; gap: 6px; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .form-row { grid-template-columns: 1fr !important; }
  .modal { width: 94% !important; max-height: 92vh; overflow: auto; }
  .login-card { width: auto; max-width: 360px; padding: 24px; }
  .doc-head { grid-template-columns: 1fr 1fr !important; }
  .doc-head .f.wide, .doc-head .f.full { grid-column: 1 / -1; }
  .kv-grid { grid-template-columns: 1fr 1fr !important; }
  .nav-child, .nav-group-head, .nav-sub-head { -webkit-tap-highlight-color: transparent; }
}

/* ---------- 每台设备 24 小时产量报表 ---------- */
.p24-matrix table { font-size: 12px; }
.p24-matrix th, .p24-matrix td { padding: 6px 6px; white-space: nowrap; }
.p24-matrix th:first-child, .p24-matrix td:first-child {
  position: sticky; left: 0; background: var(--bg-1, #fff); z-index: 2;
}
.p24-num { display: inline-block; min-width: 26px; text-align: right; }
.p24-zero { color: var(--muted); }
.p24-nil { color: var(--muted); opacity: .55; }
.p24-total { color: var(--primary); }
.p24-foot { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.8; }
.p24-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.p24-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg-2, #fafafa); }
.p24-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.p24-card-total { color: var(--primary); font-weight: 600; font-size: 12px; }
.p24-mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.p24-mini th, .p24-mini td { border-bottom: 1px dashed var(--border); padding: 3px 4px; }
.p24-mini th { text-align: left; color: var(--muted); font-weight: 500; }
.p24-mini td.num { text-align: right; }

/* 设备产量报表：视图切换 + 班次明细 */
.p24-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.p24-tab { background: none; border: 1px solid transparent; border-bottom: none; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--muted); border-radius: 6px 6px 0 0; }
.p24-tab:hover { color: var(--primary); }
.p24-tab.active { color: var(--primary); font-weight: 600; border-color: var(--border); background: var(--bg-1, #fff); margin-bottom: -1px; }
.p24-cards-wide { grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); }
.p24-shift2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p24-shift-col { min-width: 0; }
.p24-sub { font-size: 12px; color: var(--primary); margin-bottom: 4px; }

.p24-shift-note { font-size: 13px; color: var(--primary); background: var(--bg-2, #f5f7fa);
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; white-space: nowrap; }

/* ---------- 连接中断提示条（连接守护） ---------- */
.conn-banner{
  position:fixed; left:50%; transform:translateX(-50%); top:0; z-index:9999;
  background:#b4232a; color:#fff; font-size:13px; line-height:1.5;
  padding:8px 18px; border-radius:0 0 10px 10px; cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.35); animation:connPulse 1.6s ease-in-out infinite;
}
@keyframes connPulse{0%,100%{opacity:1}50%{opacity:.72}}

/* ===== 点巡检 ===== */
.patrol-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.patrol-head label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.patrol-head input, .patrol-head select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; color: var(--text); }
.patrol-progress { flex: 1; min-width: 140px; }
.patrol-progress .bar { height: 8px; background: var(--bg-3, #eef2f8); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.patrol-progress .bar i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }

.patrol-group { margin-bottom: 14px; }
.patrol-group > h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .5px; }

.patrol-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.patrol-item.ng { border-color: #f0997a; background: #fff8f6; }
.patrol-item .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.patrol-item .nm { font-size: 15px; font-weight: 600; }
.patrol-item .std { font-size: 12px; color: var(--muted); }
.patrol-item .ctrl { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.patrol-item input[type="number"], .patrol-item input[type="text"] { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; width: 120px; background: #fff; color: var(--text); }
.patrol-item input.note { width: 100%; }
.patrol-item .filled { color: var(--primary); font-size: 12px; }

.patrol-btn { flex: 1; min-width: 84px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); background: #fff; font-size: 14px; cursor: pointer; color: var(--muted); }
.patrol-btn.ok.on { background: #e8f7ef; border-color: #34a853; color: #1b7a3d; font-weight: 600; }
.patrol-btn.ng.on { background: #fdecea; border-color: #d93025; color: #b3261e; font-weight: 600; }

.patrol-submit { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 40%); padding: 12px 0 4px; display: flex; gap: 10px; align-items: center; }
.patrol-submit .cnt { font-size: 13px; color: var(--muted); flex: 1; }
.patrol-submit button { padding: 12px 26px; font-size: 15px; border-radius: 10px; }

.patrol-rec { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; cursor: pointer; }
.patrol-rec .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.patrol-rec .tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; }
.patrol-rec .tag.ok { background: #e8f7ef; color: #1b7a3d; }
.patrol-rec .tag.ng { background: #fdecea; color: #b3261e; }

@media (max-width: 900px) {
  .patrol-head { gap: 8px; }
  .patrol-head label { flex: 1 1 45%; }
  .patrol-head input, .patrol-head select { width: 100%; font-size: 15px; }
  .patrol-progress { flex: 1 1 100%; }
  .patrol-item { padding: 11px 12px; }
  .patrol-item .nm { font-size: 14px; }
  .patrol-item input[type="number"] { width: 100%; }
  .patrol-btn { padding: 12px; font-size: 15px; }
  .patrol-submit button { width: 100%; }
  .patrol-submit .cnt { flex: 1 1 100%; }
}

/* 设备实时页在手机上的微调 */
@media (max-width: 900px) {
  #lv-dia { font-size: 34px !important; }
  #lv-chart { height: 200px !important; }
  #lv-kpi, #lv-cap, #lv-nrg { grid-template-columns: repeat(2, 1fr) !important; }
  #lv-zones, #lv-tanks { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ===== 点巡检：手机端布局修正（覆盖上面的初版规则） ===== */
@media (max-width: 900px) {
  .toolbar .spacer { display: none; }
  .patrol-head { gap: 8px; }
  .patrol-head label { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .patrol-head input, .patrol-head select { width: 100%; min-width: 0; }
  .patrol-progress { flex: 1 1 100%; min-width: 0; }

  .patrol-item .ctrl { gap: 8px; flex-wrap: wrap; }
  .patrol-item .ctrl > * { min-width: 0; }
  .patrol-item input[type="number"] { flex: 1 1 55%; width: auto; }
  .patrol-btn { flex: 1 1 40%; min-width: 0; padding: 12px 6px; }
  .patrol-item .ctrl .filled { flex: 1 1 100%; }
  .patrol-item input.note { flex: 1 1 100%; width: 100%; }

  .patrol-submit { flex-wrap: wrap; }
  .patrol-submit .cnt { flex: 1 1 100%; }
}

/* ===== 点巡检：手机端最终约束（务必不横向溢出） ===== */
@media (max-width: 900px) {
  #pt-body, .patrol-group, .patrol-item, .patrol-head, .patrol-submit { max-width: 100%; min-width: 0; }
  .patrol-head label { flex: 1 1 100%; width: 100%; }
  .patrol-head input, .patrol-head select { width: 100% !important; max-width: 100%; }
  .patrol-item .ctrl { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .patrol-item input[type="number"] { flex: 1 1 100%; width: 100% !important; }
  .patrol-btn { flex: 1 1 0; min-width: 0; }
  .patrol-item .ctrl .filled { flex: 1 1 100%; }
  .patrol-submit button { flex: 1 1 100%; }
}

@media (max-width: 900px) {
  /* 数值输入与单位同一行，按钮换行 */
  .patrol-item .ctrl input[type="number"] { flex: 1 1 calc(100% - 40px); width: auto !important; }
  .patrol-item .ctrl > .std { flex: 0 0 auto; }
}
