/* ============================================
   房多多 H5 - 全局样式
   配色：商务简约
   ============================================ */
:root {
    --primary: #1A73E8;
    --primary-light: #E8F0FE;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-sub: #6B7280;
    --tag-hospital: #3B82F6;
    --tag-subway: #10B981;
    --tag-other: #F59E0B;
    --status-available: #1A73E8;
    --status-negotiable: #F59E0B;
    --status-rented: #EF4444;
    --status-reserved: #F59E0B;
    --border: #E5E7EB;
    --header-h: 2.8rem;
    --filter-h: auto;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text-main);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }

/* ========== 顶部 Header（固定，约3cm） ========== */
.top-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: #1F2E67;
    display: flex; align-items: center;
    padding: 0 12px;
}
.header-logo {
    height: 60%; width: auto; max-width: 50%;
    object-fit: contain;
    flex-shrink: 0;
}
.header-slogan {
    flex: 1; text-align: right;
    color: #fff; font-size: 13px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-left: 10px;
}

/* ========== 搜索栏（固定在 header 下方） ========== */
.search-bar {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
    background: #fff;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
}
.search-input-wrap {
    display: flex; align-items: center; gap: 6px;
}
.search-input {
    flex: 1; height: 32px;
    border: 1px solid var(--border); border-radius: 16px;
    padding: 0 12px; font-size: 13px;
    outline: none; background: var(--bg);
    color: var(--text-main);
}
.search-input:focus { border-color: var(--primary); }
.search-btn {
    height: 32px; padding: 0 14px;
    border: none; border-radius: 16px;
    background: var(--primary); color: #fff;
    font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.search-status {
    font-size: 11px; color: var(--text-sub);
    margin-top: 4px; min-height: 14px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-status:empty { display: none; }

/* ========== 筛选栏（固定在搜索栏下方） ========== */
.filter-bar {
    position: fixed; top: calc(var(--header-h) + var(--search-h, 38px)); left: 0; right: 0; z-index: 98;
    background: #fff;
    padding: 6px 10px 4px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.filter-row {
    display: flex; align-items: center;
    margin-bottom: 6px;
    min-height: 28px;
}
.filter-label {
    font-size: 13px; color: var(--text-sub);
    width: 32px; flex-shrink: 0; text-align: center;
}
.filter-options {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    scrollbar-width: none;
}
.filter-options::-webkit-scrollbar { display: none; }
.filter-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 13px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-sub);
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}
.filter-tag.active {
    background: var(--primary);
    color: #fff;
}
/* ========== 列表区域 ========== */
.house-list {
    padding: calc(var(--header-h) + var(--search-h, 35px) + var(--filter-h, 24px)) 10px 0;
}
.house-list-nopt {
    padding-top: 0;
    padding-bottom: 20px;
}

/* ========== 合作方式坑位 ========== */
.coop-card {
    display: block;
    margin-bottom: 12px;
}
.coop-img {
    width: 100%; display: block;
    border-radius: 8px;
    object-fit: cover;
}

/* ========== 房屋卡片（上图下文） ========== */
.house-card {
    display: block; position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.house-card:active { box-shadow: 0 2px 8px rgba(0,0,0,.12); }

.card-img-wrap {
    width: 100%;
    height: 227px;
    overflow: hidden;
    position: relative;
}
.card-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.card-info {
    padding: 10px 12px;
}
.card-name {
    font-size: 15px; font-weight: 600;
    color: var(--text-main);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 6px;
}
.card-price {
    font-size: 20px; font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.price-unit { font-size: 11px; font-weight: 400; color: var(--text-sub); }
.card-address {
    font-size: 12px; color: var(--text-sub);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 8px;
}

/* ========== 标签 ========== */
.card-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag {
    display: inline-block;
    padding: 1px 5px; border-radius: 3px;
    font-size: 10px; color: #fff;
    white-space: nowrap;
}
.tag-hospital { background: var(--tag-hospital); }
.tag-subway   { background: var(--tag-subway); }
.tag-other    { background: var(--tag-other); }

/* ========== 状态角标（图片右上角） ========== */
.status-badge {
    position: absolute; top: 0; right: 0;
    color: #fff; font-size: 10px;
    padding: 4px 10px;
    border-radius: 0 8px 0 8px;
    font-weight: 500;
    pointer-events: none;
}
.status-rented     { background: var(--status-rented); }
.status-negotiable { background: var(--status-negotiable); }
.status-reserved   { background: var(--status-reserved); }
.status-available  { background: var(--status-available); }

/* ========== 距离角标（图片左上角） ========== */
.distance-badge {
    position: absolute; top: 0; left: 0;
    color: #fff; font-size: 10px;
    padding: 4px 10px;
    border-radius: 8px 0 8px 0;
    font-weight: 500;
    pointer-events: none;
    background: var(--tag-subway);
}

/* ========== 名称筛选输入框 ========== */
.filter-name-wrap {
    display: flex; align-items: center; gap: 6px;
    flex: 1;
}
.filter-name-input {
    flex: 1; height: 28px; min-width: 80px;
    border: 1px solid var(--border); border-radius: 14px;
    padding: 0 10px; font-size: 13px;
    outline: none; background: var(--bg);
    color: var(--text-main);
}
.filter-name-input:focus { border-color: var(--primary); }
.filter-date-input {
    display: inline-block;
    padding: 3px 10px;
    font-size: 13px; font-family: inherit;
    border-radius: 12px;
    border: none;
    outline: none; background: var(--bg);
    color: var(--text-sub);
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.filter-date-input:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.filter-name-btn {
    height: 28px; padding: 0 12px;
    border: none; border-radius: 14px;
    background: var(--primary); color: #fff;
    font-size: 13px; cursor: pointer; flex-shrink: 0;
}
.filter-more-btn {
    font-size: 13px; color: var(--primary);
    padding: 3px 10px; border-radius: 12px;
    border: 1px solid var(--primary);
    background: #fff;
    white-space: nowrap; cursor: pointer;
    flex-shrink: 0; margin-left: auto;
    user-select: none;
}
.filter-more-btn:hover { background: var(--primary-light); }

/* ========== 空状态 ========== */
.empty-tip {
    text-align: center; padding: 60px 20px;
    color: var(--text-sub); font-size: 14px;
}

/* ========== 详情页 Header ========== */
.detail-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 44px;
    background: var(--primary);
    display: flex; align-items: center;
    padding: 0 12px;
    color: #fff;
}
.back-btn {
    color: #fff; font-size: 14px;
    margin-right: 12px;
}
.detail-title { font-size: 15px; font-weight: 500; }

/* ========== 详情页内容 ========== */
.detail-wrap { padding: 56px 0 80px; }

/* ========== 详情页 - 照片平铺 ========== */
.detail-photos {
    display: flex; flex-direction: column;
    gap: 8px;
}
.photo-item {
    width: 100%;
    border-radius: 4px;
    display: block;
}

/* ========== 详情页 - 视频 ========== */
.detail-video video {
    width: 100%; border-radius: 4px;
    background: #000;
}

.detail-main {
    background: #fff;
    padding: 14px 16px 12px;
}
.detail-name-row {
    display: flex; justify-content: space-between;
    align-items: flex-start;
}
.detail-name {
    font-size: 18px; font-weight: 600;
    flex: 1; margin-right: 10px;
}
.detail-status {
    padding: 3px 10px; border-radius: 4px;
    color: #fff; font-size: 12px; font-weight: 500;
    flex-shrink: 0;
}
.detail-price {
    font-size: 24px; font-weight: 700;
    color: var(--primary); margin: 8px 0;
}
.detail-meta {
    display: flex; gap: 16px;
    font-size: 13px; color: var(--text-sub);
    border-top: 1px solid var(--border);
    padding-top: 10px; margin-top: 6px;
}
.meta-label {
    color: var(--text-main); margin-right: 4px;
    font-size: 12px; font-weight: 600;
    background: var(--primary-light);
    padding: 1px 6px;
    border-radius: 3px;
}

/* ========== 详情分区 ========== */
.detail-section {
    background: #fff;
    margin-top: 8px;
    padding: 12px 16px;
}
.section-title {
    font-size: 15px; font-weight: 600;
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}
.detail-address { font-size: 13px; color: var(--text-sub); }
.detail-phone {
    display: inline-block; font-size: 16px; font-weight: 600;
    color: var(--primary); padding: 6px 0;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tags .tag { padding: 3px 8px; font-size: 12px; }
.detail-desc {
    font-size: 13px; color: var(--text-sub);
    line-height: 1.8;
}

/* ========== 退租方式表格 ========== */
.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.policy-table th {
    background: var(--primary-light);
    color: var(--text-main);
    font-weight: 600;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border);
    font-size: 12px;
}
.policy-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border);
    color: var(--text-sub);
    line-height: 1.5;
}

/* ========== 分享按钮悬浮底部 ========== */
.share-float {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 100;
    display: flex; gap: 10px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
.share-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 12px 0;
    border: none; border-radius: 8px;
    font-size: 14px; font-weight: 500;
    cursor: pointer; transition: opacity .2s;
}
.share-btn:active { opacity: .8; }
.share-btn-wx {
    background: #07C160; color: #fff;
}
.share-btn-qr {
    background: var(--primary); color: #fff;
}
.share-icon-wx::before { content: "\2709"; font-size: 16px; }
.share-icon-qr::before { content: "\25A3"; font-size: 16px; }

/* ========== 分享弹窗通用遮罩 ========== */
.share-modal-mask {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    align-items: center; justify-content: center;
}
.share-modal-mask.show { display: flex; }

/* ========== 二维码弹窗 ========== */
.qr-modal {
    background: #fff; border-radius: 12px;
    width: 85%; max-width: 320px;
    padding: 20px; text-align: center;
}
.qr-modal-title {
    font-size: 16px; font-weight: 600;
    margin-bottom: 14px; color: var(--text-main);
}
.qr-card {
    background: var(--bg); border-radius: 8px;
    overflow: hidden; text-align: left;
}
.qr-card-cover {
    width: 100%; height: 140px;
    object-fit: cover; display: block;
}
.qr-card-info {
    padding: 10px 12px 6px;
}
.qr-card-name {
    font-size: 14px; font-weight: 600;
    color: var(--text-main);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 4px;
}
.qr-card-addr {
    font-size: 12px; color: var(--text-sub);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qr-code-wrap {
    display: flex; justify-content: center;
    padding: 12px 0 16px;
}
.qr-modal-btns {
    display: flex; gap: 10px;
    margin-top: 14px; justify-content: center;
}
.qr-modal-save {
    flex: 1; padding: 10px 0;
    border: none; border-radius: 20px;
    background: var(--primary); color: #fff;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: opacity .2s;
}
.qr-modal-save:active { opacity: .8; }
.qr-modal-save:disabled { opacity: .5; }
.qr-modal-close {
    flex: 1; padding: 10px 0;
    border: 1px solid var(--border); border-radius: 20px;
    background: #fff; color: var(--text-sub);
    font-size: 14px; cursor: pointer;
}

/* ========== Toast 轻提示 ========== */
.toast-msg {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.9);
    background: rgba(0,0,0,.75); color: #fff;
    padding: 12px 24px; border-radius: 8px;
    font-size: 14px; z-index: 300;
    opacity: 0; transition: all .3s;
    pointer-events: none; white-space: nowrap;
}
.toast-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ========== 搜索入口页 ========== */
.search-page { min-height: 100vh; display: flex; flex-direction: column; }
.search-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; max-width: 400px; margin: 0 auto; width: 100%; }
.search-hero h1 { font-size: 22px; font-weight: 700; color: #1F2E67; text-align: center; margin-bottom: 28px; }
.search-card { background: #fff; border-radius: 14px; padding: 24px 20px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.search-field { margin-bottom: 18px; }
.search-field label { display: block; font-size: 13px; color: #888; margin-bottom: 6px; font-weight: 500; }
.search-field input { width: 100%; padding: 11px 14px; border: 1.5px solid #e0e0e0; border-radius: 10px; font-size: 15px; outline: none; transition: border-color .2s; background: #fafafa; }
.search-field input:focus { border-color: #1A73E8; background: #fff; }
.search-field .range-hint { font-size: 12px; color: #1A73E8; margin-top: 4px; }
.search-field-row { display: flex; gap: 10px; }
.search-field-row .search-field { flex: 1; }
.search-submit { width: 100%; padding: 13px; border: none; border-radius: 10px; background: linear-gradient(135deg, #1A73E8, #1557b0); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; transition: opacity .2s; }
.search-submit:active { opacity: .85; }

/* 右上地图按钮 */
.header-map-btn { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); border: none; color: #fff; font-size: 18px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-left: 8px; }

/* ========== 横排筛选（list.html） ========== */
.hfilter-bar { position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99; background: #fff; border-bottom: 1px solid var(--border); }
.hfilter-scroll { display: flex; overflow-x: auto; gap: 6px; padding: 8px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; align-items: center; }
.hfilter-scroll::-webkit-scrollbar { display: none; }
.hfilter-chip { flex-shrink: 0; padding: 5px 12px; font-size: 13px; border-radius: 14px; background: var(--bg); color: var(--text-sub); cursor: pointer; white-space: nowrap; border: 1px solid transparent; transition: all .2s; }
.hfilter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.hfilter-more { flex-shrink: 0; padding: 5px 12px; font-size: 12px; color: var(--primary); cursor: pointer; white-space: nowrap; border: 1px dashed var(--primary); border-radius: 14px; background: #fff; }
.hfilter-expand { display: none; padding: 8px 10px 12px; border-top: 1px solid var(--border); }
.hfilter-expand.show { display: block; }
.efilter-group { margin-bottom: 10px; }
.efilter-label { font-size: 12px; color: #999; margin-bottom: 6px; font-weight: 500; }
.efilter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.efilter-tag { display: inline-block; padding: 4px 10px; font-size: 12px; border-radius: 6px; background: #f5f5f5; color: #666; cursor: pointer; border: 1px solid transparent; transition: all .2s; }
.efilter-tag.active { background: #e8f0fe; color: #1A73E8; border-color: #1A73E8; }
.result-list { padding-top: calc(var(--header-h) + 44px); padding-bottom: 20px; }
.result-list-padded { padding-top: calc(var(--header-h) + 80px); }

/* ========== 地图页 ========== */
.map-page { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }
.map-page .top-header { z-index: 101; }
.map-container { width: 100%; height: 100%; }
.map-marker-info { padding: 6px 8px; font-size: 12px; max-width: 160px; }
.map-marker-info .mm-name { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.map-marker-info .mm-price { color: var(--primary); font-weight: 600; }
.map-marker-info .mm-addr { font-size: 11px; color: #999; }
