/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 小清新主题色彩方案 */
:root {
    /* 品牌主色 - 清新绿 */
    --primary-color: #7ac79d; /* 清新绿色 */
    --primary-light: #a8e6cf; /* 浅绿色 */
    --primary-dark: #4d9e76; /* 深绿色 */
    
    /* 辅助色 */
    --accent-color: #6fc7b3; /* 清新蓝绿色 */
    --accent-light: #9fe6d6; /* 浅蓝绿色 */
    --accent-dark: #3b9e8a; /* 深蓝绿色 */
    
    /* 中性色 - 小清新主题色彩方案 */
    --bg-primary: #f9f9f9; /* 超浅灰白背景 */
    --bg-secondary: #ffffff; /* 白色背景 */
    --bg-tertiary: #f0f5f2; /* 浅绿色调背景 */
    --text-primary: #222222; /* 浅黑色主文本 */
    --text-secondary: #444444; /* 中浅黑色文本 */
    --text-tertiary: #666666; /* 浅黑色次要文本 */
    --border-color: rgba(122, 199, 157, 0.2); /* 绿色边框 */
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

header {
    background-color: var(--bg-secondary);
    color: var(--primary-dark);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 20px rgba(122, 199, 157, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(122, 199, 157, 0.2);
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    color: var(--text-secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.category {
    margin-bottom: 3rem;
}

.category h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(122, 199, 157, 0.15);
    border-color: var(--primary-color);
}

.product-image {
    height: 200px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.product-description {
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.product-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-details {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.view-details:hover {
    color: var(--accent-light);
    text-decoration: none;
    border-color: var(--primary-color);
    background-color: rgba(122, 199, 157, 0.1);
}

.category-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.option-btn {
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.option-btn:hover {
    background-color: rgba(122, 199, 157, 0.1);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.option-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(122, 199, 157, 0.3);
}

/* 产品详细信息样式 */
.product-full-details {
    padding: 0 1.5rem 1.5rem;
}

.detail-images {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.detail-images img {
    height: 200px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    transition: all 0.3s ease;
}

.detail-images img:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(122, 199, 157, 0.2);
}

.detail-specs h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.detail-specs ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.detail-specs li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    position: relative;
}

.detail-note {
    color: var(--accent-color);
    font-style: italic;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(122, 199, 157, 0.15);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-tertiary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
}

footer {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

/* 搜索功能样式 */
.search-container {
    text-align: center;
    margin-bottom: 2rem;
}

.search-input {
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    width: 200px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(122, 199, 157, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.search-button:hover {
    background-color: var(--primary-light);
    box-shadow: 0 0 10px rgba(122, 199, 157, 0.3);
}

/* 回到顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    transition: all 0.3s ease;
}

#back-to-top:hover {
    background-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(122, 199, 157, 0.3);
}

/* 图片预览模态框样式 */
#image-preview-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(255, 255, 255, 0.95);
}

/* 图片名称样式 */
.image-name {
    display: block;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--primary-dark);
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    .detail-images {
        flex-direction: column;
        align-items: center;
    }
    
    .detail-images img {
        width: 100%;
        height: auto;
        max-height: 250px;
    }
}

/* 定义浅黑色主题色彩方案 */
:root {
    /* 品牌主色 - 清新绿 */
    --primary-color: #7ac79d; /* 清新绿色 */
    --primary-light: #a8e6cf; /* 浅绿色 */
    --primary-dark: #4d9e76; /* 深绿色 */
    
    /* 辅助色 */
    --accent-color: #6fc7b3; /* 清新蓝绿色 */
    --accent-light: #9fe6d6; /* 浅蓝绿色 */
    --accent-dark: #3b9e8a; /* 深蓝绿色 */
    
    /* 中性色 - 浅黑色文本 */
    --bg-primary: #f9f9f9; /* 超浅灰白背景 */
    --bg-secondary: #ffffff; /* 白色背景 */
    --bg-tertiary: #f0f5f2; /* 浅绿色调背景 */
    --text-primary: #222222; /* 浅黑色主文本 */
    --text-secondary: #444444; /* 中浅黑色文本 */
    --text-tertiary: #666666; /* 浅黑色次要文本 */
    --border-color: rgba(122, 199, 157, 0.2); /* 绿色边框 */
}

/* 删除重复的墨绿色主题定义，使用上面的浅黑色主题 */

/* 修改阴影效果以匹配浅黑色主题 */
header {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.view-details:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.option-btn.active {
    box-shadow: 0 0 10px rgba(122, 199, 157, 0.3);
}

.detail-images img:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    box-shadow: 0 0 0 2px rgba(122, 199, 157, 0.1);
}

.search-button:hover {
    box-shadow: 0 0 10px rgba(122, 199, 157, 0.3);
}

#back-to-top:hover {
    box-shadow: 0 5px 15px rgba(122, 199, 157, 0.3);
}

/* 图片名称样式修改为浅黑色 */
.image-name {
    color: var(--text-primary);
}

/* 确保所有标题使用浅黑色 */
.product-info h3,
.detail-specs h4,
.category h2 {
    color: var(--text-primary);
}

/* 确保页脚文本使用中浅黑色 */
footer {
    color: var(--text-secondary);
}
