:root {
    --bg: #ffffff;
    --bg-secondary: #f5f5f5;
    --text: #1a1a1a;
    --text-muted: #666666;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --border: #e5e5e5;
    --code-bg: #f0f0f0;
    --pre-bg: #1e1e1e;
    --pre-text: #d4d4d4;
    --accent: #2563eb;
}

[data-theme="dark"] {
    --bg: #171717;
    --bg-secondary: #242424;
    --text: #e5e5e5;
    --text-muted: #999999;
    --link: #60a5fa;
    --link-hover: #93bbfd;
    --border: #333333;
    --code-bg: #2d2d2d;
    --pre-bg: #1e1e1e;
    --pre-text: #d4d4d4;
    --accent: #60a5fa;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0 1rem;
    max-width: 720px;
    margin-inline: auto;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

header a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
}

a {
    color: var(--link);
}
a:hover {
    color: var(--link-hover);
}

h1, h2, h3 {
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.post-preview {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.post-preview:last-child {
    border-bottom: none;
}
.post-preview h2 {
    margin-bottom: 0.25rem;
}
.post-preview h2 a {
    color: var(--text);
    text-decoration: none;
}
.post-preview h2 a:hover {
    color: var(--link);
}
.post-preview .meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.post-preview .author {
    margin-left: 0.5rem;
}

article .meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
article .author {
    margin-left: 0.5rem;
}

article .body {
    margin-top: 2rem;
}

article .body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 6px;
}

article .body figure {
    margin: 1.5rem 0;
}

article .body figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

article .body figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

article .body .rich-text img {
    max-width: 100%;
    height: auto;
}

code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--pre-bg);
    color: var(--pre-text);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
}
pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

[data-theme="dark"] pre[class*="language-"] {
    background: var(--pre-bg);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}
.theme-toggle:hover {
    background: var(--bg-secondary);
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}


