:root {
    --bg:            #F8FAFB;
    --text:          #1a1a1a;
    --text-muted:    #555;
    --text-faint:    #aaa;
    --link-hover-bg: #E4EDEF;
    --code-bg:       #edf0f2;
    --code-border:   #d8dfe4;
    --code-text:     #2d3748;
}

[data-theme="dark"] {
    --bg:            #12151a;
    --text:          #dde1e7;
    --text-muted:    #9aa0aa;
    --text-faint:    #555;
    --link-hover-bg: #1e2530;
    --code-bg:       #1a1f2b;
    --code-border:   #2a3040;
    --code-text:     #ccd6f6;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    transition: background 0.2s ease, color 0.2s ease;
}

.main {
    display: flex;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.card {
    max-width: 480px;
    width: 100%;
}

.title {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0 0 1.5rem 0;
}

p {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

p + p {
    margin-top: 0.4rem;
}

.links {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
}

/* ── Links ──────────────────────────────────────────── */

a {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    padding: 0.15rem 0.35rem;
    margin: -0.15rem -0.35rem;
    border-radius: 3px;
    background: transparent;
    transition: background 0.2s ease;
}

a:hover {
    background: var(--link-hover-bg);
}

.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg);
    transition: background 0.2s ease;
    z-index: 100;
}

.top-menu .theme-toggle,
.top-menu .lang-switcher {
    position: static;
    background: transparent;
}

.theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    background-color: var(--bg);
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-faint);
    display: flex;
    gap: 0.3rem;
    align-items: center;
    transition: color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text);
}

.theme-toggle span {
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.theme-toggle .sep {
    opacity: 0.4;
}

[data-theme="light"] .theme-toggle .t-light,
:root:not([data-theme]) .theme-toggle .t-light {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle .t-dark {
    opacity: 1;
}

.lang-switcher {
    position: fixed;
    background-color: var(--bg);
    top: 1.25rem;
    left: 1.5rem;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.lang-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-faint);
    padding: 0.15rem 0.35rem;
    margin: -0.15rem -0.35rem;
    border-radius: 3px;
    transition: color 0.15s ease, background 0.15s ease;
}

a.lang-link:hover {
    color: var(--text);
    background: var(--link-hover-bg);
}

.lang-current {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text);
    padding: 0.15rem 0.35rem;
    margin: -0.15rem -0.35rem;
}

.lang-sep {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-faint);
    opacity: 0.4;
}

.post {
    max-width: 720px;
    width: 100%;
    margin: 4rem auto;
    padding: 0 2rem;
}

.post-back {
    display: inline-block;
    margin-bottom: 3rem;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.post-back:hover {
    color: var(--text);
    background: transparent;
}

.post-header {
    margin-bottom: 2rem;
}

.post-title {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.25;
    margin: 0 0 0.75rem 0;
    color: var(--text);
}

.post-description {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0.75rem 0;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-date {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.post-tag {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.75rem;
    color: var(--text-faint);
    border: 1px solid var(--text-faint);
    border-radius: 2px;
    padding: 0.1rem 0.4rem;
    margin: 0;
    opacity: 0.7;
}

a.post-tag:hover {
    opacity: 1;
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.post-link {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    color: var(--text-faint);
}

.post-link:hover {
    color: var(--text);
    background: transparent;
}

.post-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    margin-bottom: 2.5rem;
    background: var(--link-hover-bg);
}

.post-body p {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
}

.post-body h2 {
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 1.3rem;
    margin: 2.5rem 0 1rem 0;
    color: var(--text);
}

code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85em;
}

.post-body pre {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-body pre code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--code-text);
    background: none;
    padding: 0;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: 1px solid var(--code-border);
    border-radius: 3px;
    color: var(--text-faint);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.post-body pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.post-list > li > a {
    font-family: Georgia, serif;
    font-size: 1rem;
    color: var(--text);
}

.post-list-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.post-list-meta time {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    color: var(--text-faint);
    white-space: nowrap;
}
