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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    font-size: 32px;
    color: #ff6700;
    font-weight: bold;
    margin: 0;
}

.nav {
    display: none;
    /* 隐藏首页按钮 */
}

.nav a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
    color: #ff6700;
}

.search {
    display: flex;
}

.search input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px 0 0 24px;
    outline: none;
    width: 250px;
    font-size: 14px;
}

.search button {
    padding: 12px 24px;
    background-color: #ff6700;
    color: white;
    border: none;
    border-radius: 0 24px 24px 0;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.search button:hover {
    background-color: #f25807;
}

/* Banner样式 */
.banner {
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.banner-item {
    text-align: center;
    color: white;
}

.banner-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 24px;
    opacity: 0.9;
}

/* 分类导航 */
.category-nav {
    padding: 20px 0 30px;
    background-color: #fff;
    margin-bottom: 30px;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.category-item {
    text-align: center;
    padding: 10px 15px;
    margin: 0 5px 8px 0;
    background-color: #f8f8f8;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    display: inline-block;
    font-size: 14px;
    min-width: 80px;
}

.category-item.active {
    background-color: #ff6700;
    color: white;
    border-color: #ff6700;
}

@media (hover: hover) and (pointer: fine) {
    .category-item:hover {
        background-color: #e0e0e0;
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
}

.category-item:active {
    background-color: #ff6700 !important;
    color: white !important;
    border-color: #ff6700 !important;
}

/* 针对触摸设备的临时激活状态 */
.category-item.touch-active {
    background-color: #ff6700;
    color: white;
    border-color: #ff6700;
}

/* 确保激活状态优先于悬停状态 */
.category-item.active:not(.touch-active) {
    background-color: #ff6700;
    color: white;
    border-color: #ff6700;
}

.category-item h3 {
    font-size: 14px;
    margin: 0;
    font-weight: normal;
}

/* 商品区域 */
.products {
    padding: 40px 0;
    background-color: #fff;
    margin-bottom: 40px;
}

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

.product-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

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

.product-description {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.price-current {
    font-size: 20px;
    color: #ff6700;
    font-weight: bold;
}

.price-original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.product-tags {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 3px;
    background-color: #ff6700;
    color: white;
}

.tag.new {
    background-color: #4caf50;
}

/* 底部 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

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

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search input {
        width: 150px;
    }

    .banner-content h2 {
        font-size: 32px;
    }

    .banner-content p {
        font-size: 18px;
    }

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

    /* 针对移动设备的分类项样式 */
    .category-item {
        touch-action: manipulation;
    }
}
