.site-page--article-detail main.site-shell {
    padding-top: calc(3.5rem + env(safe-area-inset-top)) !important;
}

.reader-mobile-action {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 999px;
}

.reader-mobile-title {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 .25rem;
    text-align: center;
}

.reader-mobile-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0;
}

.article-breadcrumb {
    color: #a8a29e;
    font-size: .875rem;
    line-height: 1.6;
}

.article-breadcrumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.article-breadcrumb li + li::before {
    content: "/";
    margin-right: .5rem;
    color: #57534e;
}

.article-breadcrumb a {
    color: #d6d3d1;
    text-decoration: none;
}

.article-breadcrumb a:hover,
.article-breadcrumb a:focus-visible {
    color: #e6c27a;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 1.5rem;
    padding: .75rem;
    border: 1px solid rgba(201, 160, 99, .28);
    border-radius: .875rem;
    background: rgba(42, 42, 42, .78);
}

.reader-toolbar-label {
    color: #d6d3d1;
    font-size: .875rem;
    white-space: nowrap;
}

.reader-toolbar-label output {
    color: #e6c27a;
    font-variant-numeric: tabular-nums;
}

.reader-toolbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.reader-toolbar button {
    min-width: 44px;
    min-height: 44px;
    padding: .5rem .75rem;
    border: 1px solid rgba(201, 160, 99, .5);
    border-radius: .65rem;
    background: #1a1a1a;
    color: #e6c27a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.reader-toolbar button:hover,
.reader-toolbar button:focus-visible {
    border-color: #e6c27a;
    background: rgba(201, 160, 99, .13);
    outline: 3px solid rgba(230, 194, 122, .34);
    outline-offset: 2px;
}

.reader-toolbar button:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.article-body {
    --reader-font-size: 18px;
    font-size: var(--reader-font-size) !important;
}

.article-body :where(p, li, blockquote, dd, dt, td, th, span, div, a, em, strong, b, i, u, small, big, font) {
    font-size: inherit !important;
    line-height: inherit !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.article-body,
.article-body p,
.article-body li,
.article-legacy-layout,
.article-legacy-layout div,
.article-legacy-layout p {
    max-width: 100% !important;
}

.article-legacy-layout,
.article-legacy-layout div,
.article-legacy-layout p {
    width: auto !important;
}

.article-body h1 {
    font-size: calc(var(--reader-font-size) * 1.55) !important;
}

.article-body h2 {
    font-size: calc(var(--reader-font-size) * 1.35) !important;
}

.article-body h3 {
    font-size: calc(var(--reader-font-size) * 1.18) !important;
}

.article-body h4,
.article-body h5,
.article-body h6 {
    font-size: calc(var(--reader-font-size) * 1.08) !important;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    line-height: 1.55 !important;
    scroll-margin-top: 5rem;
}

.article-toc {
    padding: 0;
    overflow: hidden;
}

.article-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: .75rem 1rem;
    color: #e6c27a;
    font-weight: 700;
    cursor: pointer;
}

.article-toc summary:focus-visible {
    outline: 3px solid #e6c27a;
    outline-offset: -3px;
}

.article-toc-state {
    color: #a8a29e;
    font-size: .75rem;
    font-weight: 400;
}

#article-toc-links {
    padding: 0 1rem .9rem;
    border-top: 1px solid rgba(201, 160, 99, .16);
}

.article-neighbors {
    margin-top: 2.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(201, 160, 99, .28);
}

.article-neighbors h2 {
    margin: 0 0 .5rem;
    color: #f5f5f4;
    font-family: 'Noto Serif TC', serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.article-neighbor-scope {
    margin: 0 0 1rem;
    color: #a8a29e;
    font-size: .875rem;
    line-height: 1.65;
}

.article-neighbor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .75rem;
}

.article-neighbor-link,
.article-neighbor-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 104px;
    margin: 0;
    padding: 1rem;
    border: 1px solid rgba(201, 160, 99, .28);
    border-radius: .875rem;
    background: rgba(42, 42, 42, .62);
    color: #d6d3d1;
    text-decoration: none;
}

.article-neighbor-link--next {
    text-align: right;
}

.article-neighbor-link span,
.article-neighbor-empty span {
    margin-bottom: .35rem;
    color: #c9a063;
    font-size: .75rem;
}

.article-neighbor-link strong,
.article-neighbor-empty strong {
    overflow-wrap: anywhere;
    font-size: .95rem;
    line-height: 1.55;
}

.article-neighbor-empty {
    color: #78716c;
}

.article-neighbor-link:hover,
.article-neighbor-link:focus-visible {
    border-color: #e6c27a;
    color: #fff;
    outline: 3px solid rgba(230, 194, 122, .3);
    outline-offset: 2px;
}

.article-quiet-links {
    margin: 1.25rem 0 0;
    color: #78716c;
    font-size: .875rem;
    text-align: center;
}

.article-quiet-links a {
    color: #c9a063;
    text-decoration: underline;
    text-decoration-color: rgba(201, 160, 99, .45);
    text-underline-offset: .2em;
}

.reader-nav-open {
    min-width: 44px;
    min-height: 44px;
    padding: .5rem .65rem;
    border: 1px solid rgba(201, 160, 99, .35);
    border-radius: .65rem;
    background: transparent;
    color: #c9a063;
    font: inherit;
    cursor: pointer;
}

.reader-nav-open:hover,
.reader-nav-open:focus-visible {
    border-color: #e6c27a;
    background: rgba(201, 160, 99, .12);
    color: #e6c27a;
    outline: 3px solid rgba(230, 194, 122, .3);
    outline-offset: 2px;
}

.reader-settings-dialog {
    inset: auto 0 0;
    width: min(100%, 34rem);
    max-width: none;
    margin: auto auto 0;
    padding: 0;
    border: 1px solid rgba(201, 160, 99, .45);
    border-radius: 1rem 1rem 0 0;
    background: #202020;
    color: #e5e5e5;
    box-shadow: 0 -16px 42px rgba(0, 0, 0, .55);
}

.reader-settings-dialog::backdrop {
    background: rgba(0, 0, 0, .58);
}

.reader-settings-sheet {
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
}

.reader-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.reader-settings-heading h2 {
    margin: 0 0 .25rem;
    color: #f5f5f4;
    font-family: 'Noto Serif TC', serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.reader-settings-heading p {
    margin: 0;
    color: #a8a29e;
    font-size: .875rem;
    line-height: 1.5;
}

.reader-dialog-close,
.reader-dialog-done {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(201, 160, 99, .42);
    border-radius: .7rem;
    background: #151515;
    color: #e6c27a;
    font: inherit;
    font-weight: 700;
}

.reader-dialog-close:hover,
.reader-dialog-close:focus-visible,
.reader-dialog-done:hover,
.reader-dialog-done:focus-visible {
    border-color: #e6c27a;
    outline: 3px solid rgba(230, 194, 122, .3);
    outline-offset: 2px;
}

.reader-dialog-close {
    flex: 0 0 44px;
    padding: 0;
}

.reader-toolbar--dialog {
    margin-bottom: 1rem;
    background: #181818;
}

.reader-dialog-done {
    width: 100%;
    padding: .65rem 1rem;
}

@media (max-width: 639px) {
    .reader-toolbar {
        align-items: center;
        flex-direction: row;
        gap: .35rem;
        padding: .4rem;
    }

    .reader-toolbar-actions {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: .25rem;
    }

    .reader-toolbar button {
        width: 44px;
        min-width: 44px;
        padding-right: .25rem;
        padding-left: .25rem;
    }

    .article-neighbor-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-neighbor-link--next {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    #read-progress {
        transition: none !important;
    }
}
