/* ========== PC 地图找房页面样式 ========== */

/* 整体布局：左侧面板 + 右侧地图 */
.map-page {
    display: flex;
    height: calc(100vh - 70px);
    /* 减去导航栏高度 */
    overflow: hidden;
}

/* ========== 左侧面板 ========== */
.map-sidebar {
    width: 380px;
    min-width: 380px;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8e8e8;
    transition: margin-left 0.3s ease, min-width 0.3s ease, width 0.3s ease;
    z-index: 10;
}

.map-sidebar.collapsed {
    margin-left: -380px;
    min-width: 0;
    width: 0;
    overflow: hidden;
}

/* 筛选区域 */
.sidebar-filters {
    padding: 16px 18px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group:last-child {
    margin-bottom: 6px;
}

.filter-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    font-weight: 500;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    user-select: none;
}

.filter-tag:hover {
    color: #667eea;
    border-color: #667eea;
}

.filter-tag.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* 统计信息 */
.sidebar-stats {
    padding: 10px 18px;
    font-size: 13px;
    color: #999;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.sidebar-stats strong {
    color: #667eea;
    font-size: 15px;
}

.stats-detail {
    font-size: 12px;
    color: #bbb;
}

/* 房源列表 */
.sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.sidebar-list::-webkit-scrollbar {
    width: 5px;
}

.sidebar-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 列表加载 */
.list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0;
    color: #999;
    font-size: 13px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #eee;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: mapSpin 0.8s linear infinite;
}

@keyframes mapSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 列表空状态 */
.list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: #ccc;
}

.list-empty p {
    margin: 12px 0 0;
    font-size: 14px;
    color: #bbb;
}

/* 列表卡片 */
.list-card {
    padding: 12px 14px;
    margin-bottom: 6px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.list-card:hover {
    border-color: #d0d8ff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.list-card.active {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.12);
}

.list-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.list-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    flex-shrink: 0;
}

.list-type-badge.type-1 {
    background: #667eea;
}

.list-type-badge.type-2 {
    background: #ff6b35;
}

.list-type-badge.type-3 {
    background: #43e97b;
    color: #333;
}

.list-district {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-address {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.list-price {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.list-area {
    font-size: 12px;
    color: #999;
}

.list-detail-link {
    margin-left: auto;
    font-size: 12px;
    color: #667eea;
    text-decoration: none;
    flex-shrink: 0;
}

.list-detail-link:hover {
    text-decoration: underline;
}

/* ========== 右侧地图 ========== */
.map-main {
    flex: 1;
    position: relative;
    min-width: 0;
}

#mapContainer {
    width: 100%;
    height: 100%;
}

/* 地图加载 */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.map-loading p {
    font-size: 14px;
    color: #999;
    margin: 10px 0 0;
}

/* 定位按钮 */
.map-locate-btn {
    position: absolute;
    bottom: 30px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 15;
    cursor: pointer;
    color: #667eea;
    transition: transform 0.2s;
}

.map-locate-btn:hover {
    transform: scale(1.1);
}

/* 侧栏折叠按钮 */
.sidebar-toggle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 24px;
    height: 56px;
    background: #fff;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 15;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.sidebar-toggle:hover {
    color: #667eea;
}

/* ========== 地图标记样式 ========== */
.marker-label {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.15s;
}

.marker-label:hover {
    transform: scale(1.08);
    z-index: 10 !important;
}

.marker-park {
    background: #43e97b;
    color: #333;
}

.marker-rent {
    background: #667eea;
    color: #fff;
}

.marker-sale {
    background: #ff6b35;
    color: #fff;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .map-page {
        flex-direction: column;
        height: calc(100vh - 56px);
    }

    .map-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
    }

    .map-sidebar.collapsed {
        margin-left: 0;
        max-height: 0;
        min-height: 0;
        overflow: hidden;
    }

    .sidebar-toggle {
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        width: 56px;
        height: 24px;
        border-radius: 0 0 6px 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar-toggle svg {
        transform: rotate(90deg);
    }

    .map-main {
        flex: 1;
        min-height: 0;
    }
}
