/* ============================================================
   PC 端样式 - BEM + 侧边栏折叠（仅按钮点击，transform 动画）
   顶部栏固定定位，折叠按钮悬浮于顶部栏底部中心（增加间距）
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html,
body {
    height: 100%;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.app {
    display: flex;
    height: 100vh;
    flex-direction: column;
    position: relative;
}

/* ---- 顶部栏（固定定位） ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease;
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}
.header__title {
    font-size: 18px;
    font-weight: 600;
}
.header__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.header__user a.header-btn {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 13px;
    line-height: 1.6;
}
.header__user a.header-btn:hover {
    background: rgba(255,255,255,0.3);
}
.header__user span {
    opacity: 0.9;
}

/* ---- 折叠按钮（悬浮于顶部栏底部中心，增加间距） ---- */
.header-handle {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    width: 60px;
    height: 6px;
    border: none;
    border-radius: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    font-size: 0;
    text-indent: -9999px;
    overflow: hidden;
}
.header-handle:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}
.header-handle:active {
    transform: translateX(-50%) scale(0.95);
}
.header-handle--expanded {
    top: 62px;
}
.header-handle--collapsed {
    top: 6px;
}

/* ---- 主区域（补顶栏高度） ---- */
.main {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
    margin-top: 56px;
    transition: margin-top 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.main-expanded {
    margin-top: 0;
}

/* ---- 列表面板（transform 动画） ---- */
.list-panel {
    width: 400px;
    min-width: 320px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    overflow: hidden;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    will-change: transform;
    transform: translateX(0);
}
.list-panel.collapsed {
    transform: translateX(-100%);
    width: 400px;
    min-width: 320px;
    border-right: none;
    margin-right: -400px;
}
.list-panel.collapsed .filter-bar,
.list-panel.collapsed .list-scroll {
    display: none;
}

/* ---- 折叠悬浮按钮（侧边栏）——已优化为薄条 ---- */
.panel-toggle-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 6px;
    height: 56px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s ease,
                box-shadow 0.2s ease,
                width 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
    overflow: hidden;
    color: transparent;
}
.panel-toggle-btn:hover {
    transform: translateY(-50%) scaleX(1.8);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.panel-toggle-btn:active {
    transform: translateY(-50%) scaleX(1.2);
}
.panel-toggle-btn:focus {
    outline: none;
}

/* ---- 筛选栏 ---- */
.filter-bar {
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.filter-bar select,
.filter-bar input {
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    max-width: 80px;
}
.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: #555;
}
.filter-bar .keyword-input {
    flex: 1;
    min-width: 120px;
    max-width: 280px;
}
.filter-bar .btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.btn-search {
    background: #667eea;
    color: #fff;
}
.btn-reset {
    background: #f39c12;
    color: #fff;
}
.btn-reset:hover {
    background: #e67e22;
}
/* ---- 列表滚动容器 ---- */
.list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}
/* ---- 房源卡片 ---- */
.house-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 80px;
    overflow: hidden;
    will-change: transform;
}
.house-item:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transform: translateX(2px);
}
.house-item--active {
    background: #f0f3ff !important;
    border-left-color: #e74c3c !important;
}
.house-item__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}
.house-item__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.house-item__price {
    color: #e74c3c;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 6px;
}
.house-item__info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    line-height: 1.4;
    min-height: 20px;
}
.house-item__tag {
    background: #f0f0f0;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}
.house-item__subway::before {
    content: '🚇 ';
}
.house-item__sensitive {
    font-size: 11px;
    color: #667eea;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.house-item__remark {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: italic;
}
.house-item__thumb {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    margin-left: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    flex-shrink: 0;
}
.house-item__thumb img,
.house-item__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.house-item__thumb .no-img {
    font-size: 20px;
    color: #ccc;
}
.hot-badge {
    background: #fdebd0;
    color: #a04000;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
    border-radius: 12px;
    margin-left: 4px;
}
.empty-tip {
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
}
#container {
    flex: 1;
    height: 100%;
    background: #e8e8e8;
    position: relative;
}
.loading-more {
    text-align: center;
    padding: 10px;
    color: #888;
    font-size: 13px;
}
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.preview-modal .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    font-weight: 300;
}
.preview-modal img,
.preview-modal video {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}
.preview-modal video {
    background: #000;
}
@media (max-width: 768px) {
    .list-panel {
        width: 100%;
        min-width: unset;
        max-height: 45vh;
        transform: none !important;
        margin-right: 0 !important;
    }
    .list-panel.collapsed {
        transform: none !important;
        margin-right: 0 !important;
        width: 100%;
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        border-right: none;
    }
    .main {
        flex-direction: column-reverse;
        margin-top: 0;
    }
    #container {
        height: 55vh;
    }
    .panel-toggle-btn {
        display: none !important;
    }
    .header {
        position: relative;
        height: auto;
    }
    .header-handle {
        display: none;
    }
}
.amap-marker-label {
    background: #fff !important;
    border: 2px solid #667eea !important;
    border-radius: 16px !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    pointer-events: none;
}
.locate-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 50;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    will-change: transform;
}
.locate-btn:hover {
    transform: scale(1.05);
}
.city-label {
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    padding: 8px 14px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.multi-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 4px 0;
}
.multi-item {
    display: flex;
    flex-direction: column;
    padding: 8px 4px;
    border-bottom: 1px solid #f0f0f0;
}
.multi-item:last-child {
    border-bottom: none;
}
.multi-item__info {
    flex: 1;
}
.multi-item__title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.multi-item__price {
    color: #e74c3c;
    font-weight: 700;
}
.multi-item__detail {
    font-size: 12px;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
}
.multi-item__tag {
    background: #f0f0f0;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    color: #666;
}
.multi-item__subway {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.multi-item__remark {
    font-size: 12px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}
.multi-item__thumb-area {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.multi-item__thumb-area::-webkit-scrollbar {
    height: 4px;
}
.multi-item__thumb-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.multi-item__thumb-area img,
.multi-item__thumb-area video {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    flex-shrink: 0;
    background: #000;
}
.multi-item__thumb-area .placeholder {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 32px;
    flex-shrink: 0;
}
#maintenanceOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}
#maintenanceOverlay .box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    color: #333;
    max-width: 600px;
}
#maintenanceOverlay .box h2 {
    font-size: 28px;
    margin-bottom: 10px;
}
#maintenanceOverlay .box p {
    margin-top: 10px;
    font-size: 16px;
    color: #555;
}
#maintenanceOverlay .box .sub {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
}
.register-tip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    justify-content: center;
    align-items: center;
}
.register-tip-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
}
.register-tip-box h3 {
    color: #e74c3c;
    margin-bottom: 10px;
}
.register-tip-box p {
    color: #555;
    margin-bottom: 16px;
}
.register-tip-box .btn-close-tip {
    padding: 8px 30px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 紧凑模式 */
.house-item--compact {
    padding: 4px 8px !important;
    height: auto;
    min-height: 50px;
}
.house-item--compact .house-item__title {
    font-size: 13px;
}
.house-item--compact .house-item__info {
    font-size: 11px;
    gap: 0 4px;
}
.house-item--compact .house-item__tag {
    font-size: 10px;
    padding: 0 4px;
}
.video-play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.15s;
    width: 100%;
    height: 100%;
    font-size: 24px;
}
.video-play-icon:hover {
    transform: scale(1.05);
}

/* ===== 公告弹窗 ===== */
.announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}
.announcement-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px 35px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.announcement-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.announcement-close:hover {
    color: #333;
}
.announcement-box #announcementContent {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}
.announcement-box #announcementContent h2 {
    margin-top: 0;
    color: #667eea;
}