﻿/* 全局容器 */
.posts-container {
    padding: 2rem 0;
    min-height: 80vh;
}

/* 分类侧边栏 */
.category-card {
    border: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

    .category-card .card-header {
        background-color: #0d6efd;
        color: white;
        border-bottom: none;
        font-weight: 600;
        padding: 1rem 1.25rem;
    }

.category-list {
    padding: 0;
    margin: 0;
}

    .category-list .list-group-item {
        border: none;
        padding: 0.8rem 1.25rem;
        transition: all 0.3s ease;
        border-radius: 0 !important;
    }

        /* 激活态样式 */
        .category-list .list-group-item.active {
            background-color: #e7f1ff;
            border-left: 4px solid #0d6efd;
            color: #0d6efd;
            font-weight: 500;
        }

        .category-list .list-group-item:hover:not(.active) {
            background-color: #f8f9fa;
            padding-left: 1.5rem;
        }

    .category-list a {
        color: #333;
        text-decoration: none;
        font-size: 0.95rem;
        display: block;
        width: 100%;
    }

        .category-list a:hover {
            color: #0d6efd;
        }

/* 帖子列表卡片 */
.posts-card {
    border: none;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

    .posts-card .card-header {
        background-color: #f8f9fa;
        border-bottom: 1px solid #eee;
        padding: 1rem 1.25rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .posts-card .card-header h5 {
            margin: 0;
            font-weight: 600;
            color: #212529;
        }

    .posts-card .btn-primary {
        font-size: 0.85rem;
        padding: 0.375rem 0.75rem;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

        .posts-card .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
        }

/* 帖子表格样式 */
.posts-table {
    font-size: 0.9rem;
    margin-bottom: 0;
}

    .posts-table th {
        border-top: none;
        color: #666;
        font-weight: 500;
        padding: 1rem;
        background-color: #f8f9fa;
    }

    .posts-table td {
        padding: 1rem;
        vertical-align: middle;
        border-color: #f0f0f0;
    }

    .posts-table tr:hover {
        background-color: #f8f9fa;
    }

.post-title a {
    color: #212529;
    text-decoration: none;
    font-weight: 500;
}

    .post-title a:hover {
        color: #0d6efd;
        text-decoration: underline;
    }

/* 空数据提示 */
.empty-alert {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 3rem 2rem;
    text-align: center;
    font-size: 1rem;
    margin: 1rem;
}

    .empty-alert i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        color: #adb5bd;
    }

/* 统计数字徽章 */
.stat-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 10rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.view-count {
    background-color: #e7f5ff;
    color: #4dabf7;
}

.comment-count {
    background-color: #f0f8fb;
    color: #3bc9db;
}

.like-count {
    background-color: #fff5f5;
    color: #f76707;
}

/* 搜索关键词高亮 */
.keyword-highlight {
    color: #dc3545;
    font-weight: 600;
}

/* 🔥 核心：统一用户头像样式（和首页/详情页一致） */
.user-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    background-color: rgb(38, 142, 217) /* #0d6efd*/;
    overflow: hidden;
}

    .user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    .user-avatar span {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

/* 帖子元信息（作者/分类/时间） */
.post-card-meta {
    font-size: 13px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-author {
    color: #0d6efd;
    font-weight: 500;
}

.meta-split {
    color: #dee2e6;
    font-size: 12px;
}

/* 最后更新信息 */
.post-card-update {
    font-size: 12px;
    color: #4b525396;
    padding-left: 2px;
}

/* 帖子统计信息（阅读/评论/点赞） */
.post-card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* 适配统计徽章，新增图标间距 */
.stat-badge i {
    font-size: 11px;
    margin-right: 3px;
}

/* 卡片式帖子列表容器 */
.post-card-list {
    width: 100%;
}

/* 单个帖子卡片项 */
.post-card-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

/* 鼠标悬停效果，保留原有风格 */
.post-card-item:hover {
    background-color: #f8f9fa;
}

/* 卡片式头像放大优化 */
.post-card-item .user-avatar {
    width: 66px;
    height: 66px;
    font-size: 22px;
    border: 2px solid #f5f5f5;
}

/* 右侧帖子内容区（自动填充剩余宽度） */
.post-card-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出时挤压头像 */
}

/* 帖子标题 */
.post-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

    .post-card-title a {
        color: #212529;
        text-decoration: none;
    }

        .post-card-title a:hover {
            color: #0d6efd;
            text-decoration: underline;
        }

/* 响应式适配 */
@media (max-width: 768px) {
    .posts-table th:nth-child(4), .posts-table td:nth-child(4) {
        display: none;
    }

    .category-card {
        margin-bottom: 1.5rem;
    }

    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* 移动端头像适配 */
    .post-card-item {
        padding: 14px 16px;
        gap: 14px;
    }

    .post-card-item .user-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .posts-table .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .post-card-title {
        font-size: 15px;
    }

    .post-card-meta {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .post-card-stats {
        gap: 6px;
    }

    .stat-badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.75rem;
    }
}
