* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.navbar nav a {
    margin-left: 2rem;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.navbar nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* 主要内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.posts-container {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

/* 文章卡片 */
.post-card {
    border-bottom: 1px solid #eee;
    padding: 2rem 0;
    transition: transform 0.3s;
}

.post-card:last-child {
    border-bottom: none;
}

.post-card:hover {
    transform: translateX(5px);
}

.post-card h2 {
    font-size: 1.75rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

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

.post-card h2 a:hover {
    color: #667eea;
}

.post-meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.post-excerpt {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.post-tag {
    padding: 0.3rem 0.8rem;
    background: #ecf0f1;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.post-tag:hover {
    background: #667eea;
    color: #fff;
}

.read-more {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border: 2px solid #667eea;
    border-radius: 4px;
    transition: all 0.3s;
}

.read-more:hover {
    background: #667eea;
    color: #fff;
}

/* 文章详情页样式 */
.post-detail {
    max-width: 100%;
}

.post-detail h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    line-height: 1.3;
}

.post-detail .post-meta {
    padding: 1rem 0;
    border-top: 2px solid #eee;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
}

/* 文章内容样式 */
.post-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #444;
}

.post-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-left: 4px solid #667eea;
    padding-left: 1rem;
}

.post-content h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #34495e;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.post-content ul, .post-content ol {
    margin: 1rem 0 1rem 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 4px;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th, .post-content td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
}

.post-content th {
    background: #667eea;
    color: #fff;
}

.post-content tr:nth-child(even) {
    background: #f8f9fa;
}

/* 代码块样式 */
.post-content pre {
    background: #282c34;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-content pre code {
    color: #abb2bf;
}

.post-content p code {
    background: #f4f4f4;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    color: #e83e8c;
    font-size: 0.9rem;
}

/* 代码高亮 */
.highlight {
    background: #282c34;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.highlight pre {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    padding: 0.7rem 0;
    border-bottom: 1px solid #eee;
    transition: padding-left 0.3s;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li:hover {
    padding-left: 0.5rem;
}

.widget ul li a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.widget ul li a:hover {
    color: #667eea;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud a {
    padding: 0.4rem 1rem;
    background: #ecf0f1;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-2px);
}

/* 搜索框 */
.search-form {
    display: flex;
}

.search-form input {
    flex: 1;
    padding: 0.7rem;
    border: 2px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.95rem;
}

.search-form input:focus {
    outline: none;
    border-color: #667eea;
}

.search-form button {
    padding: 0.7rem 1.5rem;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #5568d3;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.pagination a, .pagination span {
    padding: 0.6rem 1.2rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* 响应式 */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .navbar h1 {
        font-size: 1.3rem;
    }
    
    .navbar nav a {
        margin-left: 1rem;
        padding: 0.3rem 0.7rem;
        font-size: 0.9rem;
    }
    
    .post-card h2 {
        font-size: 1.4rem;
    }
    
    .post-detail h1 {
        font-size: 1.8rem;
    }
}