/* 登记台账 · H5 设计系统
   移动优先，深蓝+安全橙，工程现场可读性优先 */
:root {
  --navy: #0f2a43;
  --navy-2: #173f5f;
  --navy-3: #245b7f;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: #fff2e8;
  --teal: #0e7490;
  --teal-soft: #e6f6f9;
  --bg: #f3f5f8;
  --card: #ffffff;
  --line: #e4eaf1;
  --line-strong: #cfd9e4;
  --text: #12263a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --ok: #15803d;
  --ok-soft: #e9f7ef;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --err: #b91c1c;
  --err-soft: #fdecec;
  --shadow: 0 10px 30px rgba(15, 42, 67, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 42, 67, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}
.view {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(228, 234, 241, 0.9);
  padding: 10px 16px;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--navy);
  display: grid;
  place-items: center;
  color: var(--orange);
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(15, 42, 67, 0.18);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { text-align: left; line-height: 1.15; }
.brand-text strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0.5px;
  color: var(--navy);
  font-weight: 800;
}
.brand-text span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.2px;
  margin-top: 3px;
  font-family: var(--mono);
}
.topbar-spacer { flex: 1; }
.building-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 6px 0 12px;
  height: 38px;
  max-width: 160px;
}
.building-picker:focus-within { border-color: var(--orange); background: #fff; }
.building-picker svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.building-picker select {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  outline: 0;
  appearance: none;
  padding: 0 16px 0 0;
  max-width: 120px;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--navy-2);
  flex: 0 0 auto;
  transition: 0.16s ease;
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }
.icon-btn svg { width: 19px; height: 19px; }
.top-nav { display: none; gap: 4px; }
.top-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.top-nav a.active { background: var(--navy); color: #fff; }

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 45;
  width: calc(100% - 24px);
  max-width: 560px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(228, 234, 241, 0.9);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(15, 42, 67, 0.14);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px;
  backdrop-filter: blur(14px);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 48px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: 0.16s ease;
}
.bottom-nav a svg { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--orange); background: var(--orange-soft); }
.bottom-nav a.active svg { stroke-width: 2.2; }

/* ---------- 通用 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--navy);
  font-weight: 800;
}
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex: 0 0 auto; }
.section { margin-top: 22px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-title h2 {
  margin: 0;
  font-size: 15px;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: 0.2px;
}
.section-title .link {
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  padding: 4px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 11px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 14px 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  transition: 0.16s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: var(--orange); color: var(--orange-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
}
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--navy); }
.btn-danger { color: var(--err); border-color: #f3c6c6; background: #fff; }
.btn-danger:hover { background: var(--err-soft); color: var(--err); border-color: var(--err); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; border-radius: 10px; }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(128deg, #0d2438 0%, #143a58 58%, #1d5273 100%);
  color: #fff;
  padding: 22px 20px;
  box-shadow: 0 16px 32px rgba(15, 42, 67, 0.22);
}
.hero::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -60px;
  width: 210px;
  height: 210px;
  border: 26px solid rgba(249, 115, 22, 0.18);
  border-radius: 50%;
}
.hero::before {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -54px;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero h1 {
  position: relative;
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.1px;
  max-width: 92%;
}
.hero p {
  position: relative;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12.5px;
}
.hero-actions {
  position: relative;
  display: flex;
  gap: 9px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hero-actions .btn { min-height: 42px; }
.hero-actions .btn-primary { box-shadow: 0 8px 18px rgba(249, 115, 22, 0.32); }
.hero-actions .btn-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.hero-actions .btn-light:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hero-meta {
  position: relative;
  display: flex;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.hero-meta b { color: #fff; font-weight: 700; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat.orange .stat-value { color: var(--orange-dark); }
.stat::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--orange-soft);
}
.stat.teal::after { background: var(--teal-soft); }
.stat.orange::after { background: var(--orange-soft); }
.stat.green::after { background: var(--ok-soft); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.quick {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.quick .q-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange-dark);
  flex: 0 0 auto;
}
.quick .q-icon.teal { background: var(--teal-soft); color: var(--teal); }
.quick .q-icon.navy { background: #e9eff5; color: var(--navy); }
.quick .q-icon.green { background: var(--ok-soft); color: var(--ok); }
.quick svg { width: 19px; height: 19px; }
.quick b { display: block; font-size: 13px; color: var(--navy); }
.quick span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.list-item:active { background: #f8fafc; }
.list-main { flex: 1; min-width: 0; }
.list-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.list-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.list-chevron { color: var(--muted-2); flex: 0 0 auto; }
.list-chevron svg { width: 17px; height: 17px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef3f8;
  color: var(--navy-2);
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
}
.avatar.orange { background: var(--orange-soft); color: var(--orange-dark); }
.avatar.teal { background: var(--teal-soft); color: var(--teal); }

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  background: #eef2f7;
  color: var(--muted);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.orange { background: var(--orange-soft); color: var(--orange-dark); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.navy { background: #e7eef5; color: var(--navy); }
.badge .dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: 30px 18px;
  color: var(--muted);
}
.empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 18px;
  background: #eef3f8;
  color: var(--navy-2);
  display: grid;
  place-items: center;
}
.empty-icon svg { width: 27px; height: 27px; }
.empty h3 { margin: 0 0 4px; color: var(--navy); font-size: 15px; }
.empty p { margin: 0; font-size: 12.5px; }
.empty .btn { margin-top: 14px; }

/* ---------- 扫码页 ---------- */
.scan-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
.scanner-card {
  position: relative;
  background: #0b1f30;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4 / 3.4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 42, 67, 0.22);
}
.scanner-card video { width: 100%; height: 100%; object-fit: cover; }
.scanner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(36, 91, 127, 0.45), transparent 58%),
    linear-gradient(150deg, #0b1f30, #12374f);
}
.scanner-placeholder svg { width: 46px; height: 46px; color: var(--orange); opacity: 0.9; }
.scanner-placeholder strong { font-size: 15px; }
.scanner-placeholder span { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); max-width: 260px; }
.scan-frame {
  position: absolute;
  width: 58%;
  max-width: 250px;
  aspect-ratio: 1;
  border-radius: 18px;
  pointer-events: none;
}
.scan-frame::before, .scan-frame::after,
.scan-frame .corner-b::before, .scan-frame .corner-b::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid var(--orange);
}
.scan-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.scan-frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.scan-frame .corner-b::before { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scan-frame .corner-b::after { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  box-shadow: 0 0 12px var(--orange);
  animation: scanmove 2.2s ease-in-out infinite;
}
@keyframes scanmove { 0%, 100% { top: 16%; opacity: 0.3; } 50% { top: 82%; opacity: 1; } }
.scan-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: rgba(8, 23, 35, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 11px;
  padding: 7px 11px;
  font-size: 11px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.scan-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.scan-controls .btn { flex: 1 1 30%; }
.paste-box { display: flex; gap: 8px; margin-top: 10px; }
.paste-box input { flex: 1; }

/* ---------- 输入 ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.field label .req { color: var(--err); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  min-height: 42px;
  padding: 9px 11px;
  outline: 0;
  font-size: 14px;
  color: var(--text);
  transition: 0.14s ease;
}
.field textarea { min-height: 78px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.field input:disabled, .field select:disabled { background: #f6f8fa; color: var(--muted); }
.field .hint { font-size: 10.5px; color: var(--muted-2); }
.field.invalid input, .field.invalid select { border-color: var(--err); background: #fffafa; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.5px;
  margin: 4px 0 2px;
}
.form-section-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--orange);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 11px;
  height: 40px;
  min-width: 0;
}
.search-box svg { width: 16px; height: 16px; color: var(--muted-2); flex: 0 0 auto; }
.search-box input {
  border: 0;
  outline: 0;
  background: none;
  width: 100%;
  min-width: 0;
  font-size: 13px;
}

/* ---------- 材料标签 ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .count {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 10px;
  padding: 0 5px;
  min-width: 17px;
  text-align: center;
}
.chip:not(.active) .count { background: #eef2f7; color: var(--muted); }

.tabs {
  display: flex;
  background: #e9eef4;
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  height: 34px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.tabs button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(15, 42, 67, 0.1); }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
table.data {
  border-collapse: collapse;
  width: 100%;
  min-width: 680px;
  font-size: 12px;
}
table.data th {
  background: #f7f9fb;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.2px;
}
table.data td {
  padding: 10px 11px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
  color: var(--text);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data td.num { font-variant-numeric: tabular-nums; }
table.data td.report-no { font-family: var(--mono); font-size: 10.5px; color: var(--navy-2); }
table.data .strong { font-weight: 700; }
.mobile-list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- 台账卡片 ---------- */.ledger-card {
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  text-align: left;
}
.ledger-top { display: flex; align-items: flex-start; gap: 10px; }
.ledger-cat {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  padding: 3px;
}
.ledger-cat.other { background: var(--teal-soft); color: var(--teal); }
.ledger-part { font-size: 13.5px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.ledger-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 5px; font-size: 11px; color: var(--muted); }
.ledger-meta b { color: var(--navy-2); font-weight: 700; }
.ledger-no { margin-top: 7px; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }

/* ---------- 报告状态 ---------- */
.status-card { padding: 18px; }
.status-head { display: flex; align-items: center; gap: 12px; }
.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  color: var(--orange-dark);
  flex: 0 0 auto;
}
.status-icon.err { background: var(--err-soft); color: var(--err); }
.status-icon.ok { background: var(--ok-soft); color: var(--ok); }
.status-icon svg { width: 24px; height: 24px; }
.status-title { font-size: 15px; font-weight: 800; color: var(--navy); }
.status-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress {
  height: 7px;
  border-radius: 999px;
  background: #e9eef4;
  overflow: hidden;
  margin-top: 14px;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), #fb923c);
  transition: width 0.5s ease;
}
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 14px; }
.tl-item { display: flex; gap: 10px; position: relative; padding-bottom: 13px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 19px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  flex: 0 0 auto;
  margin-top: 2px;
  z-index: 1;
}
.tl-item.done .tl-dot { border-color: var(--ok); background: var(--ok); }
.tl-item.active .tl-dot { border-color: var(--orange); background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.tl-text { font-size: 12px; color: var(--muted); line-height: 1.45; }
.tl-item.active .tl-text, .tl-item.done .tl-text { color: var(--navy); }
.tl-text b { display: block; font-size: 12.5px; font-weight: 700; }

/* ---------- 审核页 ---------- */
.review-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
.review-layout > .pdf-panel { order: 2; }
.review-layout > .card { order: 1; }
@media (min-width: 700px) {
  .review-layout > .pdf-panel { order: 1; }
  .review-layout > .card { order: 2; }
}
.pdf-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  align-self: start;
}
.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.pdf-toolbar .row { gap: 5px; }
.pdf-frame { background: #eef2f6; min-height: 220px; max-height: 62vh; overflow-y: auto; display: grid; place-items: center; }
.pdf-frame img { width: 100%; height: auto; }
.pdf-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 12px; }
.alert {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--warn-soft);
  color: #8a4b00;
  border: 1px solid #f7dfb3;
}
.alert svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.alert.err { background: var(--err-soft); color: var(--err); border-color: #f3c6c6; }
.alert.info { background: var(--teal-soft); color: var(--teal); border-color: #bfe5ec; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5cc; }
.confidence {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.confidence-bar { width: 74px; height: 5px; border-radius: 3px; background: #e9eef4; overflow: hidden; }
.confidence-bar i { display: block; height: 100%; background: var(--ok); }
.confidence-bar i.mid { background: var(--orange); }
.confidence-bar i.low { background: var(--err); }
.test-items { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.test-items th, .test-items td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.test-items th { color: var(--muted); font-weight: 700; background: #f8fafc; }

/* ---------- 核查要录 ---------- */
.check-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.check-top { display: flex; align-items: flex-start; gap: 10px; }
.check-form {
  flex: 0 0 auto;
  min-width: 52px;
  height: 42px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 0 6px;
  text-align: center;
  line-height: 1.2;
}
.check-title { font-size: 13.5px; font-weight: 800; color: var(--navy); line-height: 1.4; }
.check-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.check-metrics { display: flex; gap: 14px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.check-metric b { display: block; font-size: 16px; color: var(--navy); line-height: 1.2; }
.check-metric span { font-size: 10px; color: var(--muted); }
.check-actions { display: flex; gap: 8px; }
.check-actions .btn { flex: 1; }
.check-group-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted-2);
  font-weight: 700;
  font-family: var(--mono);
  margin: 16px 0 7px;
  text-transform: uppercase;
}

/* ---------- 设置 ---------- */
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
.settings-card { padding: 16px; }
.settings-card h3 { margin: 0 0 3px; font-size: 14px; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.settings-card > p { margin: 0 0 14px; font-size: 11.5px; color: var(--muted); }
.settings-card h3 svg { width: 17px; height: 17px; color: var(--orange); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.switch-row:last-child { border-bottom: 0; }
.switch-row b { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); }
.switch-row span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.18s;
}
.switch i::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + i { background: var(--orange); }
.switch input:checked + i::after { transform: translateX(18px); }
.settings-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.key-state { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--ok); font-weight: 700; }
.key-state svg { width: 12px; height: 12px; }

/* ---------- 模态 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 23, 35, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fade 0.16s ease;
}
.modal {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideup 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 15px; color: var(--navy); }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  background: #fff;
}
.modal-foot .btn { flex: 1; }
@keyframes slideup { from { transform: translateY(24px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: calc(100% - 28px);
  max-width: 420px;
  pointer-events: none;
}
.toast {
  background: rgba(15, 42, 67, 0.96);
  color: #fff;
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 12.5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  animation: toastin 0.2s ease;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  backdrop-filter: blur(8px);
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
@keyframes toastin { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 骨架 ---------- */
.skeleton {
  background: linear-gradient(90deg, #eef2f6 25%, #f7f9fb 37%, #eef2f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.loading-wrap { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 桌面 ---------- */
@media (min-width: 700px) {
  body { font-size: 15px; }
  .view { padding: 24px 24px 48px; }
  .topbar { padding: 12px 24px; }
  .page-head h1 { font-size: 26px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .scan-layout { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .review-layout { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
  .settings-layout { grid-template-columns: 1fr 1fr; align-items: start; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { border-radius: 20px; max-height: 88vh; }
  .modal-foot { border-radius: 0 0 20px 20px; }
  .hero { padding: 28px 26px; }
  .hero h1 { font-size: 24px; }
  .pdf-frame { max-height: 640px; overflow-y: auto; }
  .pdf-frame img { width: 100%; }
}

@media (min-width: 960px) {
  .top-nav { display: flex; }
  .bottom-nav { display: none; }
  .app-shell { padding-bottom: 40px; }
  .topbar-inner { gap: 17px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 18px; }
  .stat-value { font-size: 22px; }
  .btn { padding: 0 12px; }
  .scan-controls .btn { flex: 1 1 44%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 台账列表显示切换 ---------- */
.table-desktop { display: none; }
.list-mobile { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 720px) {
  .table-desktop { display: block; }
  .list-mobile { display: none; }
  .chips { flex-wrap: wrap; overflow: visible; }
}

/* ---------- 详情 / 键值 ---------- */
.kv-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv-item { background: #fff; padding: 9px 12px; }
.kv-item dt { font-size: 10.5px; color: var(--muted); margin: 0 0 2px; font-weight: 600; }
.kv-item dd { margin: 0; font-size: 12.5px; color: var(--text); word-break: break-all; line-height: 1.5; }
@media (min-width: 560px) { .kv-grid { grid-template-columns: 1fr 1fr; } }
.detail-summary {
  background: linear-gradient(120deg, #f8fafc, #fff);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
}
.detail-summary .big { font-size: 17px; font-weight: 800; color: var(--navy); line-height: 1.4; }
.detail-summary .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.detail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1 1 30%; }

/* ---------- 表单/提示补充 ---------- */
.form-note { font-size: 11px; color: var(--muted); line-height: 1.55; }
.divider-label { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; margin: 6px 0; }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
details.advanced { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
details.advanced summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--teal); list-style: none; display: flex; align-items: center; gap: 5px; padding: 4px 0; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: "＋"; color: var(--orange); font-weight: 800; }
details.advanced[open] summary::before { content: "－"; }
.upload-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 13px;
  padding: 18px;
  text-align: center;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
}
.upload-zone svg { width: 28px; height: 28px; color: var(--muted-2); margin: 0 auto 6px; }
.upload-zone b { display: block; color: var(--navy); font-size: 13px; margin-bottom: 2px; }
.scan-help { font-size: 11px; color: var(--muted); line-height: 1.6; }
.scan-help b { color: var(--navy); }
.notice-strip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f0f7fb;
  border: 1px solid #d5e8f2;
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 11px;
  color: #155e75;
  line-height: 1.55;
}
.notice-strip svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }
.file-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.file-row:last-child { border-bottom: 0; }
.file-row svg { width: 17px; height: 17px; color: var(--orange); flex: 0 0 auto; }
.file-row .grow { min-width: 0; }
.file-row b { display: block; font-size: 12px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row span { display: block; font-size: 10.5px; color: var(--muted); }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(249, 115, 22, 0.25);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.text-ok { color: var(--ok); }
.text-err { color: var(--err); }
.text-warn { color: var(--warn); }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px !important; }
.mt-2 { margin-top: 12px !important; }
.mt-3 { margin-top: 18px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px !important; }
.mb-2 { margin-bottom: 12px !important; }
.w-100 { width: 100%; }
