/* 博客首页样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

/* PC端每行显示5个 */
@media (min-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 中等屏幕每行显示3-4个 */
@media (min-width: 768px) and (max-width: 1199px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.blog-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: 0.95em;
}

.blog-title {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #2c3e50;
    height: 90px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.blog-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    height: 100%;
}

.blog-title a:hover {
    color: #3498db;
}

.blog-excerpt {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
    flex: 1;
    min-height: 120px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* PC端样式调整 */
@media (min-width: 1200px) {
    .blog-card {
        min-height: 300px;
    }
    
    .blog-content {
        padding: 18px;
        font-size: 0.9em;
    }
    
    .blog-title {
        font-size: 1.05em;
        height: 80px;
        -webkit-line-clamp: 3;
    }
    
    .blog-excerpt {
        min-height: 110px;
        -webkit-line-clamp: 4;
    }
}

.blog-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #999;
}

.blog-date {
    display: flex;
    align-items: center;
}

.blog-date i {
    margin-right: 5px;
}

.blog-author {
    display: flex;
    align-items: center;
}

.blog-author i {
    margin-right: 5px;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.read-more:hover {
    background-color: #2980b9;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-posts h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    color: #999;
    border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}
