/* ============================================
   分类树样式 - 纯缩进区分层级
   ============================================ */

/* 分类树容器 */
.category-tree-wrapper {
    max-height: 600px;
    overflow-y: auto;
    margin-top: 5px;
}

/* 自定义滚动条 */
.category-tree-wrapper::-webkit-scrollbar {
    width: 6px;
}

.category-tree-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-tree-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.category-tree-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 分类树主容器 */
.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-tree li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 分类项父级 */
.category-item-parent {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 分类项 - 基础样式 */
.category-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    background: white;
    border-radius: 8px;
    margin: 2px 8px;
    position: relative;
}

/* 分类项悬停效果 */
.category-item:hover {
    background: #f8fafc;
    border-left-color: #667eea;
}

/* 当前激活的分类 */
.category-item.active {
    background: linear-gradient(90deg, #f0f2ff 0%, #ffffff 100%);
    border-left-color: #667eea;
}

.category-item.active .category-name {
    color: #667eea;
    font-weight: 600;
}

/* 展开/折叠按钮 */
.toggle-btn {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    margin-right: 8px;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

.toggle-btn i {
    font-size: 10px;
    color: #64748b;
}

/* 无子分类时的占位符 */
.toggle-placeholder {
    width: 32px;
    height: 24px;
    display: inline-block;
    flex-shrink: 0;
}

/* 分类信息区域 */
.category-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* 分类名称 */
.category-name {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
}

/* 分类数量徽章 */
.category-count {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* ============================================
   层级缩进 - 通过内边距区分
   ============================================ */

/* 一级分类 - 基础缩进16px，加粗深色 */
.category-tree > li > .category-item-parent > .category-item {
    background: #fafbfc;
    margin-bottom: 4px;
}

.category-tree > li > .category-item-parent > .category-item .category-name {
    font-weight: 600;
    color: #1e293b;
}

/* 二级分类 - 缩进26px，正常中色 */
.category-tree .sub-category .category-item-parent > .category-item {
    background: white;
}

.category-tree .sub-category .category-item-parent > .category-item .category-name {
    font-weight: 500;
    color: #334155;
}

/* 三级分类 - 缩进36px，正常浅色 */
.category-tree .sub-category .sub-category .category-item-parent > .category-item .category-name {
    font-weight: 400;
    color: #475569;
}

/* 四级分类 - 缩进46px，正常更浅 */
.category-tree .sub-category .sub-category .sub-category .category-item-parent > .category-item .category-name {
    font-weight: 400;
    color: #64748b;
    font-size: 13px;
}

/* 子分类列表容器 */
.sub-category {
    display: block;
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}

/* 子分类列表折叠状态 */
.sub-category.collapsed {
    display: none;
}

/* 展开/折叠按钮状态 */
.toggle-btn .fa-minus {
    color: #667eea;
}

.toggle-btn .fa-plus {
    color: #94a3b8;
}

/* 分类项之间的分割线 */
.category-item-parent:not(:last-child) > .category-item {
    border-bottom: 1px solid #f0f2f5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-item {
        padding: 6px 10px;
    }
    
    .category-name {
        font-size: 13px;
    }
    
    .toggle-btn {
        width: 22px;
        height: 22px;
        margin-right: 6px;
    }
    
    .toggle-placeholder {
        width: 28px;
    }
}