/* 总览、车道详情共用的样式。车道状态的颜色只在这里定义一次。 */
:root {
  --c-offline: #a0a8b3;  /* 灰：离线 */
  --c-records: #7a8ca5;  /* 灰蓝：主程序未接入 */
  --c-alarm: #e5484d;    /* 红：报警 */
  --c-warning: #f0a020;  /* 橙：警告 */
  --c-loading: #2fb36d;  /* 绿：装车中 */
  --c-idle: #3b82f6;     /* 蓝：空闲 */
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", sans-serif; background: #f4f6f9; color: #1f2d3d; }
header { background: #1f4e8c; color: #fff; padding: 14px 16px; font-size: 18px;
         display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
/* 顶栏右边的链接由 common.js 的 nav() 补（M1），各页面不再自己写 */
header .ttl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .back { display: none; }
.toplinks { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.toplinks a { color: rgba(255,255,255,.82); text-decoration: none; }
.toplinks a:hover { color: #fff; text-decoration: underline; }
.toplinks a.on { color: #fff; font-weight: bold; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
h2 { font-size: 17px; margin: 18px 0 10px; }
.card { background: #fff; border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 12px;
        overflow-wrap: anywhere; }
.muted { color: #8492a6; font-size: 13px; }
.banner { background: #fff4e5; color: #b15d00; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }

/* 车道卡片 */
.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.lane { display: block; color: inherit; text-decoration: none; border-left: 6px solid var(--c-offline); margin: 0; }
.lane .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lane .id { font-size: 16px; font-weight: bold; }
.state { font-size: 13px; padding: 2px 8px; border-radius: 10px; color: #fff; background: var(--c-offline); white-space: nowrap; }
.s-offline { border-color: var(--c-offline); } .state.s-offline { background: var(--c-offline); }
.s-records { border-color: var(--c-records); } .state.s-records { background: var(--c-records); }
/* 卡片颜色只按装车机状态（离线、只传记录、装车中、空闲）。报警、警告不染卡片，只用下面的红字、橙字写出来 */
.s-loading { border-color: var(--c-loading); } .state.s-loading { background: var(--c-loading); }
.s-idle    { border-color: var(--c-idle); }    .state.s-idle    { background: var(--c-idle); }
.lane .line { margin-top: 6px; font-size: 14px; }
.lane .alarm, .alarmline { color: var(--c-alarm); }
.lane .warn, .warnline { color: #b06c00; }
.alarmline, .warnline { font-size: 15px; font-weight: bold; margin: -2px 0 10px; }

.bar { height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--c-loading); }

.tag { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 3px; background: #eef1f6; color: #475669; margin-right: 4px; }
.tag.ok { background: #e7f8ef; color: #13a35a; }
.tag.bad { background: #fdecee; color: #d0021b; }
.tag.mid { background: #fff4e5; color: #b06c00; }

.row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid #eef1f6; font-size: 14px; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1 1 160px; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv > div:nth-child(odd) { color: #8492a6; }

/* 装车记录、看板（B7）：筛选条、表格 */
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #475669; flex: 1 1 140px; min-width: 0; }
.filters label[hidden] { display: none; }
/* 现场、车道：页面最上面单独一行，比筛选条醒目（2026-11-05 用户提：多现场时藏在筛选里看不出看的是哪） */
.scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 12px; }
.scope label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #475669; }
.scope label[hidden] { display: none; }
.scope select { min-width: 180px; padding: 7px 10px; font-size: 15px; font-weight: bold; color: #1f2d3d;
                border: 1px solid #c0ccda; border-radius: 6px; background: #fff; }
.filters input, .filters select { width: 100%; padding: 7px; font-size: 15px; border: 1px solid #d3dce6; border-radius: 4px; background: #fff; }
.btn { padding: 8px 16px; font-size: 14px; border: 1px solid #1f4e8c; border-radius: 4px; background: #fff; color: #1f4e8c; cursor: pointer; }
.btn.primary { background: #1f4e8c; color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.stats b { font-size: 18px; }
.tablewrap { overflow-x: auto; }  /* 手机上表格在框里左右划，整页不横向滚动 */
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; white-space: nowrap; }
table.grid th, table.grid td { padding: 7px 8px; border-bottom: 1px solid #eef1f6; text-align: center; }
table.grid th { color: #8492a6; font-weight: normal; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
/* 装车记录：点一行展开这车的装车曲线（L1） */
table.grid tbody tr.pick { cursor: pointer; }
table.grid tbody tr.pick:hover, table.grid tbody tr.pick.open { background: #f3f7fc; }
table.grid tbody tr.pick td:first-child::before { content: "▸ "; color: #8492a6; }
table.grid tbody tr.pick.open td:first-child::before { content: "▾ "; }
table.grid td.curvecell { padding: 0; text-align: left; white-space: normal; background: #fbfcfe; }
/* 手机上表格在框里横着划，曲线粘在左边、宽度跟框走（JS 设），不跟着表格一起划走 */
.curve { position: sticky; left: 0; padding: 10px 12px 12px; }
.curve .sum { font-size: 14px; line-height: 1.7; margin-bottom: 6px; }
.curve .stoppick { display: inline-flex; align-items: center; gap: 6px; }
.curve .stoppick select { padding: 3px 6px; font-size: 14px; border: 1px solid #d3dce6; border-radius: 4px; background: #fff; }
.curve svg { display: block; touch-action: pan-y; user-select: none; }
.curve .axis { stroke: #d3dce6; }
.curve .gridline { stroke: #eef1f6; }
.curve .tick { fill: #8492a6; font-size: 12px; }
.curve .line { fill: none; stroke: var(--c-idle); stroke-width: 2; stroke-linejoin: round; }
.curve .area { fill: var(--c-idle); opacity: .08; }
.curve .plan { stroke: #8492a6; stroke-dasharray: 5 4; }
.curve .stop { fill: var(--c-warning); opacity: .14; }
.curve .stoptext { fill: #b06c00; font-size: 12px; }
.curve .cursor { stroke: #1f4e8c; stroke-dasharray: 3 3; }
.curve .tip rect { fill: #1f2d3d; opacity: .88; }
.curve .tip text { fill: #fff; font-size: 12px; }
/* 装车记录 | 测量记录 切换（N6）：比日期快捷按钮醒目，一看就知道现在看的是哪一种 */
.seg { display: inline-flex; border: 1px solid #1f4e8c; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.seg button { padding: 7px 22px; font-size: 15px; border: 0; background: #fff; color: #1f4e8c; cursor: pointer; }
.seg button + button { border-left: 1px solid #1f4e8c; }
.seg button.on { background: #1f4e8c; color: #fff; font-weight: bold; }
/* 测量记录（N6）：装车记录点开一车的「车辆尺寸」，测量记录点开一行 */
.mblock { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef1f6; font-size: 14px; line-height: 1.8; }
.curve > .mblock:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.mhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.mhead > b { font-size: 15px; }
.mdims { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 16px; }
.mdims b { font-size: 15px; }
.mlist { margin-top: 4px; padding-left: 10px; border-left: 3px solid #eef1f6; color: #475669; }
.mfail, table.grid tr.bad td { color: #d0021b; }
.same { color: #8492a6; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.linkbtn { border: 0; padding: 0; background: none; color: #1f4e8c; font: inherit; cursor: pointer; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tabs button { padding: 4px 10px; font-size: 13px; border: 1px solid #d3dce6; border-radius: 12px; background: #fff; color: #475669; cursor: pointer; }
.tabs button.on { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }

/* ===== 分组列表（M8，2026-11-06）：照手机「设置」的样子，「我的」「修改密码」「管理」三页用。
   一组是一张白底圆角卡片（.glist），组上面一行灰色小字是组名（.glabel）；
   每行（.gi）左边主文字、下面一行灰字（.gsub），右边灰色值（.gval），能点进去的末尾一个 ›（.go）。
   行可以是 a，也可以是 button（点了弹出操作），两种长得一样 */
.glabel { font-size: 13px; color: #8492a6; margin: 18px 6px 6px; }
.glabel:first-child { margin-top: 4px; }
.glist { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 12px; overflow: hidden; }
.gi { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; min-height: 52px; padding: 8px 16px;
      margin: 0; border: 0; border-top: 1px solid #eef1f6; border-radius: 0; background: none; color: inherit;
      font: inherit; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer; }
.glist > .gi:first-child { border-top: 0; }
.gi:active, .gi:focus-visible { background: #f4f6f9; outline: 0; }
.gi .gmain { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.gi .gsub { font-size: 13px; color: #8492a6; margin-top: 2px; }
.gi .gval { color: #8492a6; font-size: 14px; white-space: nowrap; }
.gi .tag { margin: 0 0 0 6px; vertical-align: 1px; }
.gi.go::after { content: "›"; color: #c0c8d4; font-size: 22px; line-height: 1; }
.gi.add { color: #1f4e8c; }
.gi.danger { color: #d0021b; }
.gi.center { justify-content: center; }
.gi.static { cursor: default; }
.gi.static:active { background: none; }
.gnote { font-size: 13px; color: #8492a6; margin: -6px 6px 12px; line-height: 1.6; }

/* 底部弹出的操作（点一行后从下面弹出：生成密钥、清空数据……），电脑上在中间 */
dialog.sheet { padding: 0; border: 0; background: transparent; width: min(420px, calc(100vw - 16px)); max-width: none;
               max-height: calc(100vh - 16px); box-sizing: border-box; overflow: auto; }
dialog.sheet::backdrop { background: rgba(0,0,0,.35); }
dialog.sheet .glist { margin-bottom: 8px; }
dialog.sheet .shead { padding: 12px 16px; text-align: center; font-size: 13px; color: #8492a6; }
dialog.sheet .shead b { display: block; font-size: 15px; color: #1f2d3d; margin-bottom: 2px; }
dialog.sheet .gi { justify-content: center; text-align: center; }
dialog.sheet .cancel { font-weight: bold; }

/* ===== 总览大屏（L2）：网址带 ?tv=1。挂控制室电视，3 米外看。不带时上面那套照旧 =====
   字号分两步定（2026-11-05 改，以前只按卡片大小定字号，文字那栏窄时车牌、步骤变成省略号或被卡片底边切掉）：
   ① 卡片大小给上限：cqmin = 卡片短边的百分之一，车道多卡片小，字也跟着小；
   ② index.html 的 tvFit 每次刷新后量一下放不放得下，放不下就整张卡片的字一起缩小（--k 顶栏一行、--kb 圈旁边的字），
      进度圈放左边还是上面两种都试，哪种字大用哪种。缩到 0.45 倍还放不下才用省略号兜底。
   货物、报警、现场名这几行可以折成两行，车牌、步骤不折行 */
.tvhead, .tvgrid, .tvfoot { display: none; }
body.tv { background: #0b1220; color: #e6edf7; overflow: hidden; height: 100vh; display: flex; flex-direction: column; }
body.tv.scroll { overflow: auto; height: auto; min-height: 100vh; }  /* 屏幕太窄（手机竖着）放不下时，改成上下滚 */
body.tv.idle, body.tv.idle * { cursor: none; }  /* 鼠标 3 秒不动就藏起来，电视上不留一个箭头 */
body.tv > header:not(.tvhead), body.tv > main, body.tv > footer.beian { display: none; }
/* 顶栏、底栏的字按屏幕短边算（vmin）：竖放的电视按高度算会大得挤成两行 */
body.tv .tvhead { --k: 1; display: flex; flex: none; align-items: center; gap: 1vmin 3vmin;
                  padding: 1.6vmin 2vmin; background: #111a2c; border-bottom: 1px solid #1f2a40; }
.tvhead .title { flex: 1 1 auto; min-width: 0; font-size: calc(3.8vmin * var(--k)); font-weight: bold; letter-spacing: .06em;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvhead .clock { flex: none; font-size: calc(4vmin * var(--k)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tvhead .clock small { font-size: .6em; color: #8a9bb5; margin-right: .6em; }
.tvhead .tools { flex: none; font-size: max(12px, 1.9vmin); white-space: nowrap; }
.tvhead .tools a { color: #8a9bb5; margin-left: 1.2em; cursor: pointer; text-decoration: none; }
.tvhead .tools a:hover { color: #e6edf7; }
body.tv .tvgrid { display: grid; flex: 1 1 0; min-height: 0; gap: 1.4vmin; padding: 1.4vmin; }
body.tv .tvfoot { display: flex; flex: none; flex-wrap: wrap; justify-content: space-between; align-items: center;
                  gap: .6vmin 2vmin; padding: 1vmin 2vmin 1.4vmin; font-size: max(11px, 1.7vmin); color: #5d6d88; }
.tvfoot .err { color: #ff8a8d; font-size: max(13px, 2.2vmin); }
.tvempty { grid-column: 1 / -1; align-self: center; text-align: center; font-size: 3vmin; color: #8a9bb5; }

.tvcard { --c: var(--c-offline); --k: 1; --kb: 1; container-type: size; position: relative; min-width: 0; min-height: 0;
          background: #131c2e; border: .5vmin solid #1f2a40; border-top: 1.2vmin solid var(--c); border-radius: 1.2vmin;
          padding: 1.8vmin 2.2vmin; display: flex; flex-direction: column; gap: 1.4vmin; overflow: hidden;
          color: inherit; text-decoration: none; }
.tvcard.s-records { --c: var(--c-records); }
.tvcard.s-loading { --c: var(--c-loading); }
.tvcard.s-idle    { --c: var(--c-idle); }
/* 报警不闪、不改卡片颜色（2026-11-04 用户定：挂给领导看，满屏发红不好），只在圈右边第一行写红字 .alarmtext */

.tvcard .top { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 3cqmin; }
.tvcard .id { min-width: 0; font-size: calc(10cqmin * var(--k)); font-weight: bold; line-height: 1.2;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvcard .id small { font-size: .6em; font-weight: normal; color: #8a9bb5; margin-left: .3em; }
.tvcard .pill { flex: none; font-size: calc(6cqmin * var(--k)); padding: .15em .65em; border-radius: 1em; background: var(--c); color: #fff;
                white-space: nowrap; font-weight: bold; }
/* 圈和字左右排（.v 是上下排，tvFit 挑）。圈最多占卡片宽的四成，右边的字至少留一半多 */
.tvcard .body { flex: 1; min-height: 0; display: flex; align-items: stretch; gap: 5cqmin; }
.tvcard .ring { flex: none; align-self: center; aspect-ratio: 1; height: min(100%, 72cqmin, 40cqw); }
.tvcard .ring .track { stroke: #22304a; }
.tvcard .ring .arc { stroke: var(--c); }
.tvcard .ring .pct { fill: #e6edf7; font-weight: bold; }
.tvcard .ring .sub { fill: #8a9bb5; }
.tvcard .info { flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
                justify-content: safe center; gap: calc(2.2cqmin * var(--kb)); }
.tvcard .info > div { flex: none; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvcard .info > .w { white-space: normal; overflow-wrap: anywhere;
                     display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tvcard .car { font-size: calc(11cqmin * var(--kb)); font-weight: bold; }
.tvcard .big { font-size: calc(8cqmin * var(--kb)); }
.tvcard .mid { font-size: calc(6.4cqmin * var(--kb)); color: #b8c4d8; }
.tvcard .dim { font-size: calc(5.4cqmin * var(--kb)); color: #6f809c; }
.tvcard .alarmtext { font-size: calc(8.4cqmin * var(--kb)); color: #ff8a8d; font-weight: bold; }
.tvcard .warntext { font-size: calc(7.4cqmin * var(--kb)); color: #ffc861; }
/* 上下排：卡片窄高（车道少、屏幕竖放）时字放下面更宽。圈高不超过卡片的四成，下面留给字 */
.tvcard.v .body { flex-direction: column; gap: 3cqmin; }
.tvcard.v .ring { height: min(40cqh, 70cqw); }
.tvcard.v .info { text-align: center; }
/* 手机竖着开大屏：上下滚，一行一张卡片 */
body.tv.scroll .tvhead { flex-wrap: wrap; padding: 10px 16px; gap: 4px 12px; }
body.tv.scroll .tvhead .title { font-size: 18px; flex-basis: 100%; white-space: normal; }  /* 现场名长就折行，手机上下滚不怕高 */
body.tv.scroll .tvhead .clock { font-size: 18px; }
body.tv.scroll .tvhead .clock small { font-size: 13px; }
body.tv.scroll .tvhead .tools { font-size: 13px; margin-left: auto; }
body.tv.scroll .tvgrid { flex: none; grid-auto-rows: 240px; padding: 10px 16px; gap: 10px; }
body.tv.scroll .tvfoot { padding: 10px 16px; font-size: 12px; gap: 6px; }

/* 装车 3D（车道详情 L7、装车回放 L8 共用）。底色同现场 3D */
.c3d-card { padding: 0; overflow: hidden; }
.c3d-wrap { position: relative; height: min(60vh, 520px); min-height: 300px; background: #1a1a2e; }
.c3d-wrap canvas { display: block; touch-action: pan-y; } /* 上下滑翻页、左右滑转车；真正生效的是 cargo3d.js 里那句（OrbitControls 会写内联样式盖掉这里） */
/* 提示文字盖在画面上，不能挡住拖动、缩放（2026-11-04 手机上转不了就是被它挡了） */
.c3d-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
             padding: 16px; text-align: center; color: rgba(255,255,255,.7); font-size: 14px; pointer-events: none; }
.c3d-empty[hidden], .c3d-views[hidden] { display: none; } /* 上面写了 display，hidden 属性就不管用了，要补这一句 */
.c3d-count { position: absolute; left: 10px; bottom: 8px; color: rgba(255,255,255,.6); font-size: 12px; pointer-events: none; }
.c3d-views { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.c3d-views button { width: 56px; height: 28px; font-size: 12px; color: #e0e0e0; background: rgba(40,40,40,.85);
                    border: 1px solid #00d4ff; border-radius: 4px; cursor: pointer; }
.c3d-views button:hover { background: #007a99; color: #fff; }
.c3d-foot { padding: 8px 16px; }

/* 装车回放（L8，装车记录页点开一车） */
.rp { margin-top: 12px; }
.rp .c3d-wrap { height: min(55vh, 440px); min-height: 260px; border-radius: 6px; overflow: hidden; }
.rp-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.rp-bar input[type=range] { flex: 1 1 200px; min-width: 0; }
.rp-bar .btn { min-width: 72px; }
/* 提示层不挡拖动，但里面的链接（上一车的回放入口）要点得到 */
.c3d-empty a { pointer-events: auto; color: #7fd3ff; }

/* ===== 手机排版（阶段 M，CoreForge 仓库 cloud-platform/07-mobile-layout.md）=====
   宽不超过 640 按手机排，和 common.js 的 isPhone() 同一个数。电脑上这一段只有下面三行生效 */
.tabbar, .fbar, .c-card { display: none; }
/* 小程序里只用微信自己的标题栏，网页的蓝条藏掉（Y35）。大屏的顶栏不算 */
html.wxmp body > header:not(.tvhead) { display: none; }

@media (max-width: 640px) {
  /* iPhone 横过来时刘海那边留出来（页面 meta 里写了 viewport-fit=cover） */
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  header { padding: 12px 16px; font-size: 17px; flex-wrap: nowrap; justify-content: flex-start; gap: 0; }
  header .ttl { flex: 1; }
  header .toplinks { display: none; }
  header .back { display: block; color: #fff; text-decoration: none; font-size: 28px; line-height: 1;
                 padding: 0 14px 3px 0; margin: -8px 0; }
  .desk-only { display: none !important; }
  /* 操作从屏幕底部弹出，贴着 iPhone 底下那条横线上面 */
  dialog.sheet { margin: auto auto max(8px, env(safe-area-inset-bottom)); }
  .gi { -webkit-tap-highlight-color: transparent; }

  /* 底部四个按钮（M1）。iPhone 底下那条横线的位置留出来，按钮不和系统手势挤在一起 */
  body.has-tabbar { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
            background: #fff; border-top: 1px solid #e5e9f0; box-shadow: 0 -1px 4px rgba(0,0,0,.04);
            padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .tabbar a { flex: 1; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
              gap: 2px; font-size: 12px; color: #8492a6; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .tabbar a.on { color: #1f4e8c; font-weight: bold; }
  body.typing .tabbar { display: none; }  /* 打字时藏起来，安卓键盘会把它顶上来挡住输入框 */

  /* 字号小于 16 时 iPhone 一点输入框就整页放大（M5） */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .filters input, .filters select { min-height: 40px; }
  /* 手机上现场、车道两个框各占半行，不写「现场」「车道」字（框里的「全部现场」「全部车道」已经说明了）；只有一个现场时车道框占满 */
  /* 装车记录 | 测量记录：手机上占满一行，两半各一个 */
  .seg { display: flex; margin-bottom: 10px; }
  .seg button { flex: 1; min-height: 40px; padding: 6px 8px; }
  .mdims { grid-template-columns: 1fr 1fr; }
  .scope { flex-wrap: nowrap; gap: 8px; margin-bottom: 10px; }
  .scope label { flex: 1 1 0; min-width: 0; }
  .scope label > span { display: none; }
  .scope select { width: 100%; min-width: 0; min-height: 42px; }
  .pager .btn { min-width: 84px; }

  /* 筛选条收成一行（M3、M4）：写当前条件，点开才展开，查询后收回去 */
  .fbar { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 46px; margin: 0 0 12px; padding: 10px 14px;
          background: #fff; border: 0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
          font: inherit; font-size: 14px; color: #1f2d3d; text-align: left; cursor: pointer; }
  .fbar .ftext { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fbar .fbtn { color: #1f4e8c; white-space: nowrap; }
  .fbar .fbtn::after { content: " ▾"; }
  .fbar.open { margin-bottom: 0; border-radius: 8px 8px 0 0; }
  .fbar.open .fbtn::after { content: " ▴"; }
  .fbar.open + .filters { border-radius: 0 0 8px 8px; border-top: 1px solid #eef1f6; }
  .filters.folded { display: none; }
  /* 日期快捷按钮：手机上两行、每行三个，一眼都看得到，不用左右划 */
  .quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
  .quick button { min-height: 36px; font-size: 14px; padding: 4px 6px; border-radius: 18px; }

  /* 装车记录：一车一张卡片（M3，Y34）。还是同一张表，每行多一格 .c-card 只在手机上显示，别的格藏起来；
     点开曲线、回放、分页的逻辑不动 */
  .reccard { background: transparent; box-shadow: none; padding: 0; }
  table.grid.cardify, table.grid.cardify tbody, table.grid.cardify tr { display: block; }
  table.grid.cardify thead { display: none; }
  table.grid.cardify td { display: block; text-align: left; white-space: normal; border: 0; }
  table.grid.cardify tr.pick > td:not(.c-card) { display: none; }
  table.grid.cardify tr.pick { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
                               margin-bottom: 10px; padding: 12px 14px; }
  table.grid.cardify tr.pick:hover { background: #fff; }
  table.grid.cardify tr.pick.open { margin-bottom: 0; border-radius: 8px 8px 0 0; background: #f3f7fc; }
  table.grid.cardify td.curvecell { margin-bottom: 10px; border-radius: 0 0 8px 8px; overflow: hidden;
                                    box-shadow: 0 1px 3px rgba(0,0,0,.08); }
  table.grid.cardify td.c-card { padding: 0; }
  .c-card .cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .c-card .car { font-size: 17px; font-weight: bold; min-width: 0; overflow-wrap: anywhere; }
  .c-card .car::before { content: "▸ "; color: #8492a6; font-weight: normal; }
  tr.open .c-card .car::before { content: "▾ "; }
  .c-card .cc-line { font-size: 14px; margin-top: 4px; color: #475669; }
  .c-card .cc-line.muted { font-size: 13px; color: #8492a6; }
  .c-card .tag { margin-right: 0; font-size: 13px; padding: 2px 8px; }

  /* 车道详情 3D 的视角按钮（M4）：手机上挪到画面下面横排一行，不挡画面、好点 */
  .c3d-card .c3d-wrap { height: min(55vh, 440px); min-height: 280px; }
  /* 按钮出来了才在画面下面留位置；还没有装车画面时不留空白（老浏览器不认 :has 就一直不留，按钮盖在说明字上，不影响用） */
  .c3d-card .c3d-wrap:has(> .c3d-views:not([hidden])) { margin-bottom: 52px; }
  .c3d-card .c3d-views { top: 100%; left: 0; right: 0; margin-top: 8px; padding: 0 12px; flex-direction: row; gap: 6px; }
  .c3d-card .c3d-views button,
  .c3d-card .c3d-views button:hover { flex: 1; width: auto; height: 38px; font-size: 13px;
                                      color: #475669; background: #fff; border-color: #d3dce6; }
  .c3d-card .c3d-views button:active { background: #eef1f6; }
}
