/* =========================================================
   Stellar — Typecho 博客主题样式
   设计语言：轻量 · 现代 · 高可读性
   主题色：#2563eb（品牌蓝），暗色模式跟随 CSS 变量自动切换
   ========================================================= */

/* ---------- 主题变量 ---------- */
:root {
    --bg: #f5f6f8;
    --bg-soft: #eef0f3;
    --card: #ffffff;
    --text: #1f2328;
    --text-soft: #4b5563;
    --muted: #8a919c;
    --border: #e6e8ec;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, .08);
    --accent-contrast: #ffffff;
    --code-bg: #f6f8fa;
    --code-border: #e6e8ec;
    --hl-comment: #6a737d;
    --hl-keyword: #cf222e;
    --hl-string: #0a3069;
    --hl-number: #0550ae;
    --hl-title: #8250df;
    --hl-attr: #116329;
    --hl-builtin: #953800;
    --hl-meta: #24292f;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 10px 34px rgba(16, 24, 40, .10);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", "Courier New", monospace;
    --content-width: 1180px;
}
[data-theme="dark"] {
    --bg: #0e1116;
    --bg-soft: #151a21;
    --card: #161b22;
    --text: #e6edf3;
    --text-soft: #aeb6c0;
    --muted: #6e7681;
    --border: #262d36;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --accent-soft: rgba(88, 166, 255, .12);
    --accent-contrast: #0e1116;
    --code-bg: #0d1117;
    --code-border: #262d36;
    --hl-comment: #8b949e;
    --hl-keyword: #ff7b72;
    --hl-string: #a5d6ff;
    --hl-number: #79c0ff;
    --hl-title: #d2a8ff;
    --hl-attr: #7ee787;
    --hl-builtin: #ffa657;
    --hl-meta: #e6edf3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 34px rgba(0, 0, 0, .55);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; border: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .6em; line-height: 1.35; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
svg.icon { vertical-align: -3px; }

.container { max-width: var(--content-width); margin: 0 auto; padding: 0 20px; }
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 1000;
    background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.layout-single { grid-template-columns: minmax(0, 1fr); }
.main-col { min-width: 0; }
.site-main { padding-top: 28px; padding-bottom: 60px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--card) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    height: 64px;
}
.site-brand { display: flex; align-items: center; min-width: 0; }
.site-brand a { display: inline-flex; align-items: center; color: var(--text); }
.site-logo { height: 34px; width: auto; border-radius: 6px; }
.site-name { font-size: 1.25rem; font-weight: 800; letter-spacing: .2px; }
.nav-menu { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.nav-menu a {
    position: relative; padding: 8px 12px; border-radius: 8px;
    color: var(--text-soft); font-size: .95rem; font-weight: 500;
    transition: color .2s, background .2s;
}
.nav-menu a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-menu a.current { color: var(--accent); font-weight: 600; }
.nav-menu a.current::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
    height: 2px; border-radius: 2px; background: var(--accent);
}
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--card); color: var(--text-soft);
    transition: color .2s, border-color .2s, background .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; }

/* 主题切换图标显隐 */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }

/* 搜索面板 */
.search-panel { border-top: 1px solid var(--border); padding: 14px 0; background: var(--card); }
.search-form { display: flex; gap: 10px; }
.search-input {
    flex: 1; padding: 11px 16px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); outline: none;
    transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }
.search-submit {
    padding: 0 22px; border: 0; border-radius: 10px; background: var(--accent);
    color: var(--accent-contrast); font-weight: 600;
}
.search-submit:hover { background: var(--accent-hover); }

/* ---------- 首页 Hero ---------- */
.hero { padding: 38px 4px 26px; }
.hero-title { margin: 0 0 10px; font-size: 2.1rem; letter-spacing: .3px; }
.hero-desc { margin: 0 0 8px; color: var(--text-soft); font-size: 1.05rem; }
.hero-about { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; gap: 20px; }
.post-card { padding: 26px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.post-card-cat { margin-bottom: 8px; }
.post-card-cat .category {
    display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .78rem;
    color: var(--accent); background: var(--accent-soft); font-weight: 600;
}
.post-card-title { margin: 0 0 10px; font-size: 1.45rem; }
.post-card-title a { color: var(--text); transition: color .2s; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { color: var(--text-soft); font-size: .97rem; margin: 0 0 16px; }
.post-card-content { margin: 0 0 16px; }
.post-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.post-card-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.read-more { font-size: .92rem; font-weight: 600; white-space: nowrap; }
.read-more:hover { text-decoration: underline; }
/* 带缩略图的卡片 */
.post-card.with-thumb { display: flex; gap: 22px; align-items: stretch; }
.post-card-thumb { flex-shrink: 0; width: 220px; min-height: 130px; }
.post-card-thumb img {
    width: 100%; height: 100%; min-height: 130px; object-fit: cover; border-radius: var(--radius-sm);
    transition: transform .3s ease, box-shadow .3s ease;
}
.post-card.with-thumb:hover .post-card-thumb img { transform: scale(1.02); box-shadow: var(--shadow-lg); }
.post-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-card-main .post-card-head { flex-shrink: 0; }
.post-card-main .post-card-foot { margin-top: auto; }
/* 搜索命中高亮 */
mark.search-hit {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--text); padding: 0 2px; border-radius: 3px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* 元信息 */
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--muted); font-size: .86rem; }
.post-meta .meta-author { color: var(--text-soft); font-weight: 600; }
.post-meta a { color: inherit; }
.post-meta time { border-bottom: 1px dashed var(--border); }

/* 标签 */
.tag {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem;
    color: var(--text-soft); background: var(--bg-soft); border: 1px solid var(--border);
    transition: color .2s, border-color .2s, background .2s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 文章详情 ---------- */
.post-single { padding: 34px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .current { color: var(--text-soft); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-header { margin-bottom: 22px; }
.post-title { margin: 0 0 14px; font-size: 2rem; line-height: 1.35; }
.post-cover { margin: 0 0 22px; }
.post-cover img { width: 100%; border-radius: var(--radius); display: block; }
.post-footer { margin-top: 28px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.post-copyright {
    padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-soft);
    border: 1px dashed var(--border); font-size: .86rem; color: var(--text-soft);
}
.post-copyright p { margin: 0 0 4px; }
.post-copyright p:last-child { margin: 0; }

/* 分享条 */
.post-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.share-label { font-size: .86rem; color: var(--muted); }
.share-btn {
    display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 20px;
    font-size: .84rem; color: var(--text-soft); background: var(--bg-soft);
    border: 1px solid var(--border); cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* 上下篇 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.post-nav-item { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); min-width: 0; }
.post-nav-item.next { text-align: right; }
.post-nav-item a { font-size: .95rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-nav-item a:hover { color: var(--accent); }

/* 相关文章 */
.related { margin-top: 20px; }
.section-title { margin: 0 0 16px; font-size: 1.25rem; position: relative; padding-left: 12px; }
.section-title::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
    border-radius: 4px; background: var(--accent);
}
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.related-item {
    display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg); transition: border-color .2s, transform .2s;
}
.related-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-title { color: var(--text); font-weight: 600; font-size: .93rem; line-height: 1.5; }
.related-item:hover .related-title { color: var(--accent); }
.related-date { color: var(--muted); font-size: .78rem; }

/* ---------- 正文排版 ---------- */
.post-content { font-size: 1.02rem; line-height: 1.9; word-break: break-word; }
.post-content > *:first-child { margin-top: 0; }
.post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 {
    margin: 1.8em 0 .65em; font-weight: 700; line-height: 1.45; scroll-margin-top: 84px;
}
.post-content h2 { font-size: 1.5em; padding-bottom: .35em; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 1.24em; }
.post-content h4 { font-size: 1.08em; }
.post-content p { margin: 1em 0; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.post-content a:hover { color: var(--accent-hover); }
.post-content strong { font-weight: 700; }
.post-content img { display: block; margin: 1.4em auto; border-radius: var(--radius); }
.post-content blockquote {
    margin: 1.4em 0; padding: .8em 1.1em; border-left: 3px solid var(--accent);
    background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-soft);
}
.post-content blockquote p { margin: .4em 0; }
.post-content ul, .post-content ol { margin: 1em 0; padding-left: 1.6em; }
.post-content li { margin: .4em 0; }
.post-content li::marker { color: var(--accent); }
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.post-content table {
    width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95em;
    overflow-x: auto; display: block;
}
.post-content th, .post-content td { border: 1px solid var(--border); padding: .6em .85em; text-align: left; }
.post-content th { background: var(--bg-soft); font-weight: 600; }
.post-content tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 50%, transparent); }
.post-content code {
    font-family: var(--font-mono); font-size: .88em;
    background: var(--code-bg); border: 1px solid var(--code-border);
    padding: .15em .4em; border-radius: 5px;
}
.post-content kbd {
    font-family: var(--font-mono); font-size: .85em; padding: .1em .45em;
    border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-soft);
}

/* 代码块 */
.post-content pre {
    position: relative; margin: 1.5em 0; border-radius: 10px; overflow: hidden;
    background: var(--code-bg); border: 1px solid var(--code-border); line-height: 1.65;
}
.post-content pre code {
    display: block; padding: 16px 18px; background: transparent; border: 0;
    font-size: .88em; overflow-x: auto; color: var(--text);
}
/* 由 JS 生成的代码块包裹结构：head（语言+复制）+ body（行号+代码） */
.code-block {
    margin: 1.5em 0; border-radius: 10px; overflow: hidden;
    background: var(--code-bg); border: 1px solid var(--code-border); line-height: 1.65;
}
.code-block-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 14px; background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
    border-bottom: 1px solid var(--code-border); font-family: var(--font-mono); font-size: .75rem;
    color: var(--muted);
}
.code-lang::before { content: "⌘ "; opacity: .7; }
.code-copy-btn {
    border: 0; background: transparent; color: var(--muted); font-size: .75rem;
    font-family: var(--font-mono); padding: 2px 8px; border-radius: 5px; transition: color .2s, background .2s;
}
.code-copy-btn:hover { color: var(--accent); background: var(--accent-soft); }
.code-block-body { display: flex; align-items: stretch; background: var(--code-bg); }
.code-block-body pre {
    flex: 1; min-width: 0; margin: 0; border: 0; border-radius: 0; background: transparent;
    line-height: 1.65; overflow: visible;
}
.code-lines {
    flex-shrink: 0; padding: 16px 12px; text-align: right; user-select: none;
    font-family: var(--font-mono); font-size: .88em; line-height: 1.65; color: var(--muted);
    border-right: 1px solid var(--code-border); background: color-mix(in srgb, var(--bg-soft) 50%, transparent);
}
.code-lines span { display: block; }

/* highlight.js 配色（GitHub Light/Dark 系，随主题变量切换） */
.hljs { background: transparent; color: var(--text); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-tag, .hljs-name { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition { color: var(--hl-string); }
.hljs-number, .hljs-symbol, .hljs-bullet { color: var(--hl-number); }
.hljs-title, .hljs-title.function_, .hljs-section, .hljs-selector-id, .hljs-selector-class { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-type { color: var(--hl-attr); }
.hljs-built_in, .hljs-builtin-name { color: var(--hl-builtin); }
.hljs-meta, .hljs-meta .hljs-keyword { color: var(--hl-meta); }
.hljs-deletion { color: #d73a49; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ---------- 侧边栏 ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 84px; }
.widget { padding: 20px; }
.widget-title { margin: 0 0 14px; font-size: 1rem; position: relative; padding-left: 11px; }
.widget-title::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
    border-radius: 4px; background: var(--accent);
}
.widget-about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.about-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-soft); }
.about-info .widget-title { margin: 0 0 6px; }
.about-info .widget-title::before { display: none; }
.about-socials { display: flex; gap: 8px; }
.about-desc { margin: 0; color: var(--text-soft); font-size: .88rem; }
.social-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
    color: var(--text-soft); background: var(--bg);
    transition: color .2s, border-color .2s, background .2s;
}
.social-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.sidebar-search { display: flex; gap: 8px; }
.sidebar-search input {
    flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg); color: var(--text); outline: none; transition: border-color .2s;
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search button {
    width: 40px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg);
    color: var(--text-soft); transition: color .2s, border-color .2s;
}
.sidebar-search button:hover { color: var(--accent); border-color: var(--accent); }

.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.widget-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.widget-link {
    flex: 1; min-width: 0; color: var(--text-soft); font-size: .92rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s;
}
.widget-link:hover { color: var(--accent); }
.widget-time, .widget-count { color: var(--muted); font-size: .78rem; flex-shrink: 0; }
.widget-cats .widget-link { font-weight: 500; }
.widget-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* 目录 */
.toc { max-height: calc(100vh - 140px); overflow-y: auto; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 2px 0; }
.toc-list a {
    display: block; padding: 5px 10px; border-radius: 7px; font-size: .88rem;
    color: var(--text-soft); border-left: 2px solid transparent; transition: color .2s, background .2s, border-color .2s;
}
.toc-list a:hover { color: var(--accent); background: var(--accent-soft); }
.toc-list li.active > a { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc-list .toc-h3 { padding-left: 14px; }
.toc-list .toc-h3 a { font-size: .84rem; }

/* ---------- 归档 / 独立页面 ---------- */
.archive-head { margin-bottom: 22px; }
.archive-title { margin: 0 0 6px; font-size: 1.5rem; }
.archive-meta { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.archive-search { display: flex; gap: 8px; }
.archive-search input {
    flex: 1; padding: 9px 13px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg); color: var(--text); outline: none;
}
.archive-search input:focus { border-color: var(--accent); }
.archive-search button {
    padding: 0 18px; border: 0; border-radius: 9px; background: var(--accent);
    color: var(--accent-contrast); font-weight: 600;
}
.page-single .page-header { margin-bottom: 20px; }
.page-title { margin: 0; font-size: 1.9rem; }
.archive-summary { color: var(--muted); font-size: .92rem; }
.archive-intro { margin-bottom: 18px; }

/* 时间线 */
.timeline { position: relative; margin-top: 8px; }
.timeline::before {
    content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
    background: linear-gradient(var(--accent), transparent); opacity: .35; border-radius: 2px;
}
.timeline-year { position: relative; padding-left: 30px; margin-bottom: 30px; }
.timeline-year::before {
    content: ""; position: absolute; left: 0; top: 8px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--accent); border: 4px solid var(--card);
    box-shadow: 0 0 0 2px var(--accent);
}
.timeline-year-title { font-size: 1.3rem; display: flex; align-items: baseline; gap: 10px; }
.timeline-year-title .count { font-size: .82rem; color: var(--muted); font-weight: 400; }
.timeline-month-title { margin: 14px 0 6px; font-size: .95rem; color: var(--accent); }
.timeline-list { list-style: none; margin: 0; padding: 0; }
.timeline-item {
    display: flex; align-items: baseline; gap: 14px; padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-date { color: var(--muted); font-size: .82rem; font-family: var(--font-mono); flex-shrink: 0; width: 44px; }
.timeline-link { color: var(--text-soft); font-size: .95rem; transition: color .2s; }
.timeline-link:hover { color: var(--accent); }

/* 友链 */
.links-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.link-card {
    display: flex; flex-direction: column; gap: 6px; padding: 18px; text-align: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.link-avatar { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; overflow: hidden; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; }
.link-avatar img { width: 100%; height: 100%; object-fit: cover; }
.link-name { font-weight: 700; color: var(--text); }
.link-desc { color: var(--muted); font-size: .8rem; line-height: 1.5; }

/* ---------- 片刻（动态 / 时光机） ---------- */
.page-desc { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.moments { position: relative; margin-top: 22px; }
.moments::before {
    content: ""; position: absolute; left: 26px; top: 10px; bottom: 10px; width: 2px;
    background: linear-gradient(var(--accent), transparent); opacity: .25; border-radius: 2px;
}
.moment { position: relative; display: flex; gap: 16px; padding: 0 0 26px; }
.moment:last-child { padding-bottom: 0; }
.moment-avatar {
    position: relative; z-index: 1; flex-shrink: 0; width: 54px; height: 54px;
    border-radius: 50%; overflow: hidden; background: var(--bg-soft);
    border: 2px solid var(--card); box-shadow: 0 0 0 2px var(--accent);
}
.moment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.moment-body {
    flex: 1; min-width: 0; padding: 16px 18px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .2s, box-shadow .2s;
}
.moment:hover .moment-body { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.moment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.moment-author { font-weight: 700; color: var(--text); font-size: .95rem; }
.moment-date { color: var(--muted); font-size: .8rem; }
.moment-date time { border-bottom: 1px dashed var(--border); }
.moment-content { font-size: .95rem; color: var(--text-soft); }
.moment-content > *:first-child { margin-top: 0; }
.moment-content > *:last-child { margin-bottom: 0; }
.moment-content p { margin: .5em 0; }
.moment-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }

/* ---------- 评论 ---------- */
.comments { margin-top: 20px; }
.comment-list { list-style: none; margin: 0 0 8px; padding: 0; }
.comment-item { list-style: none; margin: 0 0 14px; }
.comment-inner { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.comment-avatar img { width: 44px; height: 44px; border-radius: 50%; display: block; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 6px; }
.comment-author { font-style: normal; font-weight: 700; font-size: .95rem; }
.comment-date { color: var(--muted); font-size: .78rem; }
.comment-date time { border-bottom: 1px dashed var(--border); }
.comment-awaiting { display: inline-block; margin: 4px 0; padding: 2px 10px; border-radius: 12px; font-size: .76rem; font-style: normal; color: #b45309; background: rgba(180, 83, 9, .12); }
.comment-content { color: var(--text-soft); font-size: .94rem; word-break: break-word; }
.comment-reply a { font-size: .8rem; color: var(--muted); }
.comment-reply a:hover { color: var(--accent); }
.comment-children { margin-top: 14px; }
.comment-children .comment-list { margin: 0; }
.comment-children .comment-item { margin-bottom: 10px; }

.respond { margin-top: 22px; }
.respond-title { margin: 0 0 16px; font-size: 1.1rem; }
.cancel-comment-reply { margin-bottom: 10px; }
.cancel-comment-reply a { font-size: .85rem; color: var(--muted); }
.cancel-comment-reply a:hover { color: var(--accent); }
.comment-login { color: var(--text-soft); font-size: .9rem; }
.comment-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.comment-input {
    width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg); color: var(--text); outline: none; transition: border-color .2s;
}
.comment-input:focus { border-color: var(--accent); }
.comment-textarea {
    width: 100%; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--bg); color: var(--text); outline: none; resize: vertical; transition: border-color .2s;
}
.comment-textarea:focus { border-color: var(--accent); }
.comment-submit { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.comment-info { color: var(--muted); font-size: .8rem; }
.comment-closed { color: var(--muted); }
.comment-pagination { margin-top: 14px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 30px 0 0; padding: 0; }
.pagination li { margin: 0; }
.pagination a, .pagination .current {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 12px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--card); color: var(--text-soft); font-size: .9rem;
    transition: color .2s, border-color .2s, background .2s;
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination .current { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ---------- 空状态 / 404 ---------- */
.empty { text-align: center; padding: 60px 30px; }
.empty-icon { color: var(--muted); margin-bottom: 12px; }
.empty h2 { font-size: 1.4rem; }
.empty p { color: var(--muted); }
.error-page { text-align: center; padding: 80px 30px; }
.error-code { font-size: 6rem; font-weight: 800; line-height: 1; color: var(--accent); opacity: .35; }
.error-title { font-size: 1.6rem; }
.error-desc { color: var(--muted); }
.empty-text { color: var(--muted); }

/* ---------- 图片灯箱 ---------- */
.lightbox {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
    background: rgba(8, 10, 14, .88); backdrop-filter: blur(6px); cursor: zoom-out;
    animation: lb-fade .18s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-body { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox-body img {
    max-width: 100%; max-height: 82vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    display: block; margin: 0 auto;
}
.lightbox-caption { color: rgba(255, 255, 255, .75); font-size: .86rem; margin-top: 10px; }
.lightbox-close {
    position: absolute; top: 16px; right: 20px; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff;
    font-size: 1.6rem; line-height: 1; cursor: pointer; transition: background .2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .2); }

/* ---------- 站点地图 ---------- */
.sitemap-sec { margin-top: 26px; }
.sitemap-list { list-style: none; margin: 0; padding: 0; }
.sitemap-list li {
    display: flex; align-items: baseline; gap: 10px; padding: 7px 4px;
    border-bottom: 1px dashed var(--border); font-size: .93rem;
}
.sitemap-list li a { color: var(--text-soft); }
.sitemap-list li a:hover { color: var(--accent); }
.sitemap-list li:hover { background: var(--bg-soft); }
.sitemap-count, .sitemap-date { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.sitemap-year { font-size: 1.1rem; margin: 18px 0 4px; color: var(--text); }
.sitemap-year::before { content: "▍"; color: var(--accent); margin-right: 6px; }
.sitemap-cats li a { font-weight: 600; }
.sitemap-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* 404 搜索框 */
.error-page .archive-search { max-width: 420px; margin: 22px auto; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 22px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--card); color: var(--text-soft); font-weight: 600; font-size: .92rem;
    transition: color .2s, border-color .2s, background .2s;
}
.btn:hover { color: var(--accent); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--card); padding: 44px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; padding-bottom: 34px; }
.footer-brand .site-name { font-size: 1.2rem; }
.footer-brand .site-logo { height: 30px; }
.footer-desc { color: var(--muted); font-size: .88rem; margin: 12px 0 14px; }
.footer-socials { display: flex; gap: 8px; }
.footer-title { font-size: .95rem; margin: 0 0 14px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0 0 8px; }
.footer-links a { color: var(--text-soft); font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-count { margin-left: 6px; color: var(--muted); font-size: .78rem; }
.footer-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-bottom {
    display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; align-items: center;
    padding: 18px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem;
}
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- 返回顶部 ---------- */
#backtop {
    position: fixed; right: 26px; bottom: 30px; z-index: 90;
    width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--card); color: var(--text-soft); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .25s, transform .25s, visibility .25s, color .2s, border-color .2s;
}
#backtop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backtop:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .widget { flex: 1 1 calc(50% - 10px); min-width: 240px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    body { font-size: 15px; }
    .nav-menu {
        position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
        background: var(--card); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
        transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    }
    .nav-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .nav-menu a { padding: 12px 14px; }
    .nav-toggle { display: inline-flex; }
    .post-single { padding: 22px; }
    .post-title { font-size: 1.6rem; }
    .post-nav { grid-template-columns: 1fr; }
    .related-grid, .links-grid, .comment-fields { grid-template-columns: 1fr; }
    .post-card.with-thumb { flex-direction: column; gap: 14px; }
    .post-card-thumb { width: 100%; min-height: 0; }
    .post-card-thumb img { height: 180px; min-height: 0; }
    .hero { padding: 26px 2px 18px; }
    .hero-title { font-size: 1.7rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .footer-bottom { justify-content: flex-start; }
    #backtop { right: 16px; bottom: 20px; }
}

/* ---------- 打印 ---------- */
@media print {
    .site-header, .site-footer, .sidebar, #backtop, .post-nav, .related, .comments, .breadcrumb { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; padding: 0; }
    .post-content a { text-decoration: none; }
}
