/* =========================================================
   Tessera for Sonic v1.1.4
   1. Design tokens
   2. Reset & base
   3. Layout
   4. Header / navigation / drawer / search
   5. Banner & feed list
   6. Sections & post cards
   7. Pagination
   8. Sidebar
   9. Article & prose
   10. TOC / prev-next / related / comments
   11. Archive / categories / tags / links / journals / photos
   12. Footer / back to top / lightbox
   13. Error page
   14. Responsive
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
    --bg: #f3f5f7;
    --bg-soft: #eef1f8;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --text: #18202f;
    --text-2: #5a6478;
    --text-3: #8b94a7;
    --border: #e6e9f2;
    --border-strong: #d8dcea;
    --primary: #4f6ef7;
    --primary-strong: #3b57d6;
    --primary-soft: rgba(79, 110, 247, .10);
    --accent: #7c5cff;
    --danger: #e5484d;
    --code-bg: #f6f8fa;
    --code-text: #24292f;
    --code-inline-bg: rgba(79, 110, 247, .09);
    --code-inline-text: #3b57d6;
    --header-bg: rgba(255, 255, 255, .82);
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 10px rgba(16, 24, 40, .04);
    --shadow-2: 0 12px 32px rgba(16, 24, 40, .10);
    --shadow-3: 0 22px 48px rgba(16, 24, 40, .16);
    --r-lg: 18px;
    --r-md: 14px;
    --r-sm: 10px;
    --r-pill: 999px;
    --t: .22s cubic-bezier(.4, 0, .2, 1);
    --container: 1240px;
    --sidebar-w: 320px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

:root[data-theme="dark"] {
    --bg: #121212;
    --bg-soft: #171717;
    --surface: #1a1a1a;
    --surface-2: #212121;
    --text: #e9e9e9;
    --text-2: #a6a6a6;
    --text-3: #787878;
    --border: #2c2c2c;
    --border-strong: #383838;
    --primary: #6d86ff;
    --primary-strong: #93a7ff;
    --primary-soft: rgba(109, 134, 255, .16);
    --accent: #a78bfa;
    --danger: #ff6369;
    --code-bg: #161616;
    --code-text: #d9d9d9;
    --code-inline-bg: rgba(109, 134, 255, .16);
    --code-inline-text: #a9b8ff;
    --header-bg: rgba(18, 18, 18, .84);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .38), 0 2px 10px rgba(0, 0, 0, .28);
    --shadow-2: 0 14px 34px rgba(0, 0, 0, .5);
    --shadow-3: 0 24px 52px rgba(0, 0, 0, .6);
}

/* ---------- 2. Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

/* Iconify 图标：固定 1em 见方，无论图标数据是否已加载都占同样大小，
   避免「未定义 → 已定义但未渲染 → 渲染完成」三个阶段宽度变化导致文字左右跳动 */
iconify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    line-height: 1;
    flex: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

[hidden] {
    display: none !important;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--t);
}

a:hover {
    color: var(--primary);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

input,
textarea {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.01em;
}

p {
    margin: 0;
}

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

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

/* ---------- 3. Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 22px;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    gap: 20px;
    padding-top: 26px;
    padding-bottom: 56px;
    align-items: start;
}

.content-col {
    min-width: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 6px 18px rgba(79, 110, 247, .28);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(79, 110, 247, .34);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-3);
    font-size: 13px;
    white-space: nowrap;
}

.meta-item svg,
.meta-item iconify-icon {
    flex: none;
    opacity: .85;
}

.meta-item iconify-icon {
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.badge-cat {
    background: rgba(17, 24, 39, .55);
}

.badge-pin {
    background: linear-gradient(135deg, #ff7a59, #f43f5e);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.6;
    transition: all var(--t);
}

.tag-chip sup {
    font-size: 10px;
    color: var(--text-3);
    top: -.3em;
}

.tag-chip:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.tag-chip--lg {
    padding: 6px 14px;
    font-size: 13.5px;
}

/* ---------- 4. Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    min-width: 0;
}

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--r-sm);
    object-fit: cover;
}

.brand-name {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-nav {
    position: relative;
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: visible;
}

/* 选中态底部长条：位置与宽度由 theme.js 计算，切换菜单时左右滑动 */
.nav-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0;
    border-radius: 999px;
    background: var(--primary);
    opacity: 0;
    pointer-events: none;
    will-change: transform, width;
    transition: transform .4s cubic-bezier(.34, .72, .28, 1),
                width .4s cubic-bezier(.34, .72, .28, 1),
                opacity .22s ease;
}

.nav-indicator.is-ready {
    opacity: 1;
}

/* 首次定位：只保留透明度过渡，位移与宽度直接落位，避免刷新时长条从左侧滑入 */
.nav-indicator.is-init {
    transition: opacity .22s ease;
}

@media (prefers-reduced-motion: reduce) {
    .nav-indicator {
        transition: opacity .2s ease;
    }
}

.nav-link {
    padding: 7px 12px;
    border-radius: var(--r-pill);
    font-size: 14px;
    color: var(--text-2);
    white-space: nowrap;
    transition: color var(--t), font-weight var(--t);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.is-active {
    color: var(--primary);
    font-weight: 500;
}

/* 更多页面下拉 */
.nav-more {
    position: relative;
    flex: none;
}

.nav-more-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.nav-more-toggle iconify-icon {
    font-size: 15px;
    transition: transform var(--t);
}

.nav-more.is-open .nav-more-toggle iconify-icon {
    transform: rotate(180deg);
}

.nav-more-panel {
    position: absolute;
    top: calc(100% + 10px);
    /* 右对齐按钮：「更多页面」是导航末项，向左展开才不会在窄视口撑出横向滚动条 */
    left: auto;
    right: 0;
    min-width: 176px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--t), transform var(--t), visibility var(--t);
    z-index: 60;
}

.nav-more.is-open .nav-more-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
}

@media (hover: hover) {
    .nav-more:hover .nav-more-panel {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

.nav-more-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    font-size: 13.5px;
    color: var(--text-2);
    white-space: nowrap;
    transition: all var(--t);
}

.nav-more-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: none;
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: grid;
    font-size: 18px;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--text-2);
    transition: all var(--t);
}

.tool-btn:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.tool-btn--menu {
    display: none;
}

.icon-sun,
.icon-moon {
    display: none;
}

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

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

/* drawer */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 20, .48);
    backdrop-filter: blur(2px);
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 86vw);
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: drawer-in .26s ease;
    overflow-y: auto;
}

@keyframes drawer-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.drawer-title {
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-search {
    display: flex;
    gap: 8px;
}

.drawer-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    outline: none;
}

.drawer-search input:focus {
    border-color: var(--primary);
}

.drawer-nav {
    display: flex;
    flex-direction: column;
}

.drawer-link {
    padding: 11px 12px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 14.5px;
    border-bottom: 1px solid var(--border);
}

.drawer-link:last-child {
    border-bottom: 0;
}

.drawer-link:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.drawer-group {
    padding: 16px 12px 6px;
    font-size: 12px;
    letter-spacing: .08em;
    color: var(--text-3);
    text-transform: uppercase;
}

.drawer-link--sub {
    padding-left: 24px;
    font-size: 14px;
    color: var(--text-3);
}

.drawer-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* search modal */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 20px;
}

.search-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 20, .5);
    backdrop-filter: blur(3px);
}

.search-modal-panel {
    position: relative;
    width: min(620px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    padding: 14px 16px 12px;
    animation: pop-in .22s ease;
}

@keyframes pop-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.99);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
}

.search-form input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 15.5px;
    color: var(--text);
}

.search-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    color: var(--text-3);
}

.search-close:hover {
    color: var(--danger);
    background: var(--surface-2);
}

.search-hint {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    color: var(--text-3);
    font-size: 12.5px;
}

/* ---------- 5. Banner & feed list ---------- */
.banner {
    position: relative;
    width: 100%;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-1);
    margin-bottom: 20px;
    aspect-ratio: 16 / 6.4;
    max-height: 360px;
}

.banner-track {
    position: absolute;
    inset: 0;
}

.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s ease, visibility .7s ease;
}

.banner-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.banner-slide--plain {
    background: linear-gradient(135deg, #4f6ef7, #7c5cff);
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 7s ease;
}

.banner-slide.is-active img {
    transform: scale(1.06);
}

.banner-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 14, 14, 0) 28%, rgba(14, 14, 14, .84) 100%);
}

.banner-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: #fff;
}

.banner-eyebrow {
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .68);
}

.banner-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: 12px;
    color: #fff;
}

.banner-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .42);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-sub {
    max-width: 760px;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .84);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-dots {
    position: absolute;
    right: 24px;
    bottom: 28px;
    display: flex;
    gap: 7px;
    z-index: 2;
}

.banner-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    transition: all var(--t);
}

.banner-dot.is-active {
    width: 22px;
    border-radius: var(--r-pill);
    background: #fff;
}

/* 左右切换圆形按钮：默认隐藏，悬停显示 */
.banner-arrow {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(18, 18, 18, .42);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(.9);
    transition: opacity .28s ease, transform .28s ease, background .2s ease, visibility .28s ease;
    z-index: 3;
}

.banner-arrow--prev {
    left: 14px;
}

.banner-arrow--next {
    right: 14px;
}

.banner:hover .banner-arrow,
.banner:focus-within .banner-arrow {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.banner-arrow:hover {
    background: rgba(18, 18, 18, .68);
}

.banner-arrow:active {
    transform: scale(.94);
}

/* 触屏设备没有 hover，常驻显示以便可用 */
@media (hover: none) {
    .banner-arrow {
        opacity: .78;
        visibility: visible;
        transform: none;
    }
}

/* feed card */
.feed-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.feed-tabs {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.feed-tab {
    position: relative;
    padding: 16px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-3);
    transition: color var(--t);
}

.feed-tab:hover {
    color: var(--text);
}

.feed-tab.is-active {
    color: var(--text);
    font-weight: 650;
}

.feed-tab.is-active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
}

.feed-all {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    color: var(--text-3);
    transition: color var(--t);
}

.feed-all:hover {
    color: var(--primary);
}

.feed-all iconify-icon {
    font-size: 16px;
}

.feed-panel[hidden] {
    display: none;
}

.feed-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    transition: background var(--t);
}

/* 滚动淡入：JS 可用时才隐藏初始态，无脚本时内容照常显示 */
.js .feed-item {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity .55s cubic-bezier(.22, .61, .36, 1),
        transform .55s cubic-bezier(.22, .61, .36, 1),
        background var(--t);
    will-change: opacity, transform;
}

.js .feed-item.is-in {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
    align-items: stretch;
}

.feed-item:hover {
    background: var(--surface-2);
}

.feed-item + .feed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 1px;
    background: var(--border-strong);
    opacity: .7;
}

.feed-thumb {
    position: relative;
    flex: none;
    width: 210px;
    aspect-ratio: 16 / 10;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
}

.feed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.feed-item:hover .feed-thumb img {
    transform: scale(1.04);
}

.feed-thumb-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: rgba(255, 255, 255, .92);
    font-size: 26px;
}

.feed-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    padding-top: 1px;
}

/* 文本内图标与文字的间距（分类名、标签名、菜单名里手写的图标） */
.banner-tag iconify-icon,
.feed-thumb-cat iconify-icon,
.page-title iconify-icon,
.page-desc iconify-icon,
.nav-link iconify-icon,
.drawer-link iconify-icon,
.tag-chip iconify-icon,
.tag-group-name iconify-icon,
.cat-block-name iconify-icon {
    margin-right: 5px;
    font-size: 1.05em;
    vertical-align: -.14em;
}

/* 面包屑只显示纯文字：分类/标签名里手写的图标在这里隐藏，图标只在顶部导航等处展示 */
.breadcrumb iconify-icon {
    display: none;
}

.feed-thumb-cat {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    background: rgba(14, 14, 14, .58);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11.5px;
    line-height: 1.7;
}

.feed-thumb .badge-pin {
    position: absolute;
    right: 8px;
    top: 8px;
}

.feed-title {
    font-size: 17.5px;
    font-weight: 650;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--t);
}

.feed-item:hover .feed-title {
    color: var(--primary);
}

.feed-summary {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 6px;
    font-size: 12.5px;
    color: var(--text-3);
}

.feed-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.feed-meta-item iconify-icon {
    font-size: 14px;
}


/* ---------- 6. Sections & cards ---------- */
.section-title {
    position: relative;
    padding-left: 14px;
    font-size: 18px;
    font-weight: 650;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.post-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: var(--border-strong);
}

.post-card-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #dbe3ff, #ede4ff);
    overflow: hidden;
}

:root[data-theme="dark"] .post-card-cover {
    background: linear-gradient(135deg, #1b2436, #241f38);
}

.post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.post-card:hover .post-card-cover img {
    transform: scale(1.05);
}

.cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 13, 20, .18) 0%, rgba(9, 13, 20, 0) 42%);
}

.cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    text-align: center;
    color: rgba(59, 87, 214, .5);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
}

:root[data-theme="dark"] .cover-fallback {
    color: rgba(147, 167, 255, .35);
}

.post-card-cover .badge {
    position: absolute;
    top: 12px;
    left: 12px;
}

.post-card-cover .badge-pin {
    left: auto;
    right: 12px;
}

.post-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px 18px;
    flex: 1;
}

.post-card-title {
    font-size: 16.5px;
    font-weight: 650;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a:hover {
    color: var(--primary);
}

.post-card-summary {
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
    padding: 56px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
}

.empty-desc {
    color: var(--text-3);
    font-size: 13.5px;
}

.empty-state .btn {
    margin-top: 10px;
}

/* ---------- 7. Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 34px;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13.5px;
    transition: all var(--t);
}

.page-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.page-btn.is-current {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.page-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ---------- 8. Sidebar ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 18px;
}

.side-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 650;
}

.side-title-bar {
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.side-text {
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.75;
}

.side-text p + p {
    margin-top: 8px;
}

.side-about {
    background:
        radial-gradient(140% 120% at 0% 0%, rgba(79, 110, 247, .10), transparent 60%),
        var(--surface);
}

.about-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.about-avatar {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.about-avatar--text {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
}

.about-name {
    font-size: 15.5px;
    font-weight: 650;
}

.about-sign {
    color: var(--text-3);
    font-size: 12.5px;
    margin-top: 2px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.about-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-3);
}

.about-stat b {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* ---------- 最新评论（侧栏） ---------- */
.side-comments {
    display: flex;
    flex-direction: column;
}

.side-comment {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.side-comment:first-child {
    padding-top: 2px;
}

.side-comment:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.side-comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex: none;
    object-fit: cover;
    background: var(--surface-2);
}

.side-comment-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.side-comment-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.side-comment-author {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    max-width: 9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-comment-time {
    font-size: 11.5px;
    color: var(--text-3);
    flex: none;
}

.side-comment-text {
    font-size: 12.5px;
    line-height: 1.62;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: color var(--t);
}

.side-comment:hover .side-comment-text {
    color: var(--text);
}

.side-comments-empty {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-3);
}

.side-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.side-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.side-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12.5px;
    transition: all var(--t);
}

.side-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.side-link-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.notice-body {
    padding-left: 12px;
    border-left: 3px solid var(--primary-soft);
}

/* ---------- 9. Article ---------- */
.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 28px 32px 32px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--text-3);
    font-size: 12.5px;
}

.breadcrumb a {
    color: var(--text-3);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.crumb-sep {
    opacity: .5;
}

.crumb-current {
    color: var(--text-2);
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-title {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -.02em;
    font-weight: 700;
    margin-bottom: 14px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.article-cover {
    margin: 22px 0 4px;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-cover img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}

.article-body {
    padding-top: 22px;
}

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

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

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    margin: 1.9em 0 .8em;
    line-height: 1.4;
    scroll-margin-top: 84px;
}

.prose h1 {
    font-size: 26px;
}

.prose h2 {
    position: relative;
    font-size: 21px;
    padding-left: 14px;
}

/* 竖条用伪元素画，四角都能圆；直接给 h2 加 border-left + border-radius 只有左侧会圆 */
.prose h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.05em;
    border-radius: 2px;
    background: var(--primary);
}

.prose h3 {
    font-size: 18px;
}

.prose h4 {
    font-size: 16px;
}

.prose p {
    margin: .9em 0;
}

.prose a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--primary-soft);
}

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

.prose strong {
    font-weight: 650;
}

.prose ul,
.prose ol {
    margin: .9em 0;
    padding-left: 1.4em;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li {
    margin: .35em 0;
}

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

.prose blockquote {
    margin: 1.4em 0;
    padding: 14px 18px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border-left: 4px solid var(--primary);
    color: var(--text-2);
}

.prose blockquote p {
    margin: .3em 0;
}

.prose hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px dashed var(--border-strong);
}

.prose img {
    border-radius: var(--r-md);
    margin: 1.2em auto;
    cursor: zoom-in;
    box-shadow: var(--shadow-1);
}

.prose table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: 14px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.prose thead {
    background: var(--surface-2);
}

.prose th,
.prose td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.prose th {
    font-weight: 650;
    color: var(--text);
}

.prose tbody tr:nth-child(even) {
    background: var(--surface-2);
}

.prose code {
    font-family: var(--font-mono);
    font-size: .88em;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--code-inline-bg);
    color: var(--code-inline-text);
}

.prose pre {
    position: relative;
    margin: 1.4em 0;
    padding: 18px 18px 16px;
    border-radius: var(--r-sm);
    background: var(--code-bg);
    border: 1px solid var(--border);
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.7;
    tab-size: 4;
}

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

.code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-3);
    opacity: 0;
    transition: color var(--t), border-color var(--t), opacity var(--t), transform var(--t);
}

.code-copy iconify-icon {
    font-size: 15px;
}

.prose pre:hover .code-copy,
.code-copy:focus-visible {
    opacity: 1;
}

.code-copy:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.code-copy:active {
    transform: scale(.94);
}

.code-copy.is-done {
    color: #16a34a;
    border-color: #16a34a;
}

/* 复制成功提示：从按钮左侧向上飘出，上浮与淡出全程同步 */
.code-copied {
    position: absolute;
    top: 11px;
    right: 40px;
    font-size: 12px;
    line-height: 1;
    color: #16a34a;
    white-space: nowrap;
    pointer-events: none;
    will-change: transform, opacity;
    animation: codeCopiedFloat 1s linear forwards;
}

@keyframes codeCopiedFloat {
    0% {
        opacity: 0;
        transform: translateY(5px) scale(.95);
    }
    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-26px) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .code-copied {
        animation-duration: .01ms;
    }
}

.prose kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: .82em;
}

/* highlight.js token colors (theme-aware, no external stylesheet) */
.hljs {
    background: transparent;
    color: var(--code-text);
}

.hljs-comment,
.hljs-quote {
    color: var(--text-3);
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag {
    color: #c2410c;
}

.hljs-string,
.hljs-regexp,
.hljs-addition {
    color: #0f766e;
}

.hljs-number,
.hljs-symbol,
.hljs-bullet {
    color: #7c3aed;
}

.hljs-title,
.hljs-section,
.hljs-title.function_ {
    color: #1d4ed8;
}

.hljs-attr,
.hljs-attribute,
.hljs-variable,
.hljs-template-variable {
    color: #b45309;
}

.hljs-built_in,
.hljs-class .hljs-title,
.hljs-type {
    color: #0891b2;
}

.hljs-meta,
.hljs-meta .hljs-keyword {
    color: #9333ea;
}

.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
    color: #be123c;
}

.hljs-deletion {
    color: var(--danger);
}

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

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

:root[data-theme="dark"] .hljs-keyword,
:root[data-theme="dark"] .hljs-selector-tag,
:root[data-theme="dark"] .hljs-literal,
:root[data-theme="dark"] .hljs-doctag {
    color: #ff9d76;
}

:root[data-theme="dark"] .hljs-string,
:root[data-theme="dark"] .hljs-regexp,
:root[data-theme="dark"] .hljs-addition {
    color: #7ee2b8;
}

:root[data-theme="dark"] .hljs-number,
:root[data-theme="dark"] .hljs-symbol,
:root[data-theme="dark"] .hljs-bullet {
    color: #c4a6ff;
}

:root[data-theme="dark"] .hljs-title,
:root[data-theme="dark"] .hljs-section,
:root[data-theme="dark"] .hljs-title.function_ {
    color: #8fb8ff;
}

:root[data-theme="dark"] .hljs-attr,
:root[data-theme="dark"] .hljs-attribute,
:root[data-theme="dark"] .hljs-variable,
:root[data-theme="dark"] .hljs-template-variable {
    color: #ffcf8b;
}

:root[data-theme="dark"] .hljs-built_in,
:root[data-theme="dark"] .hljs-class .hljs-title,
:root[data-theme="dark"] .hljs-type {
    color: #7fd8ef;
}

:root[data-theme="dark"] .hljs-tag,
:root[data-theme="dark"] .hljs-name,
:root[data-theme="dark"] .hljs-selector-id,
:root[data-theme="dark"] .hljs-selector-class {
    color: #ff9db1;
}

/* ---------- 10. TOC / prev-next / related / comments ---------- */
.side-toc {
    position: sticky;
    top: 82px;
    z-index: 2;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.toc-nav {
    overflow-y: auto;
    max-height: calc(100vh - 190px);
    scrollbar-width: thin;
}

.toc-nav::-webkit-scrollbar {
    width: 4px;
}

.toc-nav::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

.toc-link {
    display: block;
    padding: 6px 10px;
    border-left: 2px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.55;
    transition: all var(--t);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-link:hover {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-soft);
}

.toc-link.is-active {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
    background: var(--primary-soft);
}

.toc-link--h3 {
    padding-left: 24px;
    font-size: 12.5px;
}

.toc-mobile {
    display: none;
    margin: 18px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
    padding: 10px 14px;
}

.toc-mobile summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    list-style: none;
}

.toc-mobile summary::-webkit-details-marker {
    display: none;
}

.toc-mobile summary::before {
    content: "☰";
    margin-right: 8px;
    color: var(--primary);
}

.toc-mobile .toc-nav {
    margin-top: 8px;
    max-height: 46vh;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 34px;
}

.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: all var(--t);
    min-width: 0;
}

.post-nav-item:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

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

.post-nav-label {
    font-size: 12px;
    color: var(--text-3);
}

.post-nav-title {
    font-size: 14px;
    font-weight: 550;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-item.is-empty {
    opacity: .55;
}

.post-nav-item.is-empty:hover {
    border-color: var(--border);
    background: var(--surface-2);
}

.related {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.related .section-title {
    margin-bottom: 18px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.comments {
    margin-top: 34px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.comments .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.comment-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--r-pill);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.comment-empty {
    padding: 22px 0;
    color: var(--text-3);
    font-size: 14px;
    text-align: center;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
}

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

.comment-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.comment-author a {
    color: inherit;
}

.comment-author a:hover {
    color: var(--primary);
}

.comment-badge {
    padding: 1px 7px;
    border-radius: var(--r-pill);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.comment-time {
    color: var(--text-3);
    font-size: 12.5px;
}

.comment-body {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.comment-reply-btn {
    padding: 0;
    color: var(--text-3);
    font-size: 12.5px;
    cursor: pointer;
    transition: color var(--t);
}

.comment-reply-btn:hover {
    color: var(--primary);
}

.comment-likes {
    color: var(--text-3);
    font-size: 12.5px;
}

.comment-children {
    margin-top: 14px;
    padding-left: 14px;
    border-left: 2px solid var(--border);
}

.comment-children .comment-item {
    padding: 12px 0;
}

.comment-children .comment-avatar {
    width: 32px;
    height: 32px;
}

.comment-more {
    align-self: center;
    margin: 16px auto 0;
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--t);
}

.comment-more:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
}

/* 评论表单 */
.comment-form {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
}

.comment-form-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.comment-form-title iconify-icon {
    color: var(--primary);
}

.comment-reply-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
}

.comment-reply-cancel {
    margin-left: auto;
    color: var(--primary);
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: underline;
}

.comment-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.comment-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.comment-label {
    font-size: 12.5px;
    color: var(--text-2);
}

.comment-label em {
    color: var(--danger);
    font-style: normal;
}

.comment-field input,
.comment-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    transition: border-color var(--t), box-shadow var(--t);
}

.comment-field textarea {
    resize: vertical;
    min-height: 110px;
}

.comment-field input:focus,
.comment-field textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.comment-form-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.comment-msg {
    font-size: 13px;
    color: var(--text-3);
}

.comment-msg.is-error {
    color: var(--danger);
}

.comment-msg.is-ok {
    color: var(--primary);
}

.comment-form-foot .btn {
    margin-left: auto;
}

.comment-form-foot .btn[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .comment-fields {
        grid-template-columns: 1fr;
    }

    .comment-avatar {
        width: 32px;
        height: 32px;
    }

    .comment-form {
        padding: 16px;
    }
}

/* ---------- 11. Inner pages ---------- */
.page-head {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 26px 28px;
    margin-bottom: 24px;
    background-image:
        radial-gradient(120% 140% at 100% 0%, rgba(124, 92, 255, .10), transparent 60%),
        radial-gradient(120% 140% at 0% 100%, rgba(79, 110, 247, .10), transparent 60%);
}

.page-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
}

.page-title {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-desc {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 14px;
}

.page-meta {
    margin-top: 10px;
    color: var(--text-3);
    font-size: 12.5px;
}

.archive {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.archive-year {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 20px 24px;
}

.archive-year-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.archive-year-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.archive-year-count {
    margin-left: auto;
    color: var(--text-3);
    font-size: 12.5px;
    font-weight: 400;
}

.archive-list {
    display: flex;
    flex-direction: column;
}

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
}

.archive-item:last-child {
    border-bottom: 0;
}

.archive-date {
    flex: none;
    width: 46px;
    color: var(--text-3);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.archive-link {
    font-size: 14.5px;
    color: var(--text-2);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-link:hover {
    color: var(--primary);
}

.cat-grid,
.tag-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.cat-block,
.tag-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    padding: 18px 20px;
}

.cat-block-head,
.tag-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.cat-block-name,
.tag-group-name {
    font-size: 15.5px;
    font-weight: 650;
}

.cat-block-count,
.tag-group-count {
    color: var(--text-3);
    font-size: 12.5px;
}

.cat-block-list li,
.tag-group-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
}

.cat-block-list a,
.tag-group-list a {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-block-list a:hover,
.tag-group-list a:hover {
    color: var(--primary);
}

.cat-block-date,
.tag-group-date {
    flex: none;
    color: var(--text-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.cat-block-more {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    font-size: 12.5px;
}

.cat-block-empty,
.tag-group-empty {
    color: var(--text-3);
    font-size: 13px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding: 20px;
    margin-bottom: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    transition: all var(--t);
    min-width: 0;
}

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

.link-logo {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 12px;
    object-fit: cover;
    background: var(--surface-2);
}

.link-logo--text {
    display: grid;
    place-items: center;
    padding: 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    color: var(--primary);
    background: var(--primary-soft);
    overflow: hidden;
}

.link-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-name {
    font-size: 14.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-desc {
    color: var(--text-3);
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.journal-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.journal-item {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
}

.journal-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
}

.journal-avatar--text {
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 700;
}

.journal-body {
    flex: 1;
    min-width: 0;
}

.journal-meta {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.journal-author {
    font-size: 13.5px;
    font-weight: 600;
}

.journal-time {
    color: var(--text-3);
    font-size: 12px;
}

.journal-content {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text-2);
}

.journal-foot {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.photo-item {
    margin: 0;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.photo-link {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.photo-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.photo-link:hover img {
    transform: scale(1.06);
}

.photo-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    font-size: 12px;
}

.photo-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-time {
    color: var(--text-3);
    flex: none;
}

/* ---------- 12. Footer ---------- */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 30px 0 20px;
}

.footer-inner {
    display: block;
}

.footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px 32px;
    flex-wrap: wrap;
}

.footer-about {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.footer-copy {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
}

.footer-copy .footer-site {
    margin-left: 6px;
    color: var(--text);
    font-weight: 600;
}

.footer-powered {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 13.5px;
    color: var(--text-3);
    line-height: 1.6;
}

.footer-powered a {
    color: var(--primary);
    font-weight: 600;
    transition: color var(--t);
}

.footer-powered a:hover {
    color: var(--primary-strong);
}

.footer-bar {
    color: var(--border-strong);
}

.footer-uptime {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.6;
}

.footer-uptime iconify-icon {
    font-size: 15px;
    color: #22c55e;
}

.uptime-value {
    color: var(--primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

.footer-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-3);
    transition: color var(--t);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links iconify-icon {
    font-size: 15px;
}

.footer-links a[href*="atom"] iconify-icon,
.footer-links a[href*="rss"] iconify-icon {
    color: #f97316;
}

.footer-metrics {
    display: flex;
    align-items: stretch;
    gap: 9px;
}

/* GitHub 仓库按钮风格：浅底 + 细边框 + 右侧数字胶囊 */
.metric {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--bg-soft);
    overflow: hidden;
    font-size: 12px;
    line-height: 1;
    transition: border-color var(--t), background var(--t);
}

.metric:hover {
    border-color: var(--text-3);
}

.metric-key {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    color: var(--text-2);
    font-weight: 500;
    white-space: nowrap;
}

.metric-key iconify-icon {
    font-size: 14px;
    opacity: .85;
}

.metric-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 6px 9px;
    background: var(--surface);
    border-left: 1px solid var(--border-strong);
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 暗色下加深边框与底色，保持 GitHub 按钮的层次 */
:root[data-theme="dark"] .metric {
    border-color: #3a3a3a;
    background: #202020;
}

:root[data-theme="dark"] .metric:hover {
    border-color: #4a4a4a;
}

:root[data-theme="dark"] .metric-val {
    border-left-color: #3a3a3a;
    background: #2b2b2b;
}

.back-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 40;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    box-shadow: var(--shadow-2);
    transition: all var(--t);
}

.back-top:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    transform: translateY(-2px);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 30px;
    background: rgba(14, 14, 14, .86);
    backdrop-filter: blur(4px);
}

.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, .26);
}

/* ---------- 13. Error page ---------- */
.page-error {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.error-wrap {
    width: 100%;
    max-width: 560px;
}

.error-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-2);
    padding: 48px 40px;
    text-align: center;
    background-image:
        radial-gradient(120% 120% at 50% 0%, rgba(79, 110, 247, .12), transparent 62%);
}

.error-code {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.error-title {
    margin-top: 14px;
    font-size: 22px;
    font-weight: 700;
}

.error-desc {
    margin-top: 10px;
    color: var(--text-2);
    font-size: 14px;
}

.error-detail {
    margin-top: 8px;
    color: var(--text-3);
    font-size: 12px;
    font-family: var(--font-mono);
    word-break: break-all;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
    flex-wrap: wrap;
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .side-toc {
        position: static;
        max-height: none;
        grid-column: 1 / -1;
    }

    .side-toc .toc-nav {
        max-height: none;
    }

}

@media (max-width: 900px) {
    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body {
        font-size: 14.5px;
    }

    .container {
        padding: 0 16px;
    }

    .main-grid {
        padding-top: 16px;
        gap: 18px;
    }

    .site-nav {
        display: none;
    }

    .tool-btn--menu {
        display: grid;
    }

    .header-inner {
        height: 58px;
        gap: 12px;
    }

    .brand-name {
        font-size: 15px;
        max-width: 44vw;
    }

    .banner {
        width: 100%;
        aspect-ratio: 2 / 1;
        max-height: none;
        min-height: 0;
        margin-bottom: 18px;
    }

    .banner-body {
        padding: 18px 18px 20px;
        gap: 7px;
    }

    .banner-title {
        font-size: 18px;
    }

    .banner-sub {
        display: none;
    }

    .banner-dots {
        top: 12px;
        right: 12px;
        bottom: auto;
    }

    .banner-dot {
        background: rgba(255, 255, 255, .55);
    }

    .banner-arrow {
        width: 32px;
        height: 32px;
        margin-top: -16px;
        font-size: 18px;
    }

    .banner-arrow--prev {
        left: 8px;
    }

    .banner-arrow--next {
        right: 8px;
    }

    .feed-tabs {
        gap: 18px;
        padding: 0 16px;
    }

    .feed-tab {
        padding: 14px 0;
        font-size: 14px;
    }

    .feed-all {
        font-size: 12px;
    }

    .feed-item {
        gap: 12px;
        padding: 16px;
    }

    .feed-thumb {
        width: 116px;
        border-radius: var(--r-sm);
    }

    .feed-title {
        font-size: 15px;
    }

    .feed-summary {
        font-size: 12.5px;
    }

    .feed-meta {
        gap: 12px;
        font-size: 12px;
    }

    .feed-thumb-cat {
        display: none;
    }

    .post-grid,
    .related-grid,
    .cat-grid,
    .tag-groups,
    .link-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }


    .article {
        padding: 20px 18px 24px;
        border-radius: var(--r-md);
    }

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

    .article-meta {
        gap: 12px;
    }

    .article-body {
        padding-top: 16px;
    }

    .prose {
        font-size: 15px;
    }

    .prose h2 {
        font-size: 18.5px;
    }

    .prose h3 {
        font-size: 16.5px;
    }

    .prose pre {
        padding: 14px 14px 12px;
        font-size: 12.5px;
        border-radius: var(--r-sm);
    }

    .prose table {
        font-size: 13px;
    }

    /* 手机端隐藏整个侧边栏（文章页目录由正文顶部的 .toc-mobile 承担） */
    .sidebar {
        display: none;
    }

    .toc-mobile {
        display: block;
    }

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

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

    .site-footer {
        padding: 24px 0 58px;
    }

    .footer-main {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        text-align: center;
    }

    .footer-about {
        align-items: center;
        gap: 6px;
    }

    .footer-powered {
        justify-content: center;
    }

    .footer-side {
        align-items: center;
        width: 100%;
        gap: 14px;
    }

    .footer-links {
        justify-content: center;
        gap: 22px;
    }

    .footer-metrics {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .metric {
        flex: 1 1 0;
        max-width: 122px;
    }

    .metric-key {
        padding: 8px 9px;
    }

    .metric-val {
        flex: 1 1 auto;
        min-width: 0;
        padding: 8px 8px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        margin-top: 18px;
        padding-top: 14px;
    }

    .page-head {
        padding: 20px 18px;
    }

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

    .archive-year {
        padding: 16px 18px;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .journal-item {
        padding: 14px;
    }

    .error-card {
        padding: 34px 22px;
    }

    .error-code {
        font-size: 56px;
    }

    .search-modal {
        padding-top: 8vh;
    }
}

@media (max-width: 400px) {
    .post-card-body {
        padding: 14px 14px 16px;
    }
}

@media (max-width: 760px) {
    .js .feed-item {
        transform: translateY(16px);
        transition:
            opacity .42s cubic-bezier(.22, .61, .36, 1),
            transform .42s cubic-bezier(.22, .61, .36, 1),
            background var(--t);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
