/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部样式 */
header {
    background-color: #4CAF50;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.back-link {
    position: absolute;
    left: 20px;
    top: 20px;
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.back-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 容器样式 */
.container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    gap: 20px;
}

/* 分类导航样式 */
.category-nav {
    width: 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: fit-content;
}

.category-nav h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

.category-nav ul {
    list-style: none;
}

.category-nav-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-nav-item:hover {
    background-color: #f0f0f0;
}

.category-nav-item.active {
    background-color: #4CAF50;
    color: white;
}

/* 主内容样式 */
main.content {
    flex: 1;
    min-width: 0;
}

/* 分类样式 */
.category {
    margin-bottom: 40px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* 商品列表样式 */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-item a {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 15px;
}

.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 4px;
}

.product-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.product-item p {
    font-size: 14px;
    color: #666;
}

/* 商品详情样式 */
.product-detail {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-detail h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #4CAF50;
}

.product-detail h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.product-desc {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

/* 图片画廊样式 */
.image-gallery {
    margin-top: 20px;
}

.main-image {
    margin-bottom: 20px;
}

.main-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.thumbnails img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.thumbnails img:hover {
    opacity: 0.8;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-radius: 8px 8px 0 0;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .category-nav {
        width: 100%;
    }
    
    .category-nav ul {
        display: flex;
        overflow-x: auto;
        gap: 10px;
    }
    
    .category-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .product-item img {
        height: 150px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .back-link {
        font-size: 14px;
        padding: 3px 8px;
    }
}