/* 面包屑导航 */
.breadcrumb {
    background-color: transparent;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #3498db;
    font-weight: 500;
}

/* 视图切换按钮组样式 */
.btn-group.view-toggle {
    display: inline-flex !important;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-toggle .btn {
    position: relative;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-radius: 0 !important;
}

.view-toggle .btn:first-child {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
}

.view-toggle .btn:last-child {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    border-left: none;
}

.view-toggle .btn:hover {
    background-color: #f8f9fa;
    color: #212529;
    z-index: 2;
}

.view-toggle .btn.active {
    background-color: #3498db !important;
    border-color: #3498db !important;
    color: white !important;
    z-index: 3;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}

.view-toggle .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    z-index: 4;
    outline: none;
}

/* 分类标签 */
.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 15px;
    background-color: var(--category-color, #6c757d);
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-badge i {
    font-size: 0.7rem;
}

/* 推荐标签 */
.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 15px;
    background-color: #ffc107;
    color: #212529;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.featured-badge i {
    font-size: 0.7rem;
}

/* 图片容器 */
.card-img-container {
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.card-img-top {
    max-height: 140px;
    max-width: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
    padding: 10px;
}

.card:hover .card-img-top {
    transform: scale(1.08);
}

/* 网格视图卡片 */
#gridViewContent .card {
    height: 100%;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-radius: 10px !important;
    overflow: hidden;
    position: relative;
}

#gridViewContent .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

/* 列表视图样式 */
#listViewContent .list-group-item {
    border: 1px solid #e9ecef;
    border-radius: 8px !important;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    padding: 15px;
}

#listViewContent .list-group-item:hover {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 侧边栏卡片 */
.sidebar-card {
    border-radius: 10px !important;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar-card .card-header {
    font-weight: 600;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* 分页样式 */
.pagination {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.pagination .page-item.active .page-link {
    background-color: #3498db;
    border-color: #3498db;
    color: white;
}

.pagination .page-link {
    color: #3498db;
    border-radius: 5px !important;
    margin: 0 3px;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* 分类列表项 */
.category-list-item {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.category-list-item:last-child {
    border-bottom: none;
}

.category-list-item:hover {
    border-left-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
    text-decoration: none;
}

.category-list-item.active {
    border-left-color: #3498db;
    background-color: rgba(52, 152, 219, 0.15);
    color: #3498db;
    font-weight: 600;
}

.category-list-item .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 2rem;
}

/* 搜索高亮 */
.search-highlight {
    background-color: #fff3cd;
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #856404;
}

/* 分类统计徽章 */
.category-count-badge {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    vertical-align: middle;
    background-color: #6c757d;
    color: white;
    border-radius: 20px;
    margin-left: 10px;
    font-weight: 500;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin: 30px 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h4 {
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 500;
}

.empty-state p {
    color: #6c757d;
    max-width: 500px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* 伪静态URL提示 */
.rewrite-url-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 8px;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.rewrite-url-hint code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #495057;
}

.rewrite-url-hint .bi-link-45deg {
    color: #3498db;
    margin-right: 5px;
}

/* 推荐搜索词 */
.recommended-search .badge {
    background-color: #f8f9fa;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    font-weight: 500;
}

.recommended-search .badge:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
    text-decoration: none;
}

/* 搜索表单 */
.search-form .input-group {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
}

.search-form .form-control {
    border: 1px solid #dee2e6;
    border-right: none;
    padding: 0.75rem 1rem;
}

.search-form .form-control:focus {
    box-shadow: none;
    border-color: #3498db;
}

.search-form .btn {
    border: 1px solid #3498db;
    background-color: #3498db;
    padding: 0.75rem 1.25rem;
}

.search-form .btn:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 加载动画 */
.spinner-border.text-primary {
    color: #3498db !important;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* 卡片内容样式 */
.card-body h5.card-title {
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-body .card-text {
    line-height: 1.5;
    color: #6c757d;
    flex-grow: 1;
}

.card-body .btn-outline-primary {
    border-color: #3498db;
    color: #3498db;
    font-weight: 500;
    transition: all 0.3s ease;
}

.card-body .btn-outline-primary:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

/* 信息统计 */
.d-flex.justify-content-between.small.text-muted {
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}

/* 侧边栏特色推荐项 */
.list-group-item.border-0.py-3 {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    transition: background-color 0.2s ease;
}

.list-group-item.border-0.py-3:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.list-group-item.border-0.py-3:last-child {
    border-bottom: none !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-img-container {
        height: 140px;
    }
    
    .card-img-top {
        max-height: 110px;
    }
    
    .sidebar-card {
        margin-bottom: 15px;
    }
    
    .view-toggle .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .empty-state {
        padding: 60px 15px;
    }
    
    .category-count-badge {
        display: block;
        margin-top: 0.5rem;
        margin-left: 0 !important;
        width: fit-content;
    }
    
    .rewrite-url-hint {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

@media (max-width: 576px) {
    .card-img-container {
        height: 120px;
    }
    
    .card-img-top {
        max-height: 90px;
    }
    
    #listViewContent .row > div {
        padding: 0 5px;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .view-toggle .btn {
        flex: 1;
        max-width: 120px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .empty-state {
        padding: 40px 15px;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        margin: 0 2px;
    }
    
    .category-list-item {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .category-badge,
    .featured-badge,
    .btn.active,
    .category-list-item.active {
        border-width: 2px;
    }
    
    .card:hover {
        outline: 2px solid #3498db;
    }
}

/* 减少动画（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
    .card,
    .view-toggle .btn,
    .pagination .page-link,
    .category-list-item,
    .sidebar-card,
    .card-img-top,
    .animate-fade-in,
    #listViewContent .list-group-item {
        transition: none !important;
        animation: none !important;
    }
    
    .card:hover,
    #listViewContent .list-group-item:hover {
        transform: none !important;
    }
}