/* ============================================================
   福之佳房产 - 移动端样式表 (mobile.css)
   适配：375px - 428px 手机屏幕
   主色调：金色 #C8A45C，辅助：深蓝 #1B2A4A
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
    --gold: #C8A45C;
    --gold-light: #D4B87A;
    --gold-dark: #A8883E;
    --gold-bg: #FDF8ED;
    --navy: #1B2A4A;
    --navy-light: #2C3E5A;
    --text: #2C3E50;
    --text-light: #8899AA;
    --text-lighter: #AAB5C0;
    --bg: #F5F6FA;
    --white: #FFFFFF;
    --border: #E8ECF0;
    --red: #E74C3C;
    --green: #27AE60;
    --orange: #E67E22;
    --blue: #3498DB;
    --purple: #9B59B6;
    --header-h: 50px;
    --tabbar-h: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; outline: none; border: none; }

/* ===== 顶部固定导航 ===== */
.m-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: linear-gradient(135deg, var(--navy) 0%, #253450 100%);
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.m-header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 16px;
}
.m-logo {
    font-size: 17px; font-weight: 700; color: var(--gold);
    letter-spacing: 1px;
}
.m-header-actions { display: flex; gap: 12px; align-items: center; }
.m-btn-text {
    font-size: 13px; color: var(--gold); padding: 4px 10px;
    border: 1px solid var(--gold); border-radius: 14px;
    transition: all 0.2s;
}
.m-btn-text:active { background: var(--gold); color: var(--navy); }

/* ===== 底部导航栏 ===== */
.m-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--tabbar-h);
    padding-bottom: var(--safe-bottom);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex; align-items: center;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.04);
}
.m-tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px;
    color: var(--text-lighter); font-size: 10px; font-weight: 500;
    transition: color 0.2s;
}
.m-tab-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.m-tab-item.active { color: var(--gold); }
.m-tab-item.active svg { stroke: var(--gold); fill: var(--gold-bg); }

/* ===== 主内容区 ===== */
.m-main {
    padding-top: var(--header-h);
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
    min-height: 100vh;
}

/* ===== 搜索栏 ===== */
.m-search-bar {
    padding: 12px 16px; background: var(--white);
    border-bottom: 1px solid var(--border);
}
.m-search-input-wrap {
    display: flex; align-items: center;
    background: var(--bg); border-radius: 40px;
    padding: 0 16px; height: 40px;
}
.m-search-icon { color: var(--text-lighter); font-size: 16px; margin-right: 8px; flex-shrink: 0; }
.m-search-input {
    flex: 1; background: transparent; font-size: 14px;
    color: var(--text);
}
.m-search-input::placeholder { color: var(--text-lighter); }
.m-search-btn {
    flex-shrink: 0; background: var(--gold); color: var(--white);
    font-size: 13px; font-weight: 600; padding: 6px 18px;
    border-radius: 20px; margin-left: 8px;
    transition: background 0.2s;
}
.m-search-btn:active { background: var(--gold-dark); }

/* ===== 分类图标网格 ===== */
.m-category-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0; padding: 8px 0; background: var(--white);
    border-bottom: 8px solid var(--bg);
}
.m-cat-item {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 14px 4px;
    transition: background 0.15s;
}
.m-cat-item:active { background: var(--gold-bg); }
.m-cat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-bottom: 6px;
}
.m-cat-icon.gold { background: var(--gold-bg); color: var(--gold); }
.m-cat-icon.blue { background: #EBF5FB; color: var(--blue); }
.m-cat-icon.green { background: #E8F8F5; color: #1ABC9C; }
.m-cat-icon.orange { background: #FEF5E7; color: var(--orange); }
.m-cat-icon.purple { background: #F4ECF7; color: var(--purple); }
.m-cat-icon.red { background: #FDEDEC; color: var(--red); }
.m-cat-label { font-size: 11px; color: var(--text); text-align: center; }

/* ===== 区块标题 ===== */
.m-section { padding: 0 16px; margin-bottom: 12px; }
.m-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0 10px;
}
.m-section-title {
    font-size: 16px; font-weight: 700; color: var(--navy);
    position: relative; padding-left: 10px;
}
.m-section-title::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px; background: var(--gold);
    border-radius: 2px;
}
.m-section-more { font-size: 12px; color: var(--text-light); }
.m-section-more:active { color: var(--gold); }

/* ===== 房源卡片 ===== */
.m-house-card {
    display: flex; background: var(--white); border-radius: 10px;
    overflow: hidden; margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.15s;
}
.m-house-card:active { transform: scale(0.985); }
.m-house-img {
    width: 120px; height: 100px; flex-shrink: 0;
    position: relative; overflow: hidden;
    background: var(--border);
}
.m-house-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.m-house-img .no-img {
    width: 100%; height: 100%; display: flex; align-items: center;
    justify-content: center; color: var(--text-lighter); font-size: 12px;
}
.m-house-tag {
    position: absolute; top: 6px; left: 6px;
    font-size: 10px; color: var(--white); background: var(--gold);
    padding: 2px 6px; border-radius: 3px; font-weight: 500;
}
.m-house-tag.urgent { background: var(--red); }
.m-house-tag.rent { background: var(--blue); }
.m-house-tag.new { background: var(--orange); }
.m-house-tag.shop { background: var(--purple); }
.m-house-info {
    flex: 1; padding: 10px 12px; display: flex;
    flex-direction: column; justify-content: space-between;
    min-width: 0;
}
.m-house-title {
    font-size: 14px; font-weight: 600; color: var(--text);
    line-height: 1.3; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.m-house-meta {
    display: flex; flex-wrap: wrap; gap: 6px;
    font-size: 11px; color: var(--text-light);
}
.m-house-meta span {
    background: var(--bg); padding: 2px 6px; border-radius: 3px;
    white-space: nowrap;
}
.m-house-bottom {
    display: flex; align-items: center; justify-content: space-between;
}
.m-house-price {
    font-size: 16px; font-weight: 700; color: var(--red);
}
.m-house-price small { font-size: 11px; font-weight: 400; }
.m-house-agent {
    font-size: 10px; color: var(--text-lighter);
    display: flex; align-items: center; gap: 4px;
}
.m-house-agent .agent-avatar {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--gold-bg); color: var(--gold); font-size: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ===== Tab 切换 ===== */
.m-tab-scroll {
    display: flex; gap: 8px; padding: 10px 16px;
    overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
    background: var(--white);
}
.m-tab-scroll::-webkit-scrollbar { display: none; }
.m-tab-chip {
    flex-shrink: 0; padding: 6px 16px; font-size: 13px; font-weight: 500;
    border-radius: 20px; background: var(--bg); color: var(--text-light);
    transition: all 0.2s;
}
.m-tab-chip.active {
    background: var(--gold); color: var(--white);
}

/* ===== 筛选 Chip 栏 ===== */
.m-filter-bar {
    display: flex; gap: 8px; padding: 10px 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    background: var(--white); border-bottom: 1px solid var(--border);
}
.m-filter-bar::-webkit-scrollbar { display: none; }
.m-filter-chip {
    flex-shrink: 0; padding: 6px 14px; font-size: 12px;
    border-radius: 16px; background: var(--bg); color: var(--text-light);
    border: 1px solid transparent; transition: all 0.2s;
}
.m-filter-chip.active {
    background: var(--gold-bg); color: var(--gold);
    border-color: var(--gold);
}

/* ===== 房源详情页 ===== */
.m-detail-swiper {
    position: relative; width: 100%; height: 260px;
    overflow: hidden; background: #1a1a1a;
}
.m-detail-swiper img {
    width: 100%; height: 100%; object-fit: cover;
    display: none;
}
.m-detail-swiper img.active { display: block; }
.m-swiper-dots {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 2;
}
.m-swiper-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.5); transition: all 0.2s;
}
.m-swiper-dot.active { background: var(--white); width: 16px; border-radius: 3px; }
.m-swiper-prev, .m-swiper-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.3); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; z-index: 2; cursor: pointer;
}
.m-swiper-prev { left: 10px; }
.m-swiper-next { right: 10px; }

.m-detail-content { padding: 0 16px; }
.m-detail-price-bar {
    display: flex; align-items: baseline; gap: 10px;
    padding: 16px 0; border-bottom: 1px solid var(--border);
}
.m-detail-price {
    font-size: 26px; font-weight: 800; color: var(--red);
}
.m-detail-price small { font-size: 13px; font-weight: 400; }
.m-detail-type-tag {
    font-size: 11px; padding: 3px 10px; border-radius: 10px;
    background: var(--gold); color: var(--white);
}
.m-detail-title {
    font-size: 18px; font-weight: 700; color: var(--navy);
    padding: 12px 0; line-height: 1.4;
}

.m-info-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px; background: var(--border);
    border-radius: 8px; overflow: hidden;
    margin: 12px 0;
}
.m-info-item {
    background: var(--white); padding: 12px 8px; text-align: center;
}
.m-info-label { font-size: 11px; color: var(--text-light); margin-bottom: 4px; }
.m-info-value { font-size: 14px; font-weight: 600; color: var(--text); }

.m-detail-desc {
    padding: 14px 0; font-size: 14px; line-height: 1.7;
    color: var(--text); border-top: 1px solid var(--border);
}

.m-agent-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; background: var(--gold-bg);
    border-radius: 10px; margin: 12px 0;
}
.m-agent-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    overflow: hidden; flex-shrink: 0;
}
.m-agent-avatar img { width: 100%; height: 100%; object-fit: cover; }
.m-agent-avatar-placeholder {
    background: var(--gold); color: var(--white); font-size: 18px;
    font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.m-agent-info { flex: 1; min-width: 0; }
.m-agent-name { font-size: 15px; font-weight: 600; color: var(--navy); }
.m-agent-company { font-size: 12px; color: var(--text-light); }
.m-agent-contact {
    flex-shrink: 0;
}
.m-agent-phone-btn {
    display: inline-block; padding: 8px 18px; background: var(--gold);
    color: var(--white); border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* ===== 文章列表卡片 ===== */
.m-article-card {
    background: var(--white); border-radius: 10px; overflow: hidden;
    margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.m-article-card:active { transform: scale(0.985); }
.m-article-card .art-img {
    width: 100%; height: 160px; overflow: hidden; background: var(--border);
}
.m-article-card .art-img img { width: 100%; height: 100%; object-fit: cover; }
.m-article-card .art-body { padding: 12px; }
.m-article-card .art-title {
    font-size: 15px; font-weight: 600; color: var(--navy);
    margin-bottom: 6px; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.m-article-card .art-summary {
    font-size: 12px; color: var(--text-light); line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    margin-bottom: 8px;
}
.m-article-card .art-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; color: var(--text-lighter);
}
.m-article-card .art-cat {
    background: var(--gold-bg); color: var(--gold); padding: 2px 8px;
    border-radius: 8px;
}

/* ===== 小区列表 ===== */
.m-comm-card {
    background: var(--white); border-radius: 10px; padding: 14px;
    margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.m-comm-name { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.m-comm-district { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.m-comm-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.m-comm-stat .stat-label { font-size: 10px; color: var(--text-lighter); }
.m-comm-stat .stat-value { font-size: 14px; font-weight: 600; color: var(--text); }
.m-comm-stat .stat-value.price { color: var(--red); }
.m-comm-link {
    display: inline-block; margin-top: 10px; font-size: 12px;
    color: var(--gold); border: 1px solid var(--gold);
    padding: 4px 14px; border-radius: 14px;
}

/* ===== 登录/注册/忘记密码表单 ===== */
.m-auth-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - var(--header-h) - var(--tabbar-h) - 40px);
    padding: 20px 16px; background: var(--bg);
}
.m-auth-box {
    width: 100%; max-width: 360px; background: var(--white);
    border-radius: 12px; padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.m-auth-box h2 {
    font-size: 20px; font-weight: 700; color: var(--navy);
    text-align: center; margin-bottom: 24px;
}
.m-form-group { margin-bottom: 16px; }
.m-form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.m-form-input {
    width: 100%; height: 44px; padding: 0 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; color: var(--text);
    transition: border-color 0.2s;
}
.m-form-input:focus { border-color: var(--gold); background: var(--white); }
.m-form-textarea {
    width: 100%; padding: 12px 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; color: var(--text);
    resize: vertical; min-height: 80px;
}
.m-form-textarea:focus { border-color: var(--gold); background: var(--white); }
.m-btn-submit {
    width: 100%; height: 44px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--white); font-size: 15px; font-weight: 700;
    border-radius: 8px; cursor: pointer; transition: opacity 0.2s;
    margin-top: 4px;
}
.m-btn-submit:active { opacity: 0.85; }
.m-auth-link { text-align: center; font-size: 13px; color: var(--text-light); margin-top: 14px; }
.m-auth-link a { color: var(--gold); font-weight: 500; }

/* ===== Alert 消息 ===== */
.m-alert {
    padding: 10px 14px; border-radius: 8px; font-size: 13px;
    margin-bottom: 14px; line-height: 1.5;
}
.m-alert-error { background: #FDEDEC; color: var(--red); border: 1px solid #F5B7B1; }
.m-alert-success { background: #E8F8F5; color: var(--green); border: 1px solid #A3E4D7; }

/* ===== 空状态 ===== */
.m-empty {
    text-align: center; padding: 40px 20px; color: var(--text-lighter);
}
.m-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.m-empty-text { font-size: 14px; }

/* ===== 分页 ===== */
.m-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; padding: 16px 0;
}
.m-page-link {
    width: 34px; height: 34px; display: flex; align-items: center;
    justify-content: center; border-radius: 8px;
    font-size: 13px; color: var(--text-light); background: var(--white);
    border: 1px solid var(--border); transition: all 0.2s;
}
.m-page-link.active { background: var(--gold); color: var(--white); border-color: var(--gold); }
.m-page-link:active { background: var(--gold-bg); }

/* ===== 联系我们 ===== */
.m-contact-page { padding: 16px; }
.m-contact-card {
    background: var(--white); border-radius: 10px; padding: 16px;
    margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.m-contact-card h3 {
    font-size: 15px; font-weight: 700; color: var(--navy);
    margin-bottom: 10px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.m-contact-card p {
    font-size: 13px; color: var(--text); line-height: 1.8;
}
.m-contact-phone {
    font-size: 20px; font-weight: 800; color: var(--gold);
}

/* ===== 404 页面 ===== */
.m-404-page {
    text-align: center; padding: 60px 20px;
}
.m-404-icon { font-size: 72px; color: var(--border); margin-bottom: 20px; }
.m-404-page h2 { font-size: 22px; color: var(--navy); margin-bottom: 10px; }
.m-404-page p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
.m-404-btn {
    display: inline-block; padding: 10px 30px;
    background: var(--gold); color: var(--white);
    border-radius: 22px; font-size: 14px; font-weight: 600;
}

/* ===== 回到顶部 ===== */
.m-back-top {
    position: fixed; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
    right: 16px; width: 40px; height: 40px; border-radius: 50%;
    background: var(--navy); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; z-index: 99; opacity: 0; pointer-events: none;
    transition: opacity 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.m-back-top.show { opacity: 0.85; pointer-events: auto; }

/* ===== 图片查看器 ===== */
.m-img-viewer {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999; background: rgba(0,0,0,0.95);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.m-img-viewer.active { opacity: 1; pointer-events: auto; }
.m-img-viewer img { max-width: 95%; max-height: 85vh; object-fit: contain; }
.m-viewer-close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2); color: var(--white);
    font-size: 20px; display: flex; align-items: center;
    justify-content: center; cursor: pointer;
}

/* ===== 热门标签 ===== */
.m-hot-tags {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px;
    background: var(--white); border-bottom: 1px solid var(--border);
}
.m-hot-tag {
    padding: 5px 14px; font-size: 12px; border-radius: 16px;
    background: var(--bg); color: var(--text-light);
    transition: all 0.2s;
}
.m-hot-tag:active { background: var(--gold-bg); color: var(--gold); }

/* ===== 底部信息 ===== */
.m-footer {
    text-align: center; padding: 16px;
    background: var(--white); border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-lighter);
}
.m-footer-phone { color: var(--gold); font-size: 13px; font-weight: 600; margin: 4px 0; }
.m-footer-copy { margin-top: 6px; }
.m-footer-copy a { color: var(--gold); }

/* ===== 快捷操作按钮行 ===== */
.m-action-row {
    display: flex; gap: 10px; padding: 12px 16px;
    background: var(--white);
}
.m-action-btn {
    flex: 1; height: 38px; display: flex; align-items: center;
    justify-content: center; font-size: 13px; font-weight: 600;
    border-radius: 8px; transition: opacity 0.2s;
}
.m-action-btn:active { opacity: 0.85; }
.m-action-btn.gold { background: var(--gold); color: var(--white); }
.m-action-btn.outline { background: var(--white); color: var(--gold); border: 1px solid var(--gold); }

/* ===== 房源列表排序栏 ===== */
.m-sort-bar {
    display: flex; gap: 8px; padding: 10px 16px;
    background: var(--white); border-bottom: 1px solid var(--border);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.m-sort-bar::-webkit-scrollbar { display: none; }
.m-sort-chip {
    flex-shrink: 0; padding: 5px 14px; font-size: 12px;
    border-radius: 14px; background: var(--bg); color: var(--text-light);
    transition: all 0.2s;
}
.m-sort-chip.active { background: var(--navy); color: var(--white); }

/* ===== 搜索结果条 ===== */
.m-result-bar {
    padding: 10px 16px; background: var(--white);
    border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-light);
}
.m-result-bar strong { color: var(--gold); }

/* ===== 服务卡片 ===== */
.m-service-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--white); border-radius: 10px;
    margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.m-svc-title { font-size: 14px; font-weight: 600; color: var(--text); }
.m-svc-price { font-size: 15px; font-weight: 700; color: var(--red); }
.m-svc-price small { font-size: 11px; font-weight: 400; color: var(--text-light); }

/* ===== 面包屑 ===== */
.m-breadcrumb {
    padding: 10px 16px; font-size: 12px; color: var(--text-light);
    background: var(--white);
}
.m-breadcrumb a { color: var(--gold); }

/* ===== 详情页配套信息 ===== */
.m-facility-list {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0;
}
.m-facility-tag {
    font-size: 12px; padding: 4px 12px; background: var(--bg);
    border-radius: 12px; color: var(--text);
}
