.category-main {
    min-height: calc(100vh - 160px);
    padding: 2rem;
    background: var(--bg-gradient);
}

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

/* 搜索区域样式 */
.search-section {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(126, 87, 255, 0.2);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(126, 87, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
    font-size: 1.2rem;
}

.search-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: var(--gradient-primary);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 过滤区域样式 */
.filter-section {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
}

/* 排序区域样式 */
.sort-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(126, 87, 255, 0.1);
}

.sort-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sort-options {
    display: flex;
    gap: 0.8rem;
    background: rgba(126, 87, 255, 0.05);
    padding: 0.5rem;
    border-radius: 12px;
}

.sort-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.sort-btn:hover {
    color: var(--primary-color);
    background: rgba(126, 87, 255, 0.1);
}

.sort-btn.active {
    color: white;
    background: var(--gradient-primary);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

/* 结果信息样式 */
.result-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 无结果样式 */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 商品网格样式 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

/* 响应式样式 */
@media screen and (max-width: 768px) {
    .category-main {
        padding: 1rem;
    }

    .search-section {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    /* 修改分类过滤区域样式 */
    .filter-section {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;  /* 防止换行 */
        scrollbar-width: none;  /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
        white-space: nowrap;
        padding: 0.5rem;
    }

    .filter-section::-webkit-scrollbar {
        display: none;  /* Chrome, Safari, Opera */
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;  /* 防止按钮被压缩 */
        margin-right: 0.5rem;  /* 按钮间距 */
    }

    /* 修改排序区域样式 */
    .sort-section {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        margin: 0.5rem 0;
        background: var(--card-bg);
        border: 1px solid rgba(126, 87, 255, 0.1);
        border-radius: 12px;
    }

    .sort-options {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        white-space: nowrap;
        padding: 0.4rem;
        margin-left: 0.5rem;
        background: rgba(126, 87, 255, 0.05);
        border-radius: 10px;
    }

    .sort-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .sort-btn.active {
        background: var(--gradient-primary);
        color: white;
    }

    .result-info {
        font-size: 0.9rem;
        white-space: nowrap;
        margin: 0;
    }

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

/* 超小屏幕适配 */
@media screen and (max-width: 375px) {
    .filter-btn, .sort-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .result-info {
        font-size: 0.85rem;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .category-main {
        background: var(--bg-gradient);
    }

    .search-box .search-input {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(126, 87, 255, 0.2);
        color: var(--light-color);
    }

    .search-box .search-input:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(126, 87, 255, 0.2);
    }

    .search-icon {
        color: var(--text-secondary);
    }

    .filter-btn {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
        border: 1px solid rgba(126, 87, 255, 0.2);
    }

    .filter-btn:hover {
        background: rgba(126, 87, 255, 0.1);
    }

    .filter-btn.active {
        background: var(--gradient-primary);
        color: white;
        border: none;
    }

    .sort-section {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(126, 87, 255, 0.2);
    }

    .sort-options {
        background: rgba(126, 87, 255, 0.1);
    }

    .sort-btn:hover {
        background: rgba(126, 87, 255, 0.15);
    }

    .sort-btn.active {
        background: var(--gradient-primary);
    }

    .result-info {
        color: var(--text-secondary);
    }

    .no-results {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-secondary);
    }

    .no-results i {
        color: var(--primary-color);
        opacity: 0.7;
    }

    .product-grid {
        background: transparent;
    }

    /* 商品卡片深色模式 */
    .product-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(126, 87, 255, 0.2);
    }

    .product-card:hover {
        background: rgba(255, 255, 255, 0.08);
        box-shadow: var(--shadow-lg);
    }

    .product-card h3 {
        color: var(--text-primary);
    }

    .product-card .description {
        color: var(--text-secondary);
    }

    .product-card .price {
        color: var(--text-primary);
    }

    .product-card .original-price {
        color: var(--text-tertiary);
    }

    .product-card .tag {
        background: rgba(126, 87, 255, 0.1);
        color: var(--primary-color);
        border: 1px solid rgba(126, 87, 255, 0.2);
    }

    .product-card .rating {
        color: var(--text-secondary);
    }

    .product-card .stock-info {
        color: var(--text-secondary);
    }

    .add-to-cart {
        background: var(--gradient-primary);
        color: white;
    }

    .add-to-cart:hover {
        box-shadow: 0 4px 15px rgba(126, 87, 255, 0.3);
    }

    .favorite-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(126, 87, 255, 0.2);
    }

    .favorite-btn:hover {
        background: rgba(126, 87, 255, 0.1);
    }

    .favorite-btn.active {
        background: var(--gradient-primary);
        border: none;
    }

    .favorite-btn i {
        color: var(--text-secondary);
    }

    .favorite-btn.active i {
        color: white;
    }
} 