/*
Theme Name: Momo Theme
Theme URI: https://example.com/
Description: A simple WordPress theme with single column layout
Author: Vss
Author URI: https://example.com/
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: momo-theme
*/

/* iconfont Symbol 图标基础样式 */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
    display: inline-block;
}

/* 菜单图标样式 */
.menu a .icon {
    margin-right: -1px;
    width: 16px;
    height: 16px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    /* 左下角浅蓝渐变到中间，右上角浅绿渐变到中间 */
    background: linear-gradient(45deg, #e0f7fa 0%, #ffffff 50%, #e8f5e9 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    padding: 20px 0;
}

/* Weiyu Header Image Styles */
.weiyu-header-image {
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 8px;
}

/* Navigation Styles */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 导航栏融入背景，不使用卡片样式 */
    background: transparent;
    padding: 10px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    margin-left: 20px;
}

.menu a {
    text-decoration: none;
    color: #333;
    position: relative;
    padding-bottom: 5px;
}

/* 当前页面菜单项下划线高亮 */
.menu .current-menu-item a {
    color: #333;
}

.menu .current-menu-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #333;
    border-radius: 1px;
}

/* Main Content Styles */
main {
    padding: 20px 0;
}

/* Posts Grid - 不添加卡片样式，只针对单篇文章做圆角白色背景 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    /* 不添加卡片样式 */
}

.post-item {
    background-color: #fff;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.post-date {
    font-size: 12px;
    color: #666;
    margin-bottom: -1px;
}

/* 最新文章日期图标样式 */
.post-date .icon {
    width: 24px;
    height: 24px;
    margin-right: 2px;
    vertical-align: middle;
}

.post-title {
    font-size: 14px;
    font-weight: normal;
    color: #333;
    text-decoration: none;
}

/* Bookshelf Styles - 不添加卡片样式，针对单本书籍添加圆角白色背景 */
.bookshelf {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    /* 不添加卡片样式 */
}

.book-item {
    background-color: #fff;
    border-radius: 5px;
    padding: 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.book-cover img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.book-info {
    flex: 1;
}

.book-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: -1px;
}

.book-rating {
    color: #ff9800;
    margin-bottom: 4px;
}

.book-description {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Microblog Styles */
.microblog {
    margin-bottom: 20px;
}

.microblog-content {
    display: flex;
    gap: 15px;
    background-color: #fff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.microblog-info {
    flex: 1;
}

.author-info {
    margin-bottom: 10px;
}

.author-name {
    font-weight: bold;
    margin-right: 10px;
}

.post-time {
    font-size: 14px;
    color: #666;
}

.microblog-text {
    margin-bottom: 8px;
}

.image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
    max-width: 50%;
    position: relative;
}

/* 基础样式 - 所有图片都是正方形显示，圆角10px */
.image-grid img {
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    width: 100%;
}

/* 单张图片显示宽度的30% */
.image-grid[data-count="1"] {
    max-width: 30%;
}

/* 两张图片：一行两列等分显示 */
.image-grid[data-count="2"] {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

/* 3张图片：等分显示 */
.image-grid[data-count="3"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

/* 4张图片：两行两列等分显示 */
.image-grid[data-count="4"] {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
}

/* 5张图片：网格等分显示 */
.image-grid[data-count="5"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
}

/* 6张图片：两行三列等分显示 */
.image-grid[data-count="6"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
}

/* 7张图片：上下两行，上行三张等分，下行四张等分 */
.image-grid[data-count="7"] {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 5px;
}

/* 上行三张图片，每张占4列，等分显示 */
.image-grid[data-count="7"] img[data-index="0"] {
    grid-column: 1 / 5;
    width: 100%;
    aspect-ratio: 1;
}

.image-grid[data-count="7"] img[data-index="1"] {
    grid-column: 5 / 9;
    width: 100%;
    aspect-ratio: 1;
}

.image-grid[data-count="7"] img[data-index="2"] {
    grid-column: 9 / 13;
    width: 100%;
    aspect-ratio: 1;
}

/* 下行四张图片，每张占3列，等分显示 */
.image-grid[data-count="7"] img[data-index="3"] {
    grid-column: 1 / 4;
    grid-row: 2;
    width: 100%;
    aspect-ratio: 1;
}

.image-grid[data-count="7"] img[data-index="4"] {
    grid-column: 4 / 7;
    grid-row: 2;
    width: 100%;
    aspect-ratio: 1;
}

.image-grid[data-count="7"] img[data-index="5"] {
    grid-column: 7 / 10;
    grid-row: 2;
    width: 100%;
    aspect-ratio: 1;
}

.image-grid[data-count="7"] img[data-index="6"] {
    grid-column: 10 / 13;
    grid-row: 2;
    width: 100%;
    aspect-ratio: 1;
}

/* 8张图片：网格等分显示 */
.image-grid[data-count="8"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
}

/* 9张图片：三行三列等分显示 */
.image-grid[data-count="9"] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.comment-icon {
    /* 评论图标样式 */
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z'%3E%3C/path%3E%3C/svg%3E");
}

/* Footer Styles */
footer {
    padding: 20px 0;
    text-align: center;
    color: #666;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .posts-grid,
    .bookshelf {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .menu li {
        margin: 0 10px;
    }
}