/* ============================================================
   布局组件库 - 复刻 wangruofeng007.com
   结构：.site-shell > .primary-sidebar + .content-wrap
         .content-wrap > .topbar + main.main-column + .footer
   ============================================================ */

/* ---------- 外壳 ---------- */
.site-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .28s;
}
body.sidebar-collapsed .site-shell { grid-template-columns: 0 minmax(0, 1fr); }

.content-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ---------- 左侧栏 ---------- */
.primary-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 280px;
    height: 100vh;
    padding: 2.2rem 1.6rem 2.5rem;
    color: #f8f9fb;
    background: linear-gradient(170deg, #2a2218 0%, #3a3020 35%, #4a3d2a 60%, #2a2218 100%);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    /* x 轴裁剪：光晕伪元素 right:-80px 越界不产生水平滚动，仅 y 向滚动 */
    overflow: hidden auto;
    overscroll-behavior: none;
    z-index: 20;
    transition: width .28s, padding .28s, opacity .2s, transform .35s;
}
[data-theme="dark"] .primary-sidebar {
    background: linear-gradient(170deg, #201a12 0%, #2c2418 35%, #3a3020 60%, #1f1a11 100%);
}
.primary-sidebar::before,
.primary-sidebar::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.primary-sidebar::before {
    width: 260px; height: 260px;
    top: -60px; right: -80px;
    filter: blur(40px);
    background: radial-gradient(circle, rgba(201, 100, 66, .2) 0%, transparent 70%);
}
.primary-sidebar::after {
    width: 200px; height: 200px;
    bottom: 80px; left: -40px;
    filter: blur(35px);
    background: radial-gradient(circle, rgba(47, 93, 98, .15) 0%, transparent 70%);
}
.primary-sidebar > * { position: relative; z-index: 1; }

body.sidebar-collapsed .primary-sidebar {
    opacity: 0;
    pointer-events: none;
    border-right-color: transparent;
    width: 0; min-width: 0;
    padding-inline: 0;
    overflow: hidden;
}

/* 侧栏内部滚动条 */
.primary-sidebar::-webkit-scrollbar { width: 4px; }
.primary-sidebar::-webkit-scrollbar-track { background: transparent; }
.primary-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 2px; }

/* ---------- 侧栏：作者卡 ---------- */
.profile-card { text-align: center; padding: .5rem 0; }
.profile-card .profile-avatar {
    display: block;
    width: 96px; height: 96px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .25);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .06);
}
.profile-card .profile-name {
    margin: 0 0 .4rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.profile-card .profile-name:hover { color: #fff; opacity: .85; }
.profile-card .profile-bio {
    margin: 0;
    font-size: .85rem;
    line-height: 1.6;
    color: rgba(248, 249, 251, .65);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* ---------- 侧栏：导航 ---------- */
.sidebar-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .85rem;
    padding: .65rem 1.2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.sidebar-nav a svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar-nav a.active svg { opacity: 1; }

/* ---------- 侧栏：底部社交 ---------- */
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.sidebar-footer .social-row { display: flex; align-items: center; justify-content: center; gap: .4rem; }
.sidebar-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem; height: 2.4rem;
    border-radius: 8px;
    color: rgba(248, 249, 251, .7);
}
.sidebar-footer a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sidebar-footer svg { width: 1.15rem; height: 1.15rem; }

/* ---------- 移动端侧栏遮罩 ---------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 15;
}
body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--topbar-offset);
    padding: .5rem 1.8rem .5rem 2rem;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); min-width: 0; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .crumb-sep { color: var(--border-strong); }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }

/* 顶栏搜索框 */
.topbar-search { position: relative; }
.topbar-search input {
    width: 13rem;
    padding: .42rem 2.2rem .42rem 2.3rem;
    border: 0;
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: width .2s, box-shadow .2s;
}
.topbar-search input:focus { width: 16rem; box-shadow: 0 0 0 2px var(--accent-bg); }
.topbar-search input::placeholder { color: var(--muted); }
.topbar-search .search-icon {
    position: absolute;
    left: .7rem; top: 50%;
    transform: translateY(-50%);
    width: .95rem; height: .95rem;
    color: var(--muted);
    pointer-events: none;
}
.topbar-search kbd {
    position: absolute;
    right: .5rem; top: 50%;
    transform: translateY(-50%);
    padding: .05rem .4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    font-size: .7rem;
    font-family: inherit;
}

/* 汉堡按钮（移动端）与折叠按钮（桌面端） */
.mobile-only { display: none; }

/* ---------- 主栏 ---------- */
/* 不限宽居中：中列弹性撑满剩余宽度，右栏 280px 贴视口右缘 */
.main-column {
    flex: 1;
    width: 100%;
    padding: 2.5rem 2.5rem 3rem;
    display: flex;
    flex-direction: column;
}
main.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main.fade-in { animation: none; } }

/* 列表页双栏：内容 + 右侧栏 */
.content-body--with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    align-items: start;
}

/* 详情页双栏：正文 + 目录 */
.content-body--with-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2.5rem;
    align-items: start;
}

/* ---------- 右侧栏 ---------- */
.site-secondary {
    position: sticky;
    top: calc(var(--topbar-offset) + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.secondary-card {
    background: var(--panel);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
}
.secondary-card h3 {
    margin: 0 0 1rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud .hash-tag { font-size: .82rem; }

.category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .1rem; }
.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem .6rem;
    border-radius: 8px;
    font-size: .9rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.category-list a:hover { background: var(--subtle-bg-hover); color: var(--text); }
.category-list .cat-count { font-size: .75rem; color: var(--muted); background: var(--subtle-bg); padding: .05rem .5rem; border-radius: 999px; }

/* ---------- 文章列表卡 ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
}
.post-item:first-child { padding-top: .5rem; }
.post-cover {
    display: block;
    background: var(--subtle-bg);
    border-radius: 6px;
    overflow: hidden;
    align-self: flex-start;
}
.post-cover img {
    display: block;
    width: 220px;
    height: 128px;
    object-fit: cover;
    transition: transform .35s ease;
}
.post-item:hover .post-cover img { transform: scale(1.04); }

.post-body { min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.post-body h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-body h2 a { color: var(--text); text-decoration: none; }
.post-body h2 a:hover { color: var(--accent); }

.post-body .desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: .95rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-body .meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: auto;
    padding-top: .35rem;
}
.post-body .meta .date {
    margin-left: auto;
    font-size: .8rem;
    color: var(--muted);
    white-space: nowrap;
}
.post-body .meta .cat-link {
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
}
.post-body .meta .cat-link:hover { color: var(--accent); }

/* 标签胶囊 */
.hash-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: var(--subtle-bg);
    color: var(--muted);
    font-size: .82rem;
    text-decoration: none;
    white-space: nowrap;
}
.hash-tag:hover { background: var(--accent-bg); color: var(--accent); }

/* ---------- 页面标题区 ---------- */
.page-hero { margin-bottom: 1rem; padding: .5rem 0 1.75rem; border-bottom: 1px solid var(--border); }
.page-hero .hero-kicker {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}
.page-hero h1 {
    margin: 0 0 .5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: anywhere;
}
.page-hero .hero-sub { margin: 0; font-size: .9rem; color: var(--muted); }
.page-hero .hero-sub .accent { color: var(--accent); font-weight: 600; }

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    margin-top: 2.5rem;
}
.pagination a,
.pagination span {
    padding: .38rem 1rem;
    font-size: .875rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--panel);
}
.pagination a:hover { border-color: var(--border-strong); color: var(--text); }
.pagination .page-info { border: 0; background: transparent; color: var(--muted); }

/* ---------- 空状态 ---------- */
.accent { color: var(--accent); font-weight: 600; }
.accent-link { color: var(--accent); text-decoration: none; }
.accent-link:hover { color: var(--accent-hover); }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-state .empty-icon { margin-bottom: 1rem; color: var(--border-strong); }
.empty-state .empty-icon svg { width: 4rem; height: 4rem; }
.empty-state h3 { margin: 0 0 .5rem; font-size: 1.25rem; color: var(--text-secondary); }
.empty-state p { margin: 0; font-size: .9rem; }
.empty-state a { color: var(--accent); }

/* ---------- 页脚 ---------- */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 0 2.5rem;
    font-size: .82rem;
    color: var(--muted);
}
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--text-secondary); }
.footer-links { display: flex; align-items: center; gap: 1rem; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--panel);
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s, background-color .2s, color .2s;
    z-index: 12;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { color: var(--accent); border-color: var(--border-strong); }
.back-to-top svg { width: 1.1rem; height: 1.1rem; }

/* ---------- 文章详情页 ---------- */
.article.card {
    background: var(--panel);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 2.5rem 2.75rem;
}
.article-header .article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--muted);
}
.article-header .article-meta .cat-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.article-header .article-meta .cat-link:hover { color: var(--accent-hover); }
.article-header h1 {
    margin: 0 0 .5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
}
.article-header .article-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* 上下篇导航 */
.post-nav {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}
.post-nav a {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    text-decoration: none;
}
.post-nav a:hover { border-color: var(--border-strong); }
.post-nav .nav-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.post-nav .nav-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-nav a:hover .nav-title { color: var(--accent); }
.post-nav .post-nav-next { text-align: right; }

/* ---------- 目录 TOC ---------- */
.toc {
    position: sticky;
    top: calc(var(--topbar-offset) + 1.5rem);
    max-height: calc(100vh - var(--topbar-offset) - 3rem);
    overflow-y: auto;
}
.toc h3 {
    margin: 0 0 .75rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a {
    display: block;
    padding: .3rem 0 .3rem .9rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .toc-h3 a { padding-left: 1.7rem; }

/* ---------- 归档时间线 ---------- */
.archive-group { margin-bottom: 2.5rem; }
.archive-group h2 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.archive-list { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); }
.archive-list li { position: relative; padding: 0 0 1.1rem; }
.archive-list li::before {
    content: "";
    position: absolute;
    left: -1.65rem;
    top: .45rem;
    width: .6rem; height: .6rem;
    border-radius: 50%;
    background: var(--panel);
    border: 2px solid var(--border-strong);
}
.archive-list li:hover::before { border-color: var(--accent); background: var(--accent-bg); }
.archive-list a { text-decoration: none; display: block; }
.archive-list .arc-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.archive-list a:hover .arc-title { color: var(--accent); }
.archive-list .arc-meta { display: block; margin-top: .2rem; font-size: .78rem; color: var(--muted); }

/* ---------- 评论区 ---------- */
.comments-section { margin-top: 2.5rem; }
.comments-section > h2 {
    margin: 0 0 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.comment-item { display: flex; gap: .8rem; }
.comment-item + .comment-item { margin-top: 1.25rem; }
.comment-item.comment-reply { margin-left: 2.6rem; margin-top: .9rem; }
.comment-avatar {
    flex-shrink: 0;
    width: 2.3rem; height: 2.3rem;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.comment-head .comment-author { font-size: .9rem; font-weight: 600; color: var(--text); }
.comment-head .comment-time { font-size: .75rem; color: var(--muted); }
.comment-content { margin: 0; font-size: .9rem; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-reply-btn {
    margin-top: .3rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: .78rem;
    color: var(--muted);
    cursor: pointer;
}
.comment-reply-btn:hover { color: var(--accent); }

.comment-form {
    margin-top: 2rem;
    background: var(--panel);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}
.comment-form h3 { margin: 0 0 1rem; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.comment-form .reply-hint { font-size: .82rem; color: var(--accent); margin-bottom: .75rem; }
.comment-form .reply-hint button { margin-left: .5rem; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .78rem; }
.comment-form .reply-hint button:hover { color: var(--text); }
.comment-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
}
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--muted); }
.comment-form textarea { resize: vertical; min-height: 6rem; margin-top: .8rem; }
.comment-form .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.comment-form .form-msg { font-size: .82rem; }
.comment-form .form-msg.ok { color: #3a9a50; }
.comment-form .form-msg.err { color: #d44545; }
.btn-submit {
    padding: .6rem 1.5rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

.comment-pagination { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: 1.5rem 0; }
.comment-pagination button {
    padding: .35rem .9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-secondary);
    font-size: .8rem;
    font-family: inherit;
    cursor: pointer;
}
.comment-pagination button:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.comment-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.comment-pagination .page-info { font-size: .8rem; color: var(--muted); }

/* ---------- 搜索页表单 ---------- */
.search-form input {
    width: 100%;
    padding: .8rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}
.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search-form input::placeholder { color: var(--muted); }

/* ---------- 响应式 ---------- */
/* 右栏收窄 */
@media (width <= 1100px) {
    .content-body--with-sidebar { grid-template-columns: minmax(0, 1fr) 260px; }
}

/* TOC 隐藏 */
@media (width <= 960px) {
    .toc { display: none; }
    .content-body--with-toc { grid-template-columns: minmax(0, 1fr); }
}

/* 平板：侧栏改抽屉，双栏变单栏 */
@media (width <= 780px) {
    .site-shell,
    body.sidebar-collapsed .site-shell { grid-template-columns: minmax(0, 1fr); }
    .primary-sidebar {
        position: fixed;
        top: 0; bottom: 0; left: 0;
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, .25);
        z-index: 30;
    }
    body.sidebar-open .primary-sidebar { transform: translateX(0); }
    body.sidebar-collapsed .primary-sidebar {
        opacity: 1;
        width: 280px;
        padding: 2.2rem 1.6rem 2.5rem;
        border-right-color: var(--border);
    }
    .mobile-only { display: inline-flex; }
    .desktop-only { display: none; }
    .main-column { padding: 1.25rem 1rem 2rem; }
    .topbar { padding: .5rem .8rem; height: auto; min-height: var(--topbar-offset); }
    .topbar-search input { width: 9rem; }
    .topbar-search input:focus { width: 11rem; }
    .content-body--with-sidebar { grid-template-columns: minmax(0, 1fr); }
    .site-secondary { position: static; }
    .back-to-top {
        right: .9rem;
        bottom: calc(.9rem + env(safe-area-inset-bottom, 0px));
        width: 3rem; height: 3rem;
    }
    .article.card { padding: 1.5rem 1.25rem; }
    .footer { padding: 1.25rem 1rem 2.5rem; }
}

/* 手机：列表卡改纵向 */
@media (width <= 560px) {
    .post-item { grid-template-columns: 1fr; gap: .9rem; padding: 1.75rem 0 1.5rem; }
    .post-cover img,
    .post-cover { width: 100%; height: auto; }
    .post-cover img { height: 11.5rem; }
    .post-body h2 { font-size: 1.2rem; }
    .page-hero h1 { font-size: 1.6rem; }
    .article-header h1 { font-size: 1.5rem; }
    .comment-form .form-grid { grid-template-columns: 1fr; }
    .comment-item.comment-reply { margin-left: 1.4rem; }
    .topbar-search input,
    .topbar-search input:focus { width: 7.5rem; }
    .topbar-search kbd { display: none; }
    .breadcrumb .crumb-root-label { display: none; }
}
