/* ============================================================
   ZH · 简约单栏主题
   单一样式表：CSS 变量定义明暗双色板，移动优先
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
    --zh-bg: #f7f8fa;
    --zh-surface: #ffffff;
    --zh-text: #1f2328;
    --zh-text-2: #6b7280;
    --zh-border: #e7e9ef;
    --zh-accent: #3e63dd;
    --zh-accent-weak: #eef2ff;
    --zh-header-bg: rgba(247, 248, 250, .82);
    --zh-code-inline-bg: #eef0f4;
    --zh-code-bg: #272822;
    --zh-code-fg: #f8f8f2;
    --zh-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --zh-shadow-lg: 0 14px 28px -14px rgba(16, 24, 40, .18);
    --zh-radius: 14px;
    --zh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --zh-bg: #0f1216;
    --zh-surface: #161a21;
    --zh-text: #e8ebf0;
    --zh-text-2: #98a1ad;
    --zh-border: #262c36;
    --zh-accent: #7c9bff;
    --zh-accent-weak: #1d2436;
    --zh-header-bg: rgba(15, 18, 22, .82);
    --zh-code-inline-bg: #232933;
    --zh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --zh-shadow-lg: 0 14px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--zh-font);
    font-size: 16px;
    line-height: 1.75;
    color: var(--zh-text);
    background: var(--zh-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .25s ease, color .25s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color .18s ease;
}

img {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

::selection {
    background: var(--zh-accent);
    color: #fff;
}

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

.zh-skip {
    position: absolute;
    left: -999px;
    top: 8px;
    z-index: 300;
    padding: .5em 1em;
    background: var(--zh-accent);
    color: #fff;
    border-radius: 8px;
}

.zh-skip:focus {
    left: 8px;
}

.zh-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.zh-main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
    flex: 1;
}

/* ---------- 顶部导航 ---------- */
.zh-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--zh-header-bg);
    -webkit-backdrop-filter: saturate(1.5) blur(14px);
    backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--zh-border);
    transition: box-shadow .25s ease;
}

.zh-header.zh-scrolled {
    box-shadow: var(--zh-shadow-sm);
}

.zh-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.zh-brand {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

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

.zh-nav {
    flex: 1;
    min-width: 0;
}

.zh-menu {
    display: flex;
    align-items: center;
    gap: .35rem;
    list-style: none;
}

.zh-item > a {
    display: flex;
    align-items: center;
    gap: .3em;
    padding: .45em .8em;
    border-radius: 8px;
    font-size: .95rem;
    color: var(--zh-text-2);
    white-space: nowrap;
}

.zh-item > a:hover {
    color: var(--zh-text);
    background: var(--zh-accent-weak);
}

.zh-item.active > a {
    color: var(--zh-accent);
    font-weight: 600;
}

.zh-caret {
    opacity: .7;
    transition: transform .2s ease;
}

.zh-has-sub {
    position: relative;
}

/* 下拉分类 */
.zh-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    list-style: none;
    background: var(--zh-surface);
    border: 1px solid var(--zh-border);
    border-radius: 12px;
    box-shadow: var(--zh-shadow-lg);
    padding: .4rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.zh-has-sub:hover .zh-caret,
.zh-has-sub.open .zh-caret {
    transform: rotate(180deg);
}

.zh-submenu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .45em .8em;
    border-radius: 8px;
    font-size: .92rem;
    color: var(--zh-text);
}

.zh-submenu a:hover {
    background: var(--zh-accent-weak);
    color: var(--zh-accent);
}

.zh-submenu-count {
    font-size: .78rem;
    color: var(--zh-text-2);
    font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (min-width: 961px) {
    .zh-has-sub:hover .zh-submenu,
    .zh-has-sub:focus-within .zh-submenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* 右侧操作区 */
.zh-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-left: auto;
}

.zh-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--zh-text-2);
    transition: background-color .18s ease, color .18s ease;
}

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

.zh-ico-moon,
.zh-ico-close {
    display: none;
}

[data-theme="dark"] .zh-ico-sun {
    display: none;
}

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

.zh-search {
    display: flex;
    align-items: center;
    position: relative;
}

.zh-search form {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width .25s ease, opacity .2s ease;
}

.zh-search input {
    width: 100%;
    height: 36px;
    padding: 0 .9em;
    border: 1px solid var(--zh-border);
    border-radius: 10px;
    background: var(--zh-surface);
    color: var(--zh-text);
    font-size: .9rem;
    outline: none;
}

.zh-search input:focus {
    border-color: var(--zh-accent);
}

.zh-search.zh-search-open form {
    width: 200px;
    opacity: 1;
    margin-right: .4rem;
}

.zh-burger {
    display: none;
}

.zh-header.zh-nav-open .zh-ico-bars {
    display: none;
}

.zh-header.zh-nav-open .zh-ico-close {
    display: block;
}

/* ---------- 文章卡片列表 ---------- */
.zh-post-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.zh-card {
    display: flex;
    gap: 1.25rem;
    background: var(--zh-surface);
    border: 1px solid var(--zh-border);
    border-radius: var(--zh-radius);
    padding: 1rem;
    box-shadow: var(--zh-shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.zh-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--zh-shadow-lg);
    border-color: transparent;
}

.zh-card-thumb {
    flex: 0 0 232px;
    align-self: flex-start;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--zh-code-inline-bg);
}

.zh-card-thumb .zh-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.zh-card:hover .zh-card-thumb .zh-thumb {
    transform: scale(1.045);
}

.zh-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .5rem;
}

.zh-card-title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.5;
}

.zh-card-title a {
    display: block;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.zh-card-title a:hover {
    color: var(--zh-accent);
}

.zh-card-excerpt {
    margin: 0;
    color: var(--zh-text-2);
    font-size: .92rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.zh-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55em;
    font-size: .82rem;
    color: var(--zh-text-2);
    font-variant-numeric: tabular-nums;
}

.zh-card-meta a:hover {
    color: var(--zh-accent);
}

.zh-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--zh-text-2);
    opacity: .55;
    flex: 0 0 auto;
}

/* ---------- 分页 ---------- */
.page-navigator {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .45rem;
    list-style: none;
    margin: 2.5rem 0 0;
}

.page-navigator li a,
.page-navigator li strong {
    display: inline-block;
    padding: .45em .95em;
    border: 1px solid var(--zh-border);
    border-radius: 9px;
    background: var(--zh-surface);
    font-size: .9rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.page-navigator li a:hover {
    color: var(--zh-accent);
    border-color: var(--zh-accent);
}

.page-navigator li.current strong {
    background: var(--zh-accent);
    border-color: var(--zh-accent);
    color: #fff;
}

/* ---------- 页面/归档标题 ---------- */
.zh-page-head {
    margin-bottom: 2rem;
}

.zh-page-title {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
}

.zh-page-sub {
    margin: 0;
    color: var(--zh-text-2);
    font-size: .9rem;
}

/* ---------- 文章页 ---------- */
.zh-post-head {
    margin-bottom: 2rem;
}

.zh-post-title {
    margin: 0 0 .75rem;
    font-size: 1.75rem;
    line-height: 1.4;
}

.zh-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55em;
    color: var(--zh-text-2);
    font-size: .86rem;
    font-variant-numeric: tabular-nums;
}

.zh-post-meta a:hover {
    color: var(--zh-accent);
}

.zh-post-foot {
    margin-top: 2.5rem;
}

.zh-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.zh-post-tags a {
    padding: .28em .85em;
    border-radius: 999px;
    background: var(--zh-accent-weak);
    color: var(--zh-accent);
    font-size: .82rem;
}

.zh-post-tags a:hover {
    opacity: .8;
}

.zh-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--zh-border);
    font-size: .92rem;
}

.zh-post-nav-item {
    flex: 1;
    min-width: 0;
}

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

.zh-post-nav-item a {
    color: var(--zh-text-2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

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

/* ---------- 正文排版 ---------- */
.zh-content {
    font-size: 1rem;
    line-height: 1.85;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.zh-content > *:first-child {
    margin-top: 0;
}

.zh-content h1,
.zh-content h2,
.zh-content h3,
.zh-content h4,
.zh-content h5,
.zh-content h6 {
    margin: 2em 0 .8em;
    line-height: 1.45;
    font-weight: 700;
}

.zh-content h2 {
    font-size: 1.35em;
    padding-bottom: .35em;
    border-bottom: 1px solid var(--zh-border);
}

.zh-content h3 {
    font-size: 1.18em;
}

.zh-content h4,
.zh-content h5,
.zh-content h6 {
    font-size: 1.05em;
}

.zh-content p {
    margin: 1.1em 0;
}

.zh-content a {
    color: var(--zh-accent);
}

.zh-content a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.zh-content blockquote {
    margin: 1.4em 0;
    padding: .2em 1.2em;
    border-left: 3px solid var(--zh-accent);
    background: var(--zh-accent-weak);
    border-radius: 0 10px 10px 0;
    color: var(--zh-text-2);
}

.zh-content blockquote p {
    margin: .8em 0;
}

.zh-content ul,
.zh-content ol {
    padding-left: 1.6em;
    margin: 1.1em 0;
}

.zh-content li {
    margin: .35em 0;
}

.zh-content img {
    border-radius: 10px;
    display: block;
    margin: 1.4em auto;
    cursor: zoom-in;
}

.zh-content code {
    padding: .18em .45em;
    border-radius: 6px;
    background: var(--zh-code-inline-bg);
    font-size: .88em;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.zh-content pre {
    margin: 1.5em 0;
    padding: 1.1em 1.2em;
    border-radius: 12px;
    background: var(--zh-code-bg);
    color: var(--zh-code-fg);
    overflow: auto;
    font-size: .875rem;
    line-height: 1.7;
    position: relative;
}

.zh-content pre code {
    display: block;
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    white-space: pre;
}

.zh-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: .92rem;
}

.zh-content th,
.zh-content td {
    border: 1px solid var(--zh-border);
    padding: .55em .9em;
    text-align: left;
}

.zh-content th {
    background: var(--zh-code-inline-bg);
}

.zh-content hr {
    border: 0;
    border-top: 1px solid var(--zh-border);
    margin: 2.5em 0;
}

.zh-content figure {
    margin: 1.6em 0;
    text-align: center;
}

.zh-content figcaption {
    margin-top: .6em;
    color: var(--zh-text-2);
    font-size: .85rem;
}

/* 代码复制按钮 */
.zh-copy-btn {
    position: absolute;
    top: .6rem;
    right: .6rem;
    padding: .25em .7em;
    border: 0;
    border-radius: 7px;
    background: rgba(255, 255, 255, .12);
    color: #c8cdd6;
    font-size: .75rem;
    opacity: 0;
    transition: opacity .18s ease, background-color .18s ease;
}

.zh-content pre:hover .zh-copy-btn,
.zh-copy-btn:focus-visible {
    opacity: 1;
}

.zh-copy-btn:hover {
    background: rgba(255, 255, 255, .22);
}

.zh-copy-btn.zh-copied {
    color: #7ee2a8;
}

/* ---------- 评论 ---------- */
.zh-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--zh-border);
}

.zh-comments-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
}

.zh-comment-list {
    list-style: none;
}

.zh-comment {
    display: flex;
    gap: .85rem;
    padding: 1.1rem 0;
    border-top: 1px solid var(--zh-border);
}

.zh-comment-list > .zh-comment:first-child {
    border-top: 0;
    padding-top: .3rem;
}

.zh-comment-children {
    margin-top: .4rem;
}

.zh-comment-children .zh-comment:first-child {
    border-top: 1px dashed var(--zh-border);
}

.zh-comment-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--zh-accent-weak);
    display: block;
}

.zh-comment-main {
    flex: 1;
    min-width: 0;
}

.zh-comment-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .7em;
    font-size: .84rem;
    color: var(--zh-text-2);
}

.zh-comment-author {
    font-weight: 600;
    color: var(--zh-text);
    font-size: .92rem;
}

.zh-comment-by-author .zh-comment-author::after {
    content: "作者";
    margin-left: .5em;
    padding: .1em .5em;
    border-radius: 999px;
    background: var(--zh-accent-weak);
    color: var(--zh-accent);
    font-size: .72rem;
    font-weight: 500;
    vertical-align: 1px;
}

.zh-comment-content {
    margin-top: .4em;
    font-size: .95rem;
    overflow-wrap: break-word;
}

.zh-comment-content p {
    margin: .4em 0;
}

.zh-comment-actions {
    margin-top: .3em;
    font-size: .82rem;
}

.zh-comment-actions a {
    color: var(--zh-text-2);
}

.zh-comment-actions a:hover {
    color: var(--zh-accent);
}

.zh-cancel-reply {
    margin-top: 1rem;
    font-size: .88rem;
}

.zh-cancel-reply a {
    color: var(--zh-accent);
    display: none;
}

.zh-cancel-reply a[style*="block"],
.zh-cancel-reply a:not([style*="none"]) {
    display: inline-block;
}

.zh-respond {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--zh-surface);
    border: 1px solid var(--zh-border);
    border-radius: var(--zh-radius);
}

.zh-respond-title {
    margin: 0 0 .9rem;
    font-size: 1rem;
}

.zh-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin-bottom: .6rem;
}

.zh-respond input,
.zh-respond textarea {
    width: 100%;
    padding: .65em .9em;
    border: 1px solid var(--zh-border);
    border-radius: 10px;
    background: var(--zh-bg);
    color: var(--zh-text);
    font-family: inherit;
    font-size: .92rem;
    outline: none;
    transition: border-color .18s ease;
}

.zh-respond input:focus,
.zh-respond textarea:focus {
    border-color: var(--zh-accent);
}

.zh-respond textarea {
    resize: vertical;
    min-height: 110px;
    margin-bottom: .75rem;
}

.zh-respond-user {
    margin: 0 0 .6rem;
    font-size: .88rem;
    color: var(--zh-text-2);
}

.zh-respond-user a {
    color: var(--zh-accent);
    margin: 0 .25em;
}

.zh-form-actions {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.zh-btn-submit {
    padding: .55em 1.5em;
    border: 0;
    border-radius: 10px;
    background: var(--zh-accent);
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    transition: opacity .18s ease, transform .18s ease;
}

.zh-btn-submit:hover {
    opacity: .88;
}

.zh-btn-submit:active {
    transform: scale(.97);
}

.zh-form-hint {
    color: var(--zh-text-2);
    font-size: .8rem;
}

.zh-comments-closed {
    color: var(--zh-text-2);
    font-size: .9rem;
}

/* ---------- 分类索引页 ---------- */
.zh-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.zh-cat-card {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: 1.1rem 1.2rem;
    background: var(--zh-surface);
    border: 1px solid var(--zh-border);
    border-radius: var(--zh-radius);
    box-shadow: var(--zh-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.zh-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--zh-shadow-lg);
    border-color: transparent;
}

.zh-cat-name {
    font-weight: 700;
}

.zh-cat-card:hover .zh-cat-name {
    color: var(--zh-accent);
}

.zh-cat-count {
    font-size: .82rem;
    color: var(--zh-text-2);
}

.zh-cat-desc {
    font-size: .85rem;
    color: var(--zh-text-2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---------- 友情链接 ---------- */
.zh-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.zh-link-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.1rem;
    background: var(--zh-surface);
    border: 1px solid var(--zh-border);
    border-radius: var(--zh-radius);
    box-shadow: var(--zh-shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.zh-link-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--zh-shadow-lg);
    border-color: transparent;
}

.zh-link-avatar {
    flex: 0 0 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--zh-accent-weak);
    color: var(--zh-accent);
    font-size: 1.2rem;
    font-weight: 700;
}

.zh-link-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.zh-link-name {
    font-weight: 600;
}

.zh-link-card:hover .zh-link-name {
    color: var(--zh-accent);
}

.zh-link-desc {
    color: var(--zh-text-2);
    font-size: .84rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* ---------- 归档时间轴 ---------- */
.zh-timeline {
    margin-bottom: 2rem;
}

.zh-timeline-year {
    margin: 0 0 .6rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--zh-border);
    font-size: 1.15rem;
}

.zh-timeline-year span {
    color: var(--zh-text-2);
    font-size: .85rem;
    font-weight: 400;
}

.zh-timeline-list {
    list-style: none;
}

.zh-timeline-list li {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: .5rem 0;
}

.zh-tl-date {
    flex: 0 0 44px;
    color: var(--zh-text-2);
    font-size: .84rem;
    font-variant-numeric: tabular-nums;
}

.zh-timeline-list a {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.zh-timeline-list a:hover {
    color: var(--zh-accent);
}

/* ---------- 空状态 / 404 ---------- */
.zh-empty {
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--zh-text-2);
    background: var(--zh-surface);
    border: 1px dashed var(--zh-border);
    border-radius: var(--zh-radius);
}

.zh-404 {
    text-align: center;
    padding-top: 4rem;
}

.zh-404-code {
    margin: 0;
    font-size: 5.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .06em;
    color: var(--zh-accent);
    opacity: .35;
    font-variant-numeric: tabular-nums;
}

.zh-404-title {
    margin: .75rem 0 .4rem;
    font-size: 1.3rem;
}

.zh-404-text {
    margin: 0 0 1.75rem;
    color: var(--zh-text-2);
}

.zh-btn {
    display: inline-block;
    padding: .6em 1.6em;
    border-radius: 10px;
    background: var(--zh-accent);
    color: #fff;
    font-weight: 600;
}

.zh-btn:hover {
    opacity: .88;
}

/* ---------- 页脚 ---------- */
.zh-footer {
    border-top: 1px solid var(--zh-border);
    margin-top: 2rem;
}

.zh-footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.25rem calc(2.25rem + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--zh-text-2);
    font-size: .84rem;
}

.zh-footer-line {
    margin: .25em 0;
}

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

.zh-footer-sep {
    margin: 0 .5em;
    opacity: .5;
}

/* ---------- 返回顶部 ---------- */
.zh-backtop {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    z-index: 90;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--zh-border);
    border-radius: 50%;
    background: var(--zh-surface);
    color: var(--zh-text-2);
    box-shadow: var(--zh-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s, color .18s ease;
}

.zh-backtop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

/* ---------- 灯箱（由 main.js 创建） ---------- */
.zh-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(8, 10, 14, .9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    animation: zh-fade-in .2s ease;
}

.zh-lightbox img {
    max-width: 94vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
    animation: zh-zoom-in .22s ease;
    cursor: default;
}

@keyframes zh-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zh-zoom-in {
    from { transform: scale(.94); }
    to { transform: scale(1); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .zh-burger {
        display: inline-flex;
    }

    .zh-nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        z-index: 99;
        background: var(--zh-surface);
        border-bottom: 1px solid var(--zh-border);
        box-shadow: var(--zh-shadow-lg);
        display: none;
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
    }

    .zh-header.zh-nav-open .zh-nav {
        display: block;
    }

    .zh-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem;
    }

    .zh-item > a {
        justify-content: space-between;
        padding: .7em .9em;
        border-radius: 10px;
        font-size: 1rem;
    }

    .zh-submenu {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding: 0 0 .35rem;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .zh-has-sub.open .zh-submenu {
        display: block;
        animation: zh-fade-in .18s ease;
    }

    .zh-has-sub.open {
        background: var(--zh-accent-weak);
        border-radius: 10px;
    }

    .zh-submenu a {
        padding-left: 1.8em;
    }

    .zh-search.zh-search-open {
        position: static;
    }

    .zh-search.zh-search-open form {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        width: min(320px, 82vw);
        margin: 0;
        padding: 4px;
        background: var(--zh-surface);
        border: 1px solid var(--zh-border);
        border-radius: 12px;
        box-shadow: var(--zh-shadow-lg);
        opacity: 1;
    }

    .zh-search.zh-search-open input {
        border-color: transparent;
        background: var(--zh-bg);
    }
}

@media (max-width: 620px) {
    .zh-main {
        padding-top: 1.75rem;
    }

    .zh-header-inner {
        height: 56px;
        gap: .75rem;
    }

    .zh-nav {
        top: 56px;
        max-height: calc(100dvh - 56px);
    }

    .zh-brand {
        font-size: 1.05rem;
    }

    .zh-card {
        flex-direction: column;
        gap: .85rem;
        padding: .85rem;
    }

    .zh-card-thumb {
        flex: none;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .zh-post-title {
        font-size: 1.45rem;
    }

    .zh-form-row {
        grid-template-columns: 1fr;
    }
}

    .zh-post-nav {
        flex-direction: column;
    }

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

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
