/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 基础颜色定义 */
:root {
    --primary-color: #8B4513; /* 大地棕 */
    --secondary-color: #1E90FF; /* 科技蓝 */
    --light-color: #f4f4f4;
    --dark-color: #333;
    --success-color: #28a745;
    --error-color: #dc3545;
}

/* 图片加载失败占位符 */
img {
    display: block;
    width: 100%;
    height: auto;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar.scrolled {
    background-color: rgba(139, 69, 19, 0.9);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo .logo-img {
    max-height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}



/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: scale(1.05);
    background-color: #6b3b13;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 产品中心模块 */
.product-section {
    padding: 3rem 0;
    background-color: var(--light-color);
    margin-top: 4rem; /* 为固定导航栏预留空间 */
}

.category {
    margin-bottom: 3rem;
}

.category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 产品卡片网格布局 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* 产品卡片样式 */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* 产品图片样式 */
.product-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* 产品信息样式 */
.product-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 图片懒加载样式 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 90%;
        padding: 0 1rem;
    }
    
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-section {
        margin-top: 5rem;
    }
}

/* 小屏幕设备优化 */
@media (max-width: 480px) {
    .navbar .logo h1 {
        font-size: 1.2rem;
    }
    
    .product-section {
        margin-top: 5.5rem;
    }
    
    /* 产品卡片在小屏幕上的调整 */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .footer {
        padding: 1rem 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
        height: auto;
        min-height: 300px;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1.2rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .product-price {
        font-size: 1.1rem;
        margin: 0.8rem 0;
    }
    
    .product-meta {
        font-size: 0.85rem;
    }
    
    .product-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    
}