/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Base ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.8;
    color: #333;
    background: #fff;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ===== Container ===== */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    padding: 16px 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.site-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}
.site-title:hover { text-decoration: none; }
.site-nav a {
    margin-left: 20px;
    font-size: 0.95rem;
    color: #555;
}
.site-nav a:hover { color: #2563eb; text-decoration: none; }

/* ===== Home ===== */
.home { padding: 40px 0; }
.home-description { color: #666; font-size: 1.05rem; margin-bottom: 32px; }
.recent-posts h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* ===== Post List ===== */
.post-list { padding: 30px 0; }
.post-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}
.post-item h2 { font-size: 1.25rem; margin-bottom: 6px; }
.post-item h3 { font-size: 1.1rem; margin-bottom: 4px; }
.post-date {
    font-size: 0.85rem;
    color: #999;
}
.post-summary {
    margin-top: 8px;
    color: #666;
    font-size: 0.95rem;
}

/* ===== Post Content ===== */
.post-content { padding: 40px 0; }
.post-header { margin-bottom: 32px; }
.post-header h1 { font-size: 1.6rem; margin-bottom: 12px; }
.post-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #999;
}
.tags a {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
    font-size: 0.8rem;
}
.tags a:hover { background: #e0e0e0; text-decoration: none; }
.post-body { line-height: 1.9; }
.post-body h2 { font-size: 1.4rem; margin: 32px 0 16px; }
.post-body h3 { font-size: 1.2rem; margin: 24px 0 12px; }
.post-body p { margin-bottom: 16px; }
.post-body ul, .post-body ol { margin: 16px 0; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}
.post-body pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
}
.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.post-body blockquote {
    border-left: 4px solid #ddd;
    padding: 12px 20px;
    margin: 20px 0;
    background: #fafafa;
    color: #555;
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.post-body th, .post-body td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    text-align: left;
}
.post-body th { background: #f5f5f5; }

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 16px;
    padding: 24px 0;
    justify-content: center;
}
.pagination a {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.pagination a:hover { background: #f5f5f5; text-decoration: none; }

/* ===== Footer ===== */
.site-footer {
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 40px;
}
.site-footer p { margin-bottom: 4px; }
.site-footer a { color: #666; }
.site-footer a:hover { color: #2563eb; }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav a { margin-left: 0; margin-right: 16px; }
    .post-header h1 { font-size: 1.4rem; }
}
