/* 地区页面整体样式 */
.regions-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.regions-page h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

/* 主内容区布局 */
.regions-content {
    display: flex;
    gap: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 左侧地区选择器 */
.regions-selector {
    flex: 0 0 350px;
    background-color: #f8f9fa;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    border-right: 1px solid #e0e0e0;
}

/* 右侧结果区域 */
.regions-results {
    flex: 1;
    padding: 20px;
    min-width: 0; /* 防止flex子元素溢出 */
}

/* 地区区块样式 */
.region-section {
    margin-bottom: 20px;
}

.region-section h2 {
    margin: 0 0 12px 0;
    padding: 10px 15px;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.region-section h2:hover {
    background-color: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* 城市卡片网格 */
.region-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding: 0 5px;
}

/* 城市卡片样式 */
.region-card {
    display: block;
    padding: 10px 15px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.region-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 地区介绍样式 */
.regions-intro {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.regions-intro h2 {
    margin-bottom: 15px;
    color: #333;
}

/* 标签页样式 */
.region-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.tab-item {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    top: 2px;
}

.tab-item:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-item.active {
    background-color: #fff;
    color: #3498db;
    border-color: #3498db;
    box-shadow: 0 -2px 0 2px #3498db;
}

/* 标签内容样式 */
.tab-content {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 0 4px 4px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 公司网格样式 */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.company-item {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.company-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.company-item a {
    display: flex;
    gap: 15px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.company-logo {
    flex: 0 0 80px;
    height: 80px;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.company-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-info {
    flex: 1;
    min-width: 0;
}

.company-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-region {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    color: #666;
}

.company-description {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 巴士网格样式 */
.buses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* 巴士项目样式 */
.bus-item {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bus-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bus-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bus-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bus-item:hover .bus-image img {
    transform: scale(1.05);
}

.bus-info {
    padding: 15px;
}

.bus-info h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.bus-info h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.bus-info h4 a:hover {
    color: #3498db;
}

.bus-type, .bus-company, .bus-operating-company {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.bus-meta {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #999;
}

/* 照片网格样式 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.photo-item {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-caption {
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

/* 无数据样式 */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.no-data p {
    margin: 0;
    font-size: 0.95rem;
}

/* 搜索框样式 */
.region-search {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    flex: 1;
    padding: 12px 40px 12px 40px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 0.95rem;
    color: #333;
    background-color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1), 0 4px 12px rgba(52, 152, 219, 0.15);
    background-color: #fff;
    transform: translateY(-1px);
}

.clear-btn {
    position: absolute;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.clear-btn:hover {
    background-color: #bdbdbd;
    color: #333;
    transform: scale(1.1);
}

.search-stats {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    text-align: right;
    transition: all 0.3s ease;
}

/* 搜索高亮样式 */
.highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    animation: highlight-pulse 0.5s ease-in-out;
}

@keyframes highlight-pulse {
    0% {
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% {
        background-color: #ffeaa7;
        transform: scale(1.05);
    }
    100% {
        background-color: #fff3cd;
        transform: scale(1);
    }
}

/* 折叠/展开图标 */
.toggle-icon {
    float: right;
    font-size: 0.8rem;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .regions-content {
        flex-direction: column;
    }
    
    .regions-selector {
        flex: none;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .regions-results {
        flex: none;
    }
    
    .region-cards {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .companies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .regions-page {
        padding: 10px;
    }
    
    .regions-selector,
    .regions-results {
        padding: 15px;
    }
    
    .region-cards {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .companies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .buses-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .region-card {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .region-section h2 {
        font-size: 1rem;
        padding: 8px 12px;
    }
    
    .region-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .region-cards {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .region-card {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .companies-grid {
        grid-template-columns: 1fr;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .bus-image,
    .photo-item img {
        height: 120px;
    }
}

/* 滚动条样式 */
.regions-selector::-webkit-scrollbar {
    width: 6px;
}

.regions-selector::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.regions-selector::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.regions-selector::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.region-section {
    animation: fadeInUp 0.3s ease;
}

/* 卡片悬停效果 */
.region-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #3498db;
    transition: all 0.3s ease;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选中效果 */
::selection {
    background-color: rgba(52, 152, 219, 0.2);
}

::-moz-selection {
    background-color: rgba(52, 152, 219, 0.2);
}

/* 标签页样式 */
.tab-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 10px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 标签项样式 */
.region-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    padding-bottom: 10px;
}

.tab-item {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.tab-item:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-item.active {
    background-color: #fff;
    color: #3498db;
    border-color: #3498db;
    box-shadow: 0 -2px 0 1px #3498db;
    font-weight: 600;
}