/* 探索页面专用样式 */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0 2rem 0;
    margin-bottom: 2rem;
}

.search-section .display-5 {
    margin-top: 1.5rem;
}

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

.search-form .form-label {
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.search-form .form-select,
.search-form .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.search-form .form-select:focus,
.search-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-reset {
    background: #6c757d;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #5a6268;
    transform: translateY(-2px);
    color: white;
}

.stats-info {
    padding: 0.5rem 0;
    min-height: 44px; /* 与按钮高度匹配 */
}

.stats-info small {
    line-height: 1.5;
    color: #666 !important;
    white-space: nowrap;
}

.stats-info strong {
    color: #333;
}



.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-bottom: 3rem;
}

.nav-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

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

.nav-screenshot-container {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.nav-screenshot {
    width: 100%;
    height: auto; /* 等比例缩放 */
    display: block;
    transition: transform 0.3s ease;
}

.nav-card:hover .nav-screenshot {
    transform: scale(1.05);
}

.nav-screenshot-placeholder {
    aspect-ratio: 16/9; /* 设置默认宽高比 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    position: relative;
}

.view-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 2;
}

.nav-card .card-body {
    padding: 1rem;
}

.nav-card .card-title {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0;
    height: 1.4rem; /* 单行高度 */
    overflow: hidden;
    white-space: nowrap; /* 单行显示 */
    text-overflow: ellipsis; /* 超出显示省略号 */
}

.nav-card .card-title a {
    color: #333 !important; /* 黑色字体 */
    text-decoration: none;
}

.nav-card .card-title a:hover {
    color: #667eea !important; /* 悬停时显示主题色 */
}

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

/* 确保移动端2列布局 - 全局规则 */
@media (max-width: 767.98px) {
    .col-lg-2-4.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) {
    .search-form {
        padding: 1.5rem;
    }
    
    /* 移动端搜索表单优化 */
    .search-form .row.g-3.mb-3 {
        margin-bottom: 1rem !important; /* 减少行间距 */
    }
    
    .search-form .form-label {
        margin-bottom: 0.3rem; /* 减少标签间距 */
        font-size: 0.9rem;
    }
    
    .search-form .form-select,
    .search-form .form-control {
        padding: 0.6rem 0.8rem; /* 稍微减少内边距 */
        font-size: 0.9rem;
    }
    
    .compact-ads {
        padding: 1.5rem;
    }
    
    .compact-ads .carousel-item img {
        height: auto;
    }
    
    .nav-screenshot-container {
        /* 移动端也使用等比例缩放 */
    }
    
    .nav-screenshot-placeholder {
        aspect-ratio: 16/9; /* 移动端保持相同宽高比 */
    }
    
    .top-tags-section {
        padding: 0.8rem 0;
    }
    
    .nav-card .card-title {
        font-size: 0.9rem;
    }
    
    /* 移动端按钮优化 */
    .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-2-4.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;
    }
}

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

}
