/* 消防隐患台账 · 手机端 H5 */
:root {
  --bg: #f5f6f7;
  --card: #fff;
  --line: #eceef0;
  --ink: #1f2328;
  --dim: #8a929b;
  --red: #c0392b;
  --red-soft: #fdf3f2;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; min-height: 100dvh; }
body.has-tab { padding-bottom: calc(62px + var(--safe-b)); }
a { color: var(--red); text-decoration: none; }
button { font: inherit; color: inherit; }
.app { padding-bottom: 20px; }

/* 顶栏 */
.hd {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(245, 246, 247, .95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hd h1 { margin: 0; font-size: 18px; }
.hd .sub { font-size: 12px; color: var(--dim); margin-top: 1px; }
.hd-main { flex: 1; min-width: 0; }
.hd .back { border: 0; background: transparent; color: var(--red); font-size: 22px; padding: 0 10px 0 0; line-height: 1; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--r);
  padding: 14px; margin: 12px 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; margin-bottom: 10px;
}
.card-title .more { font-size: 12px; color: var(--dim); font-weight: 400; }

/* 首页 */
.hello { padding: 14px 18px 4px; }
.hello .nm { font-size: 21px; font-weight: 700; }
.hello .sm { font-size: 12px; color: var(--dim); margin-top: 2px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 16px 0; }
.stat { background: var(--card); border-radius: var(--r); padding: 12px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat .n.red { color: var(--red); }
.stat .n.warn { color: #ad6200; }
.stat .c { font-size: 12px; color: var(--dim); margin-top: 1px; }

.quick { display: flex; justify-content: space-around; padding: 4px 0; }
.quick button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; background: transparent; font-size: 12px; color: #37474f; padding: 6px 10px;
}
.quick .qi { font-size: 26px; }

/* 行 / 列表 */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
  width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0;
}
.row:first-of-type { border-top: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { font-size: 12px; color: var(--dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { flex: 0 0 auto; font-size: 12px; color: var(--dim); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.lv1, .st-reported { background: #fde2e1; color: #b71c1c; }
.lv2, .st-assigned { background: #fff3cd; color: #8a6d3b; }
.lv3, .st-fixing { background: #e3f2fd; color: #0d47a1; }
.lv4 { background: #eceff1; color: #455a64; }
.st-review { background: #ede7f6; color: #4527a0; }
.st-closed { background: #e8f5e9; color: #1b5e20; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 11px; padding: 12px 16px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 600;
}
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn.gray { background: #eceff1; color: #37474f; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row > .btn { flex: 1; }

/* 表单 */
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 13px; color: #37474f; margin: 0 2px 5px; }
.fld .req { color: var(--red); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #e6e9ec; background: #f7f8fa; color: var(--ink);
  border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.input:focus { background: #fff; border-color: #e0a49e; }
textarea.input { min-height: 84px; resize: vertical; }
.fld .hintline { font-size: 11px; color: var(--dim); margin-top: 4px; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; }
.pick {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #e6e9ec; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; white-space: nowrap;
}

/* 照片 */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.photo {
  position: relative; width: 74px; height: 74px; border-radius: 9px;
  background: #eef0f2 center/cover no-repeat; overflow: hidden;
  border: 1px solid #e6e9ec;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .del {
  position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; line-height: 16px;
  text-align: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; border: 0;
}
.photo.add {
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #b0b6bc; border: 1px dashed #d3d8dd; background: #fafbfc;
}
.photo .badge {
  position: absolute; left: 3px; bottom: 3px; font-size: 10px; color: #fff;
  background: rgba(192, 57, 43, .85); padding: 1px 4px; border-radius: 4px;
}

/* 台账 */
.filters { display: flex; gap: 8px; margin: 12px 16px 0; }
.filters select.input { flex: 0 0 auto; width: 96px; padding: 9px 8px; font-size: 13px; }
.filters .input { padding: 9px 11px; font-size: 13px; }
.filters .btn { flex: 0 0 auto; padding: 9px 12px; font-size: 13px; }
.total { margin: 10px 18px 0; font-size: 12px; color: var(--dim); }
.item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code { font-size: 12px; color: var(--dim); }
.item-title { font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.item-sub { font-size: 12px; color: var(--dim); }
.item-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--dim); }
.load-more { margin: 12px 16px 0; }

/* 详情 */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; border-top: 1px dashed var(--line); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--dim); flex: 0 0 64px; }
.kv .v { flex: 1; text-align: right; word-break: break-word; }

.timeline { position: relative; padding-left: 6px; }
.tl { position: relative; padding: 0 0 14px 18px; }
.tl::before {
  content: ''; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--red);
}
.tl::after {
  content: ''; position: absolute; left: 6px; top: 15px; bottom: 0; width: 1px; background: #eee;
}
.tl:last-child::after { display: none; }
.tl .h { font-size: 13px; font-weight: 600; }
.tl .n { font-size: 12px; color: #566; margin-top: 2px; white-space: pre-wrap; }
.tl .tm { font-size: 11px; color: var(--dim); margin-top: 2px; }

/* 巡检 */
.seg { display: flex; gap: 6px; margin: 12px 16px 0; background: #eceff1; padding: 4px; border-radius: 11px; }
.seg button {
  flex: 1; border: 0; background: transparent; color: #6b7280; padding: 8px 0;
  border-radius: 8px; font-size: 14px;
}
.seg button.on { background: #fff; color: var(--red); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* 我的 */
.profile { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  flex: 0 0 auto;
}
.pname { font-size: 16px; font-weight: 600; }
.psub { font-size: 12px; color: var(--dim); margin-top: 2px; }

/* 空状态 */
.empty { text-align: center; color: #9aa0a6; font-size: 13px; padding: 26px 0; }
.hint { text-align: center; font-size: 11px; color: var(--dim); padding: 10px 16px 0; }
.hint.left { text-align: left; padding: 6px 0 0; }

/* 登录 / 注册 */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px 40px; }
.login .logo {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px;
  background: linear-gradient(150deg, #e05a4a, #a5301f); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  box-shadow: 0 10px 24px rgba(192, 57, 43, .25);
}
.login h1 { text-align: center; font-size: 21px; margin: 14px 0 2px; letter-spacing: 1px; }
.login .sub { text-align: center; font-size: 12px; color: var(--dim); margin-bottom: 20px; }
.login .field {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; margin-top: 10px;
}
.login .field span { opacity: .55; font-size: 15px; }
.login .field input { flex: 1; border: 0; background: transparent; padding: 14px 0; font-size: 16px; outline: none; }
.login .btn { width: 100%; margin-top: 16px; padding: 13px; font-size: 16px; }
.login .tip { text-align: center; font-size: 12px; color: var(--dim); margin-top: 14px; line-height: 1.8; }
.login .tip .lk { color: var(--red); }
.done { text-align: center; padding: 40px 20px; }
.done .ic { font-size: 44px; }
.done .t { font-size: 17px; font-weight: 600; margin-top: 8px; }
.done .s { font-size: 12px; color: var(--dim); margin-top: 6px; }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.tabbar[hidden] { display: none; }
.tab {
  flex: 1; text-align: center; color: #8a8a8a; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px;
}
.tab i { font-style: normal; font-size: 19px; line-height: 1.15; filter: grayscale(.4); opacity: .8; }
.tab.on { color: var(--red); font-weight: 600; }
.tab.on i { filter: none; opacity: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%);
  z-index: 90; max-width: 80vw; padding: 10px 16px; border-radius: 10px;
  background: rgba(31, 35, 40, .92); color: #fff; font-size: 13px; text-align: center;
}
.toast[hidden] { display: none; }

/* 弹层 */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet[hidden] { display: none; }
.sheet-mask { position: absolute; inset: 0; background: rgba(20, 24, 28, .45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 18px 18px 0 0;
  padding-bottom: var(--safe-b);
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(12%); opacity: .7; } to { transform: translateY(0); opacity: 1; } }
.sheet-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--line); background: #fff;
  border-radius: 18px 18px 0 0;
}
.sheet-hd b { font-size: 15px; }
.sheet-x { border: 0; background: transparent; color: var(--dim); font-size: 16px; padding: 2px 4px; }
.sheet-body { padding: 14px 16px 20px; overflow-y: auto; }

/* 扫码 */
.scan-box { position: relative; }
.scan-box video { width: 100%; border-radius: 12px; background: #000; display: block; }
.scan-tip { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-size: 12px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
