* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #f2f5fa; }
body {
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f9; color: #243043; padding-bottom: 72px;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; padding: 12px 16px; background: #1769ff; color: #fff;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.icon-btn { background: rgba(255,255,255,.18); border: 0; color: #fff; width: 34px; height: 34px;
  border-radius: 8px; font-size: 16px; cursor: pointer; }

.view { padding: 14px; max-width: 760px; margin: 0 auto; }

/* 卡片 */
.card { background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 15px; margin: 12px 0 10px; }
.muted { color: #8a94a6; font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gap { gap: 10px; }

/* 统计 */
.grid2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 14px 10px; text-align: center; min-width: 0; }
.stat .num { font-size: 22px; font-weight: 700; }
.stat .lbl { color: #8a94a6; font-size: 12px; margin-top: 2px; }
.stat.warn .num { color: #e5484d; }

/* 快捷入口 */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qbtn { background: #f0f5ff; border-radius: 10px; padding: 16px 8px; text-align: center; font-size: 13px; }

/* 记录列表 */
.rec { border: 1px solid #eef1f5; border-radius: 10px; padding: 12px; margin-top: 10px; }
.rec-main { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #46536a; }
label.block { margin-top: 12px; }
input, select, textarea {
  border: 1px solid #d5dbe4; border-radius: 8px; padding: 9px 10px; font: inherit; background: #fff; color: #243043;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1769ff; }

/* 巡检分组 */
.group { border: 1px solid #eef1f5; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.group legend { font-weight: 600; padding: 0 6px; color: #1769ff; }
.chk-row { padding: 10px 0; border-top: 1px dashed #eef1f5; }
.chk-row:first-of-type { border-top: 0; }
.chk-head { margin-bottom: 6px; }
.chk-opts { display: flex; gap: 16px; flex-wrap: wrap; }
.chk-opts label { flex-direction: row; align-items: center; gap: 5px; }
.chk-problem { margin-top: 8px; }

/* 日报明细行 */
.item-row { display: grid; grid-template-columns: 1.3fr 1fr 0.8fr 0.8fr 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.del-row { border: 1px solid #f3c6c4; background: #fff; color: #d92d20; border-radius: 8px; height: 36px; cursor: pointer; }
#addRowBtn, #addPhotoBtn { border: 1px dashed #1769ff; background: #f0f5ff; color: #1769ff; border-radius: 8px; padding: 9px 14px; cursor: pointer; }

/* 照片 */
.photos-box { margin-top: 14px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.thumb button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: #111827; color: #fff; font-size: 13px; cursor: pointer; }

/* 按钮 */
button { font: inherit; cursor: pointer; }
.primary { background: #1769ff; color: #fff; border: 1px solid #1769ff; border-radius: 9px; padding: 9px 16px; }
.primary.big { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; }
.danger { background: #fff; color: #d92d20; border: 1px solid #f3c6c4; border-radius: 9px; padding: 9px 16px; }
.btn { border: 1px solid #d5dbe4; border-radius: 9px; padding: 9px 16px; }

/* 标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { border: 1px solid #d5dbe4; background: #fff; border-radius: 9px; padding: 7px 16px; }
.tab.on { background: #1769ff; color: #fff; border-color: #1769ff; }

/* 底部导航 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid #e6ebf2; }
.tabbar a { flex: 1; text-align: center; padding: 10px 0; font-size: 12px; color: #6b7280; }
.tabbar a.active { color: #1769ff; }

/* 汇报卡片（出图用） */
.rp-card { width: 375px; background: #fff; border: 1px solid #e6ebf2; border-radius: 14px; padding: 18px; font-size: 13px; }
.rp-head { border-bottom: 1px solid #eef1f5; padding-bottom: 12px; }
.rp-project { font-weight: 700; font-size: 16px; }
.rp-title { color: #1769ff; margin: 4px 0; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: #46536a; margin-top: 6px; }
.rp-summary { margin: 10px 0; font-size: 13px; }
.rp-block { margin-top: 12px; }
.rp-body { white-space: pre-wrap; line-height: 1.7; }
.btn.big { display: block; width: 100%; text-align: center; margin-top: 10px; padding: 12px; }
.rp-label { font-weight: 600; margin-bottom: 6px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.rp-table th, .rp-table td { border-bottom: 1px solid #eef1f5; padding: 7px 4px; text-align: left; word-break: break-word; vertical-align: top; }
.rp-table th { background: #f7f9fc; font-weight: 600; color: #46536a; font-size: 11px; }
.rp-c-status { white-space: nowrap; }
.rp-c-note { font-size: 10.5px; color: #6b7280; }
.rp-c-team { font-size: 10.5px; white-space: nowrap; overflow: hidden; }
.rp-dates { font-size: 10.5px; white-space: nowrap; color: #46536a; }
.rp-empty { color: #8a94a6; padding: 8px 0; }
.rp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.rp-photo img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.rp-foot { margin-top: 16px; padding-top: 10px; border-top: 1px dashed #eef1f5; color: #8a94a6; font-size: 11px; text-align: center; }

.danger-box { border-color: #f3c6c4; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(8px); background: #111827; color: #fff;
  padding: 10px 16px; border-radius: 9px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: 80vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1.2fr 0.9fr 0.8fr 0.8fr 30px; }
  .quick { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: repeat(2, 1fr); }

  .ent-controls { grid-template-columns: 1fr 1fr; }
}

/* ===== 进度台账：模板 / 填报 ===== */
.tpl-bld { border: 1px solid #eef1f5; border-radius: 12px; padding: 12px; margin-top: 12px; }
.tb-name { flex: 1; min-width: 120px; }

/* 页面顶部总览 */
.tpl-sum { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: #f2f6ff;
  border: 1px solid #e2ecff; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 12.5px; color: #43506a; }
.tpl-sum-pct { font-weight: 700; color: #1769ff; }
.tpl-sum .tp-bar { flex: 1 1 100%; }

/* 楼栋头统计 */
.tb-stat { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 12px; color: #5b6678; }
.tb-stat-p { margin-left: auto; color: #1769ff; font-weight: 600; }

/* 部位（楼层 + 户号）卡片 */
.tpl-parts { display: flex; flex-direction: column; gap: 10px; }
.tpl-part { border: 1px solid #e9eff8; border-radius: 12px; padding: 10px; background: #fbfdff; }
.tp-meta { display: grid; grid-template-columns: 1fr 1fr 56px 28px; gap: 8px; align-items: end; }
.tp-meta .ti-fw > input { text-align: center; padding-left: 2px; padding-right: 2px; font-size: 11px; }
.ti-fw > input { text-align: center; padding-left: 2px; padding-right: 2px; font-size: 11.5px; }
.part-del { width: 24px; height: 32px; border: 1px solid #f3c6c4; background: #fff; color: #d92d20;
  border-radius: 7px; font-size: 13px; line-height: 1; cursor: pointer; align-self: end; }

/* 部位统计条 */
.tp-stat { display: flex; align-items: center; gap: 8px; margin: 9px 0 4px; font-size: 11.5px; color: #6b7688; }
.tp-stat-p { color: #1769ff; font-weight: 600; }
.tp-bar { height: 6px; flex: 1; background: #e8eefa; border-radius: 99px; overflow: hidden; }
.tp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3d82ff, #17b26a);
  border-radius: 99px; transition: width .25s; }

/* 分类组 */
.tp-cats { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; counter-reset: tprow; }
.tp-cat { border: 1px solid #eef3fb; border-radius: 10px; background: #fff; padding: 8px 8px 6px; }
.tp-cat-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; }
.tp-caret { font-size: 10px; color: #8a94a6; width: 10px; flex: none; transition: transform .2s; }
.tp-cat.folded .tp-caret { transform: rotate(-90deg); }
.tp-cat.folded .tp-items, .tp-cat.folded .tp-cat-h { margin-bottom: 0; }
.tp-cat.folded .tp-items { display: none; }
.tp-cat-h b { font-size: 13px; color: #16233a; }
/* 分类名可点：切换整组工序的分类 */
.tp-cat-name { cursor: pointer; padding: 1px 6px; border-radius: 6px; border: 1px dashed #cfe0ff;
  background: #f7faff; color: #1769ff !important; }
.tp-cat-name:active { background: #e9f1ff; }
.tp-cat-n { font-size: 11px; color: #8a94a6; }
.tp-additem { margin-left: auto; border: 1px dashed #bcd4ff; background: #f4f8ff; color: #1769ff;
  border-radius: 7px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; }
.tp-items { display: flex; flex-direction: column; gap: 6px; }

/* 工序行：行号 + 工序名/工期 + 加减号 */
.tp-row { counter-increment: tprow; display: flex; align-items: stretch; gap: 6px;
  padding: 6px; border: 1px solid #f2f6fc; border-radius: 9px; background: #fcfdff; }
.tp-no { width: 16px; flex: none; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 9px; font-size: 11px; font-weight: 600; color: #a3adbd; }
.tp-no::before { content: counter(tprow); }
.tp-rowbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-name { width: 100%; height: 36px; }
/* 工序行：名称一行 → 开工/完工各半行 → 人数 + 分项按钮一行 */
.tp-namerow { display: block; }
.tp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; align-items: end; }
.tp-dates .ti-f > span { font-size: 10px; white-space: nowrap; padding-left: 1px; }
/* 日期：文本框 + 日历按钮，宽度自适应不截断 */
.tp-dbox { position: relative; display: flex; align-items: center; }
.tp-start, .tp-end { width: 100%; min-width: 0; height: 36px; padding: 0 28px 0 8px;
  font-size: 12.5px; letter-spacing: 0; color: #16233a; background: #fff; }
.tp-start::placeholder, .tp-end::placeholder { color: #a3adbd; font-size: 11.5px; }
.tp-dcal { position: absolute; right: 3px; top: 4px; width: 26px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 0; background: transparent;
  border-radius: 6px; cursor: pointer; }
.tp-dcal:active { background: #eef4ff; }
.tp-draw { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0;
  border: 0; padding: 0; pointer-events: none; }
.tp-toolrow { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tp-wnum { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.tp-wnum > span { font-size: 10px; color: #8a94a6; white-space: nowrap; }
.tp-wnum > input { width: 56px; height: 34px; padding: 0; text-align: center; font-size: 12.5px; }

/* 分项：一道工序拆多项，如 地砖铺贴 100% / 墙砖铺贴 80% */
.tp-sub-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #dbe6f8; background: #f7faff; color: #43506a; border-radius: 7px;
  padding: 6px 10px; font-size: 11.5px; cursor: pointer; }
.tp-sub-toggle b.tp-sub-num:empty { display: none; }
.tp-sub-num { color: #1769ff; font-weight: 700; }
.tp-sub-chip { color: #17b26a; font-weight: 600; }
.tp-sub-list { display: none; margin-top: 6px; padding: 6px; border: 1px dashed #dbe6f8;
  border-radius: 9px; background: #fcfdff; }
.tp-row.subopen .tp-sub-list { display: block; }
.tp-sub { display: grid; grid-template-columns: minmax(96px, 1fr) 42px 10px 24px;
  align-items: center; gap: 4px; margin-bottom: 6px; }
.tp-sub-n { width: 100%; min-width: 0; height: 34px; padding: 0 8px; font-size: 12.5px; }
.tp-sub-p { width: 100%; min-width: 0; height: 34px; padding: 0; text-align: center; font-size: 12.5px; }
.tp-sub-pc { font-size: 11px; color: #8a94a6; text-align: center; margin: 0; }
.tp-sub-del { width: 22px; height: 32px; border: 1px solid #f3c6c4; background: #fff;
  color: #d92d20; border-radius: 6px; font-size: 12px; line-height: 1; cursor: pointer; }
.tp-sub-add { width: 100%; border: 1px dashed #bcd4ff; background: #f4f8ff; color: #1769ff;
  border-radius: 7px; padding: 5px; font-size: 11.5px; cursor: pointer; }
.tp-acts { flex: none; display: flex; flex-direction: column; gap: 4px; align-self: flex-start; padding-top: 6px; }
.tp-add, .tp-del { width: 22px; height: 22px; border-radius: 6px; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tp-add { border: 1px solid #bcd4ff; background: #eef4ff; color: #1769ff; font-weight: 600; }
.tp-del { border: 1px solid #f3c6c4; background: #fff; color: #d92d20; }
.tp-addcat { width: 100%; margin-top: 8px; border: 1px dashed #bcd4ff; background: #f6faff; color: #1769ff;
  border-radius: 9px; padding: 8px; font-size: 12.5px; cursor: pointer; }

/* 分类选择面板 */
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-pick-b { border: 1px solid #dbe6f8; background: #f7faff; color: #16233a; border-radius: 9px;
  padding: 9px 14px; font-size: 13px; cursor: pointer; }
.cat-pick-b:active { background: #eef4ff; border-color: #1769ff; color: #1769ff; }
.cat-custom { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e6edf8; }
.cat-inp { flex: 1; min-width: 0; border: 1px solid #dbe6f8; border-radius: 9px; padding: 9px 12px;
  font-size: 13px; color: #16233a; background: #fff; }
.cat-inp:focus { outline: none; border-color: #1769ff; }
.cat-ok { flex: none; border: 0; background: #1769ff; color: #fff; border-radius: 9px;
  padding: 0 16px; font-size: 13px; cursor: pointer; }


/* 填报卡片：分项逐项填完成率 */
.es-wrap { margin: 6px 0 2px; padding: 6px 8px; border: 1px solid #e6edf9; border-radius: 9px; background: #f8fbff; }
.es-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.es-n { flex: 1; min-width: 0; padding: 5px 6px; font-size: 12.5px; color: #16233a; }
.es-del { flex: none; width: 26px; height: 28px; border: 1px solid #f3c6c4; background: #fff;
  color: #d92d20; border-radius: 6px; font-size: 12px; line-height: 1; cursor: pointer; }
.es-add { width: 100%; margin-top: 4px; border: 1px dashed #bcd4ff; background: #f4f8ff;
  color: #1769ff; border-radius: 7px; padding: 6px; font-size: 12px; cursor: pointer; }
.es-wrap.empty { border-style: dashed; background: #fbfdff; }
.es-p { width: 58px; flex: none; text-align: center; padding: 5px 2px; font-size: 12.5px; }
.es-u { font-size: 11px; color: #8a94a6; flex: none; margin-left: -3px; }
.es-all { flex: none; border: 1px solid #cfe9da; background: #eef7f1; color: #17b26a;
  border-radius: 6px; padding: 4px 8px; font-size: 11.5px; cursor: pointer; }
.es-all:active { background: #dcf1e6; }
.pct-row .en-percent.auto { background: #f4f7fd; color: #1769ff; font-weight: 700; border-style: dashed; }
/* 通用小标题单元格 */
.ti-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ti-f > span { font-size: 11px; line-height: 1; color: #8a94a6; padding-left: 2px; }
.ti-f > input, .ti-f > select { width: 100%; min-width: 0; }
.mini { border: 1px dashed #1769ff; background: #f0f5ff; color: #1769ff; border-radius: 8px; padding: 7px 12px; }
/* 楼栋底部工具栏：两列对齐 */
.tpl-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tpl-tools .mini { width: 100%; text-align: center; font-size: 12.5px; }

/* ===== 工期与预警 ===== */
.badge-due { display: inline-block; font-size: 11px; line-height: 1.5; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.badge-due.over { background: #fdecea; color: #d92d20; border: 1px solid #f7c6c2; font-weight: 600; }
.badge-due.soon { background: #fff4e5; color: #b25e09; border: 1px solid #fadcb5; font-weight: 600; }
.badge-due.ok { background: #eef7f1; color: #17b26a; border: 1px solid #cfe9da; }
.badge-due.done { background: #f0f5ff; color: #2f6fed; border: 1px solid #d5e2ff; }
.badge-due.none { background: #f4f6f9; color: #8a94a6; border: 1px solid #e6ebf2; }

.alert-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff8f7; border: 1px solid #f7c6c2;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.alert-link { margin-left: auto; color: #d92d20; font-size: 12px; }
.rec-alert { display: flex; gap: 6px; margin-top: 4px; }

.ent-due { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }

/* 主线列表 */
.line-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 8px; border-radius: 10px;
  border-bottom: 1px dashed #eef1f5; cursor: pointer; }
.line-row.over { background: #fff8f7; border-left: 3px solid #e5484d; }
.line-row.soon { background: #fffaf3; border-left: 3px solid #f0a020; }
.lr-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.lr-main { flex: 1; min-width: 0; }
.lr-t { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.lr-t .muted { font-size: 11px; }
.lr-sub { font-size: 11px; margin-top: 2px; }
.lr-right { text-align: right; flex: none; }
.lr-pct { font-size: 11px; margin-top: 4px; color: #46536a; }

.rp-due { font-size: 10px; margin-top: 2px; }
.rp-due.over { color: #d92d20; font-weight: 700; }
.rp-due.soon { color: #b25e09; font-weight: 600; }
.rp-due.ok { color: #17b26a; }
.rp-due.done { color: #2f6fed; }
.rp-due.none { color: #8a94a6; }
.rp-alert { margin-top: 6px; color: #d92d20; font-size: 12px; font-weight: 600; }
.rp-alert-line { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 2px 0; }
.rp-alert-line .muted { font-size: 11px; }

.ent-item { border-top: 1px dashed #eef1f5; padding: 10px 0; }
.ent-item:first-of-type { border-top: 0; }
.ent-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.ent-controls { display: grid; grid-template-columns: 1fr 0.8fr 0.9fr 0.7fr; gap: 8px; }
.ent-controls > * { min-width: 0; width: 100%; }
.ent-controls .en-note { grid-column: 1 / -1; }

/* 进度条 */
.prog-bar { height: 8px; background: #eef1f5; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.prog-fill { height: 100%; border-radius: 6px; }

/* 报表补充 */
.rp-comp { display: flex; flex-direction: column; gap: 6px; }
.rp-comp-num { font-size: 26px; font-weight: 700; color: #1769ff; }
.rp-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.tag { font-size: 12px; }

/* 打印 / 导出 PDF：只保留报表内容 */
@media print {
  body { background: #fff; padding-bottom: 0; }
  .topbar, .tabbar, .row.gap, .quick, .photos-box, #syncBtn { display: none !important; }
  .view { padding: 0; max-width: 100%; }
  .card { border: 0; padding: 0; }
  #reportStage { display: none !important; }
  .rp-card { width: 100%; border: 0; }
}

/* ===== 楼栋详情 / 动态 ===== */
.badge-note { font-size: 11px; background: #eef1f5; color: #46536a; padding: 2px 8px; border-radius: 8px; }
.bd-head { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.bd-num { font-size: 30px; font-weight: 700; color: #1769ff; line-height: 1.1; text-align: center; }
.bd-num .muted { font-size: 11px; font-weight: 400; }
.bd-side { flex: 1; font-size: 12.5px; color: #46536a; }
.rp-tags .tag { display: inline-block; background: #f4f6f9; border-radius: 6px; padding: 1px 6px; margin-right: 4px; font-size: 11px; }

.bitem { border-bottom: 1px solid #f0f3f8; padding: 4px 0; }
.bitem summary { display: flex; align-items: flex-start; gap: 7px; list-style: none; padding: 6px 0; cursor: pointer; }
.bitem summary::-webkit-details-marker { display: none; }
.bi-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.bi-main { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.5; }
.bi-main .muted { display: block; font-size: 11px; }
.bi-meta { display: block; font-size: 11px; color: #8a94a6; }
.bi-detail { padding: 2px 0 10px 15px; }
.his-row { display: flex; gap: 8px; font-size: 11.5px; padding: 3px 0; border-bottom: 1px dashed #f4f6f9; }
.his-date { color: #8a94a6; flex: none; width: 40px; }
.his-body { flex: 1; min-width: 0; }
.his-note { font-size: 11px; color: #6b7280; background: #f8fafc; border-radius: 6px; padding: 2px 6px; margin-top: 2px; }

.tl-day { margin-top: 10px; }
.tl-day-h { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding-bottom: 5px; border-bottom: 1px solid #eef1f5; }
.tl-ev { font-size: 12px; padding: 6px 0 6px 8px; border-left: 2px solid #e6ebf2; margin-left: 4px; line-height: 1.6; }
.tl-t { font-weight: 600; }

/* 批量粘贴弹层 */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; padding: 14px; width: 100%; max-width: 460px; max-height: 86vh; overflow: auto; }
.modal-box textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6;
  border: 1px solid #dfe5ee; border-radius: 10px; padding: 8px; resize: vertical; }
.modal-box code { background: #f4f6f9; padding: 0 3px; border-radius: 4px; font-size: 11px; }
.modal-x { margin-left: auto; border: none; background: none; font-size: 22px; line-height: 1; color: #8a94a6; padding: 0 4px; }
@media (max-width: 480px) {
  .bd-head { gap: 8px; }
  .bd-num { font-size: 26px; }
}

/* ===== 工程水印相机 ===== */
.cam-page { display: flex; flex-direction: column; gap: 12px; }
.cam-stage { position: relative; border-radius: 14px; overflow: hidden; background: #11161f; aspect-ratio: 4/3; min-height: 260px; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; }
.cam-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 13px; text-align: center; padding: 16px; }
.wm-preview { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; }
.wm-card { background: rgba(15,23,42,.80); border-top-left-radius: 12px; border-top-right-radius: 12px; overflow: hidden; }
.wm-title { background: #1769ff; color: #fff; font-weight: 600; font-size: 14px; padding: 7px 12px; }
.wm-body { padding: 8px 12px 10px; color: #fff; font-size: 12px; line-height: 1.7; }
.wm-line { display: flex; gap: 8px; }
.wm-label { color: rgba(255,255,255,.72); flex: none; width: 52px; }

.cam-tabs { display: flex; justify-content: center; gap: 22px; }
.cam-tabs button { background: none; border: none; color: #8a94a6; font-size: 14px; padding: 6px 2px; }
.cam-tabs button.on { color: #1769ff; font-weight: 600; border-bottom: 2px solid #1769ff; }
.cam-controls { display: flex; align-items: center; justify-content: space-around; padding: 4px 10px 8px; }
.cam-side { width: 44px; height: 44px; border: none; background: #f0f5ff; border-radius: 12px; font-size: 18px; }
.shutter { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 2px #1769ff; background: #1769ff; }
.shutter.rec { background: #e5484d; box-shadow: 0 0 0 2px #e5484d; }

.wm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.wm-grid label, .parties label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #46536a; }
.wm-grid input, .wm-grid select, .parties input, .custom-row input { width: 100%; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.custom-row { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.custom-row .ci-label { flex: 1; } .custom-row .ci-value { flex: 1.4; }
.check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #46536a; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pcell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f4f6f9; }
.pcell img, .pcell video { width: 100%; height: 100%; object-fit: cover; }
.pcell-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(15,23,42,.72); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 6px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.86); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 18px; }
.lb-box { max-width: 420px; width: 100%; }
.lb-media { width: 100%; max-height: 72vh; border-radius: 12px; object-fit: contain; background: #000; }
.lb-meta { color: #fff; font-size: 13px; margin: 10px 0; display: flex; justify-content: space-between; gap: 10px; }

/* 概览：同步状态条 / 状态分布 / 今日小结 */
.sync-strip { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  background: #fff; border: 1px solid #e6ebf2; border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; font-size: 13px; }
.sync-strip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.sync-strip .dot.on { background: #17b26a; }
.sync-strip .dot.off { background: #e5484d; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #e6ebf2; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; background: #f8fafc; }
.sum-lines { display: flex; flex-direction: column; gap: 6px; }
.sum-line { font-size: 13.5px; line-height: 1.7; color: #2b3445; }
.sum-actions { display: flex; gap: 8px; margin-top: 12px; }
.sum-actions .btn { flex: 1; text-align: center; }

/* 版本更新 */
.update-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  background: #fff7ed; border: 1px solid #fdba74; border-radius: 12px;
  padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; color: #9a3412; }
.update-bar .btn { margin-left: auto; }
.link-btn { background: none; border: none; color: #64748b; font-size: 13px; padding: 4px 6px; }
.modal-mask { position: fixed; inset: 0; background: rgba(15, 25, 35, .5);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 360px;
  padding: 18px; box-shadow: 0 12px 32px rgba(15, 25, 35, .25); }
.modal-card h3 { margin: 0 0 10px; }
.changelog { margin: 0 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px;
  font-size: 13.5px; color: #2b3445; line-height: 1.6; }
.modal-card .row.gap { justify-content: flex-end; }

@media (max-width: 480px) {
  .wm-grid, .parties { grid-template-columns: 1fr 1fr; }
}

/* ===== 工作台首页：Hero / 速记卡片 ===== */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #1769ff 0%, #2f6fed 100%); color: #fff;
  border-radius: 14px; padding: 18px 16px; margin-bottom: 14px; }
.hero-l { min-width: 0; }
.hero-name { font-size: 18px; font-weight: 700; }
.hero-date { font-size: 12px; opacity: .85; margin-top: 4px; }
.hero-r { text-align: right; flex: none; }
.hero-num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.hero-lbl { font-size: 11px; opacity: .85; }

.cta-row { display: flex; gap: 10px; margin-bottom: 14px; }
.cta-primary { flex: 1.6; background: #1769ff; color: #fff; border-radius: 12px;
  padding: 15px 10px; text-align: center; font-size: 15px; font-weight: 600; }
.cta-ghost { flex: 1; background: #fff; border: 1px solid #1769ff; color: #1769ff;
  border-radius: 12px; padding: 15px 10px; text-align: center; font-size: 14px; font-weight: 600; }

.bq { border: 1px solid #eef1f5; border-radius: 12px; padding: 12px; margin-top: 12px; }
.bq-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; cursor: pointer; }
.bq-main { flex: 1; min-width: 0; }
.bq-main b { font-size: 15px; }
.bq-main .muted { display: block; font-size: 12px; margin-top: 2px; }
.bq-actions { display: flex; gap: 8px; margin-top: 10px; }
.bq-btn { flex: 1; text-align: center; border: 1px solid #d5dbe4; background: #f8fafc;
  border-radius: 9px; padding: 10px 6px; font-size: 13px; }
.bq-btn.bp { background: #1769ff; color: #fff; border-color: #1769ff; font-weight: 600; }

@media (max-width: 480px) {
  .grid2 { grid-template-columns: repeat(2, 1fr); }
  .hero-num { font-size: 26px; }
  .bq-actions { gap: 6px; }
  .bq-btn { font-size: 12.5px; padding: 9px 4px; }
}

/* ===== 填报页：速填控件 ===== */
.bchips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; margin-top: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.bchips::-webkit-scrollbar { display: none; }
.bchip { flex: none; padding: 7px 12px; border-radius: 999px; background: #f0f3f8; color: #46536a; font-size: 12.5px; border: 1px solid #e6ebf2; }
.bchip.on { background: #1769ff; color: #fff; border-color: #1769ff; font-weight: 600; }
.btn.small { width: auto; display: inline-block; padding: 8px 12px; font-size: 12.5px; margin: 0; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 6px; }
.seg-b { padding: 9px 2px; border-radius: 9px; border: 1px solid #e2e8f1; background: #f7f9fc; color: #46536a; font-size: 12.5px; cursor: pointer; }
.seg-b.on { background: #1769ff; border-color: #1769ff; color: #fff; font-weight: 600; }
.seg-b.on[data-v="完成"] { background: #17b26a; border-color: #17b26a; }
.seg-b.on[data-v="停工"] { background: #e5484d; border-color: #e5484d; }
.pct-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pct-lbl { font-size: 12px; color: #8a94a6; }
.pct-b { border: 1px solid #e2e8f1; background: #f7f9fc; color: #46536a; border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; }
.pct-b.on { background: #e8f1ff; border-color: #1769ff; color: #1769ff; font-weight: 600; }
.en-percent { width: 62px; text-align: center; }
.step { display: flex; align-items: center; gap: 0; border: 1px solid #e2e8f1; border-radius: 9px; overflow: hidden; }
.step .step-b { width: 34px; height: 34px; border: 0; background: #f0f3f8; color: #46536a; font-size: 16px; font-weight: 700; cursor: pointer; }
.step .en-workers { border: 0; border-radius: 0; text-align: center; }
.note-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.nc-b { border: 1px solid #e2e8f1; background: #fff; color: #8a94a6; border-radius: 999px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; }
.note-chips .nc-b:active { background: #e8f1ff; border-color: #1769ff; color: #1769ff; }
.entry-top .row.gap { gap: 8px; }
.entry-pad { height: 78px; }
.entry-bar { position: fixed; left: 0; right: 0; bottom: 44px; z-index: 30; background: #fff;
  border-top: 1px solid #e6ebf2; padding: 10px 14px; box-shadow: 0 -6px 16px rgba(23,105,255,.10); }
.entry-bar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; align-items: center; }
.entry-bar .inner .primary { flex: 1; margin: 0; padding: 12px; font-size: 14.5px; }
.entry-bar .inner .btn { flex: none; width: auto; margin: 0; padding: 12px 14px; font-size: 13px; }
.ent-controls { grid-template-columns: 1fr 1.15fr; }
@media (max-width: 380px) {
  .entry-bar { bottom: 40px; }
  .seg-b { font-size: 11.5px; }
}

/* ===== 模板 / 填报：楼层分组 ===== */
.tpl-floor { border: 1px solid #eef1f5; border-radius: 12px; padding: 10px 12px; margin-top: 10px; background: #fafbfd; }
.tf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tf-head b { font-size: 14px; color: #1769ff; }
.tf-head .muted { flex: 1; }
.tpl-floor-items { display: flex; flex-direction: column; gap: 8px; }

.ent-floor { border: 1px solid #eef1f5; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.ef-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ef-head b { font-size: 14px; }

.floor-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.fs-item { background: #f6f8fc; border: 1px solid #eef1f5; border-radius: 10px; padding: 10px; }
.fs-item b { font-size: 13.5px; }
.fs-item .muted { font-size: 11.5px; display: block; margin-top: 2px; }

.floor-pick { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.floor-pick .fp { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.floor-pick input[type=checkbox] { width: 16px; height: 16px; }
.floor-pick input#fpOther { flex: 1; min-width: 160px; }

/* ===== 首页：截图风格改版 ===== */
.hero2 { background: linear-gradient(135deg, #2f6fed 0%, #1f5fd6 55%, #17b26a 130%);
  border-radius: 18px; padding: 20px 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; color: #fff; margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(47,111,237,.28); }
.hero2-l .h2-line { font-size: 15px; margin: 8px 0; }
.hero2-l b { font-size: 21px; font-weight: 700; }
.donut { width: 96px; height: 96px; flex: none; }
.quick2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.q2-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.pill { background: #1769ff; color: #fff; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; flex: none; box-shadow: 0 6px 14px rgba(23,105,255,.28); }
.fgrid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.fgrid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.fcell { background: #fff; border: 1px solid #eef1f5; border-radius: 16px; padding: 16px 8px;
  text-align: center; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fcell .femoji { font-size: 26px; }

/* ===== 企业级视觉统一（本轮改版） ===== */
:root {
  --primary: #1769ff; --primary-deep: #2f6fed; --green: #17b26a;
  --ink: #16233a; --sub: #5b6678; --muted: #8a94a6; --line: #e8edf5;
  --bg: #f2f5fa; --soft: #eef3fc;
}
body { background: var(--bg); }
body.home-bg { background-color: var(--bg);
  background-image: linear-gradient(180deg, #1769ff 0%, #3d82ff 210px, var(--bg) 320px);
  background-repeat: no-repeat; background-size: 100% 340px; }

/* 顶栏 */
.topbar { background: var(--primary); padding: 14px 16px; box-shadow: 0 2px 10px rgba(23,105,255,.18); }
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; cursor: pointer;
  display: flex; align-items: center; }
.brand-ic { display: inline-flex; align-items: center; margin-right: 8px; }
.brand-ic svg { width: 20px; height: 20px; }
.icon-btn { background: rgba(255,255,255,.18); }

/* 通用卡片 / 文字 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  box-shadow: 0 2px 10px rgba(22,35,58,.05); }
.card h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); }

/* 首页数据卡：半透明浮在蓝色背景上 */
.hero2 { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px; padding: 22px 20px; box-shadow: 0 12px 28px rgba(23,90,220,.18); }
.hero2-l .h2-line { font-size: 14px; color: rgba(255,255,255,.92); margin: 10px 0; }
.hero2-l b { font-size: 22px; font-weight: 700; margin-left: 4px; }
.donut { width: 96px; height: 96px; }

/* 快速填报卡 */
.quick2 { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 20px; }
.q2-title { font-size: 19px; font-weight: 700; color: var(--ink); }
.q2-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill { padding: 13px 28px; border-radius: 999px; font-size: 15px; font-weight: 600; }

/* 楼层头：窄屏允许换行，按钮不被裁切 */
.tf-head { flex-wrap: wrap; row-gap: 8px; }
.tf-head .mini { margin-left: auto; }
.ef-head { flex-wrap: wrap; row-gap: 4px; }

/* 功能卡片 */
.fgrid3, .fgrid2 { gap: 12px; }
.fcell { border-radius: 18px; border: 1px solid var(--line); background: #fff;
  padding: 16px 8px; box-shadow: 0 3px 12px rgba(22,35,58,.06); gap: 10px; }
.fcell .femoji { font-size: 26px; }
.fcell .femoji svg { width: 30px; height: 30px; }
.fcell span:last-child { font-size: 14px; font-weight: 500; color: var(--ink); }
.fcell.h { background: var(--soft); border-color: #e6eefb; flex-direction: row;
  justify-content: flex-start; gap: 14px; padding: 18px 16px; text-align: left; }
.fcell.h .femoji { font-size: 26px; }
.fcell.h .femoji svg { width: 26px; height: 26px; }

/* 底部导航：五栏等分，图标在上文字在下，中间相机凸起大圆 */
.tabbar { border-top: 1px solid var(--line);
  height: calc(64px + env(safe-area-inset-bottom)); align-items: flex-end;
  padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; color: var(--muted); font-weight: 500; display: flex;
  flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px; padding: 0; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tb-ic { line-height: 1; display: flex; align-items: center; justify-content: center; }
.tb-ic svg { width: 23px; height: 23px; }
.tb-tx { font-size: 11px; line-height: 1.15; }

/* 中间相机：白色圆形凸起，向上探出导航栏 */
.tab-center { position: relative; }
.tab-center .tb-ic { width: 58px; height: 58px; border-radius: 50%;
  background: #fff; border: 1.5px solid #e3ecfb;
  box-shadow: 0 5px 16px rgba(22,35,58,.18);
  margin-top: -28px; }
.tab-center .tb-ic svg { width: 27px; height: 27px; }

/* 按钮 / 分组统一圆角 */
.primary { border-radius: 10px; font-weight: 600; }
.btn, .mini, .tabs .tab { border-radius: 10px; }
.qbtn { background: var(--soft); border: 1px solid #e6eefb; color: var(--ink); }
.tpl-bld, .ent-floor, .tpl-floor { border-radius: 14px; }

@media (max-width: 480px) {
  .fcell.h { padding: 16px 14px; }
  .fcell.h .femoji { font-size: 24px; }
}

/* 关键修正：[hidden] 必须真正隐藏，否则 .cam-empty 的 display:flex 会把它顶出来，
   造成"未检测到相机"误报（相机其实是正常的） */
[hidden] { display: none !important; }
