/* 宅卫 · 空置房管家 — 米白底 + 墨绿点缀 + 异常红 */
:root {
  --bg: #F5F3EE;
  --card: #FFFFFF;
  --ink: #26332B;
  --ink-2: #8B948C;
  --line: #E8E5DC;
  --green: #2F6B4F;
  --green-soft: #E4EFE8;
  --warn: #C94040;
  --warn-soft: #FBEAEA;
  --amber: #B98A2F;
  --amber-soft: #F7EFDC;
  --gold: #B08A4F;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh;
}
#app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(30px + env(safe-area-inset-bottom)); }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; gap: 10px;
}
.brand { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.brand span { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-left: 8px; letter-spacing: 0; }

/* 分段控件 */
.seg { display: flex; background: #EBE8E0; border-radius: 12px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 10px;
  font-size: 13px; color: var(--ink-2); font-weight: 600; cursor: pointer;
}
.seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg.small button { padding: 7px 11px; font-size: 12px; }

/* ---------- 横幅 ---------- */
.banner {
  border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.5;
  margin-bottom: 14px; background: var(--green-soft); color: var(--green);
}
.banner b { font-size: 16px; }
.banner.alert { background: var(--warn-soft); color: var(--warn); }
.banner.due { background: var(--amber-soft); color: var(--amber); }

/* ---------- 区块 ---------- */
.section { margin-bottom: 18px; }
.section-title {
  font-size: 16px; font-weight: 800; margin-bottom: 10px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.section-title .sub { font-size: 12px; color: var(--ink-2); font-weight: 400; }
.section-title .date { font-size: 12px; color: var(--ink-2); font-weight: 400; }

/* ---------- 房源卡 ---------- */
.house-card {
  background: var(--card); border-radius: 18px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 2px 10px rgba(38,51,43,.05);
}
.house-head { display: flex; align-items: center; gap: 10px; }
.house-ico {
  width: 46px; height: 46px; border-radius: 14px; background: var(--green-soft);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none;
}
.house-meta { flex: 1; min-width: 0; }
.house-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.house-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 20px; flex: none;
  background: var(--green-soft); color: var(--green); font-weight: 600;
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.due { background: var(--amber-soft); color: var(--amber); }
.badge.plain { background: #F1EFE9; color: var(--ink-2); }
.house-status {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; font-size: 13px;
}
.house-status .overdue { color: var(--warn); font-weight: 700; }
.house-status .ok { color: var(--green); font-weight: 600; }
.house-status .due { color: var(--amber); font-weight: 700; }
.house-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- 按钮 ---------- */
.btn-primary {
  width: 100%; border: 0; background: var(--green); color: #fff;
  padding: 13px; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.btn-primary:active { opacity: .85; }
.btn-ghost {
  border: 0; background: #EFEBE2; color: var(--ink);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-sm {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-icon {
  border: 0; background: var(--green); color: #fff; width: 34px; height: 34px;
  border-radius: 12px; font-size: 20px; cursor: pointer; flex: none;
}
.link { border: 0; background: none; color: var(--ink-2); font-size: 12px; cursor: pointer; text-decoration: underline; }
.muted { font-size: 12px; color: var(--ink-2); }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty .e-icon { font-size: 44px; margin-bottom: 10px; }
.empty h2 { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.empty p { font-size: 13px; line-height: 1.7; margin-bottom: 18px; }

/* ---------- 检查项行（巡检执行） ---------- */
.check-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
.check-ico { font-size: 20px; flex: none; }
.check-body { flex: 1; min-width: 0; }
.check-name { font-size: 14px; font-weight: 600; }
.check-tip { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.check-toggle { display: flex; gap: 6px; flex: none; }
.check-toggle button {
  border: 1px solid var(--line); background: var(--card); width: 44px; height: 32px;
  border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink-2);
}
.check-toggle button.on-ok { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.check-toggle button.on-bad { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.bad-note { margin: 0 0 8px 46px; }
.bad-note input {
  width: 100%; border: 1px solid var(--warn); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; background: #FFFDFD;
}
.bad-advice { font-size: 11px; color: var(--warn); margin: -4px 0 8px 46px; }

/* ---------- 报告列表 ---------- */
.report-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
.report-row .r-date { font-size: 13px; font-weight: 700; flex: none; }
.report-row .r-body { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-grid { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.photo-grid img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(20,28,23,.45); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
.mask.show { display: flex; }
.modal {
  background: var(--bg); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
}
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.field input[type="text"], .field input[type="number"], .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  font-size: 14px; background: var(--card); color: var(--ink); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--green); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn-primary { flex: 1; }
.modal-actions .btn-ghost { flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--line); background: var(--card); border-radius: 20px;
  padding: 7px 12px; font-size: 12px; color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.chips button.active { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.danger { width: 100%; border: 0; background: none; color: var(--warn); font-size: 13px; margin-top: 16px; cursor: pointer; }

/* ---------- 分享浮层 ---------- */
.share-mask {
  position: fixed; inset: 0; background: rgba(20,28,23,.72); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.share-mask.show { display: flex; }
.share-wrap { text-align: center; }
.share-wrap img { max-width: 100%; max-height: 72vh; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.share-tip { color: #fff; font-size: 13px; margin: 14px 0 10px; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding-top: 10px; }
@media (min-width: 521px) { body { padding-top: 12px; } }
