/* 基础样式文件 */

/* 全局样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* 新闻内容样式 */
.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.news-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
    text-indent: 2em;
}

.news-content p:last-child {
    margin-bottom: 0;
}

.news-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3d8bfe 0%, #00d4fe 100%);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e081f9 0%, #f3455a 100%);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid rgba(255,255,255,0.8);
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
    color: white;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: 0;
}

/* 导航样式 */
.navbar {
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

/* 房源卡片样式 */
.property-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.property-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: all 0.3s ease;
}

.property-card:hover .property-image {
    transform: scale(1.05);
}

.price-tag {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* 搜索表单样式 */
.search-form {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 统计卡片样式 */
.stat-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .search-form {
        padding: 20px;
        margin: 0 10px 30px 10px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .property-card {
        margin-bottom: 20px;
    }
}

/* 相似房源推荐样式优化 */
.similar-properties .card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    height: 120px; /* 固定卡片高度 */
}

.similar-properties .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* 桌面端图片固定尺寸 */
.similar-properties .row.g-0 {
    height: 100%; /* 确保行占满卡片高度 */
}

.similar-properties .row.g-0 .col-4 {
    height: 120px; /* 固定图片列高度 */
    overflow: hidden; /* 防止图片溢出 */
}

.similar-properties .row.g-0 .col-4 img {
    height: 120px;
    width: 100%;
    object-fit: cover;
    max-height: 120px; /* 确保不超过最大高度 */
}

.similar-properties .row.g-0 .col-4 .bg-light {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 120px; /* 确保占位符不超过最大高度 */
}

.similar-properties .row.g-0 .col-8 {
    height: 120px; /* 固定内容列高度 */
    overflow: hidden; /* 防止内容溢出 */
}

.similar-properties .card-body {
    padding: 1rem;
}

.similar-properties .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.similar-properties .card-title a {
    color: #333;
    transition: color 0.3s ease;
}

.similar-properties .card-title a:hover {
    color: #007bff;
}

@media (max-width: 768px) {
    /* 平板端优化 */
    .similar-properties .row.g-0 .col-4 img,
    .similar-properties .row.g-0 .col-4 .bg-light {
        height: 100px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .search-form {
        padding: 15px;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    /* 相似房源推荐移动端优化 */
    .similar-properties .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .similar-properties .card {
        height: auto; /* 移动端允许自适应高度 */
        min-height: 280px; /* 设置最小高度 */
    }
    
    .similar-properties .row.g-0 {
        flex-direction: column;
        height: 100%;
    }
    
    .similar-properties .row.g-0 .col-4,
    .similar-properties .row.g-0 .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .similar-properties .row.g-0 .col-4 {
        height: 200px; /* 固定图片区域高度 */
        overflow: hidden; /* 防止图片溢出 */
    }
    
    .similar-properties .row.g-0 .col-4 img {
        height: 200px;
        width: 100%;
        object-fit: cover;
        border-radius: 12px 12px 0 0;
        max-height: 200px; /* 确保不超过最大高度 */
    }
    
    .similar-properties .row.g-0 .col-4 .bg-light {
        height: 200px;
        border-radius: 12px 12px 0 0;
        max-height: 200px; /* 确保占位符不超过最大高度 */
    }
    
    .similar-properties .row.g-0 .col-8 {
        overflow: hidden; /* 防止内容溢出 */
    }
    
    .similar-properties .card-body {
        padding: 1rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 热门房源样式 */
.hot-properties .border-bottom:last-child {
    border-bottom: none !important;
}

.hot-properties .d-flex:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hot-properties img {
    transition: transform 0.3s ease;
}

.hot-properties .d-flex:hover img {
    transform: scale(1.05);
}

.hot-properties h6 a:hover {
    color: #007bff !important;
}



/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 消息提示样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination .page-link {
    border: none;
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 8px;
    color: #667eea;
    background: white;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: #667eea;
    color: white;
}

/* 徽章样式 */
.badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%) !important;
}