/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 首页头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 15px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 筛选条件样式 */
.filter-section {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
}

#filter-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}



.filter-item label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    text-align: center;
}

.filter-item select {
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    outline: none;
    text-align: center;
}

.filter-item select:focus {
    border-color: #667eea;
}

/* 房源列表样式 */
.house-list {
    padding: 15px;
}

.house-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

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

.house-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.price-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.house-info {
    padding: 15px;
}

.house-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.house-details {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.house-location {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
}

.house-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-price {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.house-type {
    background: #f0f2ff;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.back-to-top svg {
    transition: transform 0.2s ease;
}

.back-to-top:hover svg {
    transform: translateY(-1px);
}

/* 详情页头部样式 */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn, .share-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #667eea;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.back-btn:hover, .share-btn:hover {
    background-color: #f0f2ff;
}

.detail-header h1 {
    font-size: 18px;
    font-weight: 600;
}


/* 房源基本信息样式 */
.house-basic-info {
    padding: 20px 15px;
    background: white;
    border-bottom: 8px solid #f5f5f5;
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.total-price {
    font-size: 28px;
    font-weight: 700;
    color: #ff6b6b;
}

.unit-price {
    font-size: 14px;
    color: #666;
}

.house-basic-info .house-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.house-address {
    color: #666;
    font-size: 14px;
}

/* 详细属性样式 */
.house-details-section, .community-info {
    padding: 20px 15px;
    background: white;
    border-bottom: 8px solid #f5f5f5;
}

.house-details-section h3, .community-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.details-grid, .community-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #666;
    font-size: 14px;
}

.detail-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* 房源描述样式 */
.house-description {
    padding: 20px 15px;
    background: white;
    border-bottom: 8px solid #f5f5f5;
}

.house-description h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.house-description p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* 联系方式样式 */
.contact-section {
    padding: 20px 15px;
    background: white;
    position: sticky;
    bottom: 0;
    border-top: 1px solid #eee;
}

.contact-buttons {
    display: flex;
    gap: 15px;
}

.contact-btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

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

.call-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message-btn {
    background: #f0f2ff;
    color: #667eea;
    border: 1px solid #667eea;
}

.message-btn:hover {
    background: #667eea;
    color: white;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .filter-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .filter-item {
        gap: 6px;
    }
    
    .filter-item label {
        font-size: 12px;
    }
    
    .filter-item select {
        font-size: 12px;
        padding: 8px 6px;
        min-height: 36px;
    }
}

@media (max-width: 360px) {
    .filter-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .filter-item label {
        font-size: 11px;
    }
    
    .filter-item select {
        font-size: 11px;
        padding: 6px 4px;
        min-height: 32px;
    }
    
    .house-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .details-grid, .community-details {
        grid-template-columns: 1fr;
    }
    
    .price-section {
        flex-direction: column;
        gap: 5px;
    }
    
    .total-price {
        font-size: 24px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
    
    .filter-section {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .house-list {
        gap: 20px;
    }
}

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

.house-item {
    animation: fadeIn 0.5s ease forwards;
}

.house-item:nth-child(1) { animation-delay: 0.1s; }
.house-item:nth-child(2) { animation-delay: 0.2s; }
.house-item:nth-child(3) { animation-delay: 0.3s; }
.house-item:nth-child(4) { animation-delay: 0.4s; }

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}