/* 文章页面专用样式 */

/* 主容器 */
.articles-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 200px);
}

/* 页面头部 */
.articles-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.articles-title {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #53ff8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.articles-subtitle {
    font-size: 1.2rem;
    color: #9ca3af;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* 分类筛选 */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(83, 255, 138, 0.3);
}

.filter-btn.active {
    background: #53ff8a;
    color: #000000;
    border-color: #53ff8a;
    font-weight: 600;
}

/* 加载占位符 */
.loading-placeholder {
    text-align: center;
    padding: 4rem 0;
    color: #9ca3af;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(83, 255, 138, 0.3);
    border-top: 3px solid #53ff8a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 文章网格 - 强制4列布局 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    /* 确保CSS优先级 */
    width: 100% !important;
}

/* 文章卡片 */
.article-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(83, 255, 138, 0.3);
}

/* 文章特色图片 */
.article-featured-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image {
    transform: scale(1.05);
}

.article-card:hover .article-icon {
    transform: scale(1.1);
    opacity: 1;
    text-shadow: 0 0 30px rgba(83, 255, 138, 0.5);
}

/* 默认文章图标 */
.article-icon {
    font-size: 4rem;
    color: #53ff8a;
    opacity: 0.8;
    text-shadow: 0 0 20px rgba(83, 255, 138, 0.3);
    transition: all 0.3s ease;
}

/* 文章信息 */
.article-info {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.article-excerpt {
    font-size: 0.9rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-category {
    background: rgba(83, 255, 138, 0.2);
    color: #53ff8a;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-author {
    color: #9ca3af;
    font-size: 0.8rem;
}

.article-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
}

/* 分页控件 */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-info {
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(83, 255, 138, 0.3);
}

.pagination-btn.active {
    background: #53ff8a;
    color: #000000;
    border-color: #53ff8a;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 强制网格布局 - 桌面端至少4列 */
@media (min-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 2rem !important;
    }
}

@media (min-width: 1600px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
        gap: 2rem !important;
    }
}

/* 中等屏幕 - 确保至少3列 */
@media (min-width: 900px) and (max-width: 1199px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
        gap: 1.5rem !important;
    }
}

/* 小屏幕平板 - 2列 */
@media (min-width: 600px) and (max-width: 899px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

/* 默认布局强制设置 */
@media (min-width: 1000px) {
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 1.5rem !important;
        display: grid !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .articles-container {
        padding: 1rem;
    }
    
    .articles-title {
        font-size: 2rem;
    }
    
    .articles-subtitle {
        font-size: 1rem;
    }
    
    .category-filter {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        display: grid !important;
    }
    
    .article-info {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .article-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .pagination-buttons {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .articles-header {
        margin-bottom: 2rem;
        padding: 1rem 0;
    }
    
    .articles-title {
        font-size: 1.75rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        display: grid !important;
    }
    
    .article-card {
        margin: 0 -0.5rem;
    }
    
    .category-filter {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .filter-btn {
        min-width: 120px;
    }
}