/* 子分类标签样式 */
.category-tabs-container {
    margin-bottom: 2rem !important;
    padding: 1.5rem !important;
    background: transparent !important; /* 去除白色背景 */
    border-radius: 8px !important;
    box-shadow: none !important; /* 去除阴影 */
}

/* 父分类标题样式 */
.parent-category-title {
    font-size: 18px !important; /* 与bootstrap h4默认字体大小保持一致 */
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 0 !important; /* 移除底部间距，让标题和链接在同一行 */
    padding-bottom: 0 !important;
    border-bottom: none !important; /* 去除分隔线 */
    display: flex !important;
    align-items: center !important;
    flex: 1 !important; /* 让标题占据剩余空间 */
}

/* 确保所有分类标题字体大小一致 */
.text-gray {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

/* 特别针对有子分类的分类标题 */
.category-tabs-container .text-gray {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
}

/* 强制覆盖所有可能的字体大小设置 */
h4.text-gray,
h4.parent-category-title,
.category-tabs-container h4,
.category-tabs-container .text-gray,
.category-tabs-container .parent-category-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.4 !important;
}

/* 移除调试样式，恢复正常外观 */

/* 确保子分类标签字体大小 */
.sub-category-tabs .sub-tab {
    font-size: 15px !important; /* 修改：从13px增加到15px */
    font-weight: 500 !important;
}

.parent-category-title i {
    font-size: 1.5rem !important;
    margin-right: 12px !important;
    /* 不修改图标颜色，保持原有样式 */
}

/* 子分类标签导航 - 长条形样式 */
.sub-category-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin-bottom: 1rem !important; /* 缩小底部间距 */
    padding: 0 !important;
    border-bottom: none !important; /* 去除分隔线 */
    background: #f8f9fa !important;
    border-radius: 25px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    justify-content: space-between !important; /* 确保子标签和更多标签分布在两端 */
    align-items: center !important;
}

/* 子标签包装器 */
.sub-tabs-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    align-items: center !important;
}

/* 当没有子分类时，让"所有分类工具"链接居中显示 */
.sub-tabs-wrapper:empty + .more-tabs {
    margin: 0 auto !important;
    border-left: none !important;
}

.sub-tab {
    display: inline-block !important;
    padding: 10px 18px !important; /* 稍微缩小内边距 */
    background: transparent !important;
    color: #6c757d !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    font-size: 15px !important; /* 修改：从13px增加到15px */
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
    user-select: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important; /* 根据内容自适应宽度，不平均分配 */
    text-align: center !important;
    position: relative !important;
    min-width: fit-content !important; /* 最小宽度适应内容 */
}

.sub-tab:hover {
    background: #e9ecef !important;
    color: #495057 !important;
    transform: none !important;
    box-shadow: none !important;
}

.sub-tab.active {
    background: #667eea !important;
    color: #fff !important;
    border-color: #667eea !important;
    box-shadow: none !important;
    position: relative !important;
}

/* 添加分隔线 */
.sub-tab:not(:last-child)::after {
    content: '' !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1px !important;
    height: 60% !important;
    background: #dee2e6 !important;
}

/* 更多标签样式 - 长条形样式 */
.more-tabs {
    display: inline-block !important;
    padding: 10px 18px !important; /* 与子分类标签保持一致 */
    background: transparent !important;
    color: #667eea !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    font-size: 13px !important; /* 与子分类标签保持一致 */
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    position: relative !important;
    min-width: fit-content !important; /* 最小宽度适应内容 */
    border-left: 1px solid #dee2e6 !important; /* 添加左边框分隔线 */
}

.more-tabs:hover {
    background: #667eea !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

/* 子分类内容区域 */
.sub-category-contents {
    position: relative !important;
}

.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

.tab-content.active {
    display: block !important;
}

/* 子分类标签导航样式（替代面包屑） */
.category-breadcrumb-container {
    margin-bottom: 1.5rem !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* 完全隐藏面包屑和重复标签 */
.parent-category-breadcrumb,
.category-breadcrumb-container {
    display: none !important;
}

.parent-category-breadcrumb {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 !important;
}

.parent-category-breadcrumb i {
    font-size: 1.2rem !important;
    margin-right: 8px !important;
    color: #667eea !important;
}

.parent-name {
    font-weight: 600 !important;
    color: #495057 !important;
    font-size: 18px !important; /* 确保字体大小与主标题一致 */
}

.breadcrumb-separator {
    margin: 0 8px !important;
    color: #adb5bd !important;
    font-size: 16px !important;
}

.child-name {
    font-weight: 600 !important;
    color: #667eea !important;
    font-size: 18px !important; /* 确保字体大小与主标题一致 */
}

/* 子分类标签样式 - 长条形样式 */
.sub-category-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin-top: 8px !important; /* 缩小与父分类的间距 */
    margin-bottom: 15px !important; /* 缩小底部间距 */
    padding: 0 !important;
    border: none !important; /* 去除所有边框 */
    border-bottom: none !important; /* 去除底部分隔线 */
    background: #f8f9fa !important;
    border-radius: 25px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.sub-tab {
    display: inline-block !important;
    padding: 10px 18px !important; /* 稍微缩小内边距 */
    background: transparent !important;
    color: #6c757d !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    font-size: 13px !important; /* 进一步缩小子分类字体，比父分类18px小 */
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: none !important;
    user-select: none !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important; /* 根据内容自适应宽度，不平均分配 */
    text-align: center !important;
    position: relative !important;
    min-width: fit-content !important; /* 最小宽度适应内容 */
}

.sub-tab:hover {
    background: #e9ecef !important;
    color: #495057 !important;
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.sub-tab.active {
    background: #667eea !important;
    color: #fff !important;
    border-color: #667eea !important;
    box-shadow: none !important;
    transform: none !important;
    position: relative !important;
}

/* 添加分隔线 */
.sub-tab:not(:last-child)::after {
    content: '' !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 1px !important;
    height: 60% !important;
    background: #dee2e6 !important;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .category-tabs-container {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .parent-category-title {
        font-size: 16px !important;
        margin-bottom: 1rem !important;
    }
    
    .parent-category-title i {
        font-size: 1.3rem !important;
        margin-right: 10px !important;
    }
    
    .sub-category-tabs {
        gap: 0 !important;
        margin-bottom: 1rem !important;
        flex-wrap: wrap !important;
    }
    
    .sub-tab {
        padding: 8px 12px !important;
        font-size: 12px !important; /* 进一步缩小子分类字体 */
        flex: 0 0 auto !important; /* 保持自适应宽度 */
    }
    
    .more-tabs {
        padding: 8px 12px !important;
        font-size: 12px !important; /* 与子分类标签保持一致 */
        margin-top: 8px !important;
        width: 100% !important;
        text-align: center !important;
        flex: 1 1 100% !important; /* 手机端占满宽度 */
        border-left: none !important; /* 手机端移除左边框 */
    }
    
    .category-breadcrumb-container {
        padding: 0.5rem 0.75rem !important;
    }
    
    .parent-category-breadcrumb {
        font-size: 0.9rem !important;
        flex-wrap: wrap !important;
    }
}

@media (max-width: 480px) {
    .category-header-with-link {
        gap: 8px !important;
    }
    
    .parent-category-title {
        font-size: 15px !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .parent-category-title i {
        margin-right: 8px !important;
    }
    
    .more-tabs-inline {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    
    .sub-tab {
        padding: 6px 10px !important;
        font-size: 12px !important; /* 进一步缩小子分类字体 */
    }
}

/* 强制显示更多标签 - 最高优先级 */
.more-tabs {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* 分类标题与链接的布局 */
.category-header-with-link {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 1rem !important;
    flex-wrap: nowrap !important;
    gap: 15px !important;
    justify-content: space-between !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* 内联的"所有分类工具"链接样式 */
.more-tabs-inline {
    display: inline-block !important;
    padding: 6px 14px !important;
    background: transparent !important;
    color: #667eea !important;
    text-decoration: none !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 1px solid #667eea !important;
    white-space: nowrap !important;
    position: relative !important;
    min-width: fit-content !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

.more-tabs-inline:hover {
    background: #667eea !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-header-with-link {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }
    
    .more-tabs-inline {
        padding: 6px 12px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
    }
    
    .parent-category-title {
        flex: 1 !important;
        min-width: 0 !important;
    }
}