/* 拾光 (shiguang) — 晨曦拾光的原创主题 */

:root {
    --bg: #fbfaf7;
    --surface: #ffffff;
    --text: #22201c;
    --text-soft: #4a463f;
    --muted: #7b756b;
    --line: #e9e5dc;
    --line-strong: #d8d2c6;
    --accent: #c2410c;
    --accent-soft: #fdf0e6;
    --code-bg: #f4f1ea;
    --code-text: #2b2823;
    --selection: #fbd9bd;
    --shadow: 0 1px 2px rgba(60, 40, 20, 0.05), 0 8px 24px rgba(60, 40, 20, 0.06);

    --hl-comment: #948e83;
    --hl-keyword: #c2410c;
    --hl-string: #3f7d1c;
    --hl-number: #0f7b8a;
    --hl-title: #2459c9;
    --hl-attr: #8a5a00;
    --hl-add: #e3f3dc;
    --hl-del: #fbe3e0;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC",
        "MiSans", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", ui-monospace, Menlo,
        Consolas, "Noto Sans Mono CJK SC", monospace;

    --wrap: 720px;
    --header-h: 56px;
}

:root[data-theme="dark"] {
    --bg: #111418;
    --surface: #181c22;
    --text: #e7e3db;
    --text-soft: #c5c0b6;
    --muted: #8f897e;
    --line: #262b33;
    --line-strong: #353b45;
    --accent: #f5a261;
    --accent-soft: #2a211a;
    --code-bg: #191d24;
    --code-text: #dcd7cd;
    --selection: #5a3a1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);

    --hl-comment: #6f7680;
    --hl-keyword: #f5a261;
    --hl-string: #a3c76d;
    --hl-number: #5cc8d6;
    --hl-title: #82aaff;
    --hl-attr: #e5c07b;
    --hl-add: #1f3323;
    --hl-del: #3b2222;
}

/* ---------- 基础 ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--selection);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button {
    font: inherit;
}

:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    margin: 0 auto;
    max-width: calc(var(--wrap) + 48px);
    padding: 0 24px;
    width: 100%;
}

.dot {
    color: var(--muted);
    opacity: 0.7;
    margin: 0 0.5em;
}

.skip-link {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    left: 12px;
    padding: 6px 12px;
    position: absolute;
    top: -60px;
    z-index: 100;
}

.skip-link:focus {
    top: 12px;
}

/* ---------- 顶栏 ---------- */

.site-header {
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header-inner {
    align-items: center;
    display: flex;
    gap: 8px;
    height: var(--header-h);
}

.brand {
    align-items: center;
    display: inline-flex;
    font-size: 16px;
    font-weight: 650;
    gap: 8px;
    letter-spacing: 0.04em;
    margin-right: auto;
    white-space: nowrap;
}

.brand-mark {
    color: var(--accent);
    flex: none;
}

.brand-mark-echo {
    opacity: 0.45;
}

.site-nav {
    display: flex;
    gap: 2px;
}

.site-nav a {
    border-radius: 6px;
    color: var(--muted);
    font-size: 14.5px;
    padding: 5px 10px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

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

.site-nav a[aria-current="page"] {
    color: var(--accent);
}

.icon-btn {
    align-items: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: color 0.15s, background 0.15s;
    width: 32px;
}

.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.icon-moon,
:root[data-theme="dark"] .icon-sun {
    display: none;
}

:root[data-theme="dark"] .icon-moon {
    display: block;
}

/* ---------- 主体 / 页脚 ---------- */

#main {
    flex: 1;
    padding-bottom: 72px;
    padding-top: 48px;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    padding: 24px 0 32px;
}

.site-footer p {
    margin: 0 0 4px;
}

.site-footer b {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.site-footer .beian {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
}

.site-footer .beian a {
    align-items: center;
    display: inline-flex;
    gap: 4px;
}

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

/* ---------- 首页简介 ---------- */

.intro {
    align-items: center;
    display: flex;
    gap: 20px;
    margin-bottom: 44px;
}

.intro-avatar {
    border: 1px solid var(--line);
    border-radius: 50%;
    flex: none;
    height: 64px;
    object-fit: cover;
    width: 64px;
}

.intro-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.3;
    margin: 0 0 4px;
}

.intro-sub,
.intro-note {
    color: var(--muted);
    font-size: 14.5px;
    margin: 0;
}

.intro-sub {
    color: var(--text-soft);
}

/* ---------- 文章列表 ---------- */

.year-mark {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    gap: 14px;
    letter-spacing: 0.08em;
    margin: 36px 0 6px;
}

.year-mark:first-child {
    margin-top: 0;
}

.year-mark::after {
    background: var(--line);
    content: "";
    flex: 1;
    height: 1px;
}

.entry {
    display: grid;
    gap: 0 20px;
    grid-template-columns: 3.4rem minmax(0, 1fr);
    padding: 20px 0;
}

.entry + .entry {
    border-top: 1px dashed var(--line);
}

.entry-date {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 29px;
}

.entry-title {
    font-size: 18px;
    font-weight: 650;
    line-height: 1.6;
    margin: 0;
}

.entry-title a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 1.5px;
    transition: background-size 0.25s ease, color 0.15s;
}

.entry-title a:hover {
    background-size: 100% 1.5px;
    color: var(--accent);
}

.entry-excerpt {
    color: var(--muted);
    display: -webkit-box;
    font-size: 14.5px;
    line-height: 1.75;
    margin: 6px 0 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.entry-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 10px;
}

.tag {
    color: var(--muted);
    font-size: 13px;
    transition: color 0.15s;
}

.tag::before {
    color: var(--line-strong);
    content: "#";
    margin-right: 1px;
}

.tag:hover {
    color: var(--accent);
}

.stats {
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    gap: 12px;
    margin-left: auto;
    white-space: nowrap;
}

.likes[hidden] {
    display: none;
}

.stats b,
.post-meta b {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.entries-compact .entry {
    padding: 11px 0;
}

.entries-compact .entry-title {
    font-size: 16px;
    font-weight: 500;
}

.entries-compact .entry-date {
    line-height: 26px;
}

.pager {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: grid;
    font-size: 14px;
    grid-template-columns: 1fr auto 1fr;
    margin-top: 28px;
    padding-top: 20px;
}

.pager a:hover {
    color: var(--accent);
}

.pager a[rel="next"] {
    text-align: right;
}

.pager-pos {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* ---------- 首页「读得最多」 ---------- */

.home-body {
    position: relative;
}

.hot {
    margin-top: 44px;
}

.hot[hidden] {
    display: none;
}

.hot-heading {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    margin: 0 0 8px;
}

.hot ol {
    counter-reset: hot;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hot li {
    align-items: baseline;
    counter-increment: hot;
    display: flex;
    font-size: 14px;
    gap: 10px;
    line-height: 1.55;
    padding: 6px 0;
}

.hot li::before {
    color: var(--accent);
    content: counter(hot);
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
    width: 1em;
}

.hot li a {
    color: var(--text-soft);
    flex: 1;
    min-width: 0;
    transition: color 0.15s;
}

.hot li a:hover {
    color: var(--accent);
}

.hot-count {
    color: var(--muted);
    flex: none;
    font-family: var(--font-mono);
    font-size: 12px;
}

/* 宽屏：挂到正文右侧的留白里，和文章页的目录同一个位置 */
@media (min-width: 1340px) {
    .hot {
        bottom: 0;
        left: 100%;
        margin: 0 0 0 56px;
        position: absolute;
        top: 0;
        width: 232px;
    }

    .hot-inner {
        border-left: 1px solid var(--line);
        padding-left: 14px;
        position: sticky;
        top: calc(var(--header-h) + 32px);
    }

    .hot li {
        font-size: 13px;
    }
}

/* ---------- 页面标题（归档 / 标签 / 关于） ---------- */

.page-header {
    margin-bottom: 36px;
}

.page-kicker {
    color: var(--accent);
    font-size: 13px;
    letter-spacing: 0.1em;
    margin: 0 0 4px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.page-desc {
    color: var(--muted);
    font-size: 14px;
    margin: 6px 0 0;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    font-size: 14.5px;
    gap: 8px;
    padding: 5px 14px;
    transition: border-color 0.15s, color 0.15s;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chip-count {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* ---------- 文章页 ---------- */

#progress {
    background: var(--accent);
    height: 2px;
    left: 0;
    position: fixed;
    top: 0;
    transform: scaleX(0);
    transform-origin: 0 50%;
    width: 100%;
    z-index: 30;
}

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

.post-kicker {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 10px;
}

.post-kicker a {
    color: var(--accent);
}

.post-kicker time {
    font-family: var(--font-mono);
    font-size: 13px;
}

.post-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
    margin: 0 0 14px;
    text-wrap: balance;
}

.post-meta {
    color: var(--muted);
    font-size: 13.5px;
    margin: 0;
}

.post-body {
    position: relative;
}

/* 目录 */

.toc,
.toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc ol {
    padding-left: 14px;
}

.toc a {
    border-left: 2px solid transparent;
    color: var(--muted);
    display: block;
    font-size: 13px;
    line-height: 1.5;
    margin-left: -2px;
    padding: 4px 0 4px 12px;
    transition: color 0.15s;
}

.toc a:hover {
    color: var(--text);
}

.toc a.active {
    border-left-color: var(--accent);
    color: var(--accent);
}

.toc-side {
    bottom: 0;
    display: none;
    left: 100%;
    margin-left: 56px;
    position: absolute;
    top: 0;
    width: 232px;
}

.toc-side-inner {
    border-left: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h) - 64px);
    overflow-y: auto;
    position: sticky;
    scrollbar-width: thin;
    top: calc(var(--header-h) + 32px);
}

.toc-heading {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    margin: 0 0 6px 12px;
}

.toc-inline {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 28px;
    padding: 10px 16px;
}

.toc-inline summary {
    color: var(--text-soft);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.toc-inline[open] summary {
    margin-bottom: 6px;
}

.toc-inline .toc a {
    padding-left: 4px;
}

@media (min-width: 1340px) {
    .toc-side {
        display: block;
    }

    .toc-inline {
        display: none;
    }
}

/* 正文排版 */

.prose {
    color: var(--text);
    font-size: 16.5px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.prose > :first-child {
    margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose .code-block,
.prose .table-wrap,
.prose figure {
    margin: 1.15em 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-weight: 700;
    line-height: 1.45;
    margin: 2.2em 0 0.8em;
    position: relative;
}

.prose h1 {
    font-size: 1.6em;
}

.prose h2 {
    border-bottom: 1px solid var(--line);
    font-size: 1.42em;
    margin-top: 2.6em;
    padding-bottom: 0.35em;
}

.prose h3 {
    font-size: 1.18em;
}

.prose h4,
.prose h5,
.prose h6 {
    font-size: 1.04em;
}

.prose .headerlink {
    display: none;
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s;
}

.prose a:hover {
    text-decoration-color: var(--accent);
}

.prose strong {
    font-weight: 650;
}

.prose ul,
.prose ol {
    padding-left: 1.5em;
}

.prose li {
    margin: 0.35em 0;
}

.prose li::marker {
    color: var(--muted);
}

.prose li > ul,
.prose li > ol {
    margin: 0.35em 0;
}

.prose blockquote {
    border-left: 3px solid var(--line-strong);
    color: var(--text-soft);
    padding: 0.1em 0 0.1em 1.1em;
}

.prose blockquote > :first-child {
    margin-top: 0;
}

.prose blockquote > :last-child {
    margin-bottom: 0;
}

/* 文章开头的引用块当作导语卡片 */
.prose > blockquote:first-child {
    background: var(--accent-soft);
    border-left-color: var(--accent);
    border-radius: 0 10px 10px 0;
    font-size: 0.94em;
    padding: 0.9em 1.2em;
}

.prose hr {
    border: 0;
    color: var(--line-strong);
    margin: 2.4em 0;
    text-align: center;
}

.prose hr::after {
    content: "· · ·";
    letter-spacing: 0.5em;
}

.prose img {
    border-radius: 8px;
    cursor: zoom-in;
    display: block;
    height: auto;
    margin: 1.4em auto;
}

.prose code {
    background: var(--code-bg);
    border-radius: 4px;
    color: var(--code-text);
    font-family: var(--font-mono);
    font-size: 0.86em;
    padding: 0.15em 0.4em;
}

.prose a code {
    color: inherit;
}

.prose kbd {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.82em;
    padding: 0.1em 0.4em;
}

/* 代码块 */

.code-block {
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.code-bar {
    align-items: center;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    font-family: var(--font-mono);
    font-size: 12px;
    height: 32px;
    justify-content: space-between;
    padding: 0 6px 0 14px;
}

.code-copy {
    background: none;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12px;
    padding: 2px 8px;
}

.code-copy:hover {
    background: var(--line);
    color: var(--text);
}

.code-copy.copied {
    color: var(--accent);
}

.prose pre {
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.65;
    overflow-x: auto;
    padding: 14px 16px;
    scrollbar-width: thin;
    tab-size: 4;
}

.code-block pre {
    border: 0;
    border-radius: 0;
    margin: 0;
}

.prose pre code {
    background: none;
    border-radius: 0;
    color: var(--code-text);
    display: block;
    font-size: inherit;
    padding: 0;
    white-space: pre;
    width: max-content;
    min-width: 100%;
}

.hljs-comment,
.hljs-quote,
.hljs-meta {
    color: var(--hl-comment);
}

.hljs-comment,
.hljs-quote {
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
    color: var(--hl-keyword);
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-symbol,
.hljs-bullet {
    color: var(--hl-string);
}

.hljs-number,
.hljs-literal,
.hljs-type,
.hljs-link {
    color: var(--hl-number);
}

.hljs-title,
.hljs-section,
.hljs-selector-id,
.hljs-selector-class,
.hljs-function .hljs-title {
    color: var(--hl-title);
}

.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable,
.hljs-params,
.hljs-property {
    color: var(--hl-attr);
}

.hljs-params {
    color: inherit;
}

.hljs-deletion {
    background: var(--hl-del);
}

.hljs-addition {
    background: var(--hl-add);
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: 700;
}

/* 表格 */

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.prose table {
    border-collapse: collapse;
    font-size: 0.9em;
    line-height: 1.6;
    width: 100%;
}

.prose th,
.prose td {
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
    text-align: left;
    vertical-align: top;
}

.prose th {
    background: var(--code-bg);
    font-weight: 600;
    white-space: nowrap;
}

.prose tr:last-child td {
    border-bottom: 0;
}

/* 文末 */

.post-footer {
    margin-top: 56px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.action-btn {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    gap: 7px;
    padding: 7px 18px;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
}

.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.action-btn:active {
    transform: scale(0.97);
}

#like-btn.liked {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

#like-btn.pop svg {
    animation: like-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes like-pop {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.45);
    }
    100% {
        transform: scale(1);
    }
}

/* 转发菜单 */

.share {
    position: relative;
}

.share-menu {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    bottom: calc(100% + 8px);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    left: 0;
    min-width: 172px;
    padding: 5px;
    position: absolute;
    z-index: 10;
}

.share-menu[hidden],
.share-menu button[hidden] {
    display: none;
}

.share-menu button {
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.share-menu button:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* 分享卡片 */

#card-modal {
    align-items: center;
    background: rgba(10, 10, 12, 0.78);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    position: fixed;
    z-index: 55;
}

#card-modal[hidden] {
    display: none;
}

.card-box {
    margin: auto;
    max-width: 360px;
    text-align: center;
    width: 100%;
}

.card-box img {
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: block;
    max-height: 70vh;
    margin: 0 auto;
    object-fit: contain;
    width: auto;
}

.card-hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    margin: 14px 0 12px;
}

.card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#like-btn.liked svg {
    fill: currentColor;
}

.post-nav {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
    margin-top: 36px;
    padding-top: 24px;
}

.post-nav-item {
    display: block;
    min-width: 0;
}

.post-nav-next {
    text-align: right;
}

.post-nav-label {
    color: var(--muted);
    display: block;
    font-size: 12.5px;
    margin-bottom: 2px;
}

.post-nav-title {
    display: block;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.55;
    transition: color 0.15s;
}

.post-nav-item:hover .post-nav-title {
    color: var(--accent);
}

/* 提示条 / 图片预览 */

#toast {
    background: var(--text);
    border-radius: 999px;
    bottom: 40px;
    color: var(--bg);
    font-size: 13px;
    left: 50%;
    opacity: 0;
    padding: 7px 18px;
    pointer-events: none;
    position: fixed;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 60;
}

#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

#lightbox {
    align-items: center;
    background: rgba(10, 10, 12, 0.86);
    cursor: zoom-out;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 50;
}

#lightbox[hidden] {
    display: none;
}

#lightbox img {
    border-radius: 6px;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 640px) {
    .wrap {
        padding: 0 18px;
    }

    #main {
        padding-top: 32px;
    }

    .brand {
        font-size: 15px;
    }

    .site-nav a {
        font-size: 14px;
        padding: 5px 7px;
    }

    .intro {
        gap: 14px;
        margin-bottom: 32px;
    }

    .intro-avatar {
        height: 52px;
        width: 52px;
    }

    .intro-title {
        font-size: 22px;
    }

    .entry {
        display: block;
        padding: 16px 0;
    }

    .entry-date {
        display: block;
        font-size: 12px;
        line-height: 1.6;
    }

    .entry-title {
        font-size: 17px;
    }

    .entries-compact .entry-date {
        line-height: 1.6;
    }

    .post-title {
        font-size: 24px;
    }

    .page-title {
        font-size: 24px;
    }

    .prose {
        font-size: 16px;
        line-height: 1.8;
    }

    .prose pre {
        font-size: 13px;
        padding: 12px 14px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
    }
}

@media (max-width: 380px) {
    .brand span {
        display: none;
    }
}

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

@media print {
    .site-header,
    .site-footer,
    .toc-side,
    .toc-inline,
    .actions,
    .hot,
    .post-nav,
    #progress {
        display: none !important;
    }
}
