/* 文章卡片流布局样式 */

/* ==================== 容器布局 ==================== */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 工具栏 */
.articles-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.toolbar-left {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 0.5rem;
}

/* 排序选择器 */
.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-select:hover {
    border-color: #4CAF50;
}

/* 视图切换按钮 */
.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    background: #f5f5f5;
}

.view-btn.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

/* ==================== 卡片网格 ==================== */
.articles-grid {
    display: grid;
    gap: 1.5rem;
    transition: all 0.3s;
}

/* 列表视图 */
.articles-grid.list-view {
    grid-template-columns: 1fr;
}

/* 网格视图 */
.articles-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* ==================== 文章卡片 ==================== */
.article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 列表视图卡片 */
.list-view .article-card {
    flex-direction: row;
    min-height: 200px;
}

/* 卡片头部 */
.card-header {
    padding: 1rem 1.5rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #07C160 0%, #06AE56 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.author-name {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* 卡片封面 */
.card-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.list-view .card-cover {
    width: 300px;
    height: 100%;
    flex-shrink: 0;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .card-cover img {
    transform: scale(1.05);
}

/* 卡片内容 */
.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-view .card-excerpt {
    -webkit-line-clamp: 2;
}

/* 卡片标签 */
.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: #f0f0f0;
    color: #666;
    border-radius: 20px;
    font-size: 0.75rem;
    transition: all 0.3s;
}

.tag:hover {
    background: #4CAF50;
    color: #fff;
}

/* 卡片底部 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #999;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-item svg {
    width: 16px;
    height: 16px;
}

.card-date {
    font-size: 0.85rem;
    color: #999;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .articles-toolbar {
        flex-direction: column;
        gap: 1rem;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .articles-grid.grid-view {
        grid-template-columns: 1fr;
    }

    .list-view .article-card {
        flex-direction: column;
    }

    .list-view .card-cover {
        width: 100%;
        height: 200px;
    }

    .card-title {
        font-size: 1.1rem;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeInUp 0.5s ease;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.5;
}