/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 代码块样式 */
pre {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4a6cf7;
    text-decoration: none;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 2rem;
}

.nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav ul li a:hover {
    color: #4a6cf7;
}

/* 主要内容区域 */
.main {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.content-area {
    flex: 3;
    background-color: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 博客文章样式 */
.post {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-title a {
    text-decoration: none;
    color: #2c3e50;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #4a6cf7;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.date, .category {
    background-color: #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.post-excerpt p {
    margin-bottom: 1rem;
    color: #555;
}

.read-more {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #4a6cf7;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.read-more:hover {
    background-color: #3a5ae0;
}

/* 侧边栏样式 */
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.widget h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a6cf7;
    color: #2c3e50;
}

.widget p {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.6;
}

.recent-posts, .categories {
    list-style: none;
}

.recent-posts li, .categories li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.recent-posts li:last-child, .categories li:last-child {
    border-bottom: none;
}

.recent-posts a, .categories a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s ease;
}

.recent-posts a:hover, .categories a:hover {
    color: #4a6cf7;
}

.categories span {
    float: right;
    background-color: #ecf0f1;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* 底部样式 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer .container {
    text-align: center;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav ul li {
        margin: 0 0.5rem 0.5rem;
    }
    
    .main {
        flex-direction: column;
    }
    
    .content-area, .sidebar {
        width: 100%;
    }
    
    .post-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .content-area {
        padding: 1.5rem;
    }
    
    .nav ul li {
        margin: 0 0.25rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}