/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 容器样式 */
.main {
    padding: 40px 0;
    background-color: #fff;
}

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

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-3,
.col-md-9 {
    padding: 0 15px;
}

.col-md-3 {
    flex: 0 0 24%;
    max-width: 24%;
}

.col-md-9 {
    flex: 0 0 calc(76% - 20px);
    max-width: calc(76% - 20px);
    margin-left: 20px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

/* 侧边栏样式 */
.sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
    padding: 0;
}

.sidebar > * {
    background: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 10px;
}

.author-info {
    text-align: center;
    margin-bottom: 30px;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    border: 3px solid #f0f0f0;
}

.author-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.author-bio {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.nav-menu {
    margin-top: 20px;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    display: block;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #f0f0f0;
    color: #333;
}

/* 内容区样式 */
.content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 文章列表样式 */
.post {
    margin-bottom: 20px; /* 减小间隔 */
}

/* 文章头部布局 */
.post-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

/* 博主头像 */
.author-avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.author-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 标题和分类区域 */
.post-title-section {
    flex: 1;
}

.post-title {
    font-size: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #f3e5f5;
    color: #8e24aa;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    font-weight: normal;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-title a:hover {
    color: #007bff;
}

/* 文章摘要 */
.post-excerpt {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: #666;
    padding-left: 65px;
}

/* 文章图片九宫格 */
.post-images-grid {
    margin: 20px 0 20px 65px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 40%;
}

/* 移除冗余的图片样式，因为在.image-item中已经定义了完整的图片样式 */

.image-item {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background-color: #f5f5f5;
}

.image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

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

/* 文章底部信息 */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 65px;
    margin-top: 15px;
    font-size: 14px;
}

.post-date {
    color: #999;
}

.read-more {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #0056b3;
    text-decoration: underline;
}

.comment-link {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-link:hover {
    color: #007bff;
}

/* 分页样式 */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    list-style: none;
}

.pagination li {
    margin: 0 5px;
}

.pagination a,
.pagination span {
    display: block;
    padding: 8px 15px;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination .active span {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

/* 页脚样式 */
.footer {
    background-color: #fff;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

.footer-info p {
    margin-bottom: 10px;
    color: #666;
}

.footer-info a {
    color: #007bff;
    text-decoration: none;
}

.footer-info a:hover {
    text-decoration: underline;
}

/* 侧边栏额外组件样式 */
.category-list,
.tag-cloud {
    margin-top: 30px;
}

.list-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.category-list ul {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    background-color: #f0f0f0;
    color: #333;
}

.count {
    font-size: 12px;
    color: #999;
}

.tag-cloud .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    background-color: #f5f5f5;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background-color: #007bff;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .col-md-3,
    .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
    }
    
    .sidebar {
        margin-bottom: 30px;
        position: relative;
        top: 0;
    }
    
    /* 文章列表响应式调整 */
    .post-header {
        flex-wrap: wrap;
    }
    
    .author-avatar-small {
        width: 40px;
        height: 40px;
    }
    
    .post-title {
        font-size: 18px;
    }
    
    .post-excerpt {
        padding-left: 55px;
        font-size: 14px;
    }
    
    .post-images-grid {
        margin-left: 55px;
        width: 70%; /* 在平板设备上稍宽一些 */
    }
    
    .post-footer {
        font-size: 12px;
        color: #666;
        margin-left: 55px;
    }
    
    @media (max-width: 480px) {
        .post-images-grid {
            grid-template-columns: repeat(2, 1fr);
            margin-left: 55px;
            width: 80%; /* 在手机设备上宽度调整 */
        }
        
        .post-title {
            font-size: 16px;
        }
        
        .category-tag {
            font-size: 11px;
            padding: 1px 6px;
        }
    }
}