/*
Theme Name: Blog Theme B
Description: 一个简洁的三栏博客主题，左侧个人介绍，中间内容，右侧搜索和推荐
Version: 1.0
Author: Your Name
*/

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

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

.container {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 0;
    min-height: 100vh;
}

/* 左侧边栏样式 */
.sidebar-left {
    background: #f7f7f7;
    padding: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.profile-avatar {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 0;
}

.avatar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e0e0e0;
}

.profile-avatar img {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid white;
    border-radius: 50%;
    z-index: 2;
}

.profile-info {
    padding: 50px 30px 0px 30px;
}

.profile-info h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.5em;
}

.profile-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* 联系信息样式 */
.profile-contact {
    margin-top: 15px;
    text-align: left;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #666;
}

.contact-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: #666;
}

.contact-item span {
    flex: 1;
}

/* 菜单分割线样式 */
.menu-separator {
    height: 1px;
    background-color: #ddd;
    margin: 20px 30px;
}

.profile-menu {
    padding: 0 30px 30px 30px;
}

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

.profile-menu li {
    margin-bottom: 5px;
}

.profile-menu a {
    display: block;
    padding: 5px 0;
    color: #000;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    margin-left: 15px;
}

.profile-menu a i {
    color: #000;
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.profile-menu a:hover,
.profile-menu a.current-menu-item {
    background-color: #3498db;
    color: white;
    border-left-color: #2980b9;
    transform: translateX(5px);
}

/* 主内容区域 */
.main-content {
    background: white;
    padding: 30px 30px 0 30px;
    min-height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
}


/* 页脚样式 */
.main-footer {
    background: transparent;
    text-align: center;
    padding: 30px 0;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

.main-footer a {
    color: #3498db;
    text-decoration: none;
}

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

/* 文章网格布局 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 00px 0 30px 0;
}

.post-card {
    background: #fafafa;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0;
    position: relative;
}

.post-card:hover {
    transform: translateY(-2px);
    border-color: #3498db;
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* 无图片占位符 */
.post-thumbnail.no-image {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
    font-size: 14px;
    text-align: center;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: center;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.post-meta {
    color: #888;
    font-size: 0.85em;
}

.post-meta .post-date {
    font-size: 0.8em;
}

.post-meta .post-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    padding: 4px 10px;
    font-size: 14px;
    z-index: 3;
}

.post-meta .post-category a {
    color: #666;
    text-decoration: none;
}

.post-meta .post-category a:hover {
    color: #3498db;
}

.post-meta-bottom {
    color: #888;
    font-size: 0.8em;
    margin-bottom: 12px;
    text-align: center;
}

.post-meta-bottom .post-date {
    font-size: 0.85em;
}

.post-excerpt {
    color: #666;
    line-height: 1.5;
    font-size: 0.95em;
}

/* 右侧边栏样式 */
.sidebar-right {
    background: #f7f7f7;
    padding: 30px 20px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background: transparent;
    padding: 20px 0;
    border: none;
}

.widget h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.1em;
}

/* 搜索表单 */
.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #3498db;
}

.search-form button {
    padding: 10px 16px;
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-form button:hover {
    background: #2980b9;
}

/* 随机文章列表 */
.random-posts ul {
    list-style: none;
}

.random-posts li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.random-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.random-posts li i {
    color: #888;
    margin-right: 8px;
    font-size: 0.9em;
}

.random-posts a {
    color: #555;
    text-decoration: none;
    font-size: 0.95em;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.random-posts a:hover {
    color: #3498db;
}

.random-posts a:hover i {
    color: #3498db;
}

/* 分类列表 */
.categories ul {
    list-style: none;
}

.categories li {
    margin-bottom: 8px;
}

.categories a {
    color: #555;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.categories a i {
    color: #888;
    margin-right: 8px;
    font-size: 0.9em;
}

.categories a:hover {
    color: #3498db;
}

.categories a:hover i {
    color: #3498db;
}

.category-count {
    float: right;
    background: #e0e0e0;
    color: #666;
    padding: 2px 8px;
    font-size: 0.8em;
}

/* 单页面样式 */
.single-post {
    line-height: 1.8;
}

.single-post h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.2em;
    line-height: 1.3;
    text-align: center;
}

/* 单篇文章页面样式 */
.single-post {
    width: 100%;
    margin: 0;
}

.single-post .post-header {
    margin-bottom: 30px;
    text-align: center;
}

.single-post .post-meta {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
    color: #666;
}

.single-post .post-meta span {
    margin: 0 15px;
    font-size: 0.9em;
}

.single-post .post-meta i {
    margin-right: 5px;
    color: #999;
}

.single-post .post-meta a {
    color: #3498db;
    text-decoration: none;
}

.single-post .post-meta a:hover {
    text-decoration: underline;
}


.single-post .post-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
}

.single-post .post-content h1,
.single-post .post-content h2,
.single-post .post-content h3,
.single-post .post-content h4,
.single-post .post-content h5,
.single-post .post-content h6 {
    margin: 30px 0 15px 0;
    color: #2c3e50;
}

.single-post .post-content p {
    margin-bottom: 20px;
}

.single-post .post-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.single-post .post-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

.single-post .post-content code {
    background: #f8f8f8;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.single-post .post-content pre {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

/* 文章导航样式 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
    max-width: 45%;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation a {
    display: block;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 5px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s ease;
}

.post-navigation a:hover {
    background: #3498db;
    color: white;
}

/* 页面链接样式 */
.page-links {
    margin: 30px 0;
    text-align: center;
}

.page-links a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background: #f8f8f8;
    border-radius: 3px;
    text-decoration: none;
    color: #555;
}

.page-links a:hover {
    background: #3498db;
    color: white;
}

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

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

/* 手机端页眉样式 */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
}

.mobile-header .mobile-menu-btn {
    background: transparent;
    color: #333;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s ease;
}

.mobile-header .mobile-menu-btn:hover {
    color: #3498db;
}

.mobile-header .site-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    flex: 1;
}

.mobile-header .mobile-search-btn {
    background: transparent;
    color: #333;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.3s ease;
}

.mobile-header .mobile-search-btn:hover {
    color: #3498db;
}

/* 手机端搜索框 */
.mobile-search-box {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 999;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-search-box.active {
    transform: translateY(0);
}

.mobile-search-box .search-form {
    display: flex;
    gap: 10px;
}

.mobile-search-box .search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.mobile-search-box .search-form input[type="search"]:focus {
    border-color: #3498db;
}

.mobile-search-box .search-form button {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.mobile-search-box .search-form button:hover {
    background: #2980b9;
}

/* 手机端侧边栏覆盖层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    /* 显示手机端页眉 */
    .mobile-header {
        display: block;
    }
    
    /* 显示手机端搜索框 */
    .mobile-search-box {
        display: block;
    }
    
    /* 隐藏菜单分隔符 */
    .menu-separator {
        display: none;
    }
    
    /* 隐藏右侧边栏 */
    .sidebar-right {
        display: none;
    }
    
    /* 左侧边栏手机端样式 */
    .sidebar-left {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1001;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar-left.active {
        left: 0;
    }
    
    /* 文章页导航全宽 */
    .post-navigation .nav-previous, 
    .post-navigation .nav-next {
        max-width: 100%;
    }
    
    .post-navigation {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .post-navigation a {
        max-width: 100%!important;
    }
    
    /* 容器布局调整 */
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    
    .main-content {
        order: 1;
        min-height: 100vh;
        padding: 80px 15px 30px 15px; /* 为页眉留出空间，减少左右边距 */
    }
    
    /* 手机端文章网格 - 2列布局 */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* 减少间距 */
        margin: 0 0 30px 0;
    }
    
    /* 手机端文章卡片样式优化 */
    .post-card {
        font-size: 14px; /* 减小基础字体 */
    }
    
    .post-card .post-thumbnail {
        height: 120px; /* 减小图片高度 */
    }
    
    .post-card .post-content {
        padding: 12px; /* 减少内边距 */
    }
    
    .post-card .post-title {
        font-size: 14px; /* 减小标题字体 */
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .post-card .post-meta .post-category {
        font-size: 11px; /* 减小分类标签字体 */
        padding: 2px 6px;
        top: 6px;
        right: 6px;
    }
    
    .post-card .post-meta-bottom {
        font-size: 11px; /* 减小元数据字体 */
        margin-bottom: 8px;
    }
    
    .post-card .post-excerpt {
        font-size: 12px; /* 减小摘要字体 */
        line-height: 1.4;
        /* 限制摘要显示行数 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 单篇文章页面手机端优化 */
    .single-post h1 {
        font-size: 1.6em; /* 减小文章标题字体 */
        margin-bottom: 15px;
    }
    
    .single-post .post-meta span {
        margin: 0 8px; /* 减少间距 */
        font-size: 0.8em;
    }
    
    .single-post .post-content {
        font-size: 1em; /* 调整正文字体 */
        line-height: 1.6;
    }
}

/* 分页样式 */
.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    text-decoration: none;
    color: #555;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .current {
    background: #3498db;
    color: white;
}

/* 归档页面头部样式 */
.archive-header {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e0e0e0;
}

.archive-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.archive-description {
    color: #666;
    line-height: 1.6;
}

/* 搜索页面头部样式 */
.search-header {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid #e0e0e0;
    text-align: center;
}

.search-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.search-header p {
    color: #666;
    margin: 5px 0;
}

/* 旧的菜单分隔符样式 - 已被新样式替代 */
.profile-menu .menu-separator {
    margin: 20px 0 10px;
    padding: 8px 15px;
    background: #f0f0f0;
    color: #888;
    font-size: 0.9em;
    font-weight: bold;
    border: 1px solid #e0e0e0;
    cursor: default;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 打印样式 */
@media print {
    .sidebar-left,
    .sidebar-right {
        display: none;
    }
    
    .container {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
