/* =====================
   seerking Theme — Personal Blog
   Self-contained, no external CSS frameworks
   ===================== */

/* ---- Fonts (system-only, zero network requests) ---- */

/* ---- Variables ---- */
:root {
    /* 纯系统字体栈,无 webfont,无 @import,最快 */
    --font-sans: system-ui, -apple-system, 'Segoe UI Variable', 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Cascadia Mono', 'Consolas', 'JetBrains Mono', monospace;

    --accent: #0070f3;
    --accent-hover: #0060df;
    --accent-soft: rgba(0, 112, 243, 0.08);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;

    --transition: 0.15s ease;

    /* Light mode */
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-muted: #f4f4f5;
    --border: #e4e4e7;
    --border-hover: #a1a1aa;
    --text: #111111;
    --text-muted: #71717a;
    --text-faint: #a1a1aa;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-muted: #1a1a1a;
    --border: #1f1f1f;
    --border-hover: #3f3f46;
    --text: #ededed;
    --text-muted: #71717a;
    --text-faint: #3f3f46;
}

/* ---- CSS Reset (replaces Pico.css) ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

ul, ol { list-style: none; }

table {
    border-collapse: collapse;
    width: 100%;
}

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---- Header ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.site-brand { flex: 1; }

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    font-family: system-ui, -apple-system, sans-serif;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    transition: transform 0.2s ease,
                box-shadow 0.2s ease,
                filter 0.2s ease;
    /* 默认微浮影 */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.brand-link:hover .brand-logo {
    /* 浮起 2px + 阴影变深(Notion / Twitter 风) */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-desc {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li { margin: 0; }

.nav-links a {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
    transition: color var(--transition);
    font-family: system-ui, -apple-system, sans-serif;
}

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

/* ---- Header actions (search + theme + menu) ---- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-toggle,
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

.search-toggle:hover,
.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ---- Hamburger menu button (移动端用) ---- */
.menu-toggle {
    display: none;  /* 桌面端默认隐藏 */
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all var(--transition);
}

.menu-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all var(--transition);
}

.menu-toggle:hover {
    border-color: var(--text-muted);
}

.menu-toggle:hover span { background: var(--text); }

/* 汉堡 → X 动画(展开时) */
.menu-toggle.is-active span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
}
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
}

/* ---- Search bar (下拉搜索框) ---- */
.search-wrap {
    position: relative;       /* 定位上下文,让搜索框对齐搜索按钮 */
    display: flex;
    align-items: center;
}

.search-bar {
    /* 绝对定位:不占文档流,展开时不会推动其他内容(消除晃动) */
    position: absolute;
    top: 100%;          /* 紧贴 header 底部 = 紧贴搜索按钮下方 */
    left: 0;            /* 对齐搜索按钮的左边缘 */
    right: auto;
    width: 280px;       /* 固定宽度,跟按钮差不多窄,从按钮位置展开 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);  /* 入场时从上方 8px 滑入 */
    transition: max-height 0.25s ease,
                padding 0.25s ease,
                border-color 0.25s ease,
                opacity 0.2s ease,
                transform 0.25s ease,
                visibility 0s linear 0.25s;  /* visibility 延迟,关闭后等动画完再隐藏 */
    background: var(--bg);
    border-top: 1px solid transparent;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    z-index: 99;
}

.search-bar.is-open {
    max-height: 60px;
    padding: 0.75rem 1.5rem;
    border-top-color: var(--border);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    /* 展开时 visibility 立即生效,关闭时延迟到动画结束 */
    transition: max-height 0.25s ease,
                padding 0.25s ease,
                border-color 0.25s ease,
                opacity 0.2s ease,
                transform 0.25s ease,
                visibility 0s linear 0s;
}

.search-bar-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text);
    font-family: inherit;
    padding: 0.25rem 0;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 0.25rem;
    line-height: 1;
}

.search-bar-close:hover { color: var(--text); }

/* ---- 移动端响应式(≤ 768px) ---- */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }  /* 移动端显示汉堡 */

    /* 搜索框:移动端全宽(从左到右) */
    .search-bar,
    .search-bar.is-open {
        left: 0;
        right: 0;
        width: auto;
        max-width: 100%;
    }

    /* 导航链接:默认隐藏在 header 下方 */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-top: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 99;
    }

    .nav-links.is-open {
        max-height: 500px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .nav-links li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child { border-bottom: none; }

    .nav-links a {
        display: block;
        padding: 0.875rem 1.5rem;
        font-size: 14px;
    }

    .site-header { position: relative; }

    /* 副标题在小屏隐藏,避免拥挤 */
    .brand-desc { display: none; }
}

/* ---- Theme Toggle ---- */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

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

/* ---- Main ---- */
.site-main {
    padding-top: 0.5rem;
    padding-bottom: 4rem;
    min-height: calc(100vh - 180px);
}

/* ---- Page Header ---- */
.page-header { margin-bottom: 1.75rem; }

/* ---- Page Layout (with sidebar) ---- */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 3rem;
    align-items: start;
}

.page-main {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 5rem;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin: 0 0 0.6rem;
}

/* ---- TOC ---- */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin: 0;
}

.toc-link {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    padding: 0.2rem 0;
    line-height: 1.5;
    transition: color var(--transition);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.toc-level-3 { padding-left: 0.8rem; }

/* ---- Tags ---- */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-item {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}

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

/* ---- Recent Posts ---- */
.recent-posts {
    max-width: 640px;
    margin: 0 auto;
}
.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.post-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 0;
    transition: padding-left var(--transition);
}

.timeline-item:hover { padding-left: 0.3rem; }

.timeline-date {
    font-size: 13px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}

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

.timeline-link {
    font-size: 15px;
    color: var(--text);
    font-weight: 400;
    transition: color var(--transition);
}

.timeline-link:hover { color: var(--text); }

.timeline-excerpt {
    font-size: 13px;
    color: var(--text-faint);
    margin: 0.2rem 0 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .home-sidebar {
        position: static;
        order: -1;
    }
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* ---- Posts Grid ---- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ---- Post Card ---- */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
    overflow: hidden;
}

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

.post-card-cover {
    display: block;
    overflow: hidden;
    cursor: zoom-in;
}

.post-card-cover img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.post-card-inner {
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    height: 100%;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 11px;
    color: var(--text-muted);
}

.post-meta-top svg { vertical-align: middle; flex-shrink: 0; }

.post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.post-category,
.post-category a {
    background: var(--bg-muted) !important;
    color: var(--text-muted) !important;
    padding: 1px 7px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
}

.post-title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}

.post-title a {
    color: var(--text) !important;
    transition: color var(--transition);
    text-decoration: none !important;
}

.post-title a:hover { color: var(--accent) !important; }

.post-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    flex: 1;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.read-more {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    transition: gap var(--transition);
}

.read-more:hover { gap: 0.5rem; color: var(--accent-hover); }

.read-more svg { transition: transform var(--transition); }
.read-more:hover svg { transform: translateX(2px); }

.post-comments-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 11px;
    color: var(--text-faint);
}

/* ---- Pagination ---- */
.pagination-wrap { margin-top: 2.5rem; text-align: center; }

.pagination-wrap ol,
.pagination-wrap ul {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    margin: 0;
}

.pagination-wrap li {
    display: inline-block;
}

.pagination-wrap a,
.pagination-wrap span {
    display: inline-block;
    padding: 0.4rem 0.875rem;
    margin: 0 0.2rem;
    border-radius: var(--radius-md);
    font-size: 13px;
}

.pagination-wrap a {
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.pagination-wrap a:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* ---- Single Post ---- */
.single-post {
    max-width: 720px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.single-post-title {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin: 0.75rem 0 0.5rem;
    color: var(--text);
}

.post-meta-top .post-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.post-tags a {
    background: var(--bg-muted);
    color: var(--text-muted);
    padding: 2px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    transition: all var(--transition);
}

.post-tags a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ---- Post Content ---- */
.post-content.prose {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text);
}

.post-content.prose h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.post-content.prose h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.post-content.prose p { margin-bottom: 1.25rem; }

.post-content.prose img {
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.post-content.prose blockquote {
    border-left: 2px solid var(--border-hover);
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-style: normal;
    margin: 1.5rem 0;
}

.post-content.prose code {
    font-family: var(--font-mono);
    background: var(--bg-muted);
    color: var(--text);
    padding: 0.15em 0.45em;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    border: 1px solid var(--border);
    /* 覆盖 typecho 编辑器生成的 inline style(background/padding/color/font-size/border-radius) */
    background: var(--bg-muted) !important;
    color: var(--text) !important;
    padding: 0.15em 0.45em !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.875em !important;
    border-color: var(--border) !important;
}

.post-content.prose pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content.prose pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 13px;
    line-height: 1.7;
}

/* Prism 代码高亮微调 — 与主题卡片视觉一致 */
.post-content.prose pre[class*="language-"] {
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem 1.25rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow-x: auto;
}
.post-content.prose code[class*="language-"],
.post-content.prose pre[class*="language-"] code {
    font-family: var(--font-mono);
    /* 覆盖任何 inline style(typecho 编辑器生成的) */
    background: transparent !important;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 13px;
    text-shadow: none !important;
    hyphens: none;
    tab-size: 2;
}
/* 行号微调 */
.post-content.prose pre[class*="language-"].line-numbers {
    padding-left: 3.5rem;
}
.post-content.prose .line-numbers .line-numbers-rows {
    border-right-color: var(--border);
}
/* prism toolbar(默认隐藏,用我们自己的悬浮按钮) */
.post-content.prose div.prism-toolbar { display: none !important; }

/* 自定义代码块悬浮复制按钮(替换 prism 工具栏,更优雅) */
.post-content.prose pre[class*="language-"] {
    position: relative;
}
.post-content.prose .code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    user-select: none;
}
.post-content.prose pre[class*="language-"]:hover .code-copy-btn,
.post-content.prose .code-copy-btn:focus,
.post-content.prose .code-copy-btn.copied {
    opacity: 1;
}
.post-content.prose .code-copy-btn:hover {
    color: var(--text);
    background: var(--bg-muted);
    border-color: var(--border-hover);
}
.post-content.prose .code-copy-btn.copied {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}
[data-theme="dark"] .post-content.prose .code-copy-btn.copied {
    color: #4ade80;
    border-color: #166534;
    background: #0a2e1a;
}
.post-content.prose .code-copy-btn svg {
    flex-shrink: 0;
}

.post-content.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent-soft);
    text-underline-offset: 3px;
}

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

.post-content.prose ul,
.post-content.prose ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.post-content.prose li { margin-bottom: 0.4rem; }

.post-content.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* ---- Post Footer / Nav ---- */
.post-footer {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--border);
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-nav-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 70px;
}
.post-nav-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-muted);
    color: var(--text);
    transform: translateY(-1px);
}
.post-nav-card:hover .nav-arrow {
    color: var(--accent);
    transform: translateX(2px);
}
.post-nav-card.post-nav-next:hover .nav-arrow {
    transform: translateX(-2px);
}

.nav-arrow {
    font-size: 18px;
    color: var(--text-faint);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}
.nav-content-right {
    align-items: flex-end;
    text-align: right;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    font-weight: 600;
}

.nav-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.nav-empty {
    color: var(--text-faint);
    font-weight: 400;
    font-style: italic;
}

/* ---- Sticky 置顶文章(首页顶部) ---- */
.sticky-section {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border);
}
.sticky-header {
    margin-bottom: 0.75rem;
}
.sticky-label {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sticky-grid {
    display: grid;
    gap: 0.5rem;
}
.sticky-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
}
.sticky-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-muted);
    color: var(--text);
    transform: translateX(2px);
}
.sticky-date {
    font-size: 11px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 2.5em;
}
.sticky-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Page Navigator (首页 / 列表页分页) ---- */
.page-navigator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    padding: 2.5rem 0 1rem;
    margin: 0;
    flex-wrap: wrap;
}
.page-navigator li {
    display: inline-block;
}
.page-navigator li a,
.page-navigator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}
.page-navigator li a:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--bg-muted);
}
.page-navigator li.current a,
.page-navigator li.current span {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}
.page-navigator li.disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Comments ---- */
.comments-section {
    max-width: 720px;
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.comments-list { list-style: none; padding: 0; }

.comment {
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

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

.comment .comment-date {
    font-size: 11px;
    color: var(--text-faint);
    margin-left: 0.5rem;
}

.comment .comment-content {
    margin-top: 0.5rem;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-muted);
}

/* ---- Comment Form ---- */
.comment-form-wrap { margin-top: 2rem; }

.comment-form-wrap h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
    font-family: var(--font-sans);
    font-size: 13px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    color: var(--text);
    transition: border-color var(--transition);
    width: 100%;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.required { color: var(--accent); }

.submit-btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity var(--transition);
    letter-spacing: -0.01em;
}

.submit-btn:hover { opacity: 0.8; }

/* ---- Archive Page ---- */
.archive-page {
    max-width: 680px;
    margin: 0 auto;
}

.archive-page .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.archive-year-group { margin-bottom: 2rem; }

.archive-year {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.archive-list { list-style: none; padding: 0; margin: 0; }

.archive-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left var(--transition);
}

.archive-item:hover { padding-left: 0.4rem; }

.archive-date {
    font-size: 12px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.archive-item a {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
    transition: color var(--transition);
}

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

/* ---- 404 Page ---- */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}

.error-content { position: relative; }

.error-code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
    font-family: var(--font-sans);
}

.error-message {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.error-back {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--text);
    color: var(--bg) !important;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    transition: opacity var(--transition);
}

.error-back:hover { opacity: 0.8; }

/* ---- Footer ---- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
}

.footer-inner { text-align: center; }

.footer-copy {
    font-size: 12px;
    color: var(--text-faint);
    margin: 0;
}

.footer-copy a { color: var(--text-faint); }
.footer-copy a:hover { color: var(--text-muted); }

/* ---- Back to Top ---- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img,
.lightbox-overlay video,
.lightbox-overlay .lightbox-media {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-header nav {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 12px; }

    .posts-grid { grid-template-columns: 1fr; }

    .page-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar {
        display: none;
    }

    .single-post-title { font-size: 1.5rem; }

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

    .post-nav { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
}

/* ---- Search Results ---- */
.search-summary {
    color: var(--text-secondary, #6b7280);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}
.search-count {
    color: var(--accent, #3b82f6);
    font-weight: 600;
}
.search-summary em {
    color: var(--text, #1f2937);
    font-style: normal;
    font-weight: 600;
    background: linear-gradient(transparent 60%, rgba(59, 130, 246, 0.18) 60%);
    padding: 0 2px;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.search-result {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    padding: 1.25rem 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.search-result:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--accent, #3b82f6);
}
.search-result-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}
.search-result-title a {
    color: var(--text, #1f2937);
    text-decoration: none;
}
.search-result-title a:hover {
    color: var(--accent, #3b82f6);
}
.search-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.6rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.search-result-cat a {
    color: var(--accent, #3b82f6);
    text-decoration: none;
}
.search-result-excerpt {
    color: var(--text-secondary, #4b5563);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0;
}

.search-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary, #6b7280);
}
.search-empty svg {
    color: var(--text-secondary, #9ca3af);
    margin-bottom: 1rem;
}
.search-empty p {
    margin: 0.5rem 0;
    font-size: 1rem;
}
.search-empty em {
    color: var(--text, #1f2937);
    font-style: normal;
    font-weight: 600;
}
.search-tip {
    font-size: 0.85rem !important;
    color: var(--text-secondary, #9ca3af);
}
