/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn:hover {
    background-color: #34495e;
}

/* 头部样式 */
.header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 24px;
    color: #2c3e50;
}

.contact-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.contact-info a {
    color: #34495e;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-info a i {
    color: #2980b9;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('../images/hero-bg.jpg') center/cover no-repeat;
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* 产品展示区域 */
.product-gallery {
    padding: 80px 0;
}

.product-gallery h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 30px;
    color: #2c3e50;
}

/* 品牌筛选器 */
.brand-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #2980b9;
    color: white;
    border-color: #2980b9;
}

.filter-btn:hover:not(.active) {
    border-color: #2980b9;
    color: #2980b9;
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* 防止图片加载时抖动 */
    aspect-ratio: 1/1;
    background-color: #f0f0f0;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-brand {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.product-count {
    color: #7f8c8d;
    font-size: 14px;
}

/* 联系我们区域 */
.contact-section {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.contact-section h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 30px;
    color: #2c3e50;
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.contact-card {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.contact-card i {
    font-size: 36px;
    color: #2980b9;
    margin-bottom: 20px;
}

.contact-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.contact-card p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
}

/* 图片模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    padding: 20px;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #bbb;
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.nav-btn {
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.nav-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .hero-content h2 {
        font-size: 28px;
    }
    
    .product-gallery h2, .contact-section h2 {
        font-size: 24px;
    }
    
    .modal-nav {
        padding: 0 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* 图片懒加载样式 */
.product-img.loading {
    background: #f0f0f0 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%23cccccc" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>') center no-repeat;
}