/* ========== 站点骨架 ========== */
.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgb(255 255 255 / .82);
    border-bottom: 1px solid var(--ui-border);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    transition: box-shadow var(--dur-med) ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px rgb(15 23 42 / .06); }
.header-inner {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding-block: var(--sp-3);
    min-height: 64px;
}

/* 品牌区：徽章 + 双行文字，无 Logo 时自动显示内置 B 徽章 */
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--ui-text-1);
    min-width: 0;
}
.brand:hover { color: var(--ui-text-1); }
.brand-badge {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ui-accent), var(--ui-accent-2));
    color: #fff;
    box-shadow: 0 4px 12px rgb(47 107 255 / .22);
    overflow: hidden;
    transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) ease;
}
.brand-badge::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: conic-gradient(transparent 0 72%, rgb(255 255 255 / .75) 84%, rgb(255 255 255 / .15) 92%, transparent 100%);
    opacity: 0;
    transition: opacity var(--dur-med) ease;
    pointer-events: none;
}
.brand:hover .brand-badge::after { opacity: .5; animation: flow-border 3s linear infinite; }
.brand:hover .brand-badge { transform: translateY(-1px) rotate(-3deg); box-shadow: 0 8px 18px rgb(47 107 255 / .28); }
.brand-badge img,
.brand-badge svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-badge.is-text { font-family: var(--ui-font-serif); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--ui-text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--dur-fast) ease;
}
.brand:hover .brand-name { color: var(--ui-accent); }
.brand-sub {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--ui-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* 导航 */
.nav { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; }
.nav a {
    position: relative;
    color: var(--ui-text-2);
    font-size: 13.5px;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--ui-radius-sm);
    transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.nav a:hover, .nav a.active { color: var(--ui-accent); background: var(--ui-accent-soft); }
.nav-toggle {
    display: none;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text-2);
}
.nav-toggle .bars { display: flex; flex-direction: column; gap: 4px; }
.nav-toggle .bars i { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(15 23 42 / .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-med) ease;
}
body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

/* 布局 */
.layout { flex: 1 0 auto; width: 100%; display: flex; gap: var(--sp-5); align-items: flex-start; padding-block: var(--sp-5); }
.main { flex: 1; min-width: 0; }
.sidebar { width: 288px; flex: 0 0 288px; position: sticky; top: 84px; }
.layout-reader .sidebar { display: none; }
.layout-reader .main { max-width: 680px; margin: 0 auto; }
/* 文章页无侧栏时收敛阅读宽度，避免行长过长 */
.layout > .main:only-child { max-width: 860px; margin-inline: auto; width: 100%; }
.layout-reader > .main:only-child { max-width: 680px; }
/* 有左侧目录时，正文同样收敛 */
.main-post { flex: 1 1 auto; max-width: 860px; margin-inline: auto; }

/* 侧栏卡片 */
.widget {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
    box-shadow: var(--ui-shadow-sm);
}
.widget-title {
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 var(--sp-3);
    padding-left: var(--sp-2);
    border-left: 3px solid var(--ui-accent);
    line-height: 1.2;
    letter-spacing: .02em;
}
.widget a { display: block; color: var(--ui-text-2); padding: 5px 0; font-size: 13.5px; }
.widget a:hover { color: var(--ui-accent); }
.list { margin: 0; padding: 0; list-style: none; }
.list li + li { margin-top: var(--sp-2); }

/* ========== 文章卡片：双层流光（保留原旋转机制） ========== */
.post-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.post-card {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 3px !important;
    border: 0 !important;
    border-radius: var(--ui-radius-md) !important;
    background: transparent !important;
    color: inherit;
    transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) ease;
}
.post-card::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 260%;
    aspect-ratio: 1 / 1;
    background: conic-gradient(
        from 0deg,
        transparent 0deg 8deg,
        var(--ui-accent) 30deg 62deg,
        transparent 88deg 188deg,
        var(--ui-accent-2) 210deg 242deg,
        transparent 268deg 360deg
    );
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: opacity var(--dur-fast) ease;
    pointer-events: none;
}
/* 第二层：模糊辉光，双倍质感 */
.post-card::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 260%;
    aspect-ratio: 1 / 1;
    background: conic-gradient(
        from 0deg,
        transparent 0deg 4deg,
        var(--ui-accent) 24deg 68deg,
        transparent 92deg 184deg,
        var(--ui-accent-2) 204deg 248deg,
        transparent 272deg 360deg
    );
    filter: blur(10px);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: opacity var(--dur-fast) ease;
    pointer-events: none;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgb(47 107 255 / .1);
}
.post-card:hover::before {
    opacity: 1;
    animation: flow-border 2s linear infinite;
}
.post-card:hover::after {
    opacity: .55;
    animation: flow-border 2s linear infinite;
}
@keyframes flow-border {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* 触屏设备：入场自动旋转一周，保证流光可见 */
@media (hover: none) {
    .post-card::before { animation: flow-border 2.4s linear 1; }
    .post-card::after { animation: flow-border 2.4s linear 1; }
    .post-card::before, .post-card::after { opacity: 1; }
}
.post-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: var(--sp-5);
    min-height: 100%;
    padding: var(--sp-5);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: calc(var(--ui-radius-md) - 3px);
    transition: border-color var(--dur-fast) ease;
}
.post-card:hover .post-card-inner { border-color: transparent; }
.post-cover {
    display: block;
    width: 200px;
    flex: 0 0 200px;
    border-radius: var(--ui-radius-sm);
    overflow: hidden;
    background: var(--ui-accent-soft);
}
.post-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-med) var(--ease-out); }
.post-card:hover .post-cover img { transform: scale(1.04); }
/* 无封面时的渐变占位：由 JS 注入 --cover-a / --cover-b 与首字 */
.post-cover.is-placeholder {
    position: relative;
    background: linear-gradient(135deg, var(--cover-a, #3b82f6), var(--cover-b, #8b5cf6));
}
.post-cover.is-placeholder::after {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ui-font-serif);
    font-size: 56px;
    font-weight: 700;
    color: rgb(255 255 255 / .9);
    text-shadow: 0 2px 12px rgb(15 23 42 / .18);
}
.post-body { display: block; flex: 1; min-width: 0; }
.post-title {
    display: block;
    font-size: 19px;
    margin: 0 0 var(--sp-2);
    font-weight: 750;
    line-height: 1.45;
    color: var(--ui-text-1);
    transition: color var(--dur-fast) ease;
}
.post-card:hover .post-title { color: var(--ui-accent); }
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    color: var(--ui-text-3);
    font-size: 12px;
    margin: 0 0 var(--sp-3);
}
.post-meta > span {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    line-height: 1.7;
}
.post-meta > span:first-child { color: var(--ui-accent); background: var(--ui-accent-soft); border-color: transparent; font-weight: 600; }
.post-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ui-text-2);
    font-size: 13.5px;
    line-height: 1.75;
    margin: 0;
}
/* 移动端抽屉用户区 */
.nav-user { display: none; }

/* ========== 文章详情 ========== */
.article {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--ui-shadow-sm);
}
.article-title { font-size: 38px; margin: 0 0 var(--sp-3); font-weight: 850; letter-spacing: -.03em; line-height: 1.22; }
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    color: var(--ui-text-3);
    font-size: 12.5px;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--ui-border);
}
.article-meta > span {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
}
.article-meta > span:first-child { color: var(--ui-accent); background: var(--ui-accent-soft); border-color: transparent; font-weight: 600; }
.article-cover { width: 100%; border-radius: var(--ui-radius-md); margin-bottom: var(--sp-5); }
.article-content { color: var(--ui-text-1); font-size: 16.5px; line-height: 1.9; letter-spacing: .005em; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 { margin: var(--sp-5) 0 var(--sp-3); scroll-margin-top: 90px; }
.article-content h2 { font-size: 23px; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--ui-border); font-weight: 800; }
.article-content h3 { font-size: 19px; font-weight: 750; }
.article-content p { margin: 0 0 var(--sp-4); }
.article-content ul, .article-content ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
.article-content li + li { margin-top: 4px; }
.article-content blockquote {
    margin: var(--sp-4) 0;
    padding: var(--sp-3) var(--sp-4);
    border-left: 3px solid var(--ui-accent);
    background: var(--ui-accent-soft);
    color: var(--ui-text-2);
    border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-content img { border-radius: var(--ui-radius-md); cursor: zoom-in; max-width: 100%; height: auto; }
.article-content img.img-w75 { width: 75%; }
.article-content img.img-w50 { width: 50%; }
.article-content img.img-w25 { width: 25%; }
.article-content img.img-w75, .article-content img.img-w50, .article-content img.img-w25 { display: block; margin-left: auto; margin-right: auto; }
.article-content code { background: var(--ui-bg); padding: 2px 6px; border-radius: 6px; font-size: 13.5px; color: var(--ui-accent-hover); }
.article-content > :first-child { margin-top: 0; }
.table-wrap { overflow-x: auto; margin: var(--sp-4) 0; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table-wrap th, .table-wrap td { padding: 9px var(--sp-3); border-bottom: 1px solid var(--ui-border); text-align: left; font-size: 14px; }
.table-wrap th { background: var(--ui-bg); font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }

/* 代码块 */
.code-block-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); margin: var(--sp-4) 0; }
.code-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    height: 26px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text-3);
    font-size: 11.5px;
    line-height: 24px;
    box-shadow: 0 1px 2px rgb(15 23 42 / .03);
    transition: all var(--dur-fast) ease;
}
.code-copy::before {
    content: "";
    width: 11px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    box-shadow: 3px -3px 0 -1px currentColor;
    opacity: .9;
}
.code-copy:hover { color: #fff; background: var(--ui-accent); border-color: var(--ui-accent); }
.code-copy.is-copied { color: #fff; background: var(--ui-success); border-color: var(--ui-success); }
.code-block {
    width: 100%;
    margin: 0;
    background: linear-gradient(135deg, #111827, #0b1220);
    border-radius: var(--ui-radius-md);
    overflow: hidden;
    box-shadow: 0 8px 20px rgb(15 23 42 / .18);
}
.code-block__lang {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px var(--sp-3);
    background: rgb(255 255 255 / .05);
    color: #93a4bd;
    font-size: 10.5px;
    font-family: var(--ui-font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.code-block__lang::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f87171;
    box-shadow: 10px 0 0 #fbbf24, 20px 0 0 #34d399;
    margin-right: 18px;
}
.code-block pre { margin: 0; padding: var(--sp-4); overflow-x: auto; color: #e5edf8; font-size: 13.5px; line-height: 1.75; tab-size: 4; }
.code-block code { background: transparent; padding: 0; color: inherit; white-space: pre; }

.article-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-4) 0; }
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-4);
    margin: var(--sp-5) 0 0;
    padding-top: var(--sp-4);
    border-top: 1px solid var(--ui-border);
}
.article-nav a { max-width: 48%; color: var(--ui-text-2); font-size: 13.5px; }
.article-nav a:hover { color: var(--ui-accent); }
.article-toc-mobile { display: none; padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.article-toc-mobile summary { cursor: pointer; font-size: 13px; font-weight: 800; }
/* 桌面端左侧目录（文章节点） */
.article-toc-col {
    width: 232px;
    flex: 0 0 232px;
    position: sticky;
    top: 84px;
    align-self: flex-start;
}
.article-toc-col .widget { margin-bottom: 0; }
.article-toc-col .toc { position: static; }
.toc { position: sticky; top: 84px; }
.toc a { display: block; padding: 3px 0; color: var(--ui-text-2); font-size: 12.5px; border-left: 2px solid transparent; padding-left: var(--sp-3); }
.toc a.level-1 { padding-left: 0; color: var(--ui-text-1); font-weight: 700; font-size: 13px; }
.toc a.level-3 { padding-left: var(--sp-5); color: var(--ui-text-3); }
.toc a.level-4 { padding-left: var(--sp-6); color: var(--ui-text-3); font-size: 12px; }
.toc a.level-5 { padding-left: 40px; color: var(--ui-text-3); font-size: 11.5px; }
.toc a.level-6 { padding-left: var(--sp-7); color: var(--ui-text-3); font-size: 11.5px; }
.toc a:hover { color: var(--ui-accent); border-left-color: var(--ui-accent); }

/* 分页 */
.pagination { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-5) 0; }
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 var(--sp-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text-2);
    font-size: 12.5px;
    transition: all var(--dur-fast) ease;
}
.pagination a:hover { border-color: var(--ui-accent); color: var(--ui-accent); transform: translateY(-1px); }
.pagination .current { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; font-weight: 700; }
.pagination .page-step { gap: 4px; padding: 0 var(--sp-3); }
.pagination .page-step i { font-style: normal; font-size: 15px; line-height: 1; }
.pagination .page-step em { font-style: normal; }
.pagination .page-step.is-disabled { opacity: .4; cursor: default; }
.pagination .page-gap { border-color: transparent; background: transparent; }
@media (max-width: 640px) {
    .pagination .page-step em { display: none; }
    .pagination .page-step { padding: 0 var(--sp-2); }
}

/* 空状态 */
.empty {
    padding: var(--sp-7) var(--sp-5);
    text-align: center;
    color: var(--ui-text-3);
    background: var(--ui-surface);
    border: 1px dashed var(--ui-border);
    border-radius: var(--ui-radius-md);
    font-size: 14px;
}
.empty::before {
    content: "◍";
    display: block;
    font-size: 30px;
    line-height: 1;
    margin-bottom: var(--sp-3);
    color: var(--ui-accent);
    opacity: .45;
}

/* 页脚：只渲染后台填写的 HTML，居中显示 */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--ui-border);
    color: var(--ui-text-3);
    font-size: 12.5px;
    text-align: center;
}
.site-footer .wrap { padding-block: var(--sp-4); }
.footer-custom { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--sp-3); }
.footer-custom a { color: var(--ui-text-2); }
.footer-custom a:hover { color: var(--ui-accent); }
.footer-custom p { margin: 0; }
.footer-custom img { max-height: 24px; vertical-align: middle; }

/* 回到顶部 */
.back-top {
    position: fixed;
    right: var(--sp-4);
    bottom: var(--sp-6);
    z-index: 50;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    background: var(--ui-surface);
    color: var(--ui-text-3);
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--ui-shadow);
    transition: opacity .2s ease, color .2s ease, transform .2s var(--ease-out);
}
.back-top.show { opacity: .95; pointer-events: auto; }
.back-top:hover { color: var(--ui-accent); transform: translateY(-3px); }
.lock-btn {
    position: fixed;
    right: var(--sp-4);
    bottom: var(--sp-4);
    z-index: 50;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 0;
    border: 1px solid var(--ui-border);
    border-radius: 50%;
    background: var(--ui-surface);
    color: var(--ui-text-3);
    opacity: .35;
    font-size: 16px;
    box-shadow: var(--ui-shadow);
    transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
}
.lock-btn:hover, .lock-btn:focus { opacity: .95; color: var(--ui-accent); }
.lock-btn svg { display: block; }

/* 弹窗 */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: rgb(15 23 42 / .55);
    backdrop-filter: blur(4px);
    animation: modal-fade .18s ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
    width: 100%;
    max-width: 460px;
    background: var(--ui-surface);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-lg);
    overflow: hidden;
    animation: modal-pop .24s var(--ease-out);
}
@keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head, .modal-body, .modal-actions { padding: var(--sp-4); }
.modal-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--ui-border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--ui-text-3); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); border-top: 1px solid var(--ui-border); }
body.lightbox-open { overflow: hidden; }
.lightbox-full { position: fixed; inset: 0; z-index: 200; background: rgb(5 8 14 / .94); display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.lightbox-full-img { max-width: 94vw; max-height: 94vh; user-select: none; cursor: grab; transform-origin: center center; will-change: transform; }
.lightbox-full-img.is-dragging { cursor: grabbing; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .22); background: rgb(0 0 0 / .4); color: #fff; font-size: 24px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lightbox-close:hover { background: rgb(0 0 0 / .65); }

/* 搜索 */
.search-form { display: flex; gap: var(--sp-2); align-items: center; }
.search-form .field { flex: 1; margin: 0; }
.search-form .btn { height: 46px; flex: 0 0 auto; }
.nav-search { display: none; width: 100%; padding: var(--sp-2) 0; }

/* 阅读进度条 */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--ui-accent), var(--ui-accent-2));
    z-index: 60;
    transition: width .1s linear;
    border-radius: 0 3px 3px 0;
}

/* 导航分类下拉 */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a { padding: var(--sp-2) var(--sp-3); }
.nav-sub-toggle { display: none; border: 0; background: transparent; color: var(--ui-text-3); padding: 0 var(--sp-2); font-size: 14px; }
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    padding: var(--sp-2);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow);
    z-index: 50;
}
.nav-item:hover .nav-dropdown, .nav-item.is-open .nav-dropdown { display: flex; flex-direction: column; }
.nav-dropdown a { padding: var(--sp-2) var(--sp-3); border-radius: var(--ui-radius-sm); }
.nav-dropdown a:hover { background: var(--ui-accent-soft); }

/* 分类树 */
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-tree li { position: relative; }
.cat-row { display: flex; align-items: center; gap: var(--sp-2); }
.cat-row a { flex: 1; }
.cat-count { color: var(--ui-text-3); font-size: 11px; background: var(--ui-bg); border-radius: 999px; padding: 0 7px; }
.cat-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--ui-border);
    border-radius: 5px;
    background: var(--ui-surface);
    color: var(--ui-text-3);
    padding: 0;
    font-size: 12px;
    line-height: 1;
}
.cat-toggle:hover { color: var(--ui-accent); border-color: var(--ui-accent); }
.cat-children { display: none; margin: 0 0 0 var(--sp-3); padding: 0 0 0 var(--sp-3); list-style: none; border-left: 1px solid var(--ui-border); }
.cat-tree li.is-open > .cat-children { display: block; }

@media (max-width: 1023px) {
    .article-toc-col { display: none; }
    .article-toc-mobile { display: block; }
}
@media (max-width: 767px) {
    .header-inner { min-height: 56px; gap: var(--sp-2); }
    .brand-badge { width: 32px; height: 32px; border-radius: 10px; }
    .brand-badge.is-text { font-size: 17px; }
    .brand-name { font-size: 17px; }
    .brand-sub { font-size: 11px; }
    .nav-toggle { display: inline-flex; z-index: 70; }
    .nav {
        display: flex;
        position: fixed;
        top: 57px;
        right: 0;
        height: calc(100vh - 57px);
        width: min(84vw, 320px);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-1);
        margin: 0;
        padding: var(--sp-3);
        background: var(--ui-surface);
        border-left: 1px solid var(--ui-border);
        box-shadow: -12px 0 40px rgb(15 23 42 / .16);
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform var(--dur-med) var(--ease-out), visibility var(--dur-med);
        overflow-y: auto;
        z-index: 60;
    }
    .nav.open { display: flex; transform: translateX(0); visibility: visible; pointer-events: auto; }
    .nav-user {
        display: flex;
        align-items: center;
        gap: var(--sp-2);
        width: 100%;
        padding: var(--sp-3);
        margin-bottom: var(--sp-2);
        border-bottom: 1px solid var(--ui-border);
    }
    .nav-user .brand-badge { width: 34px; height: 34px; }
    .nav-user .brand-name { font-size: 15px; }
    .nav a { width: 100%; padding: var(--sp-3); font-size: 15px; border-radius: var(--ui-radius-sm); }
    .nav-item { width: 100%; flex-wrap: wrap; }
    .nav-item > a { width: 100%; }
    .nav-sub-toggle {
        display: inline-flex;
        position: absolute;
        right: 4px;
        top: 2px;
        margin: 0;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--ui-border);
        border-radius: 10px;
        background: var(--ui-bg);
        color: var(--ui-text-2);
        font-size: 20px;
        font-weight: 600;
        line-height: 1;
        box-shadow: 0 1px 2px rgb(15 23 42 / .04);
        transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform .12s ease;
    }
    .nav-sub-toggle:active { transform: scale(.92); }
    .nav-item.is-open .nav-sub-toggle {
        background: var(--ui-accent);
        border-color: var(--ui-accent);
        color: #fff;
    }
    .nav-item > a { padding-right: 56px; }
    .nav-search { display: block; }
    .nav-dropdown { display: none; position: static; width: 100%; padding-left: var(--sp-3); border: 0; box-shadow: none; background: transparent; }
    .nav-item.is-open .nav-dropdown { display: flex; }
    .layout { flex-direction: column; padding-block: var(--sp-4); gap: var(--sp-4); }
    .sidebar { display: none; position: static; width: 100%; flex: none; }
    .post-card-inner { flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); }
    .post-cover { width: 100%; flex: none; aspect-ratio: 16 / 9; }
    .post-cover.is-placeholder { display: none; }
    .post-title { font-size: 17px; }
    .article { padding: var(--sp-4); border-radius: var(--ui-radius-md); }
    .article-title { font-size: 25px; }
    .article-content { font-size: 16px; }
    .article-nav { flex-direction: column; }
    .article-nav a { max-width: 100%; }
    .site-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
