* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(to right, #ff9000, #ff5000);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 20px 0 0 20px;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    padding: 10px 25px;
    background: #ff5000;
    border: none;
    border-radius: 0 20px 20px 0;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.search-bar button:hover {
    background: #e64800;
}


    background: rgba(255,255,255,0.3);
}

    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* 分类导航 */
.category-nav {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.category-nav .container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 20px;
    border: 1px solid #ff5000;
    background: white;
    color: #ff5000;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background: #ff5000;
    color: white;
}

/* 商品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 30px 0;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f9f9f9;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.product-price {
    color: #ff5000;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-price::before {
    content: '¥';
    font-size: 14px;
}

.product-sales {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.product-shop {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.shop-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

    width: 100%;
    padding: 10px;
    background: linear-gradient(to right, #ff9000, #ff5000);
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
    margin-top: 10px;
    border-radius: 20px;
}

    opacity: 0.9;
}

/* 购物车弹窗 */
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

    display: flex;
}

    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
}

.close-btn:hover {
    color: #333;
}

    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

    flex: 1;
}

    font-size: 14px;
    margin-bottom: 5px;
}

    color: #ff5000;
    font-weight: bold;
}

    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

    text-align: center;
    color: #999;
    padding: 40px 0;
}

    padding: 20px;
    border-top: 1px solid #eee;
}

.total {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #ff5000;
}

    width: 100%;
    padding: 15px;
    background: linear-gradient(to right, #ff9000, #ff5000);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
}

    opacity: 0.9;
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-title {
        font-size: 12px;
        height: 32px;
    }

    .product-price {
        font-size: 16px;
    }
}

/* 立即购买按钮 */
.buy-now-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(to right, #ff9000, #ff5000);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.buy-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 80, 0, 0.3);
}
