/* css/style.css */
:root {
    --primary-color: #FF9F43; /* 活力橙 */
    --secondary-color: #54A0FF; /* 智慧蓝 */
    --text-color: #333;
    --bg-color: #f9f9f9;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 15px;
}

.price {
    color: #ff4757;
    font-size: 1.2rem;
    font-weight: bold;
}

/* 购买按钮 */
.btn-buy {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
}

.btn-buy:hover {
    background-color: #e67e22;
}

/* 弹窗样式 (PC端二维码) */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 300px;
}

.close-modal {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
}

/* 产品列表页布局 */
.product-list-page {
    display: flex;
    gap: 2rem;
    padding-top: 2rem;
}

.filter-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #333;
}

.filter-group label {
    display: block;
    margin-bottom: 0.3rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

/* 产品卡片样式 */
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-info {
    padding: 1rem;
}

.card-title {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

.age-badge {
    background: #e0f7fa;
    color: #006064;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.btn-buy-small {
    width: 100%;
    padding: 0.5rem;
    background: #ff9800;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-buy-small:hover {
    background: #f57c00;
}

.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* 移动端适配 */
@media (max-width: 768px) {
     .nav-links {
        display: none; /* 简化处理，实际项目可做汉堡菜单 */
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-list-page {
        flex-direction: column;
    }
    
    .filter-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filter-group {
        margin-bottom: 0;
        flex: 1;
        min-width: 120px;
    }
}
 