/* 手机端现场检查 PWA —— 大按钮、少文字、适合现场操作 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #1a5fb4;
  --primary-dark: #14497f;
  --green: #2ec27e;
  --red: #e01b24;
  --gray: #9a9996;
  --light: #f5f5f4;
  --border: #e0e0de;
  --text: #241f31;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--light);
  color: var(--text);
  padding-bottom: 40px;
}

.hidden { display: none !important; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center;
  background: var(--primary); color: #fff;
  padding: 12px 16px; min-height: 56px;
}
.topbar h1 { font-size: 18px; font-weight: 600; flex: 1; text-align: center; }
.back-btn {
  position: absolute; left: 8px;
  background: none; border: none; color: #fff;
  font-size: 17px; padding: 8px 12px;
}

main { padding: 12px; }

/* 卡片 */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #fff; border-radius: 12px;
  padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  cursor: pointer; border: 2px solid transparent;
}
.card:active { background: #f0f4fb; }
.card .title { font-size: 17px; font-weight: 600; }
.card .sub { font-size: 13px; color: #77767c; margin-top: 4px; }
.card .row { display: flex; justify-content: space-between; align-items: center; }

/* 状态徽标 */
.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; color: #fff;
}
.badge.pending   { background: var(--gray); }
.badge.in_progress { background: #e5a50a; }
.badge.done      { background: var(--green); }
.badge.completed { background: var(--green); }
.badge.confirmed { background: var(--primary); }
.badge.normal    { background: var(--green); }
.badge.abnormal  { background: var(--red); }
.badge.unable    { background: var(--gray); }
.badge.not_applicable { background: #cdc9c1; }
.badge.risk-high { background: var(--red); }
.badge.risk-medium { background: #e5a50a; }
.badge.risk-low { background: var(--green); }

/* 进度 */
.progress-bar {
  background: #fff; border-radius: 10px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 10px; color: #555;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.progress-bar b { color: var(--primary); }

/* 楼层分组 */
.floor-block { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.floor-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: #eef3fa;
  font-weight: 600; font-size: 16px;
}
.space-row {
  padding: 14px 16px; border-top: 1px solid var(--border);
  font-weight: 500;
}
.point-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px 13px 28px; border-top: 1px solid var(--border);
  cursor: pointer; font-size: 15px;
}
.point-row:active { background: #f0f4fb; }

/* 元信息卡 */
.meta-card {
  background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.meta-card .title { font-size: 18px; font-weight: 700; }
.meta-card .sub { font-size: 13px; color: #77767c; margin-top: 6px; line-height: 1.5; }
.meta-card .reason {
  font-size: 12px; color: #6b5e00; background: #fff8d6;
  border-radius: 8px; padding: 8px 10px; margin-top: 8px; line-height: 1.5;
}

/* 大按钮 */
.btn {
  border: none; border-radius: 12px; font-size: 17px; font-weight: 600;
  padding: 15px; cursor: pointer; font-family: inherit;
}
.btn:active { opacity: .85; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary[disabled] { background: var(--gray); }

.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.btn-answer { font-size: 20px; padding: 26px 8px; color: #fff; }
.btn-normal   { background: var(--green); }
.btn-abnormal { background: var(--red); }
.btn-unable   { background: var(--gray); }
.btn-na       { background: #b58f6a; }
.btn-answer.selected { outline: 4px solid #241f31; }

/* 表单 */
.form-label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.req { color: var(--red); }
textarea, input[type="text"] {
  width: 100%; border: 2px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 16px; font-family: inherit; background: #fff;
}
textarea:focus { border-color: var(--primary); outline: none; }
input[type="file"] { font-size: 14px; width: 100%; }
#abnormal-form, #item-saved { margin-top: 18px; }

/* 照片 */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-grid img {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
}

/* 保存状态 */
.saved-banner {
  border-radius: 12px; padding: 16px; text-align: center;
  font-size: 17px; font-weight: 700; color: #fff;
}
.saved-banner.normal { background: var(--green); }
.saved-banner.abnormal { background: var(--red); }
.saved-banner.unable { background: var(--gray); }
.saved-banner.not_applicable { background: #b58f6a; }

/* 空状态 */
.empty { text-align: center; color: #9a9996; padding: 60px 20px; font-size: 16px; line-height: 1.8; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(36,31,49,.92); color: #fff;
  padding: 12px 22px; border-radius: 10px; font-size: 15px;
  z-index: 99; max-width: 86%; text-align: center;
}

/* 安装按钮 */
.btn-install {
  position: fixed; right: 14px; bottom: 14px; z-index: 50;
  background: var(--primary-dark); color: #fff; font-size: 14px;
  padding: 10px 14px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
