/* 金华惠民家装 · 手机端 H5 样式（移动优先，参考视口 390×844；纯静态自包含，无外部字体/CDN） */

:root {
  --primary: #1769aa;
  --primary-dark: #0f5488;
  --primary-soft: #e8f2f9;
  --success: #2e8b57;
  --warn: #c98a1b;
  --danger: #c0392b;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2733;
  --text-2: #6b7684;
  --line: #e5eaef;
  --radius: 12px;
  --tabbar-h: 58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + 24px);
}

/* ===== 顶栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
}
.topbar .title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.topbar .back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: #fff; font-size: 20px; cursor: pointer;
}
.topbar .spacer { width: 32px; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
}
.card h3 { margin: 0 0 12px; font-size: 16px; }

.section-gap { margin-top: 4px; }

/* ===== 表单（字段上下排列） ===== */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); background: #fff; }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--text-2); }

/* ===== 按钮（触控目标 ≥44px） ===== */
.btn {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-danger-ghost { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }

/* ===== 列表项 / 工地卡片 ===== */
.project-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  margin: 12px 16px 0;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
  cursor: pointer;
}
.project-card .p-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.project-card .p-meta { font-size: 13px; color: var(--text-2); }
.project-card .p-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-green { background: #e7f4ec; color: var(--success); }
.badge-warn { background: #fbf1dd; color: var(--warn); }
.badge-gray { background: #eef1f4; color: var(--text-2); }
.badge-red { background: #fbe9e7; color: var(--danger); }

/* 信息行 */
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-2); flex: 0 0 88px; }
.info-row .v { flex: 1; text-align: right; word-break: break-all; }

/* ===== 机位 / 摄像头卡片 ===== */
.camera-card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 12px 16px 0;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 60, 0.06);
}
.camera-card .c-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.camera-card .c-name { font-size: 16px; font-weight: 600; }
.camera-card .c-meta { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.camera-actions { display: flex; gap: 10px; }
.camera-actions .btn { min-height: 42px; font-size: 15px; }

/* 播放 / 回放占位面板（M4 实时模块独立，本期不实现播放内核） */
.placeholder-panel {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fafbfc;
  padding: 28px 18px;
  text-align: center;
  color: var(--text-2);
}
.placeholder-panel .ph-icon { font-size: 30px; margin-bottom: 8px; }
.placeholder-panel .ph-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.placeholder-panel .ph-desc { font-size: 13px; }

/* 回放列表占位行 */
.record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.record-row:last-child { border-bottom: none; }
.record-row .r-time { color: var(--text-2); font-size: 13px; }

/* ===== 提示条 / 空态 ===== */
.alert {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.alert-error { background: #fbe9e7; color: var(--danger); }
.alert-warn { background: #fbf1dd; color: var(--warn); }
.alert-info { background: var(--primary-soft); color: var(--primary); }

.empty {
  margin: 48px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}
.empty .e-icon { font-size: 34px; margin-bottom: 10px; }

/* ===== 我的页面 ===== */
.me-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 16px 18px;
  background: var(--primary);
  color: #fff;
}
.me-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600;
}
.me-head .m-name { font-size: 18px; font-weight: 600; }
.me-head .m-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.menu-list { background: var(--card); border-radius: var(--radius); margin: 12px 16px; overflow: hidden; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .arrow { color: var(--text-2); }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  height: var(--tabbar-h);
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 20;
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 12px;
}
.tabbar a.active { color: var(--primary); }
.tabbar .t-icon { font-size: 20px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 25, 35, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 24px;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 18px;
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: rgba(20, 30, 40, 0.88);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 60;
  max-width: 80%;
  text-align: center;
}

/* 同意书勾选 */
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.consent-check input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 18px; }

.text-muted { color: var(--text-2); font-size: 13px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
