/* ============================================================
   H5 移动端布局
   结构：沉浸渐变头部 + 上浮卡片内容 + 底部 Tab + 悬浮按钮
   ============================================================ */
body { background: #e8ecf3; }
.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f4f6fa;
  position: relative; padding-bottom: calc(64px + env(safe-area-inset-bottom));
  box-shadow: 0 0 48px rgba(15, 23, 42, .1);
}

/* ==================== 顶部栏 ==================== */
.navbar {
  position: sticky; top: 0; z-index: 50; color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #3b82f6 100%);
  padding: 14px 16px 34px; border-radius: 0 0 24px 24px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .18);
}
.navbar::after {
  content: ''; position: absolute; right: -30px; top: -46px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none;
}
.navbar .row { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.navbar .lg { width: 36px; height: 36px; border-radius: 11px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex: none; }
.navbar .title { font-size: 16.5px; font-weight: 600; letter-spacing: -.2px; }
.navbar .sub { font-size: 11.5px; opacity: .82; margin-top: 3px; }
.navbar .pill { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .18); border-radius: 20px; padding: 5px 11px; font-size: 12px; display: flex; align-items: center; gap: 4px; cursor: pointer; flex: none; transition: .15s; }
.navbar .pill:active { background: rgba(255, 255, 255, .3); }
.navbar .ic { color: #fff; }
.navbar .bell { position: relative; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; flex: none; }
.navbar .bell .dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; border: 1.5px solid #1d4ed8; }

/* 子页面返回栏 */
.navbar.back-bar {
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); color: var(--txt);
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 14px; box-shadow: none;
}
.navbar.back-bar::after { display: none; }
.navbar.back-bar .ic { color: var(--txt); }
.navbar.back-bar .row { justify-content: space-between; }
.navbar.back-bar .bt { flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.navbar.back-bar .bb { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.navbar.back-bar .bb:active { background: #f1f5f9; }

/* ==================== 页面容器 ==================== */
.page { padding: 12px 12px 16px; }
/* 仅首屏为白卡的页面（首页 / 我的）上浮到渐变头部中 */
.app.hero .page { margin-top: -22px; position: relative; z-index: 2; }

/* ==================== 卡片 ==================== */
.hcard {
  background: #fff; border-radius: 14px; padding: 15px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px rgba(15, 23, 42, .05);
  border: 1px solid rgba(230, 234, 242, .8);
}
.hcard .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hcard .hd b { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; }
.hcard .hd .more { font-size: 12px; color: var(--brand); padding: 3px 8px; border-radius: 6px; background: var(--brand-l); font-weight: 500; }

/* ==================== 指标 ==================== */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 12px; }
.metric {
  background: #fff; border-radius: 14px; padding: 14px; position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px rgba(15, 23, 42, .05);
  border: 1px solid rgba(230, 234, 242, .8);
}
.metric::before { content: ''; position: absolute; right: -18px; bottom: -18px; width: 68px; height: 68px; border-radius: 50%; opacity: .1; }
.metric.blue::before { background: #2563eb; }
.metric.green::before { background: #10b981; }
.metric.red::before { background: #ef4444; }
.metric.orange::before { background: #f59e0b; }
.metric .lb { font-size: 12px; color: var(--txt2); position: relative; font-weight: 500; }
.metric .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.8px; line-height: 1.1; position: relative; }
.metric .v small { font-size: 12.5px; font-weight: 500; color: var(--txt3); margin-left: 2px; }
.metric .d { font-size: 11.5px; color: var(--txt3); margin-top: 6px; position: relative; line-height: 1.5; }
.metric.blue .v { color: #2563eb; }
.metric.green .v { color: #10b981; }
.metric.red .v { color: #ef4444; }
.metric.orange .v { color: #f59e0b; }

/* ==================== 九宫格 ==================== */
.grid9 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.grid9 .g { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 2px; cursor: pointer; border-radius: 10px; transition: .15s; }
.grid9 .g:active { background: #f6f8fc; transform: scale(.96); }
.grid9 .g .ico { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 3px 10px rgba(15, 23, 42, .13); }
.grid9 .g .ico svg { width: 21px; height: 21px; }
.grid9 .g span { font-size: 11.5px; color: var(--txt2); text-align: center; line-height: 1.3; }

/* ==================== 筛选 chip ==================== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chips .chip { flex: none; padding: 6px 13px; border-radius: 18px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--txt2); cursor: pointer; transition: .15s; font-weight: 500; }
.chips .chip.on { background: linear-gradient(135deg, #3b82f6, #2563eb); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .28); }
.chips::-webkit-scrollbar { display: none; }

/* ==================== 列表行 ==================== */
.cell { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #f2f5f9; transition: .15s; }
.cell:last-child { border: none; }
.cell:active { background: #fafbfd; }
.cell .main { flex: 1; min-width: 0; }
.cell .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.1px; }
.cell .s { font-size: 12px; color: var(--txt3); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .r { text-align: right; flex: none; }
.cell .r .amt { font-size: 14px; font-weight: 600; }
.cell .av { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px; flex: none; box-shadow: 0 2px 7px rgba(15, 23, 42, .12); }

/* ==================== 房源卡片 ==================== */
.unit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.unit-card { background: #fff; border-radius: 14px; padding: 13px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); border: 1px solid rgba(230, 234, 242, .8); cursor: pointer; transition: .15s; }
.unit-card:active { transform: scale(.98); }
.unit-card .code { font-size: 14px; font-weight: 600; }
.unit-card .m { font-size: 11.5px; color: var(--txt3); margin-top: 5px; line-height: 1.6; }

/* ==================== 搜索 ==================== */
.hsearch { display: flex; gap: 8px; margin-bottom: 10px; }
.hsearch .ipt { flex: 1; height: 38px; border-radius: 19px; padding: 0 15px; background: #fff; }

/* ==================== 底部 Tab ==================== */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: flex; z-index: 60; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 16px rgba(15, 23, 42, .05);
}
.tabbar .tb { flex: 1; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--txt3); font-size: 11px; cursor: pointer; position: relative; transition: .15s; }
.tabbar .tb .ic { width: 22px; height: 22px; transition: .18s; }
.tabbar .tb.on { color: var(--brand); font-weight: 600; }
.tabbar .tb.on .ic { transform: translateY(-1px) scale(1.06); }
.tabbar .tb.on::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, #3b82f6, #2563eb); }

/* ==================== 详情抽屉 / 弹窗（移动全屏） ==================== */
.drawer { width: 100vw !important; max-width: 480px; height: 100vh; border-radius: 0 !important; }
.drawer-hd { background: #fff; position: sticky; top: 0; z-index: 5; }
.modal { max-width: 92vw !important; }
.form-grid { grid-template-columns: 1fr; gap: 13px; }
.fld.half { grid-column: span 1; }

/* ==================== 我的 ==================== */
.mine-hd { background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #3b82f6); color: #fff; padding: 20px 16px 34px; display: flex; align-items: center; gap: 13px; border-radius: 0 0 24px 24px; }
.mine-hd .av { width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 600; flex: none; }
.mine-hd .n { font-size: 17px; font-weight: 600; }
.mine-hd .r { font-size: 12px; opacity: .88; margin-top: 4px; }
.mine-body { margin-top: -20px; padding: 0 12px 12px; position: relative; z-index: 2; }

/* ==================== 提醒 ==================== */
.rm { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f2f5f9; }
.rm:last-child { border-bottom: none; }
.rm .tp { font-size: 11px; padding: 3px 8px; border-radius: 6px; height: fit-content; font-weight: 500; }

/* ==================== 空态 / 时间线 ==================== */
.empty { padding: 40px 20px; font-size: 13px; }
.timeline { padding-left: 16px; }
.timeline .it { padding-bottom: 15px; }
.timeline .it::before { left: -16px; width: 9px; height: 9px; }

/* ==================== 悬浮按钮 ==================== */
.fab {
  position: fixed; right: calc(50% - 216px); bottom: calc(78px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .45); z-index: 55; transition: .15s;
}
.fab:active { transform: scale(.93); }
.fab svg { width: 24px; height: 24px; }
@media (max-width: 480px) { .fab { right: 16px; } }

/* ==================== 表格（移动端窄表） ==================== */
.table-wrap { border-radius: 12px; }
.tbl { font-size: 12.5px; }
.tbl thead th { padding: 10px 10px; }
.tbl tbody td { padding: 10px; }
