/* 探索页面专用样式 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --accent-color: #60a5fa;
    --background-color: #f8fafc;
    --card-background: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255,255,255,0.2);
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 15px -3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --text-primary: var(--primary-color);
    --text-secondary: #64748b;
}

body {
    background: var(--background-color);
    background-image:
        radial-gradient(at 40% 20%, rgba(37,99,235,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(96,165,250,0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(37,99,235,0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: #1e293b;
}

/* 推荐商品轮播区域样式 */
.featured-products-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.featured-products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,133.3C960,128,1056,96,1152,90.7C1248,85,1344,107,1392,117.3L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.section-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.carousel-controls {
    display: flex;
    gap: 1rem;
}

.carousel-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.carousel-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.featured-products-carousel {
    position: relative;
    z-index: 2;
}

.featured-products-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.featured-product-item {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.featured-product-item.active {
    display: block;
}

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

.featured-product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    min-height: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.featured-product-image {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.featured-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-product-image:hover img {
    transform: scale(1.05);
}

.featured-product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
}

.featured-product-placeholder i {
    font-size: 4rem;
}

.featured-product-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #333;
}

.featured-product-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.featured-product-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.featured-product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #333;
}

.featured-product-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.featured-product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.featured-sale-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff4757;
}

.featured-original-price {
    font-size: 1rem;
    color: #8b92a3;
    text-decoration: line-through;
}

.featured-product-actions {
    display: flex;
    gap: 1rem;
}

.featured-product-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.featured-product-btn:not(.secondary) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.featured-product-btn:not(.secondary):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.featured-product-btn.secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.featured-product-btn.secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.featured-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.featured-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-indicator.active {
    background: white;
    width: 30px;
    border-radius: 5px;
}



.compact-ads {
    margin-bottom: 2rem;
    border-radius: 15px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.compact-ads .carousel-inner {
    width: 100%;
    margin: 0;
    padding: 0;
}

.compact-ads .carousel-item {
    display: block;
    padding: 0;
    width: 100%;
}

.compact-ads .carousel-item a {
    width: 100%;
    display: block;
    line-height: 0;
}

.compact-ads .carousel-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.top-tags-section {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    text-align: center; /* 标签列表居中显示 */
}

.tags-container {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: inline-block; /* 使容器可以居中 */
}

.tags-container::-webkit-scrollbar {
    display: none;
}

.view-all-tag {
    display: inline-block;
    margin: 0 0.15rem;
    padding: 0.35rem 0.7rem;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.view-all-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.section-title {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.section-title i {
    color: #667eea;
    margin-right: 0.5rem;
}

.tag-item {
    display: inline-block;
    margin: 0 0.15rem;
    padding: 0.35rem 0.7rem;
    border-radius: 16px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.tag-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.tag-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    font-size: 0.65rem;
    margin-left: 0.3rem;
}

.hot-navs-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* 商品卡片样式 - 商城风格 */
.product-card {
    height: 420px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

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

.product-image-container {
    width: 100%;
    height: 220px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-image-placeholder {
    width: 100%;
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    position: relative;
}

.product-image-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.product-image-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

/* 商品标签/徽章 */
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 2;
}

.product-badge.discount {
    background: #ff4757;
    font-weight: bold;
}

/* 商品悬停覆盖层 */
.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.view-count {
    color: white;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-rating {
    color: #ffd700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-rating span {
    color: white;
    margin-left: 0.25rem;
}

/* 商品信息区域 */
.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: white;
}

/* 商品标签容器 */
.product-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    min-height: 24px; /* 确保有一致的高度 */
}

/* 商品标签样式 */
.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

/* 分类标签样式 */
.product-tag.category-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.product-tag.category-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

/* 品牌标签样式 */
.product-tag.brand-tag {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    box-shadow: 0 2px 4px rgba(240, 147, 251, 0.3);
}

.product-tag.brand-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(240, 147, 251, 0.4);
}

/* 标签图标样式 */
.product-tag i {
    font-size: 0.65rem;
    opacity: 0.9;
}

.product-category {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为两行 */
    -webkit-box-orient: vertical;
}

.product-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: var(--primary-color) !important;
}

.product-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.publisher, .brand {
    font-size: 0.75rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* 商品价格区域 */
.product-price {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff4757;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sale-price {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.sale-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.sale-price:hover::before {
    left: 100%;
}

.original-price {
    font-size: 0.9rem;
    color: #8b92a3;
    text-decoration: line-through;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
    background: rgba(139, 146, 163, 0.1);
    border-radius: 8px;
    position: relative;
}

.original-price::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b92a3;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* 免费价格样式 */
.product-price .sale-price[style*="免费"] {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

/* 商品操作按钮 */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.product-btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-btn.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border: 2px solid transparent;
}

.product-btn.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.product-btn.btn-primary:hover::before {
    left: 100%;
}

.product-btn.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.product-btn.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 按钮图标动画 */
.product-btn i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.product-btn:hover i {
    transform: scale(1.1);
}

/* 自定义4列布局 */
.col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
}

/* 确保移动端2列布局 - 全局规则 */
@media (max-width: 767.98px) {
    .col-lg-3.col-md-4.col-6 {
        flex: 0 0 auto;
        width: 50% !important;
        max-width: 50% !important;
    }
}

/* 按钮组样式 */
.button-group {
    white-space: nowrap; /* 防止按钮换行 */
}

.button-group .btn {
    min-width: auto; /* 让按钮宽度自适应 */
}

@media (max-width: 768px) {
    .featured-products-section {
        padding: 2rem 0;
    }
    
    .section-header {
        justify-content: center;
    }
    
    .featured-product-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .featured-product-image {
        flex: 0 0 auto;
        height: 200px;
    }
    
    .featured-product-content {
        padding: 1.5rem;
    }
    
    .featured-product-title {
        font-size: 1.2rem;
    }
    
    .featured-product-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .featured-product-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .featured-product-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .compact-ads {
        padding: 1.5rem;
    }
    
    .compact-ads .carousel-item img {
        height: auto;
    }
    
    .product-image-container {
        height: 180px; /* 移动端减小图片高度 */
    }
    
    .product-image-placeholder {
        height: 180px; /* 移动端减小占位符高度 */
    }
    
    .product-card {
        height: 360px; /* 移动端减小卡片总高度 */
    }
    
    .top-tags-section {
        padding: 0.8rem 0;
    }
    
    .product-title {
        font-size: 0.9rem;
        margin-top: 0.5rem;
        margin-bottom: 0.2rem;
        height: 2.5rem; /* 移动端调整标题高度 */
    }

    /* 移动端标签适配 */
    .product-tags {
        gap: 0.3rem;
        margin-bottom: 0.4rem;
    }

    .product-tag {
        padding: 0.2rem 0.5rem;
        font-size: 0.65rem;
    }

    .product-tag i {
        font-size: 0.6rem;
    }
    
    .product-price {
        font-size: 1rem; /* 移动端调整价格字体大小 */
    }
    
    .product-btn {
        padding: 0.5rem 0.8rem; /* 移动端调整按钮大小 */
        font-size: 0.8rem;
        border-radius: 20px;
    }

    .product-btn i {
        margin-right: 0.3rem;
        font-size: 0.75rem;
    }
    
    /* 移动端按钮优化 */
    .button-group {
        display: flex;
        justify-content: center;
        gap: 0.5rem; /* 按钮间距 */
        flex-wrap: nowrap; /* 禁止换行 */
    }
    
    .button-group .btn {
        flex: 0 0 auto; /* 不允许伸缩 */
        padding: 0.6rem 1.2rem; /* 稍微缩小按钮 */
        font-size: 0.9rem;
    }
    
    /* 移动端课本卡片调整为2列显示 */
    .col-lg-3.col-md-4.col-6 {
        flex: 0 0 auto;
        width: 50% !important; /* 移动端强制2列布局 */
        max-width: 50% !important;
    }
    
    /* 确保热门课本区域的2列布局 */
    .hot-navs-section .row .col-6 {
        width: 50% !important;
        max-width: 50% !important;
    }
    
    /* 移动端只显示前6个热门课本 */
    .hot-nav-item[data-index="6"],
    .hot-nav-item[data-index="7"],
    .hot-nav-item[data-index="8"],
    .hot-nav-item[data-index="9"] {
        display: none !important;
    }
}

/* 更小屏幕的适配 */
@media (max-width: 576px) {
    .button-group .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-reset {
        margin-right: 0.5rem !important;
    }
    

}
