/* 泓构好房 · 三端共享样式
   视觉口径：正文 14px / 辅助 13px / 金额 22px / 主按钮 50px；按常规 App 尺度，不做刻意放大 */
:root {
  --brand: #0a76bd;
  --brand-d: #075b93;
  --brand-l: #e6f3fc;
  --accent: #c2410c;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f6f7;
  --card: #ffffff;
  --warn: #b45309;
  --warn-bg: #fff7ed;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 20px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .15s; font-family: inherit;
  width: 100%;
}
.btn:hover { background: var(--brand-d); }
.btn:disabled { background: #cbd5e1; color: #fff; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-l); }
.btn.sm { height: 36px; font-size: 13px; padding: 0 14px; width: auto; border-radius: 8px; }
.btn.gray { background: #64748b; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #991b1b; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
}
.card.tight { padding: 12px 14px; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 6px;
  font-size: 12px; line-height: 20px; background: var(--brand-l); color: var(--brand-d);
}
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.danger { background: var(--danger-bg); color: var(--danger); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.gray { background: #f1f5f9; color: var(--ink-2); }

.muted { color: var(--ink-3); font-size: 13px; }
.strong { font-weight: 600; }
.money { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.money.sm { font-size: 16px; }
.money.ink { color: var(--ink); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 4px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

.notice {
  border-left: 3px solid var(--brand); background: var(--brand-l);
  padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--brand-d);
}
.notice.warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.notice.danger { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 118, 189, .12);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; color: var(--ink-2); font-weight: 600; font-size: 13px; }
tbody tr:hover { background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 手机壳 ---------- */
.phone-wrap { display: flex; justify-content: center; padding: 20px 12px 40px; }
.phone {
  width: 390px; max-width: 100%; background: var(--bg);
  border-radius: 22px; box-shadow: 0 8px 40px rgba(16, 24, 40, .14);
  border: 8px solid #1f2937; overflow: hidden; position: relative;
}
.phone-status {
  height: 26px; background: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-size: 11px; color: var(--ink-3); border-bottom: 1px solid var(--line);
}
.phone-body { min-height: 640px; max-height: 760px; overflow-y: auto; padding-bottom: 70px; }
.phone-body::-webkit-scrollbar { width: 5px; }
.phone-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.navbar {
  position: sticky; top: 0; z-index: 20; background: #fff;
  height: 46px; display: flex; align-items: center; padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.navbar .back { width: 32px; font-size: 20px; color: var(--ink-2); cursor: pointer; }
.navbar .t { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.navbar .r { width: 32px; text-align: right; font-size: 13px; color: var(--ink-3); }

.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 56px; background: #fff;
  border-top: 1px solid var(--line); display: flex;
}
.tabbar div {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-3); cursor: pointer; gap: 2px;
}
.tabbar div.on { color: var(--brand); font-weight: 600; }
.tabbar .ico { font-size: 17px; }

.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%);
  color: #fff; padding: 20px 16px 24px;
}
.hero h2 { font-size: 19px; margin-bottom: 4px; }
.hero p { margin: 0; font-size: 13px; opacity: .9; }

.line-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: #fff; border-radius: 12px; margin-bottom: 10px; cursor: pointer;
  box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .15s;
}
.line-tile:hover { border-color: var(--brand); }
.line-tile .ic {
  width: 42px; height: 42px; border-radius: 10px; background: var(--brand-l);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none;
}
.line-tile .tx { flex: 1; }
.line-tile .tx b { display: block; font-size: 15px; }
.line-tile .tx span { font-size: 12.5px; color: var(--ink-3); }
.line-tile .ar { color: #cbd5e1; font-size: 18px; }

.pick {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: #fff;
}
.pick.on { border-color: var(--brand); background: var(--brand-l); }
.pick input[type=checkbox], .pick input[type=radio] { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: var(--brand); }
.pick .pt { flex: 1; }
.pick .pt b { font-size: 14px; font-weight: 600; display: block; }
.pick .pt .d { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

.steps { display: flex; padding: 16px 12px; background: #fff; border-radius: 12px; margin-bottom: 12px; }
.steps .st { flex: 1; text-align: center; position: relative; font-size: 11.5px; color: var(--ink-3); }
.steps .st .dot {
  width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #94a3b8;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-size: 11px;
}
.steps .st.done .dot { background: var(--brand); color: #fff; }
.steps .st.done { color: var(--brand-d); font-weight: 600; }
.steps .st:not(:last-child)::after {
  content: ''; position: absolute; top: 11px; left: 62%; width: 76%; height: 2px; background: #e5e7eb;
}
.steps .st.done:not(:last-child)::after { background: var(--brand); }

.thumb-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.thumb {
  width: 52px; height: 52px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line); background: #f1f5f9;
}
.thumb.add {
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
  font-size: 20px; cursor: pointer; border-style: dashed;
}

/* ---------- 后台 PC 布局 ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; background: #0a3d5c; color: #cbd5e1; flex: none;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 18px 16px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; opacity: .6; margin-top: 2px; }
.sidebar nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.sidebar nav a {
  display: block; padding: 10px 16px; color: #cbd5e1; font-size: 13.5px; cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar nav a.on { background: rgba(10,118,189,.35); color: #fff; border-left-color: #38bdf8; font-weight: 600; }
.main { flex: 1; padding: 20px 24px 60px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12.5px; color: var(--ink-3); }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .v.sm { font-size: 20px; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar select, .toolbar input {
  height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  font-size: 13px; font-family: inherit; background: #fff;
}
.panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.panel .hd { padding: 13px 16px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.panel .bd { padding: 0; }
.panel .bd.pad { padding: 16px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 520px; max-width: 100%;
  max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal .mh { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; justify-content: space-between; }
.modal .mb { padding: 18px; }
.modal .mf { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal .mf .btn { width: auto; }

.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13.5px; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 92vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); font-size: 13px; }

/* ---------- 三端共用组件 ----------
   这些类原先只写在客户端页内样式里，导致工程师端与后台用了同样的 class 却没有样式。
   统一收到这里；页内样式优先级更高，个别页面要覆盖仍然可以覆盖。 */
.sec-title { font-size: 15px; font-weight: 600; margin: 18px 4px 10px; display: flex; align-items: center; gap: 6px; }
.sec-title::before { content: ''; width: 3px; height: 15px; background: var(--brand); border-radius: 2px; flex: none; }
.mini { font-size: 12.5px; color: var(--ink-3); }

.line-item { padding: 12px; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .r1 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.line-item .r1 b { font-size: 14px; }
.line-item .r2 { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }
.line-item .r3 { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; padding: 6px 8px; background: #f8fafc; border-radius: 6px; }

.sum-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 16px; font-weight: 600; }

.zero-box { background: #f8fafc; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-3); max-height: 150px; overflow-y: auto; }
.zero-box div { display: flex; justify-content: space-between; padding: 2px 0; }

.countdown { font-size: 12.5px; color: var(--ok); background: var(--ok-bg); padding: 8px 12px; border-radius: 8px; }
.countdown.out { color: var(--ink-3); background: #f1f5f9; }

/* 多套房产切换芯片（房屋档案） */
.pick-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; font-family: inherit; cursor: pointer;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.tag.off { background: #f1f5f9; color: var(--ink-3); }

/* 消息（tabbar 未读徽标 + 未读条目） */
.tabbar .ico { position: relative; }
.tabbar .dot {
  position: absolute; top: -6px; right: -14px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; border-radius: 8px; font-size: 10px; font-style: normal;
  line-height: 16px; text-align: center; font-weight: 600;
}
.line-item.unread { background: var(--brand-l); }
.unread-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); margin-right: 6px; vertical-align: 2px;
}

.badge-status { padding: 2px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.st-pending_payment { background: #f1f5f9; color: #475569; }
.st-paid { background: #eff6ff; color: #1d4ed8; }
.st-dispatched { background: #f0f9ff; color: #0369a1; }
.st-arrived { background: #fef3c7; color: #92400e; }
.st-submitted { background: #ede9fe; color: #6d28d9; }
.st-disputed { background: #fee2e2; color: #b91c1c; }
.st-confirmed { background: #dcfce7; color: #15803d; }
.st-closed { background: #e2e8f0; color: #334155; }
.st-cancelled, .st-refunded { background: #f8fafc; color: #94a3b8; }

@media (max-width: 720px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
  .sidebar nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .sidebar nav a.on { border-left: 0; border-bottom-color: #38bdf8; }
  .main { padding: 14px; }
}
