/* ===== 农残产区工作台 全局样式（科技蓝 + 生态绿 双主题） ===== */
:root {
  --bg: #050a18; --panel: rgba(10,18,36,.82); --line: rgba(80,170,255,.28);
  --txt: #e6f1ff; --muted: #9db8d6; --cyan: #22d3ee; --green: #34d399; --red: #ff4d5e;
  --amber: #fbbf24; --deepred: #d81e3c; --lightred: #ff9a9a;
  --sidebar: 220px;
  /* 不透明面板色：sticky 表头/粘底操作栏必须用实底，半透明会与滚动内容重合（2026-10-01 BUG-A） */
  --panel-solid: #091122;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--txt); overflow: hidden; }
body.theme-green { --bg: #04150d; --panel: rgba(6,24,16,.82); --line: rgba(52,211,153,.28); --muted: #9fcebe; --panel-solid: #061810; }
.hidden { display: none !important; }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }

/* ===== 登录页 ===== */
#loginOverlay { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(34,211,238,.10), transparent 60%),
              radial-gradient(900px 700px at 80% 90%, rgba(52,211,153,.08), transparent 55%), var(--bg); }
.login-card { width: 380px; padding: 34px 36px; text-align: center; }
/* 备案信息（2026-10-11）：封面底部居中，ICP + 公安备案并列，低调小字 + 徽章图标，不抢视觉 */
.login-footer { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-footer a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; text-decoration: none; letter-spacing: .5px; }
.login-footer a:hover { color: var(--cyan); }
.login-footer .sep { color: var(--muted); font-size: 11px; opacity: .6; }
.login-footer img { width: 14px; height: 14px; display: block; }
.login-logo { font-size: 42px; margin-bottom: 10px; }
.login-title { font-size: 21px; font-weight: 800; letter-spacing: 2px; background: linear-gradient(90deg, var(--cyan), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; letter-spacing: 1px; }
.login-field { text-align: left; margin-bottom: 14px; }
.login-field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; letter-spacing: 1px; }
.login-field input { width: 100%; padding: 11px 14px; font-size: 14px; color: var(--txt); background: rgba(120,180,255,.06);
  border: 1px solid var(--line); border-radius: 9px; outline: none; letter-spacing: 1px; }
.login-field input:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(34,211,238,.3); }
.login-btn { width: 100%; margin-top: 8px; font-size: 15px; padding: 12px 0; letter-spacing: 6px; }
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin-top: 10px; }
.login-note { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }

/* ===== 登录页 · 风险自查访客入口（2026-10-13）===== */
.login-guest { margin-top: 14px; }
.login-guest-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin-bottom: 12px; }
.login-guest-sep::before, .login-guest-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.guest-btn { width: 100%; padding: 11px 0; font-size: 14px; letter-spacing: 1px; color: var(--cyan); border-color: rgba(34,211,238,.45); background: rgba(34,211,238,.07); }
.guest-btn:hover { background: rgba(34,211,238,.16); border-color: var(--cyan); }
.login-guest-tip { color: var(--muted); font-size: 11px; margin-top: 8px; line-height: 1.6; }

/* ===== 风险自查 · 访客模式视图（独立全屏，与主工作台隔离）===== */
#guestView { position: fixed; inset: 0; z-index: 100002; display: none; align-items: center; justify-content: center;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(34,211,238,.10), transparent 60%),
              radial-gradient(900px 700px at 80% 90%, rgba(52,211,153,.08), transparent 55%), var(--bg); }
#guestView.hidden { display: none !important; }
/* 水印层：全页斜纹（地址+时间），盖在卡片之上但绝不挡操作 */
.guest-watermark { position: absolute; inset: 0; z-index: 5; pointer-events: none; background-repeat: repeat; }
.guest-card { position: relative; z-index: 2; width: min(440px, 94vw); max-height: 94vh; overflow: auto; padding: 20px 22px 18px; }
.guest-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.guest-title { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.guest-tag { font-size: 11px; font-weight: 400; color: var(--cyan); border: 1px solid rgba(34,211,238,.45); border-radius: 999px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; }
.guest-sub { color: var(--muted); font-size: 12px; line-height: 1.8; margin-bottom: 14px; }
#guestMapWrap { margin-bottom: 14px; }
#guestMap { width: 100%; height: 180px; border-radius: 10px; border: 1px solid var(--line); }
.guest-locate { width: 100%; font-size: 15px; padding: 13px 0; letter-spacing: 2px; }
.guest-empty { padding: 30px 0 10px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 2; }
.guest-empty span { font-size: 11.5px; opacity: .8; }
/* 结果卡：绿✓ / 红✗ 大标 */
.guest-res { margin-top: 16px; border-radius: 12px; padding: 18px 16px 14px; text-align: center; }
.guest-res.ok { background: rgba(52,211,153,.10); border: 1px solid rgba(52,211,153,.55); }
.guest-res.bad { background: rgba(255,77,94,.10); border: 1px solid rgba(255,77,94,.55); }
.guest-mark { width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; }
.guest-mark.ok { color: var(--green); border: 3px solid var(--green); background: rgba(52,211,153,.12); }
.guest-mark.bad { color: var(--red); border: 3px solid var(--red); background: rgba(255,77,94,.12); }
.guest-res-title { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.guest-res-title.t-green { color: var(--green); }
.guest-res-title.t-red { color: var(--red); }
.guest-res-zone { font-size: 14px; font-weight: 700; color: var(--txt); margin-top: 8px; word-break: break-all; }
.guest-res-msg { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.8; }
.guest-info { margin-top: 14px; text-align: left; border-top: 1px dashed var(--line); padding-top: 12px; }
.guest-info > div { display: flex; gap: 10px; padding: 4px 0; font-size: 12.5px; align-items: baseline; }
.guest-info label { flex: 0 0 74px; color: var(--muted); font-size: 11.5px; text-align: right; }
.guest-info b { font-weight: 600; color: var(--txt); word-break: break-all; }
.guest-actions { display: flex; gap: 10px; margin-top: 14px; }
.guest-actions .btn { flex: 1; }
.guest-tip { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
/* 手机端访客卡片贴边 */
@media (max-width: 768px) {
  .guest-card { padding: 16px 14px 14px; max-height: 96vh; }
  .guest-mark { width: 64px; height: 64px; font-size: 34px; }
}

/* ===== 布局 ===== */
#app { display: flex; height: 100vh; height: 100dvh; }   /* dvh：修正手机浏览器地址栏伸缩造成的 100vh 偏差 */
#sidebar { width: var(--sidebar); min-width: var(--sidebar); background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; z-index: 30; }
.side-logo { font-size: 15px; font-weight: 700; padding: 6px 10px 16px; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
#nav { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-size: 13.5px; transition: all .18s; border: 1px solid transparent; }
.nav-item:hover { background: rgba(120,180,255,.1); color: var(--txt); }
.nav-item.active { background: rgba(34,211,238,.14); color: var(--cyan); border-color: rgba(34,211,238,.35); font-weight: 700; }
/* 下拉菜单（产区地图 → 热力图/地图）—— 移动 APP 列表风格：整行 图标+文字+>箭头 */
.nav-item { position: relative; }
.nav-arrow { margin-left: auto; font-size: 11px; opacity: .6; transition: transform .18s; }
.nav-item.open .nav-arrow { transform: rotate(180deg); }
.nav-sub { display: none; position: absolute; left: 0; top: 100%; min-width: 220px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.nav-item.open .nav-sub { display: block; }
.nav-sub-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--txt); white-space: nowrap; transition: background .15s; border-bottom: 1px solid rgba(255,255,255,.04); }
.nav-sub-item:last-child { border-bottom: none; }
.nav-sub-item::after { content: '›'; margin-left: auto; color: var(--cyan); font-size: 20px; font-weight: 700; line-height: 1; }
.nav-sub-item:hover { background: rgba(34,211,238,.12); color: var(--cyan); }
.nav-sub-item.active { background: rgba(34,211,238,.18); color: var(--cyan); font-weight: 700; }
.nav-sub-item.active::after { content: '✓'; font-size: 16px; }
.ni-ico { font-size: 17px; }
.side-foot { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.side-user b { display: block; font-size: 13px; }
.side-user small { color: var(--muted); font-size: 11px; }

#main { flex: 1; position: relative; overflow: hidden; }
.page { position: absolute; inset: 0; overflow: auto; padding: 18px 22px; display: none; }
.page.active { display: block; }
#page-map { padding: 0; overflow: hidden; }

/* ===== 通用控件 ===== */
.btn { background: rgba(120,180,255,.08); color: var(--txt); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 13px; font-size: 13px; cursor: pointer; transition: all .18s; white-space: nowrap; }
.btn:hover { background: rgba(120,180,255,.18); }
.btn.primary { background: linear-gradient(90deg, var(--cyan), var(--green)); color: #041018; font-weight: 700; }
.btn.danger { border-color: rgba(255,77,94,.5); color: var(--red); }
.btn.mini { padding: 5px 10px; font-size: 12px; }
.btn.active { background: rgba(34,211,238,.22); border-color: var(--cyan); }

/* ===== 仪表卡片 ===== */
.pg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.pg-title { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.pg-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card .c-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.card .c-value { font-size: 26px; font-weight: 800; }
.card .c-value.ok { color: var(--green); } .card .c-value.over { color: var(--red); } .card .c-value.cy { color: var(--cyan); }
.card .c-value.amber { color: var(--amber); }
.card .c-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* ===== 表格 ===== */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl-wrap h3 { padding: 12px 16px; font-size: 14px; color: var(--cyan); letter-spacing: 1px; border-bottom: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
/* 表头 sticky 悬浮：必须用不透明实底（--panel-solid），否则滚动内容会从半透明表头下穿透重合 */
.tbl th { background: linear-gradient(rgba(120,180,255,.08), rgba(120,180,255,.08)) var(--panel-solid); color: var(--muted); font-weight: 600; text-align: left; padding: 9px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid rgba(128,160,200,.12); white-space: nowrap; }
.tbl tr:hover td { background: rgba(120,180,255,.05); }
.tbl .t-over { color: var(--red); font-weight: 700; }
.tbl .t-ok { color: var(--green); }
.tbl .t-muted { color: var(--muted); }
.tbl .t-amber { color: var(--amber); }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar select, .filter-bar input { background: #fff; border: 1px solid #9db3c8; color: #111;
  padding: 8px 11px; border-radius: 9px; font-size: 13px; outline: none; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--cyan); }
.filter-bar label { color: var(--muted); font-size: 12.5px; }

/* ===== 地图页 ===== */
#mapStage { position: absolute; inset: 0; }
#mapStage canvas { display: block; position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
#tmapStage { position: absolute; inset: 0; }
.map-mode { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 22; }
.map-mode-btn { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--txt); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.map-mode-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.map-mode-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.5); margin-top: 4px; }
.map-mode.open .map-mode-menu { display: block; }
.map-mode.open .nav-arrow { transform: rotate(180deg); }
.map-mode-option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--txt); white-space: nowrap; transition: background .15s; border-bottom: 1px solid rgba(255,255,255,.04); }
.map-mode-option:last-child { border-bottom: none; }
.map-mode-option::after { content: '›'; margin-left: auto; color: var(--cyan); font-size: 20px; font-weight: 700; line-height: 1; }
.map-mode-option:hover { background: rgba(34,211,238,.12); color: var(--cyan); }
.map-mode-option.active { background: rgba(34,211,238,.18); color: var(--cyan); font-weight: 700; }
.map-mode-option.active::after { content: '✓'; font-size: 16px; }
.map-back { position: absolute; top: 58px; left: 14px; z-index: 21; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.map-back:hover { color: var(--cyan); border-color: var(--cyan); }
.map-tools { position: absolute; top: 14px; right: 14px; z-index: 20; padding: 12px 14px; min-width: 240px; }
.map-tools h4 { font-size: 13px; color: var(--cyan); margin-bottom: 8px; letter-spacing: 1px; }
.radius-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.radius-row input[type=range] { flex: 1; accent-color: var(--cyan); }
.radius-val { color: var(--cyan); font-weight: 700; font-size: 14px; min-width: 64px; }
.radius-info { color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ===== toast ===== */
#toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(10px); z-index: 100000;
  background: var(--panel); border: 1px solid var(--line); color: var(--txt); padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .3s; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 地图 CSS2D 标牌 ===== */
.lab-target { color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 0 10px rgba(255,77,94,.9); pointer-events: none; white-space: nowrap; }
.lab-l0 { color: #ffd6d6; } .lab-l1 { color: #ffb3ba; } .lab-l2 { color: #ff7b86; }
.lab-dim { color: #7d9cc0; font-size: 12px; opacity: .85; text-shadow: 0 0 6px rgba(0,0,0,.7); pointer-events: none; white-space: nowrap; }
.lab-town { color: var(--cyan); font-size: 13px; font-weight: 600; text-shadow: 0 0 8px rgba(34,211,238,.8); pointer-events: none; white-space: nowrap; }
.lab-over { color: #ff8b93; font-size: 12px; font-weight: 600; text-shadow: 0 0 8px rgba(255,77,94,.8); pointer-events: none; white-space: nowrap; }
.lab-placeholder { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: 2px; pointer-events: none; white-space: nowrap; }
.lab-lemon { color: #ffd166; font-size: 15px; font-weight: 700; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255,209,102,.6); pointer-events: none; white-space: nowrap; }
.lab-extend { color: #7fd8ef; font-size: 12px; opacity: .95; text-shadow: 0 0 6px rgba(34,211,238,.6); pointer-events: none; white-space: nowrap; }

/* ===== 面包屑/地图悬浮 ===== */
.crumb { position: absolute; top: 14px; left: 14px; z-index: 20; padding: 8px 14px; font-size: 13px; color: var(--muted); }
.crumb b { color: var(--cyan); }

/* ===== 模态 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(2,6,16,.7); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.modal { width: 480px; max-width: 92vw; max-height: 84vh; overflow: auto; padding: 20px 22px; }
.modal h3 { font-size: 15px; margin-bottom: 14px; color: var(--cyan); }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.form-row input, .form-row select { width: 100%; padding: 9px 12px; background: #fff; border: 1px solid #9db3c8;
  color: #111; border-radius: 8px; font-size: 13px; outline: none; }
/* 下拉框选项白底黑字（所有界面统一，最清晰） */
select option { background: #fff; color: #111; padding: 6px 10px; }
select option:hover, select option:checked { background: #e8f6ff; color: #0a4d6e; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
/* 弹窗内错误提示（失败时留在弹窗里，不依赖转瞬即逝的 toast） */
.form-err { margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.7;
  background: rgba(255,77,94,.14); border: 1px solid rgba(255,77,94,.5); color: #ffb3ba; word-break: break-all; }
/* 弹窗打开时，屏蔽地图对指针事件的拦截：
   腾讯地图 GL 内部存在高层级的透明交互层，会吃掉弹窗下半部分的点击，
   表现为「弹窗里的按钮点了没反应」（只有点上方空白处才有效）。
   用「容器 + 其全部后代」双重覆盖，不依赖对地图内部结构的假设。 */
body.modal-open #rzMap, body.modal-open #rzMap *,
body.modal-open #mapStage, body.modal-open #mapStage *,
body.modal-open #tmapStage, body.modal-open #tmapStage *,
body.modal-open .tmap-container, body.modal-open .tmap-container * { pointer-events: none !important; }

/* ===== 进度条 / 徽章 ===== */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; }
.badge.red { background: rgba(255,77,94,.15); color: var(--red); }
.badge.green { background: rgba(52,211,153,.15); color: var(--green); }
.badge.amber { background: rgba(251,191,36,.15); color: var(--amber); }
.badge.gray { background: rgba(138,167,199,.15); color: var(--muted); }
.badge.cyan { background: rgba(34,211,238,.15); color: var(--cyan); }

/* ============================================================
   移动端元素：桌面端一律隐藏
   ============================================================ */
#tabbar { display: none; }
#drawerMask { display: none; }

/* ============================================================
   移动端适配（≤768px）
   改造前问题：侧边栏固定 220px，390px 手机上主内容只剩 170px，
   卡片被压成一条、地图缩成一团、表格不可读 —— 全站没有任何媒体查询。
   改造后：侧边栏变左侧抽屉（底部标签栏的「更多」打开），主内容占满屏。
   ============================================================ */
@media (max-width: 768px) {
  /* ---- 布局：内容区 + 底部标签栏 ---- */
  #app { flex-direction: column; }
  #main { flex: 1; min-height: 0; }

  /* ---- 侧边栏 → 左侧抽屉 ---- */
  #sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 80vw; max-width: 320px; min-width: 0;
    z-index: 500; overflow-y: auto;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-104%); transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 34px rgba(0,0,0,.65);
  }
  body.drawer-open #sidebar { transform: translateX(0); }
  #drawerMask { position: fixed; inset: 0; z-index: 490; background: rgba(2,6,16,.62); }
  body.drawer-open #drawerMask { display: block; }
  /* 抽屉内导航项加大，方便手指点 */
  .nav-item { padding: 14px; font-size: 15px; }
  .nav-sub-item { padding: 12px 16px; }
  .side-logo { font-size: 16px; padding-bottom: 12px; }

  /* ---- 底部标签栏 ---- */
  #tabbar {
    display: flex; flex: 0 0 auto; height: 58px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line);
    z-index: 60;
  }
  .tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted); font-size: 10.5px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; user-select: none; position: relative; }
  .tab-item .tab-ico { font-size: 19px; line-height: 1; }
  .tab-item.active { color: var(--cyan); font-weight: 700; }
  .tab-item.hidden { display: none !important; }
  /* 待办红点徽标：超标待处理 / 风险待审核+复评到期（2026-10-01 快赢批次） */
  .tab-badge { position: absolute; top: 6px; right: calc(50% - 22px); min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--bg); }

  /* ---- 页面容器 ---- */
  .page { padding: 12px 12px 16px; -webkit-overflow-scrolling: touch; }
  #page-map { padding: 0; }

  /* ---- 页头 ---- */
  .pg-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .pg-title { font-size: 17px; }
  .pg-sub { font-size: 11.5px; }

  /* ---- 统计卡片：两列 ---- */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }
  .card { padding: 11px 12px; }
  .card .c-value { font-size: 21px; }
  .card .c-sub { font-size: 10.5px; }

  /* ---- 表格：整体横向滑动，不压扁每一列 ---- */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.tbl { font-size: 12px; }
  table.tbl:not(.cards) { min-width: 560px; }
  .tbl th, .tbl td { padding: 9px 10px; }

  /* ---- 操作型表格 → 卡片 ----
     待审核超标点这类需要「动手点」的表格，横滑后按钮在屏幕外很难点到；
     卡片化后所有字段与操作按钮都在同一屏内可见。 */
  table.tbl.cards { min-width: 0; }
  table.tbl.cards thead { display: none; }
  table.tbl.cards tbody { display: block; }
  table.tbl.cards tr { display: flex; flex-direction: column; padding: 12px 12px 12px; border-bottom: 1px solid rgba(128,160,200,.18); }
  table.tbl.cards tr:last-child { border-bottom: none; }
  table.tbl.cards td { display: flex; align-items: flex-start; gap: 10px;
    padding: 4px 0; border: none; white-space: normal !important; max-width: none !important; }
  table.tbl.cards td::before { content: attr(data-label); flex: 0 0 68px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
  /* 排序：先「谁 / 什么车 / 超标什么」，紧接着就是操作按钮，次要信息往后放，减少滚动 */
  table.tbl.cards td[data-label="检测点"] { order: 1; font-size: 13.5px; font-weight: 700; padding-bottom: 6px; }
  table.tbl.cards td[data-label="检测点"]::before { display: none; }
  table.tbl.cards td[data-label="车牌号"] { order: 2; }
  table.tbl.cards td[data-label="超标项目"] { order: 3; }
  table.tbl.cards td[data-label="审核操作"] { order: 4; flex-wrap: wrap; gap: 7px; padding: 10px 0 4px; }
  table.tbl.cards td[data-label="审核操作"]::before { display: none; }
  table.tbl.cards td[data-label="产区"] { order: 5; }
  table.tbl.cards td[data-label="乡镇/街道"] { order: 6; }
  table.tbl.cards td[data-label="样品种类"] { order: 7; }
  table.tbl.cards td[data-label="检测日期"] { order: 8; }
  table.tbl.cards td[data-label="坐标"] { order: 9; }
  .tbl-scroll { overflow: visible !important; max-height: none !important; }

  /* ---- 农残检测明细：移动端同样卡片化（2026-10-01）----
     10 列宽表在手机上横滑体验差；卡片化后一行记录一屏读完。 */
  #page-pest table.tbl { display: block; min-width: 0; }
  #page-pest table.tbl thead { display: none; }
  #page-pest table.tbl tbody { display: block; }
  #page-pest table.tbl tr { display: flex; flex-direction: column; padding: 11px 12px; border-bottom: 1px solid rgba(128,160,200,.18); }
  #page-pest table.tbl tr:last-child { border-bottom: none; }
  #page-pest table.tbl td { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; border: none; white-space: normal !important; max-width: none !important; }
  #page-pest table.tbl td::before { content: attr(data-label); flex: 0 0 64px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
  #page-pest table.tbl td[data-label="样品种类"] { order: 1; }
  #page-pest table.tbl td[data-label="车牌号"] { order: 2; }
  #page-pest table.tbl td[data-label="关联回货"] { order: 3; }
  #page-pest table.tbl td[data-label="项目"] { order: 4; }
  #page-pest table.tbl td[data-label="检测值"] { order: 5; }
  #page-pest table.tbl td[data-label="限量"] { order: 6; }
  #page-pest table.tbl td[data-label="结果"] { order: 7; }
  #page-pest table.tbl td[data-label="日期"] { order: 8; }
  #page-pest table.tbl td[data-label="产区"] { order: 9; }
  #page-pest table.tbl td[data-label="乡镇"] { order: 10; }
  #page-pest .tbl-wrap > div { overflow: visible !important; max-height: none !important; }

  /* ---- 风险地域自查：移动端卡片化（2026-10-01）----
     风险区列表 10 列在手机上横滑体验差；驻场品控手机查看是高频场景。 */
  #page-riskzone table.tbl { display: block; min-width: 0; }
  #page-riskzone table.tbl thead { display: none; }
  #page-riskzone table.tbl tbody { display: block; }
  #page-riskzone table.tbl tr { display: flex; flex-direction: column; padding: 11px 12px; border-bottom: 1px solid rgba(128,160,200,.18); }
  #page-riskzone table.tbl tr:last-child { border-bottom: none; }
  #page-riskzone table.tbl td { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; border: none; white-space: normal !important; max-width: none !important; }
  #page-riskzone table.tbl td::before { content: attr(data-label); flex: 0 0 64px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
  #page-riskzone .tbl-wrap > div { overflow: visible !important; max-height: none !important; }
  /* 待审核列表首列放前面（检测点名最重要） */
  #page-riskzone table.tbl td[data-label="超标项目"] { order: 1; }
  #page-riskzone table.tbl td[data-label="检测点"] { order: 2; }

  /* ---- 筛选栏与表单 ---- */
  .filter-bar { gap: 8px; }
  .filter-bar select, .filter-bar input { padding: 9px 11px; }
  /* 输入框字号 ≥16px：否则 iOS Safari 聚焦时会自动放大整个页面 */
  input, select, textarea { font-size: 16px !important; }

  /* ---- 按钮：触控目标加大 ---- */
  .btn { padding: 10px 14px; font-size: 13.5px; min-height: 40px; }
  .btn.mini { padding: 8px 12px; font-size: 12.5px; min-height: 36px; }

  /* ---- 弹窗 → 底部升起的面板 ---- */
  .modal-mask { align-items: flex-end; }
  .modal { width: 100% !important; max-width: 100% !important; border-radius: 16px 16px 0 0;
    max-height: 88vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    animation: sheetUp .24s cubic-bezier(.32,.72,.35,1); }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .form-actions { position: sticky; bottom: 0; background: var(--panel-solid); padding-top: 10px; }
  /* 注意：上面两条只对「弹窗内」的底部按钮生效。
     若写成全局 .form-actions，会把页面内的操作区（如定位自查）也变成吸底、并让按钮被挤扁。 */
  .modal .form-actions { position: sticky; bottom: 0; background: var(--panel-solid); padding-top: 10px; }
  .modal .form-actions .btn { flex: 1; }
  /* 定位自查操作区：定位按钮占整行，手动输入框与「判断」并排
     —— 原先是「按钮 + 260px 输入框 + 按钮」硬挤一行，第一个按钮被压成窄条、文字显示不全 */
  .me-actions { flex-wrap: wrap; position: static; background: none; padding-top: 0; }
  .me-actions .btn.primary { flex: 1 1 100%; }
  .me-actions input { flex: 1 1 auto; width: auto !important; min-width: 0; }
  .me-actions .btn { flex: 0 0 auto; }

  /* ---- 地图页控件重排（原先全挤在顶部与角落，手机上互相压字） ---- */
  /* 车辆定位信息浮层：原样式 position:absolute + bottom:18px + z-index:50，
     而底部标签栏是 z-index:60 且高 58px —— 浮层正好被压在标签栏下面，显示不全。
     这里改为相对视口贴底、抬到标签栏之上、左右满宽。 */
  #tmapTruckPopup {
    position: fixed !important;
    left: 8px !important; right: 8px !important; width: auto !important;
    bottom: calc(66px + env(safe-area-inset-bottom)) !important;
    min-width: 0 !important; max-height: 44vh; overflow: auto;
    z-index: 300 !important; padding: 12px 14px !important;
    -webkit-overflow-scrolling: touch;
  }
  /* 浮层里的关闭按钮加大，手指好点 */
  #tmapTruckPopup [onclick*="display"] { font-size: 24px !important; padding: 0 8px !important; line-height: 1 !important; }

  .crumb { top: 8px; left: 8px; right: 8px; padding: 6px 10px; font-size: 11.5px;
    max-width: calc(100vw - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .map-back { top: 52px; left: 8px; padding: 9px 12px; font-size: 13px; }
  .map-mode { top: auto; bottom: 54px; left: 8px; transform: none; }   /* 让开腾讯地图左下角的比例尺 */
  .map-mode-btn { padding: 9px 12px; font-size: 13px; }
  .map-mode-menu { top: auto; bottom: 100%; margin: 0 0 6px 0; min-width: 180px; }
  .map-tools { top: auto; bottom: 12px; right: 8px; left: auto; min-width: 0; max-width: 58vw; padding: 11px 12px; }
  /* 三维地图标签缩小，减少手机上的互相压字 */
  .lab-target { font-size: 12px; }
  .lab-dim { font-size: 10px; }
  .lab-town { font-size: 11px; }
  .lab-placeholder, .lab-lemon { font-size: 12px; }
  .lab-extend { font-size: 10px; }

  /* ---- 登录页：窄屏自适应 ---- */
  .login-card { width: min(380px, 92vw); padding: 26px 22px; }

  /* ---- toast 上移，避免被底部标签栏挡住 ---- */
  #toast { bottom: calc(74px + env(safe-area-inset-bottom)); max-width: 90vw; text-align: center; }
}

/* ===== 2026-10-01 快赢批次:骨架占位 / 空状态 / 全局打印 ===== */
/* 页面加载占位(首次进入板块、接口未返回前) */
.page-loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.page-loading::after { content: ''; display: block; width: 34px; height: 34px; margin: 14px auto 0;
  border: 3px solid rgba(120,180,255,.18); border-top-color: var(--cyan); border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 统一空状态:图标 + 主文案 + 副文案,替代各页零散的「暂无数据」纯文本 */
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty .empty-ico { font-size: 30px; margin-bottom: 8px; opacity: .75; }
.empty .empty-main { font-size: 13.5px; color: var(--txt); opacity: .85; margin-bottom: 4px; }
.empty .empty-sub { font-size: 12px; line-height: 1.7; }

/* 全局打印:只打印当前激活页内容,隐藏侧边栏/底部栏/背景(配合各单据的 window.open 打印互不影响) */
@media print {
  body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  #sidebar, #tabbar, #toast, .modal-mask, #loginOverlay, .map-tools { display: none !important; }
  #app { display: block !important; height: auto !important; }
  #main { overflow: visible !important; height: auto !important; }
  .page { display: none !important; padding: 0 !important; }
  .page.active { display: block !important; }
  .page.active .tbl-wrap { border-color: #ccc; background: #fff; }
  .page.active .tbl th { background: #f0f2f5 !important; color: #000 !important; box-shadow: none; position: static; }
  .page.active .tbl td { border-color: #ddd; color: #000 !important; }
  .page.active .card, .page.active .glass { background: #fff !important; border-color: #ccc !important; box-shadow: none !important; }
  .page.active .pg-title, .page.active .c-value, .page.active .t-muted, .page.active .c-sub { color: #000 !important; }
}

/* ===== 可搜索下拉面板（2026-10-01）：产区/项目/供应商筛选，输入过滤 + 点选取值 ===== */
.cb-panel { position: fixed; z-index: 4000; background: var(--panel-solid, #0b1220); border: 1px solid var(--line, rgba(120,180,255,.18)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45); max-height: 260px; overflow-y: auto; max-width: 90vw; }
.cb-opt { padding: 7px 12px; font-size: 13px; cursor: pointer; color: inherit; }
.cb-opt:hover { background: rgba(120,180,255,.14); }
.cb-opt.active { color: var(--cyan, #4cc3ff); }

/* ===== 图层看板（产区地图新版 2026-10-18，lt- 前缀零冲突） ===== */
#layerStage { position: absolute; inset: 0; }
#layerStageMap { position: absolute; inset: 0; }
.lt-panel { position: absolute; top: 14px; right: 14px; z-index: 1100; width: 236px;
  background: rgba(10,18,36,.88); border: 1px solid rgba(80,170,255,.28); border-radius: 12px;
  padding: 12px; backdrop-filter: blur(8px); box-shadow: 0 8px 30px rgba(0,0,0,.4); color: #e6f1ff; }
.lt-panel h4 { margin: 0 0 8px; font-size: 13px; color: #22d3ee; letter-spacing: 1px; }
.lt-status { font-size: 11px; color: #9db8d6; margin-bottom: 8px; line-height: 1.6; min-height: 18px; }
.lt-status b { color: #22d3ee; }
.lt-status .lt-err { color: #ff8b93; }
.lt-group { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.lt-group .lt-wide { grid-column: 1 / span 2; }
.lt-btn { padding: 8px 6px; font-size: 12px; color: #e6f1ff; background: rgba(120,180,255,.08);
  border: 1px solid rgba(80,170,255,.28); border-radius: 8px; cursor: pointer; transition: all .15s; text-align: center; }
.lt-btn:hover { background: rgba(120,180,255,.2); }
.lt-btn.active { background: rgba(34,211,238,.2); border-color: #22d3ee; color: #22d3ee; font-weight: 700; }
.lt-btn.rad-on { background: rgba(255,77,94,.18); border-color: #ff4d5e; color: #ff8b93; }
.lt-tip { font-size: 10.5px; color: #9db8d6; line-height: 1.7; border-top: 1px dashed rgba(80,170,255,.28); padding-top: 8px; }
.lt-card { position: absolute; top: 14px; left: 14px; z-index: 1100; width: 240px; display: none;
  background: rgba(10,18,36,.92); border: 1px solid rgba(80,170,255,.28); border-radius: 12px; padding: 14px 16px;
  backdrop-filter: blur(8px); box-shadow: 0 8px 30px rgba(0,0,0,.4); color: #e6f1ff; }
.lt-card.show { display: block; }
.lt-card .lt-close { position: absolute; top: 8px; right: 10px; cursor: pointer; color: #9db8d6; font-size: 15px; }
.lt-card .lt-name { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.lt-card .lt-city { font-size: 11px; color: #9db8d6; margin-bottom: 10px; }
.lt-card table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lt-card td { padding: 4px 0; }
.lt-card td:first-child { color: #9db8d6; width: 64px; }
.lt-card td:last-child { font-weight: 700; }

/* ===== ⚙️ 分级颜色设置弹窗（2026-10-25） ===== */
.lt-grade-mask { position: fixed; inset: 0; z-index: 3000; background: rgba(4,10,22,.62);
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.lt-grade-dlg { width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto;
  background: rgba(10,18,36,.97); border: 1px solid rgba(80,170,255,.32); border-radius: 14px;
  padding: 16px 18px; color: #e6f1ff; box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.lt-grade-head { font-size: 14px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; }
.lt-grade-x { cursor: pointer; color: #9db8d6; font-size: 15px; }
.lt-grade-sec { margin-bottom: 14px; }
.lt-grade-label { font-size: 11.5px; color: #9db8d6; margin-bottom: 6px; }
.lt-grade-metrics { display: flex; gap: 8px; }
.lt-grade-metrics .lt-btn { flex: 1; }
.lt-grade-hint { font-size: 10.5px; color: #7f9ec2; line-height: 1.6; margin-top: 6px; }
.lt-grade-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.lt-grade-color { width: 34px; height: 28px; padding: 0; border: 1px solid rgba(80,170,255,.32);
  border-radius: 6px; background: transparent; cursor: pointer; flex: 0 0 auto; }
.lt-grade-name { flex: 1 1 auto; min-width: 0; background: rgba(120,180,255,.08);
  border: 1px solid rgba(80,170,255,.28); border-radius: 6px; color: #e6f1ff; padding: 5px 8px; font-size: 12px; }
.lt-grade-ge { color: #9db8d6; font-size: 12px; flex: 0 0 auto; }
.lt-grade-min { width: 62px; flex: 0 0 auto; background: rgba(120,180,255,.08);
  border: 1px solid rgba(80,170,255,.28); border-radius: 6px; color: #e6f1ff; padding: 5px 8px; font-size: 12px; }
.lt-grade-unit { color: #9db8d6; font-size: 11px; flex: 0 0 auto; }
.lt-grade-del { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  background: rgba(255,77,94,.14); border: 1px solid rgba(255,77,94,.4); color: #ff8b93; font-size: 12px; }
.lt-grade-del:hover { background: rgba(255,77,94,.28); }
.lt-grade-ops { display: flex; gap: 8px; margin-top: 8px; }
.lt-grade-ops .lt-btn { flex: 1; }
.lt-grade-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
  border-top: 1px dashed rgba(80,170,255,.28); padding-top: 14px; }
.lt-grade-foot .lt-btn { padding: 7px 20px; }
.lt-grade-foot .lt-btn.primary { background: rgba(34,211,238,.2); border-color: #22d3ee; color: #a5f3fc; }

/* ===== 高对比度/强制颜色模式兼容（2026-10-20） =====
 * Windows 高对比度主题或 Edge「强制颜色」开启时，浏览器会把所有颜色强制
 * 刷成系统调色板（白底黑字），深色玻璃 UI 会被破坏。
 * 下面这些品牌化容器声明 forced-color-adjust:none，强制保留设计配色；
 * 该属性仅在强制颜色模式生效，普通模式零影响。 */
#sidebar, #sidebar *, #tabbar, #tabbar *, .lt-panel, .lt-panel *, .lt-card, .lt-card * {
  forced-color-adjust: none;
  -webkit-forced-color-adjust: none;
}

/* ===== 地图 WebGL 降级兜底（2026-10-20） =====
 * 无 WebGL 时腾讯地图走 2D 渲染、不支持个性化暗色样式 → 浅色底图。
 * 用 CSS 滤镜压成暗色，尽量贴近墨渊观感；仅作用于地图 canvas，不影响面板。 */
#layerStageMap.no-webgl canvas {
  filter: invert(0.92) hue-rotate(180deg) brightness(0.88) contrast(1.05) saturate(0.72);
}
