/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin:0; font-family:"Microsoft YaHei","PingFang SC","Helvetica Neue",Arial,sans-serif;
  background:#f4f6fa; color:#1f2937; font-size:14px; }
a { color:#2563eb; text-decoration:none; }
button, input, select, textarea { font-family:inherit; font-size:14px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:0; cursor:pointer;
  padding:8px 16px; border-radius:8px; background:#2563eb; color:#fff; font-size:14px; transition:.15s; }
.btn:hover { filter:brightness(1.08); }
.btn:active { transform:scale(.98); }
.btn.ghost { background:#fff; color:#374151; border:1px solid #d1d5db; }
.btn.gray { background:#6b7280; }
.btn.green { background:#059669; }
.btn.red { background:#dc2626; }
.btn.sm { padding:5px 10px; font-size:13px; border-radius:6px; }
.btn:disabled { opacity:.5; cursor:not-allowed; }
input, select, textarea { padding:8px 10px; border:1px solid #d1d5db; border-radius:8px; outline:none; background:#fff; }
input:focus, select:focus, textarea:focus { border-color:#2563eb; }
.card { background:#fff; border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,.06); margin-bottom:12px; }
.row { display:flex; gap:10px; align-items:center; }
.between { display:flex; justify-content:space-between; align-items:center; }
.muted { color:#6b7280; }
.small { font-size:13px; }
.tag { display:inline-block; padding:2px 8px; border-radius:20px; font-size:12px; background:#eef2ff; color:#4338ca; }
.tag.g { background:#ecfdf5; color:#047857; }
.tag.r { background:#fef2f2; color:#b91c1c; }
.tag.y { background:#fffbeb; color:#b45309; }
.tag.gray { background:#f3f4f6; color:#4b5563; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:8px 8px; border-bottom:1px solid #eef0f3; text-align:left; white-space:nowrap; }
th { color:#6b7280; font-weight:600; background:#fafbfc; position:sticky; top:0; }
tbody tr:hover { background:#fafbff; }
.scroll { overflow:auto; }
.empty { text-align:center; color:#9ca3af; padding:30px 0; }
.hidden { display:none !important; }

/* ---------- 租客端 ---------- */
.app { max-width:520px; margin:0 auto; min-height:100vh; background:#f4f6fa; padding-bottom:70px; }
.hd { background:linear-gradient(135deg,#2563eb,#1d4ed8); color:#fff; padding:18px 16px 22px; border-radius:0 0 18px 18px; }
.hd .t { font-size:15px; opacity:.9; }
.hd .big { font-size:34px; font-weight:700; margin:6px 0; }
.hd .sub { font-size:13px; opacity:.9; display:flex; gap:14px; flex-wrap:wrap; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.stat { background:#fff; border-radius:12px; padding:12px; text-align:center; }
.stat .v { font-size:20px; font-weight:700; color:#111827; }
.stat .k { font-size:12px; color:#6b7280; margin-top:2px; }
.tabs { position:fixed; bottom:0; left:0; right:0; background:#fff; display:flex; border-top:1px solid #e5e7eb;
  max-width:520px; margin:0 auto; z-index:20; }
.tabs div { flex:1; text-align:center; padding:9px 0 7px; color:#9ca3af; font-size:12px; cursor:pointer; }
.tabs div.on { color:#2563eb; }
.tabs .ico { font-size:18px; display:block; margin-bottom:2px; }
.pad { padding:12px; }
.list-item { display:flex; justify-content:space-between; align-items:center; padding:11px 0; border-bottom:1px solid #f1f3f6; }
.list-item:last-child { border:0; }
.alert { border-radius:10px; padding:10px 12px; font-size:13px; margin-bottom:12px; }
.alert.warn { background:#fffbeb; color:#92400e; border:1px solid #fde68a; }
.alert.err { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.alert.info { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }
.qrbox { text-align:center; padding:14px; }
.qrbox img { max-width:230px; width:80%; border:1px solid #e5e7eb; border-radius:10px; }
.amount-btns { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:10px 0; }
.amount-btns button { padding:9px 0; border:1px solid #d1d5db; background:#fff; border-radius:8px; cursor:pointer; }
.amount-btns button.on { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; font-weight:600; }

/* ---------- 后台 ---------- */
.wrap { display:flex; min-height:100vh; }
.side { width:180px; background:#111827; color:#cbd5e1; padding:16px 0; flex-shrink:0; }
.side .logo { color:#fff; font-size:16px; font-weight:700; padding:0 18px 16px; }
.side a { display:block; padding:11px 20px; color:#cbd5e1; cursor:pointer; font-size:14px; }
.side a:hover { background:#1f2937; color:#fff; }
.side a.on { background:#2563eb; color:#fff; }
.main { flex:1; padding:18px 22px; overflow:auto; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:14px; }
.kpi { background:#fff; border-radius:12px; padding:14px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.kpi .v { font-size:22px; font-weight:700; }
.kpi .k { font-size:12px; color:#6b7280; margin-top:3px; }
.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.modal-mask { position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center;
  justify-content:center; z-index:99; padding:20px; }
.modal { background:#fff; border-radius:14px; width:100%; max-width:560px; max-height:88vh; overflow:auto; }
.modal .mh { padding:14px 18px; border-bottom:1px solid #eef0f3; font-weight:700; display:flex;
  justify-content:space-between; align-items:center; }
.modal .mb { padding:16px 18px; }
.modal .mf { padding:12px 18px; border-top:1px solid #eef0f3; display:flex; justify-content:flex-end; gap:8px; }
.fld { margin-bottom:12px; }
.fld label { display:block; font-size:13px; color:#4b5563; margin-bottom:4px; }
.fld input, .fld select, .fld textarea { width:100%; }
.fld textarea { min-height:80px; }
.grid3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
.grid2b { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.toast { position:fixed; top:16px; left:50%; transform:translateX(-50%); background:#111827; color:#fff;
  padding:10px 18px; border-radius:8px; z-index:200; font-size:14px; }
pre.json { background:#0f172a; color:#a5f3fc; padding:12px; border-radius:8px; font-size:12px;
  overflow:auto; max-height:260px; white-space:pre-wrap; word-break:break-all; }
@media (max-width:900px){
  .wrap{flex-direction:column;} .side{width:100%;display:flex;overflow:auto;}
  .side .logo{display:none;} .side a{padding:10px 14px;white-space:nowrap;} .main{padding:12px;}
  .grid3{grid-template-columns:1fr;}
}
