/*
Theme Name: Life
Theme URI: https://vss.plus
Description: A clean, single-column WordPress theme with a warm background color.
Author: Slin
Author URI: https://vss.plus
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: life
*/

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 16px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    background-color: #f5f5f5;
}

/* 导航菜单 */
header {
    background-color: #f5f5f5;
    padding: 20px 0 10px 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #e74c3c;
}

/* 最新文章样式 */
.latest-posts {
    margin: 15px 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.post-card {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    padding: 12px;
    border-radius: 4px;
}

/* 交替的渐变背景 */
.posts-grid .post-card:nth-child(odd) {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
}

.posts-grid .post-card:nth-child(even) {
    background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%);
}
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-date {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    display: block;
}

.post-title {
    font-size: 16px;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
}

.post-title:hover {
    color: #e74c3c;
}

/* 热门文章样式 */
.popular-posts {
    margin: 15px 0;
}

.split-card {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    border-radius: 4px;
}

/* 交替的渐变背景 */
.split-card:nth-child(odd) {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
}

.split-card:nth-child(even) {
    background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%);
}
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    min-height: 200px;
}

.split-card.reverse {
    flex-direction: row-reverse;
}

.card-image {
    width: 40%;
    background-size: cover;
    background-position: center;
}

.card-content {
    width: 60%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-content .post-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.card-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 微语模块样式 */
.micro-talks {
    margin: 15px 0;
}

.micro-card {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    padding: 20px;
    border-radius: 4px;
}

/* 交替的渐变背景 */
.micro-talks .micro-card:nth-child(odd) {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
}

.micro-talks .micro-card:nth-child(even) {
    background: linear-gradient(135deg, #e8e8e8 0%, #d8d8d8 100%);
}
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-image: url('https://pic.vss.plus/pianke/touxiang3.jpg');
    background-size: cover;
    flex-shrink: 0;
}

.micro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.micro-text {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* 12宫格图片样式 */
.micro-images {
    display: grid;
    gap: 6px;
    width: fit-content;
    margin-top: 10px;
}

/* 单张图片 */
.micro-images.single {
    grid-template-columns: 1fr;
}

.micro-images.single .micro-image {
    width: 240px;
    height: 240px;
}

/* 两张图片 */
.micro-images.double {
    grid-template-columns: repeat(2, 1fr);
}

.micro-images.double .micro-image {
    width: 220px;
    height: 220px;
}

/* 三张图片 */
.micro-images.triple {
    grid-template-columns: repeat(3, 1fr);
}

.micro-images.triple .micro-image {
    width: 180px;
    height: 180px;
}

/* 四张及以上图片 */
.micro-images.multi {
    grid-template-columns: repeat(4, 1fr);
}

.micro-images.multi .micro-image {
    width: 140px;
    height: 140px;
}

/* 图片通用样式 */
.micro-image {
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative; /* 为了支持覆盖层 */
    overflow: hidden;
}

/* 图片覆盖层样式 - 显示额外图片数量 */
.micro-image .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* 超过12张图片时，隐藏第13张及以后的图片 */
.micro-images .micro-image:nth-child(n+13) {
    display: none;
}

/* 超过12张图片时，在第12张图片上显示额外的数量 */
.micro-images .micro-image:nth-child(12) {
    position: relative;
}

.micro-images .micro-image:nth-child(12):after {
    content: attr(data-more);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* 手机端响应式设计 */
@media (max-width: 768px) {
    .micro-images.single .micro-image {
        width: 180px;
        height: 180px;
    }
    
    .micro-images.double .micro-image {
        width: 160px;
        height: 160px;
    }
    
    .micro-images.triple .micro-image {
        width: 120px;
        height: 120px;
    }
    
    /* 手机端改为3列显示，最多9张 */
    .micro-images.multi {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .micro-images.multi .micro-image {
        width: 100px;
        height: 100px;
    }
    
    /* 手机端只显示前9张 */
    .micro-images.multi .micro-image:nth-child(n+10) {
        display: none;
    }
    
    .micro-images.multi .micro-image:nth-child(9) {
        position: relative;
    }
    
    .micro-images.multi .micro-image:nth-child(9):after {
        content: attr(data-more);
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
    }
}

.micro-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
}

/* 文章详情页样式 */
.single-post {
    background: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
    padding: 30px;
    border-radius: 4px;
}
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
}

.single-post h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.3;
}

.single-post-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.single-post-content {
    line-height: 1.8;
    margin-bottom: 30px;
}

.single-post-content p {
    margin-bottom: 20px;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 4px;
}

/* 评论区域 */
.comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .split-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .card-image,
    .card-content {
        width: 100%;
    }
    
    .card-image {
        height: 200px;
    }
    
    .container {
        padding: 0 15px;
    }
}