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

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

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #007cba;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu li a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu li a:hover {
    color: #007cba;
}

.nav-menu li a.active {
    color: #007cba;
    font-weight: 600;
}

/* 主内容区域 */
.main {
    display: flex;
    gap: 30px;
    padding: 40px 0;
}

/* 文章列表 */
.content {
    flex: 1;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.post-list {
    display: grid;
    gap: 30px;
}

.post-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.post-header {
    padding: 20px;
}

.post-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 15px;
}

.post-excerpt {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 20px;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
}

.post-categories {
    display: flex;
    gap: 10px;
}

.post-category {
    background-color: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.post-category:hover {
    background-color: #e5e7eb;
}

.post-read-more {
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.post-read-more:hover {
    color: #006ba1;
    text-decoration: underline;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
}

.sidebar-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.sidebar-menu {
    list-style: none;
}

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

.sidebar-menu li a {
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: block;
    padding: 5px 0;
}

.sidebar-menu li a:hover {
    color: #007cba;
}

.sidebar-menu li a.active {
    color: #007cba;
    font-weight: 500;
}

/* 页脚 */
.footer {
    background-color: white;
    border-top: 1px solid #e5e7eb;
    padding: 40px 0;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #111827;
}

.footer-section p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links li a:hover {
    color: #007cba;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.pagination a.active {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* 文章详情页 */
.post-detail {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.post-detail-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.post-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 30px;
}

.post-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.post-detail-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 15px;
    color: #111827;
}

.post-detail-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: #111827;
}

.post-detail-content p {
    margin-bottom: 15px;
}

.post-detail-content ul,
.post-detail-content ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.post-detail-content li {
    margin-bottom: 5px;
}

/* 评论区 */
.comments-section {
    margin-top: 40px;
}

.comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.comment-form {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-button {
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-button:hover {
    background-color: #006ba1;
}

.comment-list {
    list-style: none;
}

.comment-item {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 500;
    color: #111827;
}

.comment-time {
    font-size: 12px;
    color: #6b7280;
}

.comment-content {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

/* 搜索框 */
.search-form {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s ease;
}

.search-button:hover {
    color: #007cba;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background-color: #f3f4f6;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: #007cba;
    color: white;
}