/* ============================
   默认主题样式 - Default Theme
   ============================ */

/* ── Reset & Base ─────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-text: #333333;
    --color-text-muted: #6c757d;
    --color-primary: #0366d6;
    --color-primary-hover: #024ea2;
    --color-border: #e1e4e8;
    --color-code-bg: #f6f8fa;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --max-width: 800px;
    --radius: 6px;
}

html {
    font-size: 16px;
    line-height: 1.7;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ── Header ────────────────── */
.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.site-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
}
.site-title:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.site-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.site-nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.site-nav a {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}
.site-nav a:hover {
    color: var(--color-primary);
}

/* ── Main Content ──────────── */
.site-main {
    flex: 1;
    padding: 2rem 0 3rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.page-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}
.page-description {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* ── Post Card (列表) ──────── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}
.post-card:last-child {
    border-bottom: none;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.post-card-title a {
    color: var(--color-text);
}
.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.post-card-divider {
    margin: 0 0.4rem;
}

.post-card-category {
    color: var(--color-primary);
}

.post-card-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-card-tags {
    margin-top: 0.5rem;
}

.tag {
    display: inline-block;
    background: var(--color-code-bg);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    margin-right: 0.4rem;
    margin-bottom: 0.3rem;
}
.tag:hover {
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
}

/* ── Post Detail ───────────── */
.post-detail {
    line-height: 1.85;
}

.post-header {
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.post-divider {
    margin: 0 0.4rem;
    color: var(--color-border);
}

.post-updated {
    font-style: italic;
}

.post-category, .post-tags {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.post-cover {
    margin-top: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
}
.post-cover img {
    max-width: 100%;
    height: auto;
    display: block;
}

.post-content {
    margin-bottom: 2rem;
}

/* ── Typography (inside post-content) ── */
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
}
.post-content h1 { font-size: 1.6rem; }
.post-content h2 { font-size: 1.35rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.35rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.75rem;
}

.post-content li {
    margin-bottom: 0.3rem;
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--color-code-bg);
    color: var(--color-text-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

.post-content pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.9rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.post-content th, .post-content td {
    border: 1px solid var(--color-border);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.post-content th {
    background: var(--color-code-bg);
    font-weight: 600;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.post-content a {
    word-break: break-all;
}

/* ── Post Nav ──────────────── */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.95rem;
}

/* ── Related Posts ─────────── */
.related-posts {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--color-code-bg);
    border-radius: var(--radius);
}
.related-posts h3 {
    margin-bottom: 0.75rem;
}
.related-posts ul {
    padding-left: 1.25rem;
}
.related-posts li {
    margin-bottom: 0.3rem;
}

/* ── Pagination ────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.pagination-info {
    color: var(--color-text-muted);
}

/* ── Archive ────────────────── */
.archive-year {
    margin-bottom: 1.5rem;
}
.archive-year-title {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}
.archive-month-title {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.archive-post-list {
    list-style: none;
    padding-left: 1rem;
    margin-bottom: 1rem;
}
.archive-post-list li {
    margin-bottom: 0.35rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.archive-post-list time {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
    min-width: 5.5rem;
}
.archive-category {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ── Page Detail ───────────── */
.page-content {
    line-height: 1.85;
}
.page-content h1, .page-content h2, .page-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}
.page-content p {
    margin-bottom: 1rem;
}

/* ── Footer ────────────────── */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.social-links {
    margin-top: 0.5rem;
}
.social-links a {
    margin: 0 0.5rem;
}

/* ── Empty ─────────────────── */
.empty-hint {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 2rem 0;
}

/* ── Comments ──────────────── */
.comments {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding: 0 1.25rem;
}

/* ── Code Highlight (Pygments) ── */
.highlight .hll { background-color: #ffc; }
.highlight .c { color: #6a737d; }  /* comment */
.highlight .k { color: #d73a49; }  /* keyword */
.highlight .s { color: #032f62; }  /* string */
.highlight .n { color: #24292e; }  /* name */
.highlight .o { color: #d73a49; }  /* operator */
.highlight .p { color: #24292e; }  /* punctuation */

/* ── Responsive ────────────── */
@media (max-width: 640px) {
    .site-header .container {
        flex-direction: column;
    }
    .site-nav {
        margin-left: 0;
        flex-wrap: wrap;
    }
    .post-title {
        font-size: 1.5rem;
    }
    .post-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .archive-post-list li {
        flex-direction: column;
        gap: 0;
    }
}
