:root {
    --primary-color: #1a73e9;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-radius: 15px;
    --scroll-bg: #f8f8f8;
}

.products-section {
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--scroll-bg) 0%, #ffffff 100%);
}

.product-tabs {
    border: 2px solid #e3e8f1;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
    overflow: hidden;
    width: 100%;
}

/* 电脑端默认布局 */
.tab-nav {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--scroll-bg);
    border-bottom: 2px solid #e3e8f1;
    flex-wrap: wrap;
    position: relative;
}

/* 手机端滑动布局 */
@media (max-width: 768px) {
    .tab-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-right: 40px;
        min-width: calc(100% + 100px);
        margin: 0 -15px;
    }
    
    .tab-nav::-webkit-scrollbar {
        display: none;
    }
    
    .tab-nav::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, var(--scroll-bg), transparent);
        pointer-events: none;
    }
}

.mc-btn {
    background: none;
    border: 0;
    padding: 10px 20px;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition-base);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: max-content;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 4px;
    box-shadow: none !important;
}

.mc-btn.mc-active {
    color: var(--primary-color);
    transform: translateY(-2px);
    font-weight: 500;
}

.mc-btn:hover:not(.mc-active) {
    color: #444;
    background: rgba(0,0,0,0.03);
}

.mc-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 233, 0.2);
}

.tab-contents {
    height: 65vh;
    min-height: 500px;
    max-height: 800px;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
    background: var(--scroll-bg);
}

.tab-contents::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

.tab-contents::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid white;
}

.tab-contents:hover::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0.5rem;
}

.product-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    opacity: 0;
    animation: cardEntrance 0.6s ease-out forwards;
}

.product-card h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

@keyframes cardEntrance {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.product-card:hover {
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .mc-btn {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 140px;
        margin: 0;
    }
    
    .product-tabs {
        border-radius: 12px;
        margin-top: 1.5rem;
    }

    .tab-contents {
        height: 60vh;
        min-height: 400px;
        padding: 1rem;
    }

    .product-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card h3 {
        font-size: 1.1rem;
    }
}

.product-card {
    position: relative; 
    padding-top: 45px; 
}

.product-card .tag {
    position: absolute;
    right: -15px;
    top: -50px;
    width: 80px;
    height: 80px;
    z-index: 2;
    transition: var(--transition-base);
}

/* 调整标题位置 */
.product-card h2 {
    position: relative;
    padding-right: 40px; 
    margin-top: -25px; 
}

/* 适配移动端 */
@media (max-width: 768px) {
    .product-card {
        padding-top: 35px;
    }
    
    .product-card .tag {
        width: 80px;
        height: 80px;
        right: -15px;
        top: -45px;
    }
}