@charset "utf-8";

:root {
    --reading-ink: #202522;
    --reading-muted: #69736d;
    --reading-line: #d9dfdb;
    --reading-soft: #f4f7f5;
    --reading-accent: #176b55;
    --reading-warm: #b24d35;
}

body {
    color: var(--reading-ink);
    background: #eaeeeb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.75;
}

p {
    white-space: normal;
}

.post-audio {
    margin: 1.25rem 0 1.75rem;
    padding: 0.9rem 1rem 1rem;
    border: 1px solid var(--reading-line);
    border-left: 3px solid var(--reading-accent);
    background: var(--reading-soft);
}

.post-audio figcaption {
    margin-bottom: 0.55rem;
    color: var(--reading-ink);
    font-size: 0.92rem;
    font-weight: 650;
}

.post-audio audio {
    display: block;
    width: 100%;
    max-width: 560px;
    height: 40px;
}

a {
    color: var(--reading-accent);
}

.paper {
    background: #eaeeeb;
}

.paper-main {
    max-width: 900px;
    padding: 40px clamp(24px, 5vw, 64px) 0;
    border-top: 4px solid var(--reading-accent);
    background: #fff;
    box-shadow: 0 12px 36px rgba(32, 37, 34, 0.1);
}

.index-main {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px clamp(24px, 5vw, 64px) 0;
    border-top: 4px solid var(--reading-accent);
    border-radius: 0;
    background: #fff;
    box-shadow: 0 12px 36px rgba(32, 37, 34, 0.1);
}

.site-header {
    margin: 0 0 44px;
    border: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
}

.site-brand-mark {
    display: block;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
}

.site-brand-mark img {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 4px;
    object-fit: cover;
}

.site-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-brand-title {
    color: var(--reading-ink);
    font-size: 1.85rem;
    font-weight: 750;
    line-height: 1.25;
}

.site-brand-title:hover {
    color: var(--reading-accent);
}

.site-brand-description {
    color: var(--reading-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.site-nav {
    width: 100%;
    border-top: 1px solid var(--reading-line);
    border-bottom: 1px solid var(--reading-line);
}

.site-nav-list {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-item {
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: center;
}

.site-nav-item a {
    position: relative;
    display: block;
    min-height: 44px;
    padding: 11px 4px 9px;
    color: #4d5953;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 24px;
}

.site-nav-item a:hover {
    color: var(--reading-accent);
    background: var(--reading-soft);
}

.site-nav-item.is-active a {
    color: var(--reading-accent);
    box-shadow: inset 0 -3px 0 var(--reading-accent);
}

.site-nav-item a:focus-visible,
.home-more-link:focus-visible,
.home-channel-list a:focus-visible,
.taxonomy-grid a:focus-visible {
    outline: 2px solid var(--reading-warm);
    outline-offset: -2px;
}

.collection-header {
    margin: 0 0 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--reading-line);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

.collection-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--reading-warm);
    font-size: 0.76rem;
    font-weight: 700;
}

.collection-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.collection-title-row h1 {
    margin: 0;
    color: var(--reading-ink);
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.35;
}

.collection-count {
    flex: 0 0 auto;
    color: var(--reading-muted);
    font-size: 0.82rem;
}

.home-main {
    margin-bottom: 24px;
}

.home-section + .home-section {
    margin-top: 48px;
}

.home-post-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-post-list li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--reading-line);
}

.home-post-list time {
    color: var(--reading-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
}

.home-post-copy {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.home-post-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.home-post-copy a {
    min-width: 0;
    color: var(--reading-ink);
    font-family: ui-serif, "Noto Serif SC", "Source Han Serif SC", "Songti SC",
        "STSong", serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.55;
}

.home-post-copy a:hover {
    color: var(--reading-accent);
}

.home-post-summary {
    max-width: 46em;
    overflow: hidden;
    color: var(--reading-muted);
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-post-copy span {
    flex: 0 0 auto;
    color: var(--reading-muted);
    font-size: 0.76rem;
}

.home-more-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--reading-accent);
    font-size: 0.88rem;
    font-weight: 700;
}

.home-more-link::after {
    content: " →";
    color: var(--reading-warm);
}

.home-subsection-header {
    margin-bottom: 12px;
}

.home-subsection-header h2 {
    margin: 0;
    color: var(--reading-ink);
    font-size: 1.25rem;
    line-height: 1.4;
}

.home-channel-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    border-bottom: 1px solid var(--reading-line);
}

.home-channel-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--reading-line);
    color: var(--reading-ink);
    font-weight: 650;
}

.home-channel-list a:hover {
    color: var(--reading-accent);
}

.home-channel-list small {
    color: var(--reading-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.archive-list {
    margin-bottom: 28px;
}

.archive {
    margin: 0;
    padding: 0;
}

.archive li,
.archive li:nth-child(odd),
.archive li:nth-child(even) {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--reading-line);
    background: #fff;
}

.archive-date,
.archive li span.archive-date {
    width: auto;
    color: var(--reading-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
}

.archive-main {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.archive-main .archive-title:link,
.archive-main .archive-title:visited {
    color: var(--reading-ink);
    text-decoration: none;
    line-height: 1.55;
}

.archive-main .archive-title:hover {
    color: var(--reading-accent);
    text-decoration: none;
}

.archive li .archive-category {
    flex: 0 0 auto;
    width: auto;
    color: var(--reading-warm);
    font-size: 0.74rem;
}

.year-font-color {
    grid-column: 1 / -1;
    width: 100% !important;
    margin-top: 18px;
    color: var(--reading-ink) !important;
    font-size: 1.15rem;
    font-weight: 750;
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    margin: 0 0 32px;
    padding: 0;
    border-bottom: 1px solid var(--reading-line);
    list-style: none;
}

.taxonomy-grid li {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--reading-line);
}

.taxonomy-grid a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    color: var(--reading-ink);
}

.taxonomy-grid a:hover {
    color: var(--reading-accent);
}

.taxonomy-grid small {
    flex: 0 0 auto;
    color: var(--reading-muted);
    font-size: 0.75rem;
}

.taxonomy-tags {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 24px;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 52px;
    padding: 18px 0 24px;
    border-top: 1px solid var(--reading-line);
    color: var(--reading-muted);
    font-size: 0.75rem;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-footer a {
    color: var(--reading-muted);
}

.site-footer a:hover {
    color: var(--reading-accent);
}

.header,
.post-header {
    border-color: var(--reading-line);
}

.post-main-title {
    margin: 18px 0 8px;
    color: var(--reading-ink);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
}

.post-md {
    min-width: 0;
    color: var(--reading-ink);
    font-family: ui-serif, "Noto Serif SC", "Source Han Serif SC", "Songti SC",
        "STSong", serif;
    font-size: 17px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.post-md p {
    margin: 1.05em 0;
}

.post-md h1,
.post-md h2,
.post-md h3,
.post-md h4,
.post-md h5,
.post-md h6 {
    color: var(--reading-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0;
}

.post-md h1 {
    margin: 3.4rem 0 1.25rem;
    padding: 0 0 0.65rem;
    border-bottom: 2px solid var(--reading-line);
    font-size: 1.65rem;
    line-height: 1.45;
}

.post-md h2 {
    margin: 3.2rem 0 1.2rem;
    padding: 0.15rem 0 0.15rem 0.85rem;
    border-left: 4px solid var(--reading-accent);
    font-size: 1.5rem;
    line-height: 1.45;
}

.post-md h3 {
    margin: 2.5rem 0 0.95rem;
    padding: 0;
    color: #293a33;
    font-size: 1.2rem;
    line-height: 1.55;
}

.post-md h4,
.post-md h5,
.post-md h6 {
    margin: 2rem 0 0.8rem;
    padding: 0;
    font-size: 1.05rem;
    line-height: 1.55;
}

.post-md strong {
    color: #1d4f40;
    font-weight: 700;
}

.post-md a {
    color: var(--reading-accent);
    box-shadow: 0 1px 0 rgba(23, 107, 85, 0.35);
}

.post-md a:hover {
    color: var(--reading-warm);
    box-shadow: 0 2px 0 var(--reading-warm);
}

.post-md ul,
.post-md ol {
    margin: 1rem 0;
    padding-left: 1.65rem;
}

.post-md li {
    margin: 0.45rem 0;
    padding-left: 0.2rem;
}

.post-md li::marker {
    color: var(--reading-accent);
    font-weight: 700;
}

.post-md blockquote {
    margin: 1.7rem 0;
    padding: 0.8rem 1.15rem;
    border-left: 4px solid var(--reading-warm);
    border-radius: 0 6px 6px 0;
    color: #37433e;
    background: #f7f5f2;
}

.post-md blockquote p {
    margin: 0.25rem 0;
}

.post-md hr {
    width: 72px;
    height: 2px;
    margin: 3rem auto;
    border: 0;
    background: var(--reading-line);
}

.post-md img {
    content-visibility: auto;
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 6px;
}

.post-md picture.post-image {
    display: block;
    max-width: 100%;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 6px;
    background: var(--reading-line);
}

.post-md > table {
    display: block;
    width: 100%;
    margin: 1.8rem 0;
    overflow-x: auto;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 0.9rem;
    line-height: 1.65;
    -webkit-overflow-scrolling: touch;
}

.post-md > table thead,
.post-md > table tbody {
    min-width: 680px;
}

.post-md > table th,
.post-md > table td,
.post-md > table tr:nth-child(odd) td,
.post-md > table tr:nth-child(even) td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--reading-line);
    background: #fff;
    vertical-align: top;
}

.post-md > table th {
    border-top: 2px solid var(--reading-accent);
    border-bottom: 2px solid var(--reading-line);
    color: #26332e;
    background: var(--reading-soft);
    font-weight: 700;
    white-space: nowrap;
}

.post-md > table th:first-child,
.post-md > table td:first-child {
    white-space: nowrap;
}

.post-md pre {
    max-width: 100%;
    margin: 1.6rem 0;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    border: 1px solid #d7ddd9;
    border-radius: 6px;
    background: #f1f4f2;
    line-height: 1.65;
}

.post-md pre table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.post-md figure.highlight {
    max-width: 100%;
    margin: 1.6rem 0;
    overflow-x: auto;
    border: 1px solid #d7ddd9;
    border-radius: 6px;
    background: #f1f4f2;
    -webkit-overflow-scrolling: touch;
}

.post-md figure.highlight table {
    width: max-content;
    min-width: 100%;
}

.post-md figure.highlight pre {
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: 0;
}

.post-md pre code {
    padding: 0;
    color: #24332d;
    background: transparent;
    font-size: 0.88rem;
}

.post-md :not(pre) > code {
    padding: 0.15em 0.35em;
    color: #87402f;
    background: #f5efec;
    font-size: 0.9em;
}

.post-md .post-toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1.5rem;
    margin: 1.4rem 0 3.2rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--reading-line);
    border-bottom: 1px solid var(--reading-line);
    list-style: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.5;
}

.post-md .post-toc::before {
    content: "文章目录";
    grid-column: 1 / -1;
    margin-bottom: 0.4rem;
    color: var(--reading-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.post-md .post-toc > .post-toc-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-md .post-toc-link {
    display: block;
    padding: 0.18rem 0;
    color: #3e4b45;
    box-shadow: none;
    font-size: 0.9rem;
}

.post-md .post-toc-link:hover {
    color: var(--reading-accent);
    box-shadow: none;
}

.post-md .post-toc-child {
    display: none;
}

.post-meta {
    margin-top: 3.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--reading-line);
    color: var(--reading-muted);
}

.bs-docs-sidebar .nav > li > a {
    color: #748078;
}

.bs-docs-sidebar .nav > .active > a,
.bs-docs-sidebar .nav > li > a:hover,
.bs-docs-sidebar .nav > li > a:focus {
    color: var(--reading-accent);
    border-left-color: var(--reading-accent);
}

@media (max-width: 760px) {
    .paper {
        padding: 0;
    }

    .paper-main {
        padding: 24px 20px 0;
        border-top-width: 3px;
        box-shadow: none;
    }

    .index-main {
        padding: 24px 20px 0;
        border-top-width: 3px;
        box-shadow: none;
    }

    .site-header {
        margin-bottom: 34px;
    }

    .site-brand {
        gap: 12px;
        padding-bottom: 16px;
    }

    .site-brand-mark,
    .site-brand-mark img {
        width: 46px;
        height: 46px;
    }

    .site-brand-mark {
        flex-basis: 46px;
    }

    .site-brand-title {
        font-size: 1.5rem;
    }

    .site-brand-description {
        font-size: 0.72rem;
    }

    .site-nav-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .site-nav-item:nth-child(-n + 4) {
        border-bottom: 1px solid var(--reading-line);
    }

    .site-nav-item a {
        min-height: 40px;
        padding: 8px 2px;
        font-size: 0.84rem;
    }

    .collection-header {
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .collection-title-row h1 {
        font-size: 1.65rem;
    }

    .home-post-list li {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 0;
    }

    .home-post-copy {
        display: block;
    }

    .home-post-text {
        display: block;
    }

    .home-post-copy a {
        display: block;
        font-size: 0.98rem;
    }

    .home-post-copy span {
        display: block;
        margin-top: 3px;
    }

    .home-post-summary {
        display: block;
        margin-top: 2px;
        white-space: normal;
    }

    .home-channel-list {
        column-gap: 20px;
    }

    .archive li,
    .archive li:nth-child(odd),
    .archive li:nth-child(even) {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 10px;
        padding: 11px 0;
    }

    .archive-main {
        display: block;
    }

    .archive-category {
        display: block;
        margin-bottom: 2px;
    }

    .taxonomy-grid,
    .taxonomy-tags {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 20px;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        margin-top: 42px;
    }

    .post-header {
        margin-bottom: 32px;
    }

    .post-main-title {
        font-size: 1.65rem;
    }

    .post-md {
        font-size: 16px;
        line-height: 1.85;
    }

    .post-md h1 {
        font-size: 1.5rem;
    }

    .post-md h2 {
        margin-top: 2.7rem;
        font-size: 1.32rem;
    }

    .post-md h3 {
        margin-top: 2.2rem;
        font-size: 1.12rem;
    }

    .post-md .post-toc {
        grid-template-columns: 1fr;
        gap: 0.3rem;
        margin-bottom: 2.6rem;
    }

    .post-md blockquote {
        padding: 0.7rem 0.9rem;
    }
}

@media (max-width: 1440px) {
    .left-toc-container {
        display: none;
    }
}

@media print {
    body,
    .paper,
    .paper-main {
        background: #fff;
    }

    .paper-main {
        border-top: 0;
        box-shadow: none;
    }
}

/* Small additions kept on top of the original A4 layout. */
.site-header {
    position: relative;
}

.reading-search-trigger {
    position: absolute;
    top: 12px;
    right: 0;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--reading-line);
    border-radius: 999px;
    color: var(--reading-muted);
    background: transparent;
    font-size: 1.05rem;
    line-height: 1.2;
    cursor: pointer;
}

.reading-search-trigger:hover {
    color: var(--reading-accent);
    border-color: var(--reading-accent);
}

.post-neighbors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 30px 0 10px;
    padding-top: 18px;
    border-top: 1px solid var(--reading-line);
}

.post-neighbors a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    color: var(--reading-ink);
    text-decoration: none;
}

.post-neighbors a.next {
    align-items: flex-end;
    text-align: right;
}

.post-neighbors small {
    color: var(--reading-warm);
    font-size: .72rem;
}

.post-neighbors strong {
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.5;
}

.post-neighbors a:hover strong {
    color: var(--reading-accent);
}

.search-dialog[hidden] { display: none; }
.search-dialog { position: fixed; inset: 0; z-index: 100; }
.search-dialog-backdrop { position: absolute; inset: 0; background: rgba(32, 37, 34, .46); }
.search-panel { position: relative; width: min(600px, calc(100% - 32px)); margin: 12vh auto 0; padding: 20px; border: 1px solid var(--reading-line); border-radius: 6px; background: #fff; box-shadow: 0 18px 50px rgba(32, 37, 34, .2); }
.search-panel-header { display: flex; align-items: center; justify-content: space-between; }
.search-panel h2 { margin: 0; color: var(--reading-ink); font-size: 1.15rem; }
.dialog-close { width: 32px; height: 32px; border: 0; color: var(--reading-muted); background: transparent; font-size: 1.35rem; cursor: pointer; }
.search-field { display: block; margin-top: 14px; }
.search-field input { box-sizing: border-box; width: 100%; padding: 11px 12px; border: 1px solid var(--reading-line); border-radius: 4px; color: var(--reading-ink); background: var(--reading-soft); font: inherit; outline: 0; }
.search-field input:focus { border-color: var(--reading-accent); }
.search-results { max-height: 50vh; margin-top: 12px; overflow-y: auto; }
.search-empty { margin: 22px 0; color: var(--reading-muted); font-size: .85rem; text-align: center; }
.search-result { display: flex; flex-direction: column; gap: 3px; padding: 10px 4px; border-bottom: 1px solid var(--reading-line); color: var(--reading-ink); text-decoration: none; }
.search-result:hover { color: var(--reading-accent); background: var(--reading-soft); }
.search-result small { color: var(--reading-muted); font-size: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.reading-theme-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--reading-line);
    border-radius: 50%;
    color: var(--reading-muted);
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 16px rgba(32, 37, 34, .12);
}

.reading-theme-toggle:hover {
    color: var(--reading-accent);
    border-color: var(--reading-accent);
}

body.dark-theme {
    --reading-ink: #edf3ed;
    --reading-muted: #a6b3aa;
    --reading-line: #3b4a42;
    --reading-soft: #29372f;
    --reading-accent: #83c5a8;
    --reading-warm: #e09a80;
    color: var(--reading-ink);
    background: #18211d;
}

body.dark-theme .paper,
body.dark-theme .paper-main,
body.dark-theme .index-main,
body.dark-theme .archive li,
body.dark-theme .search-panel {
    color: var(--reading-ink);
    background: #202b26;
}

body.dark-theme .site-brand-title,
body.dark-theme .post-main-title,
body.dark-theme .post-md,
body.dark-theme .archive-main .archive-title:link,
body.dark-theme .archive-main .archive-title:visited,
body.dark-theme .home-post-copy a,
body.dark-theme .home-facts strong,
body.dark-theme .home-subsection-header h2,
body.dark-theme .collection-title-row h1,
body.dark-theme .search-panel h2,
body.dark-theme .search-result {
    color: var(--reading-ink);
}

body.dark-theme .post-md blockquote,
body.dark-theme .post-audio,
body.dark-theme .search-field input,
body.dark-theme .search-result:hover {
    background: var(--reading-soft);
}

body.dark-theme .post-md .post-toc-link {
    color: var(--reading-muted);
}

body.dark-theme .post-md .post-toc-link:hover {
    color: var(--reading-accent);
}

body.dark-theme .reading-theme-toggle {
    color: var(--reading-ink);
    background: #202b26;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .25);
}

body.dark-theme .site-nav-item a,
body.dark-theme .post-meta,
body.dark-theme .site-footer,
body.dark-theme .archive-date,
body.dark-theme .collection-count,
body.dark-theme .year-font-color {
    color: var(--reading-muted);
}

body.dark-theme .site-nav-item a:hover,
body.dark-theme .site-nav-item.is-active a {
    color: var(--reading-accent);
    background: var(--reading-soft);
}

body.dark-theme .post-md pre,
body.dark-theme .post-md figure.highlight,
body.dark-theme .post-md :not(pre) > code {
    color: var(--reading-ink);
    background: #16201b;
}

@media (max-width: 760px) {
    .reading-search-trigger { top: 8px; right: 0; padding: 3px 8px; }
    .post-neighbors { grid-template-columns: 1fr; gap: 8px; }
    .post-neighbors a.next { align-items: flex-start; text-align: left; }
    .reading-theme-toggle { right: 16px; bottom: 16px; }
}

/* Editorial details: keep the original A4 rhythm while adding context. */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 120;
    height: 3px;
    pointer-events: none;
}

.reading-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--reading-accent);
    transform: scaleX(0);
    transform-origin: left center;
}

.home-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 0 0 40px;
    padding: 0 0 22px;
    border-bottom: 1px solid var(--reading-line);
}

.home-intro p {
    max-width: 34em;
    margin: 0;
    color: var(--reading-muted);
    font-size: .92rem;
    line-height: 1.75;
}

.home-facts {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 22px;
}

.home-facts span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 52px;
}

.home-facts strong {
    color: var(--reading-ink);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.home-facts small {
    color: var(--reading-muted);
    font-size: .7rem;
    line-height: 1.35;
    white-space: nowrap;
}

.post-title-block {
    margin: 12px 0 8px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--reading-line);
}

.post-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--reading-muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: .76rem;
    line-height: 1.4;
}

.post-eyebrow a {
    color: var(--reading-warm);
    font-weight: 700;
}

.post-lede {
    max-width: 42em;
    margin: 8px 0 0;
    color: var(--reading-muted);
    font-size: .95rem;
    line-height: 1.7;
}

.post-related {
    margin: 34px 0 8px;
    padding-top: 18px;
    border-top: 1px solid var(--reading-line);
}

.post-section-kicker {
    margin-bottom: 8px;
    color: var(--reading-warm);
    font-size: .76rem;
    font-weight: 700;
}

.related-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.related-list li {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid var(--reading-line);
}

.related-list time {
    color: var(--reading-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .72rem;
}

.related-list a {
    color: var(--reading-ink);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.55;
    text-decoration: none;
}

.related-list a:hover {
    color: var(--reading-accent);
}

body.search-open {
    overflow: hidden;
}

body.dark-theme .post-md h3,
body.dark-theme .post-md strong {
    color: var(--reading-ink);
}

body.dark-theme .post-md blockquote {
    color: var(--reading-muted);
    background: var(--reading-soft);
}

body.dark-theme .post-md pre,
body.dark-theme .post-md figure.highlight {
    border-color: var(--reading-line);
}

body.dark-theme .post-md > table th,
body.dark-theme .post-md > table td,
body.dark-theme .post-md > table tr:nth-child(odd) td,
body.dark-theme .post-md > table tr:nth-child(even) td {
    color: var(--reading-ink);
    background: #202b26;
}

body.dark-theme .post-md > table th {
    background: var(--reading-soft);
}

body.dark-theme .post-lede,
body.dark-theme .post-eyebrow,
body.dark-theme .home-intro p {
    color: var(--reading-muted);
}

@media (max-width: 760px) {
    .home-intro {
        display: block;
        margin-bottom: 32px;
        padding-bottom: 18px;
    }

    .home-facts {
        flex-wrap: wrap;
        gap: 14px 24px;
        margin-top: 16px;
    }

    .post-title-block {
        padding-bottom: 18px;
    }

    .post-lede {
        font-size: .9rem;
    }

    .related-list li {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress span,
    .shadow-drop-2-bottom,
    .shadow-drop-2-top,
    .shadow-drop-2-right {
        animation: none;
        transition: none;
    }
}
