/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 左侧边栏样式 */
.sidebar {
    width: 33.33%;
    max-width: 300px;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 20px;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.logo {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #34495e;
}

.logo h1 {
    font-size: 24px;
    font-weight: bold;
}

.main-nav {
    margin-top: 30px;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin-bottom: 15px;
}

.main-nav a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 18px;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    background-color: #34495e;
}

.sidebar-footer {
    margin-top: auto;
    text-align: center;
    font-size: 14px;
    padding: 20px 0;
}

/* 右侧内容区域样式 */
.content {
    width: calc(100% - 300px);
    margin-left: 300px; /* 与左侧边栏宽度一致 */
    padding: 30px;
    overflow-y: auto;
}

header {
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

header h2 {
    font-size: 28px;
    color: #2c3e50;
}

/* 文章列表样式 */
.posts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.post-card-content {
    padding: 20px;
}

.post-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.post-card p {
    color: #7f8c8d;
    margin-bottom: 15px;
}

.post-card .date {
    font-size: 14px;
    color: #95a5a6;
}

.post-card .read-more {
    display: inline-block;
    margin-top: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.post-card .read-more:hover {
    text-decoration: underline;
}

/* 文章页面样式 */
.article {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.article h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.article .meta {
    color: #95a5a6;
    margin-bottom: 30px;
    font-size: 14px;
}

.article-content {
    line-height: 1.8;
    width: 100%;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content h2 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: #2c3e50;
}

.article-content h3 {
    font-size: 20px;
    margin: 25px 0 15px;
    color: #2c3e50;
}

.article-content h4 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: #2c3e50;
}

.article-content pre {
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.article-content code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 20px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 4px solid #3498db;
    padding-left: 15px;
    margin-left: 0;
    margin-right: 0;
    color: #7f8c8d;
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

.article-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

.article-content th, .article-content td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.article-content th {
    background-color: #f2f2f2;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-width: none;
        height: auto;
        position: relative;
    }

    .content {
        width: 100%;
        margin-left: 0;
    }

    .posts-container {
        grid-template-columns: 1fr;
    }
}
