:root {
    --post-ink: #f4efe7;
    --post-muted: #aaa5a0;
    --post-line: rgba(244, 239, 231, 0.12);
    --post-gold: #d4a574;
    --post-teal: #5fb3a3;
}

* { box-sizing: border-box; }

body.post-page {
    min-height: 100vh;
    margin: 0;
    color: var(--post-ink);
    background: #111114;
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
}

/* 正文字号档位：默认 16px，小 ~14.7px，大 ~17.6px。
   文章页加在 body 上，编辑器加在画布/预览元素上。 */
.post-font-small { --post-body-size: .92rem; }
.post-font-large { --post-body-size: 1.1rem; }

.post-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    min-height: 72px;
    margin: 0 auto;
    padding: 0 28px;
    background: rgba(17, 17, 20, 0.84);
    border-bottom: 1px solid var(--post-line);
    backdrop-filter: blur(18px);
}

.post-nav a {
    color: var(--post-ink);
    text-decoration: none;
}

.post-brand {
    color: var(--post-gold) !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.post-back {
    color: var(--post-muted) !important;
    font-size: .9rem;
    transition: color .2s ease;
}

.post-back:hover { color: var(--post-gold) !important; }

.post-shell {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 64px 28px 56px;
}

.post-heading { max-width: 780px; margin: 0 auto 40px; }

.post-kicker {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 16px;
    color: var(--post-gold);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.post-kicker::before {
    width: 28px;
    height: 1px;
    background: currentColor;
    content: '';
}

.post-title {
    margin: 0;
    color: #fffdf8;
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.post-deck {
    margin: 18px 0 0;
    color: #c8c2ba;
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
    line-height: 1.7;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 20px;
    color: var(--post-muted);
    font-size: .85rem;
}

.post-meta span + span::before { margin-right: .8rem; color: #686562; content: '·'; }

.post-cover { margin: 0 0 48px; overflow: hidden; border: 1px solid var(--post-line); border-radius: 18px; background: #080b10; }
.post-cover img { display: block; width: 100%; aspect-ratio: 1.82 / 1; object-fit: cover; }
.post-cover figcaption { padding: 12px 16px; color: #85817c; font-size: .78rem; }

.post-content {
    width: min(100%, 720px);
    margin: 0 auto;
    color: #ddd8d1;
    font-family: 'Noto Serif SC', serif;
    font-size: var(--post-body-size, 1rem);
    line-height: 1.7;
}

.post-content > *:first-child { margin-top: 0; }
.post-content p { margin: 0 0 .75em; }
.post-content h2 { margin: 1.9em 0 .6em; color: #fffdf8; font-size: 1.4rem; line-height: 1.4; }
.post-content h3 { margin: 1.5em 0 .45em; color: #f4efe7; font-size: 1.12rem; line-height: 1.45; }
.post-content strong { color: #fff8eb; font-weight: 600; }

.post-content blockquote {
    margin: 1.5em 0;
    padding: .85em 1.1em;
    color: #f0d7b4;
    border-left: 2px solid var(--post-gold);
    background: rgba(212, 165, 116, 0.07);
    font-size: 1.05rem;
}

.post-content ul, .post-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.post-content li { margin: .25em 0; padding-left: .2em; }
.post-content ul[data-type="taskList"] { padding-left: 0; list-style: none; }
.post-content li[data-type="taskItem"] { display: flex; align-items: flex-start; gap: .65rem; padding-left: 0; }
.post-content li[data-type="taskItem"] input[type="checkbox"] { width: 1rem; height: 1rem; margin-top: .45em; accent-color: var(--post-teal); }
.post-content li[data-type="taskItem"][data-checked="true"] { color: var(--post-muted); text-decoration: line-through; }
.post-content mark { padding: .04em .18em; color: #241d13; border-radius: 3px; background: #e7c66b; }
.post-content [data-type="highlightBlock"] { margin: 1.5rem 0; padding: 1rem 1.1rem; border: 1px solid rgba(212, 165, 116, .38); border-radius: 8px; background: rgba(212, 165, 116, .1); }
.post-content [data-type="highlightBlock"] > *:last-child { margin-bottom: 0; }
.post-content table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-family: 'Inter', 'Noto Serif SC', sans-serif; font-size: .9rem; line-height: 1.6; }
.post-content th, .post-content td { padding: .6rem .7rem; border: 1px solid var(--post-line); text-align: left; vertical-align: top; }
.post-content th { color: #fffdf8; background: rgba(212, 165, 116, .1); font-weight: 600; }
.post-content td { background: rgba(244, 239, 231, .025); }
.post-content details { margin: 1.5rem 0; padding: .9rem 1rem; border: 1px solid rgba(212, 165, 116, .28); border-radius: 10px; background: rgba(212, 165, 116, .045); }
.post-content details summary { color: #fffdf8; cursor: pointer; font-family: 'Inter', 'Noto Serif SC', sans-serif; font-weight: 600; }
.post-content details > div { padding-top: .75rem; }
.post-content .math-block { overflow-x: auto; margin: 1.5rem 0; padding: .5rem 0; text-align: center; }
.post-content .math-inline { white-space: nowrap; }
.post-content .math-error { color: #e59a9a; font-family: 'JetBrains Mono', monospace; }

.post-aside {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    border: 1px solid rgba(95, 179, 163, .22);
    border-radius: 12px;
    background: rgba(95, 179, 163, .06);
    color: #cce2de;
    font-family: 'Inter', 'Noto Serif SC', sans-serif;
    font-size: .95rem;
    line-height: 1.7;
}

.post-endmark { margin-top: 2em !important; color: #f2d5ab; font-size: 1.1rem; }

.post-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 720px);
    margin: 56px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--post-line);
}

.post-footer a { color: var(--post-gold); text-decoration: none; font-size: .92rem; }
.post-footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .post-nav { min-height: 62px; padding: 0 18px; }
    .post-shell { padding: 48px 18px 40px; }
    .post-heading { margin-bottom: 28px; }
    .post-cover { margin-bottom: 36px; border-radius: 12px; }
    .post-content { line-height: 1.75; }
    .post-content h2 { font-size: 1.28rem; }
    .post-footer { margin-top: 44px; }
}
