﻿/* 城市选择页面 - 参照贝壳找房风格 */

/* 全局重置 */
.city-selector-page {
    background-color: #ffffff;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* 顶部导航栏 */
.top-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 15px 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
}

.page-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

/* 搜索区域 */
.search-section {
    background: #fff;
    padding: 30px 0;
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.06);*/
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.search-input {
    flex: 1;
    height: 50px;
    padding: 0 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    width: 120px;
    height: 50px;
    background: #192e75;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #0f1d4a;
}

/* 搜索结果弹出框 */
.search-results-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    max-height: 500px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 10px;
    z-index: 1000;
    overflow: hidden;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e8e8e8;
    background: #f7f8fa;
}

.results-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #e8e8e8;
}

.search-results-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px 20px;
}

.search-results-body .city-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-results-body .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.content-wrapper {
    display: flex;
    gap: 20px;
    position: relative;
}

/* 左侧城市列表 */
.city-list-section {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    padding: 0;
}

.section-block {
    padding: 25px 30px;
    border-bottom: 1px solid #e8e8e8;
}

.section-block:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* 城市项目容器 */
.city-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.city-item {
    padding: 8px 20px;
    background: #f7f8fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.city-item:hover {
    background: #e8eef9;
    color: #192e75;
}

.city-item .city-name {
    font-size: 14px;
    color: #333;
}

.city-item:hover .city-name {
    color: #192e75;
}

/* 定位城市特殊样式 */
.location-item {
    background: #f7f8fa;
    border: 1px solid transparent;
}

.location-item-unavailable {
    background: #f7f8fa;
    border: 1px solid #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.unavailable-tag {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
}

.location-icon {
    font-size: 16px;
}

/* 字母分组 */
.letter-group {
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
}

.letter-group:last-child {
    border-bottom: none;
}

.letter-title {
    font-size: 18px;
    font-weight: 700;
    color: #192e75;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #192e75;
    display: inline-block;
    min-width: 30px;
}

/* 右侧字母导航 */
.letter-nav {
    position: sticky;
    top: 100px;
    width: 40px;
    height: fit-content;
    align-self: flex-start;
}

.letter-nav-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    padding: 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.letter-link {
    width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    border-radius: 4px;
}

.letter-link:hover,
.letter-link.active {
    background: #192e75;
    color: #fff;
}

/* 加载状态 */
.loading,
.loading-nav,
.no-data {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

.loading-nav {
    padding: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-section {
        padding: 20px 0;
    }
    
    .search-box {
        max-width: 100%;
        margin: 0 15px;
    }
    
    .search-input {
        height: 44px;
        font-size: 14px;
    }
    
    .search-btn {
        width: 80px;
        height: 44px;
        font-size: 14px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .letter-nav {
        display: none;
    }
    
    .section-block {
        padding: 20px 15px;
    }
    
    .letter-group {
        padding: 15px;
    }
    
    .city-items {
        gap: 10px;
    }
    
    .city-item {
        padding: 6px 15px;
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-block {
    animation: fadeIn 0.5s ease-out;
}
