/* =====================================================
   Post List - 币安风格样式
   使用币安主题 CSS 变量，保持与主题一致
   ===================================================== */

/* 使用币安全局 CSS 变量，保持与主题一致
   主题颜色定义：
   - 主色调（币安黄）: --primary: #F0B90B
   - 主色调深色: --primary-dark: #D9A441
   - 主色调浅色: --primary-light: #FFD93D
   - 背景主色: --bg-dark: #0B0E11
   - 背景次色: --bg-header: #1A1D22
   - 背景卡片: --bg-card: rgba(240, 185, 11, 0.03)
   - 文字主色: --text-light: #f0f0f0
   - 文字次色: --text-gray: #848E9C
   - 文字muted: --text-muted: #5A6370
*/

.post-list {
    /* 映射到币安主题变量 */
    --primary-color: var(--primary, #F0B90B);
    --primary-dark: var(--primary-dark, #D9A441);
    --accent-color: var(--primary, #F0B90B);

    /* 背景色 */
    --bg-primary: var(--bg-dark, #0B0E11);
    --bg-secondary: var(--bg-card, rgba(240, 185, 11, 0.03));
    --bg-tertiary: var(--theme-black-lighter, #2A2D32);

    /* 边框色 */
    --border-color: var(--border-light, rgba(240, 185, 11, 0.1));
    --border-light: var(--border-medium, rgba(240, 185, 11, 0.2));

    /* 文字色 */
    --text-primary: var(--text-light, #f0f0f0);
    --text-secondary: var(--text-gray, #848E9C);
    --text-muted-custom: var(--text-muted, #5A6370);

    /* 阴影 - 币安风格 */
    --shadow-sm: 0 2px 4px rgba(240, 185, 11, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(240, 185, 11, 0.15);
    --shadow-lg: 0 10px 15px -3px rgba(240, 185, 11, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(240, 185, 11, 0.25);

    /* 币安发光阴影 */
    --neon-shadow-sm: 0 0 10px rgba(240, 185, 11, 0.2);
    --neon-shadow-md: 0 0 20px rgba(240, 185, 11, 0.3);
    --neon-shadow-lg: 0 0 30px rgba(240, 185, 11, 0.4);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* 字体 */
    --font-family-base: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* 容器基础样式 */
    display: block;
    width: 100%;
    padding: clamp(2rem, 4vw, 4rem) 0;
    background: var(--bg-primary);
}

/* 主容器布局 */
.post-list .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

/* 顶部标题区域 */
.section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.category-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.category-desc {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* 文章网格区域 */
.articles-area {
    min-width: 0;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.5rem, 3vw, 2rem);
}

/* 文章卡片 - 币安风格 */
.article-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: var(--neon-shadow-md);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* 文章图片 */
.article-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* 文章内容 */
.article-content {
    padding: clamp(1.25rem, 2.5vw, 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-title {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

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

.article-excerpt {
    font-size: clamp(0.875rem, 1.5vw, 0.9375rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.article-date {
    font-size: clamp(0.75rem, 1.2vw, 0.8125rem);
    color: var(--text-muted-custom);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-date::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* 加载动画 */
.post-list {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 网格动画延迟 */
.article-grid > .article-card:nth-child(1) { animation-delay: 0.1s; }
.article-grid > .article-card:nth-child(2) { animation-delay: 0.2s; }
.article-grid > .article-card:nth-child(3) { animation-delay: 0.3s; }
.article-grid > .article-card:nth-child(4) { animation-delay: 0.4s; }
.article-grid > .article-card:nth-child(5) { animation-delay: 0.5s; }
.article-grid > .article-card:nth-child(6) { animation-delay: 0.6s; }

/* 响应式设计 */
@media (max-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .post-list {
        padding: clamp(1.5rem, 3vw, 2rem) 0;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .post-list .container {
        padding: 0 1rem;
    }
    
    .article-content {
        padding: 1.25rem;
    }
}

/* 暗色模式优化 */
@media (prefers-color-scheme: dark) {
    .post-list {
        background: var(--bg-primary);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .article-card:hover {
        transform: none;
        transition: none;
    }
    
    .article-image img,
    .article-card:hover .article-image img {
        transform: none;
        transition: none;
    }
    
    .post-list,
    .article-grid > .article-card {
        animation: none;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .article-card:active {
        transform: scale(0.98);
    }
    
    .article-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .article-card:hover .article-image img {
        transform: none;
    }
    
    .article-card:hover .article-title {
        color: var(--text-primary);
    }
}

/* 打印样式 */
@media print {
    .post-list {
        background: white;
        color: black;
    }
    
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}