/* 沪上家园 H5 · 移动端样式 · 浅色卡片风格 */
:root {
  --brand: #1a3878;
  --brand-2: #2b5099;
  --brand-light: #eaf0fa;
  --accent: #d42d24;
  --accent-light: #fdecea;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2a44;
  --text-2: #52607a;
  --text-3: #8b97ad;
  --line: #e5ebf4;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(26, 56, 120, .06);
  --nav-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
  box-shadow: 0 0 32px rgba(26, 56, 120, .08);
}
.page-loading { padding: 64px 0; text-align: center; color: var(--text-3); }

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 14px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f3f5f8;
}
.topbar .back svg { width: 18px; height: 18px; }
.topbar .title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
.topbar .right { width: 32px; flex: 0 0 32px; display: flex; justify-content: flex-end; }
.topbar .right .dots { font-size: 20px; color: var(--text-2); letter-spacing: 1px; }

/* 首页头部 */
.home-head {
  background: linear-gradient(160deg, #e8eefb 0%, #f3f6fd 58%, var(--bg) 100%);
  padding: 14px 16px 8px;
}
.home-loc { display: flex; align-items: center; justify-content: space-between; }
.loc-btn { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 700; }
.loc-btn svg { width: 14px; height: 14px; }
.home-loc .slogan { font-size: 12px; color: var(--text-2); }
.home-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; margin-top: 12px; padding: 0 12px;
  background: #fff; border-radius: 22px; box-shadow: var(--shadow);
  color: var(--text-3);
}
.home-search svg { width: 17px; height: 17px; flex: none; }
.home-search > span:not(.search-btn) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-search .search-btn {
  padding: 5px 14px; border-radius: 16px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
}

/* Banner */
.banner-wrap { padding: 8px 16px 4px; }
.banner {
  position: relative; height: 112px; border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(120deg, #e4ecfa, #f6f9ff 70%);
  padding: 18px 18px; display: flex; flex-direction: column; justify-content: center;
}
.banner::after {
  content: ""; position: absolute; right: -24px; top: -30px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,56,120,.16), rgba(212,45,36,.08) 70%);
}
.banner h2 { margin: 0 0 4px; font-size: 18px; color: #1a3878; }
.banner p { margin: 0; font-size: 12px; color: #52607a; }
.banner p.banner-desc-placeholder { min-height: 15px; }
.banner .banner-tag {
  position: relative; z-index: 1; align-self: flex-start;
  margin-top: 10px; padding: 4px 10px; border-radius: 12px;
  background: #fff; color: var(--brand); font-size: 11px; font-weight: 600;
}
.banner-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.banner-dots i { width: 5px; height: 5px; border-radius: 3px; background: #cbd5e1; transition: .2s; }
.banner-dots i.on { width: 14px; background: var(--brand); }

/* 快捷入口 */
.section { padding: 14px 16px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.section-head .more { font-size: 12px; color: var(--text-3); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-item {
  background: var(--card); border-radius: var(--radius); padding: 12px 4px 10px;
  text-align: center; box-shadow: var(--shadow);
}
.quick-item .ico {
  width: 40px; height: 40px; margin: 0 auto 6px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand);
}
.quick-item .ico svg { width: 21px; height: 21px; }
.quick-item .ico.orange { background: #fff4e5; color: #e58a0b; }
.quick-item .ico.green { background: #e8f8f0; color: #12996b; }
.quick-item .ico.purple { background: #f1ebff; color: #7c5cd6; }
.quick-item span { font-size: 12px; color: var(--text-2); }

/* 搜索页 */
.search-page { padding: 12px 16px; }
.search-bar { display: flex; gap: 8px; }
.search-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 7px; height: 40px;
  padding: 0 12px; background: #fff; border-radius: 20px; box-shadow: var(--shadow);
}
.search-input-wrap svg { width: 16px; height: 16px; color: var(--text-3); }
.search-input-wrap input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.search-submit { padding: 0 16px; border-radius: 20px; background: var(--brand); color: #fff; font-weight: 600; }
.search-block { margin-top: 20px; }
.search-block h3 { margin: 0 0 10px; font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 12px; border-radius: 15px; background: #fff;
  color: var(--text-2); font-size: 12px; box-shadow: var(--shadow);
}
.tag.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.history-row { display: flex; flex-wrap: wrap; gap: 8px; }
.history-row .tag { color: var(--text-3); }
.empty-hint { padding: 24px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* 列表页 */
.filter-bar {
  position: sticky; top: 52px; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line);
}
.filter-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 2px; border-radius: 8px; font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden;
}
.filter-btn.active { color: var(--brand); font-weight: 600; background: var(--brand-light); }
.filter-btn svg { width: 10px; height: 10px; flex: none; }
.filter-btn .txt { overflow: hidden; text-overflow: ellipsis; }
.sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 4px; font-size: 12px; color: var(--text-3);
}
.sort-select { border: 0; background: transparent; color: var(--text-2); outline: 0; }
.result-list { padding: 6px 16px 20px; }

/* 房源卡片 */
.house-card {
  display: flex; gap: 10px; padding: 10px; margin-bottom: 10px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.house-cover { position: relative; width: 112px; height: 90px; flex: none; border-radius: 10px; overflow: hidden; background: #e5eaf1; }
.house-cover img { width: 100%; height: 100%; object-fit: cover; }
.house-cover .count {
  position: absolute; right: 5px; bottom: 5px; padding: 1px 6px;
  border-radius: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 10px;
}
.house-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.house-title { margin: 1px 0 4px; font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.house-meta { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.house-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.house-tags span { padding: 1px 6px; border-radius: 4px; background: #f1f5fb; color: #5b7496; font-size: 10px; }
.house-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.price { color: var(--accent); font-weight: 700; font-size: 16px; }
.price small { font-size: 11px; font-weight: 400; color: var(--text-3); }
.fav-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.fav-btn svg { width: 17px; height: 17px; }

/* 详情页 */
.detail-hero { position: relative; height: 250px; background: #e5eaf1; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-back, .hero-fav {
  position: absolute; top: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: center; z-index: 3;
}
.hero-back { left: 14px; }
.hero-fav { right: 14px; }
.hero-back svg, .hero-fav svg { width: 18px; height: 18px; }
.hero-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; z-index: 3; }
.hero-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.6); }
.hero-dots i.on { background: #fff; width: 16px; border-radius: 4px; }
.hero-count { position: absolute; right: 12px; bottom: 10px; z-index: 3; padding: 2px 8px;
  border-radius: 10px; background: rgba(0,0,0,.42); color: #fff; font-size: 11px; }
.detail-body { padding: 14px 16px 96px; }
.detail-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.detail-price { font-size: 24px; font-weight: 700; color: var(--accent); }
.detail-price small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.detail-title { margin: 6px 0 8px; font-size: 17px; font-weight: 700; line-height: 1.4; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tags span { padding: 3px 8px; border-radius: 5px; background: var(--brand-light); color: var(--brand); font-size: 11px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; margin-top: 4px; }
.info-grid .k { font-size: 11px; color: var(--text-3); }
.info-grid .v { font-size: 14px; font-weight: 600; margin-top: 2px; }
.card-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.card-title::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--brand); }
.detail-text { margin: 0; color: var(--text-2); font-size: 13px; white-space: pre-line; line-height: 1.75; }
.facility-list { display: flex; flex-wrap: wrap; gap: 8px; }
.facility-list span { padding: 6px 10px; border-radius: 8px; background: #f6f8fb; color: var(--text-2); font-size: 12px; }
.contact-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.contact-info { flex: 1; }
.contact-info .name { font-weight: 600; }
.contact-info .desc { font-size: 11px; color: var(--text-3); }
.contact-call { padding: 7px 14px; border-radius: 18px; border: 1px solid var(--brand); color: var(--brand); font-size: 12px; font-weight: 600; }
.detail-location { font-size: 13px; color: var(--text-2); }
.detail-location .addr { margin-top: 4px; color: var(--text); }
.detail-location svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; color: var(--brand); }
.detail-footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px calc(8px + var(--safe-b));
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(26,56,120,.06);
}
.detail-footer .fav-mini { width: 46px; text-align: center; font-size: 10px; color: var(--text-3); }
.detail-footer .fav-mini svg { width: 20px; height: 20px; margin: 0 auto 2px; }
.btn-primary {
  flex: 1; height: 42px; border-radius: 22px; background: var(--brand); color: #fff;
  font-weight: 600; font-size: 14px; text-align: center; line-height: 42px;
}
.btn-ghost {
  flex: 1; height: 42px; border-radius: 22px; background: var(--brand-light); color: var(--brand);
  font-weight: 600; font-size: 14px; text-align: center; line-height: 42px;
}

/* 表单页 */
.form-page { padding: 14px 16px 28px; }
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 14px; margin-bottom: 12px; }
.form-item { display: flex; align-items: center; min-height: 50px; border-bottom: 1px solid var(--line); gap: 10px; }
.form-item:last-child { border-bottom: 0; }
.form-item label { width: 84px; flex: none; color: var(--text-2); font-size: 13px; }
.form-item label .req { color: var(--accent); }
.form-item input, .form-item select, .form-item textarea {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0;
}
.form-item textarea { resize: none; height: 80px; line-height: 1.6; }
.form-item .unit { color: var(--text-3); font-size: 12px; }
.form-tip { margin: 6px 2px 14px; font-size: 11px; color: var(--text-3); line-height: 1.6; }
.submit-btn { width: 100%; height: 46px; border-radius: 24px; background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; }
.submit-btn:disabled { opacity: .6; }
.success-panel { padding: 40px 20px; text-align: center; }
.success-icon { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; background: #e8f8f0; color: #12996b;
  display: flex; align-items: center; justify-content: center; }
.success-icon svg { width: 32px; height: 32px; }
.success-panel h3 { margin: 0 0 6px; font-size: 18px; }
.success-panel p { margin: 0 0 22px; color: var(--text-2); font-size: 13px; }

/* 联系页 */
.contact-hero {
  margin: 14px 16px; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, #e9f2ff, #f7faff); box-shadow: var(--shadow);
}
.contact-hero h2 { margin: 0 0 4px; font-size: 18px; }
.contact-hero p { margin: 0; font-size: 12px; color: var(--text-2); }
.contact-list { padding: 0 16px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.contact-item .ci { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: none; }
.contact-item .ci svg { width: 18px; height: 18px; }
.contact-item .ct { flex: 1; }
.contact-item .ct .k { font-size: 11px; color: var(--text-3); }
.contact-item .ct .v { font-size: 14px; font-weight: 600; margin-top: 2px; }
.contact-item .go { color: var(--text-3); font-size: 18px; }

/* 我的 */
.mine-head { padding: 24px 16px 20px; background: linear-gradient(160deg, #e8eefb, var(--bg)); }
.mine-user { display: flex; align-items: center; gap: 12px; }
.mine-user .avatar { width: 52px; height: 52px; font-size: 18px; background: #fff; }
.mine-user .n { font-size: 17px; font-weight: 700; }
.mine-user .d { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.mine-stats { display: flex; margin-top: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 0; }
.mine-stats div { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.mine-stats div:last-child { border-right: 0; }
.mine-stats b { display: block; font-size: 18px; }
.mine-stats span { font-size: 11px; color: var(--text-3); }
.mine-list { padding: 14px 16px; }
.mine-list .contact-item { margin-bottom: 8px; }
.sub-tabs { display: flex; gap: 8px; padding: 10px 16px 0; }
.sub-tabs button { flex: 1; padding: 8px; border-radius: 10px; background: #fff; color: var(--text-2); font-size: 13px; }
.sub-tabs button.on { background: var(--brand-light); color: var(--brand); font-weight: 600; }

/* 底部导航 */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 25;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; background: #fff; border-top: 1px solid var(--line);
}
.bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font-size: 10px; }
.bottom-nav button.on { color: var(--brand); font-weight: 600; }
.bottom-nav svg { width: 21px; height: 21px; }
.page-with-nav { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }

/* 筛选抽屉 */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.38); }
.filter-panel {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 41;
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  background: #fff; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b);
}
.filter-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-head b { font-size: 15px; }
.filter-head .close { font-size: 20px; color: var(--text-3); }
.filter-group { padding: 14px 16px 4px; border-bottom: 1px solid var(--line); }
.filter-group h4 { margin: 0 0 10px; font-size: 13px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
.filter-chips button { padding: 7px 14px; border-radius: 8px; background: #f5f7fa; color: var(--text-2); font-size: 12px; }
.filter-chips button.on { background: var(--brand-light); color: var(--brand); font-weight: 600; outline: 1px solid var(--brand); }
.price-range { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; }
.price-range input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; }
.price-range span { color: var(--text-3); }
.filter-actions { display: flex; gap: 10px; padding: 14px 16px; }
.filter-actions button { flex: 1; height: 42px; border-radius: 22px; font-weight: 600; }
.filter-actions .reset { background: #f3f5f8; color: var(--text-2); }
.filter-actions .confirm { background: var(--brand); color: #fff; }

/* 图片预览 */
.preview { position: fixed; inset: 0; z-index: 60; background: #0f172a; display: flex; align-items: center; justify-content: center; }
.preview img { width: 100%; max-height: 80vh; object-fit: contain; }
.preview .close { position: absolute; top: 16px; right: 16px; color: #fff; font-size: 26px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 12px);
  z-index: 80; padding: 10px 18px; border-radius: 22px; background: rgba(26,56,120,.92);
  color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty-state { padding: 56px 20px; text-align: center; color: var(--text-3); }
.empty-state .e-ico { font-size: 38px; margin-bottom: 10px; }
.empty-state p { margin: 0 0 16px; font-size: 13px; }
.empty-state button { padding: 8px 18px; border-radius: 18px; background: var(--brand-light); color: var(--brand); font-weight: 600; }

@media (min-width: 481px) {
  body { padding: 0; }
}

/* ===== V1.2 品牌视觉强化 ===== */
.brand-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand-logo { width: 132px; height: auto; flex: none; }
.brand-head .brand-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(26,56,120,.22), transparent); }
.brand-head .brand-cert { font-size: 10px; color: var(--brand); background: #fff; border: 1px solid rgba(26,56,120,.14); border-radius: 10px; padding: 3px 8px; white-space: nowrap; }
.home-loc { padding-top: 2px; }
.home-search .search-btn { background: var(--accent); }
.section-head h3 { display: flex; align-items: center; gap: 7px; }
.section-head h3::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.card-title::before { background: var(--accent); }
.house-card { border: 1px solid rgba(26,56,120,.05); }
.detail-tags span, .facility-list span { background: var(--brand-light); color: var(--brand); }
.bottom-nav button.on { position: relative; color: var(--brand); }
.bottom-nav button.on::before { content: ""; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 0 0 3px 3px; background: var(--accent); }
.topbar .title { color: var(--brand); }
.banner { border: 1px solid rgba(26,56,120,.07); }
.banner .banner-tag { color: var(--accent); }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--brand); font-size: 18px; }
.auth-logo img { width: 116px; height: auto; }

