/* ===== Post / Article reading page — R2 "Frostpaper" light reading look =====
   Matches _restyle-2-kb.html article styling. Tokens come from site-tokens.css.
   Light warm paper, dark ink, comfortable measure (~68ch), lh ~1.85. */

.post {
    max-width: 920px;
    margin: 0 auto;
    padding: 7rem 64px 6rem;
}

/* ---------- header ---------- */
.post-header {
    margin-bottom: 2.6rem;
    padding-bottom: 1.9rem;
    border-bottom: 1px solid var(--line);
}

.post-date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-3);
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 1.1rem;
}

.post-title {
    font-family: var(--fraunces);
    font-size: clamp(2rem, 4.4vw, 2.85rem);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin-bottom: 0.85rem;
}

.post-subtitle {
    font-family: var(--cn);
    font-weight: 400;
    font-size: 1.08rem;
    color: var(--ink-2);
    line-height: 1.75;
}

/* ---------- body — the readability core ---------- */
.post-body {
    font-family: var(--cn);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.85;
    color: var(--ink);
}

.post-body p {
    margin-bottom: 1.45rem;
    color: var(--ink);
}

.post-body > p:first-child,
.post-body .lead {
    font-size: 18.5px;
    line-height: 1.8;
    color: var(--ink);
}

.post-body h2 {
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    letter-spacing: 0.01em;
    margin: 3rem 0 1.1rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--line);
}

.post-body h3 {
    font-family: var(--serif);
    font-size: 1.32rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin: 2.1rem 0 0.7rem;
}

/* ---------- lists ---------- */
.post-body ul,
.post-body ol {
    margin: 1rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

.post-body li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 0.85rem;
    font-size: 16.5px;
    line-height: 1.8;
    color: var(--ink);
}

.post-body ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
}

.post-body ol {
    counter-reset: post-ol;
}

.post-body ol li {
    counter-increment: post-ol;
}

.post-body ol li::before {
    content: counter(post-ol);
    position: absolute;
    left: 0;
    top: 0.05em;
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--teal);
    letter-spacing: 0.04em;
}

.post-body li b,
.post-body li strong {
    color: var(--ink);
    font-weight: 600;
}

.post-body a {
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px solid var(--teal-wash);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.post-body a:hover {
    color: var(--teal-deep);
    border-bottom-color: var(--teal);
}

.post-body strong,
.post-body b {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- images: breakout wider than text (杂志式宽图) ---------- */
.post-body img {
    display: block;
    width: calc(100% + 128px);
    max-width: calc(100% + 128px);
    margin: 2.5rem -64px;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.06);
}
/* figure + 图注（如用 <figure><img><figcaption>）*/
.post-body figure {
    margin: 2.5rem -64px;
}
.post-body figure img {
    width: 100%;
    max-width: 100%;
    margin: 0;
}
.post-body figcaption {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    text-align: center;
    margin-top: 0.7rem;
    padding: 0 64px;
}

/* ---------- blockquote / note — teal-amber wash ---------- */
.post-body blockquote {
    margin: 1.9rem 0;
    padding: 18px 24px;
    border-radius: 0 12px 12px 0;
    background: var(--card);
    border-left: 3px solid var(--amber);
    color: var(--ink-2);
    font-style: normal;
}

.post-body blockquote p {
    font-family: var(--cn);
    font-weight: 400;
    font-size: 15.5px;
    line-height: 1.82;
    color: var(--ink-2);
    margin: 0 0 0.7rem;
}

.post-body blockquote p:last-child {
    margin-bottom: 0;
}

/* teal-wash variant (use class="note-teal" on a blockquote) */
.post-body blockquote.note-teal {
    background: var(--teal-wash);
    border-left-color: var(--teal);
}

/* ---------- inline code + code blocks (light) ---------- */
.post-body code {
    font-family: var(--mono);
    background: var(--paper-2);
    color: var(--teal-deep);
    padding: 0.12rem 0.42rem;
    border-radius: 5px;
    border: 1px solid var(--line-soft);
    font-size: 0.86em;
}

.post-body pre {
    background: var(--card);
    color: var(--ink);
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.8rem 0;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.post-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ---------- tables — light with zebra + mono figures ---------- */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.9rem 0;
    font-family: var(--sans);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.post-body table caption {
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 14px 20px;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
}

.post-body th {
    text-align: left;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal-deep);
    font-weight: 600;
    padding: 13px 20px;
    background: var(--teal-wash);
    border-bottom: 1px solid var(--frost);
}

.post-body td {
    padding: 13px 20px;
    font-size: 15.5px;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line-soft);
}

/* mono figures: numeric cells read in mono */
.post-body td.num,
.post-body td.range,
.post-body td.figure {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
}

.post-body tbody tr:last-child td {
    border-bottom: none;
}

.post-body tbody tr:nth-child(even) {
    background: #e3e8ea;
}

.post-body tbody tr:hover {
    background: var(--teal-wash);
}

/* ---------- horizontal rule ---------- */
.post-body hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2.4rem 0;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
    .post {
        padding: 6.5rem 24px 4rem;
    }
    .post-body img,
    .post-body figure {
        width: calc(100% + 48px);
        max-width: calc(100% + 48px);
        margin: 1.8rem -24px;
        border-radius: 10px;
    }
    .post-body figure img { width: 100%; max-width: 100%; margin: 0; }
    .post-body figcaption { padding: 0 24px; }
    .post-body table,
    .post-body pre {
        font-size: 13.5px;
    }
}

@media (max-width: 600px) {
    .post {
        padding: 6rem 20px 3.5rem;
    }
    .post-body img,
    .post-body figure {
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
        margin: 1.6rem -20px;
    }
    .post-body figcaption { padding: 0 20px; }
}
