/* 文章列表页、分类页和搜索结果页的优化样式 */

/* 文章列表容器样式 */
.col-lg-8 {
    padding: 0 1rem;
}

/* 文章卡片布局优化 */
.article-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.45rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    overflow: visible;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding-bottom: 0;
    margin-top: 4px;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 文章标题样式 */
.article-title {
    margin: 0;
    padding: 1rem 1.25rem;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.article-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

/* 文章主体内容区 */
.article-main {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    padding: 1.25rem;
    padding-bottom: 1.05rem;
    position: relative;
}

/* 封面图容器样式 */
.article-cover {
    position: relative;
    height: 160px;
    overflow: hidden;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.article-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.3rem;
}

/* 右侧内容样式 */
.article-content {
    display: flex;
    flex-direction: column;
    padding-left: 1.25rem;
    min-height: 160px;
    position: relative;
    padding-bottom: 0;
}

/* 文章摘要样式 */
.article-excerpt {
    color: #718096;
    font-size: 0.925rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 文章元数据和操作区域 */
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.6rem;
    padding-bottom: 0.55rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0;
}

/* 文章元数据样式 */
.article-meta {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #a0aec0;
    gap: 1.25rem;
}

.article-meta .category,
.article-meta .views,
.article-meta .date {
    display: flex;
    align-items: center;
    color: inherit;
}

.article-meta i {
    margin-right: 0.25rem;
    opacity: 0.8;
}

.article-meta a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-meta a:hover {
    color: var(--primary-color);
}

/* 阅读全文链接 */
.read-more {
    font-size: 0.8125rem !important;
    color: var(--primary-color) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.35rem 0.75rem !important;
    background-color: transparent !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 0.25rem !important;
    z-index: 1 !important;
    position: relative;
}

.read-more i {
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.read-more:hover {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    text-decoration: none !important;
}

.read-more:hover i {
    transform: translateX(2px);
}

/* 阅读全文按钮容器 */
.read-more-wrapper {
    position: relative;
    margin-bottom: 0;
    display: inline-block;
    margin-top: -2px; /* 微调按钮位置 */
}

/* 暗色模式下的阅读全文链接 */
[data-theme="dark"] .read-more {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .read-more:hover {
    color: #fff !important;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* 暗色模式适配 */
[data-theme="dark"] .article-card {
    background-color: var(--bs-card-bg);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .article-title {
    border-bottom-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .article-cover {
    background-color: #2d3748;
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .article-title a {
    color: #e2e8f0;
}

[data-theme="dark"] .article-excerpt {
    color: #a0aec0;
}

[data-theme="dark"] .article-footer {
    border-top-color: rgba(255,255,255,0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.25rem;
        padding: 0.875rem 1rem;
        padding-bottom: 0.7rem; /* 减少标题底部内边距 */
    }

    .article-main {
        grid-template-columns: 1fr;
        padding: 0.85rem;
        padding-bottom: 0.85rem;
        gap: 0.8rem;
    }
    
    .article-content {
        padding-left: 0;
        min-height: auto;
        padding-bottom: 0;
    }

    .article-cover {
        margin-bottom: 0.25rem;
        height: 140px;
    }
    
    .article-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 4;
        margin-bottom: 0.6rem; /* 增加摘要底部外边距，给按钮留更多空间 */
        line-height: 1.5; /* 稍微减小行高 */
    }
    
    .article-footer {
        flex-wrap: wrap;
        gap: 0.8rem; /* 减少元素间距 */
        padding-top: 0.5rem; /* 再减少顶部内边距 */
        padding-bottom: 0.2rem;
        border-top-width: 1px; /* 确保边框宽度 */
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 0.6rem; /* 减少元素间距 */
        font-size: 0.75rem;
        width: 100%;
    }

    .read-more {
        margin-left: auto;
        padding: 0.25rem 0.6rem !important;
        font-size: 0.75rem !important;
        margin-bottom: 0.1rem; /* 添加底部外边距 */
    }

    .article-card {
        padding-bottom: 0;
        margin-bottom: 1.35rem;
    }
}

/* 无封面图时的样式 */
.article-card.no-cover .article-main {
    grid-template-columns: 1fr;
}

.article-card.no-cover .article-content {
    padding-left: 0;
}

/* 分页导航样式优化 */
.custom-pagination {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.custom-pagination .page-link {
    color: var(--primary-color);
    border-color: #e2e8f0;
    background-color: #fff;
    font-size: 0.9rem;
}

.custom-pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.custom-pagination .page-link:hover {
    background-color: #f8fafc;
    color: var(--primary-color-hover);
    border-color: #cbd5e0;
}

[data-theme="dark"] .custom-pagination .page-link {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
} 