/**
 * 所有分类页面样式 - 按父级分组设计
 * 总宽度: 1280px
 */

/* ==================== 页面容器 ==================== */
.all-categories-page {
    min-height: calc(100vh - var(--header-height) - 100px);
    padding: 30px 0;
    background: #f5f7fa;
}

/* 页面标题 */
.page-header {
    max-width: 1280px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.page-header-inner {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.2);
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title i {
    color: #ffffff;
    margin-right: 12px;
    opacity: 0.9;
}

.page-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
}

/* ==================== 分类容器 ==================== */
.categories-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.categories-grouped {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 1280px;
    margin: 0 auto;
}

/* ==================== 父级分类组 ==================== */
.category-group {
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
    transition: box-shadow 0.3s;
}

.category-group:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 父级分类标题栏（蓝色渐变） */
.parent-category-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.parent-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3) 50%, transparent);
}

.parent-category-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 36px;
}

/* 子分类网格容器 - 每行4个 */
.child-categories-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 28px 24px;
    background: linear-gradient(to bottom, #fafbfc 0%, #f5f7fa 100%);
}

/* ==================== 子分类卡片 ==================== */
.child-category-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 20px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    min-width: 0;
}

.child-category-card:hover {
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.15);
    transform: translateY(-6px);
    border-color: #4a90e2;
}

.child-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: transform 0.3s;
}

.child-card-link:hover {
    transform: scale(1.02);
}

/* 子分类图标 */
.child-card-icon {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s;
}

.child-category-card:hover .child-card-icon {
    transform: scale(1.05);
}

.child-card-icon i {
    font-size: 40px;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.child-card-icon.has-custom-image {
    background: #f0f2f5;
}

.child-card-icon.has-custom-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* 子分类名称 */
.child-card-name {
    font-size: 17px;
    font-weight: 700;
    color: #202124;
    margin: 0 0 10px 0;
    text-align: center;
    line-height: 1.3;
}

.child-category-card:hover .child-card-name {
    color: #4a90e2;
}

/* 文章数量 */
.child-card-count {
    font-size: 14px;
    color: #80868b;
    margin: 0;
    font-weight: 500;
}

.child-card-count::before {
    content: '📝 ';
    opacity: 0.6;
}

/* 子分类关注按钮 */
.child-follow-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    color: #5f6368;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

.child-follow-btn i {
    font-size: 20px;
    transition: transform 0.3s;
}

.child-follow-btn:hover {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #ffffff;
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.4);
}

.child-follow-btn:hover i {
    transform: rotate(-90deg);
}

.child-follow-btn.following {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.child-follow-btn.following:hover {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #f44336;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.4);
    transform: scale(1.15) rotate(180deg);
}

.child-follow-btn:active {
    transform: scale(0.9);
}

/* ==================== 空状态 ==================== */
.no-categories-message {
    text-align: center;
    padding: 100px 20px;
    color: #9e9e9e;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.no-categories-message i {
    font-size: 80px;
    margin-bottom: 24px;
    opacity: 0.4;
    color: #4a90e2;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

.no-categories-message p {
    font-size: 20px;
    margin: 0;
    font-weight: 500;
    color: #5f6368;
}

/* ==================== Toast提示（保留原有样式） ==================== */
.toast-message,
.follow-toast,
.quick-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #4caf50;
    color: #ffffff;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    text-align: center;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1320px) {
    .categories-container {
        max-width: 100%;
    }
}

@media (max-width: 1320px) {
    .categories-grouped {
        width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 1024px) {
    .child-categories-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
    }
    
    .page-description {
        font-size: 14px;
    }
    
    .category-group {
        border-radius: 8px;
    }
    
    .parent-category-header {
        height: 32px;
    }
    
    .parent-category-header h2 {
        font-size: 14px;
        line-height: 32px;
    }
    
    .child-categories-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 20px 16px;
    }
    
    .child-card-icon {
        width: 70px;
        height: 70px;
        border-radius: 12px;
    }
    
    .child-card-icon i {
        font-size: 32px;
    }
    
    .child-card-name {
        font-size: 15px;
    }
    
    .child-follow-btn {
        width: 32px;
        height: 32px;
    }
    
    .child-follow-btn i {
        font-size: 18px;
    }
}

