/**
 * 标签云和分类树样式
 *
 * 该CSS文件定义了标签云和分类树的样式，
 * 包括标签云的多级显示、分类树的层级结构等
 */

/* 标签云容器 */
.tag-cloud-container {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.6;
}

.tag-cloud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tag-cloud-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tag-cloud-actions {
    display: flex;
    gap: 10px;
}

.tag-cloud-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 300px;
    align-items: center;
}

.tag-item {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    font-weight: 500;
}

.tag-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.tag-item:hover::before {
    left: 100%;
}

.tag-item.level-0 {
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.tag-item.level-1 {
    font-size: 14px;
    background: #e3f2fd;
    color: #1976d2;
    border-color: #bbdefb;
}

.tag-item.level-2 {
    font-size: 15px;
    background: #e8f5e8;
    color: #388e3c;
    border-color: #c8e6c9;
}

.tag-item.level-3 {
    font-size: 16px;
    background: #fff3e0;
    color: #f57c00;
    border-color: #ffe0b2;
}

.tag-item.level-4 {
    font-size: 17px;
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
    font-weight: bold;
}

.tag-item.level-5 {
    font-size: 18px;
    background: #f3e5f5;
    color: #7b1fa2;
    border-color: #e1bee7;
    font-weight: bold;
}

.tag-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 分类树容器 */
.category-tree-container {
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.6;
}

.category-tree {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.category-tree ul {
    list-style: none;
    padding-left: 20px;
    margin: 0;
}

.category-tree li {
    margin: 5px 0;
    position: relative;
}

.category-tree .category-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.5;
}

.category-tree .category-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.category-tree .category-name {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

.category-tree .category-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    min-width: 24px;
    text-align: center;
}

.category-tree .toggle-icon {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.category-tree .category-icon {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* 标签和分类统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.stat-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tag-cloud {
        min-height: 400px;
    }
    
    .tag-item {
        margin: 6px;
    }
}