/* flavor 主题 · 2026 改版样式（自用版，不开源）
   叠加在原有 8 个样式文件之上；规范稿见 are.ink 工作区 theme/designs/ui-spec-20261129/。
   单独引用并带版本号（不并入 main.min.css），避免 PWA 缓存让老访客拿到新页面配旧样式。
   基调：黑纸、白字、一点红。强调色只用在当前位置、链接线、置顶竖线、已点赞和焦点上。 */

/* ── 1. 设计变量 ───────────────────────────────────────────── */
:root {
  --bg: #000000;
  --surface: #0d0d0e;
  --surface-2: #161618;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .24);
  --text-1: #f5f5f7;
  --text-2: #d2d2d7;
  --text-3: #a1a1a6;
  --text-4: #86868b;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-code: "SF Mono", SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;

  --fs-micro: 12px;
  --fs-meta: 13px;
  --fs-ui: 14px;
  --fs-item: 15px;
  --fs-h3: 17px;
  --fs-body: 16px;
  --fs-h2: 21px;
  --fs-title: 28px;
  --fs-display: 32px;
  --lh-title: 1.42;
  --lh-ui: 1.65;
  --lh-read: 1.85;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;

  --read: 860px;                                  /* 正文栏宽：16px 字约 53 字；代码块、配图、表格同宽 */
  --page: 1200px;
  --gutter: 24px;

  --ease: cubic-bezier(.4, 0, .6, 1);
  --ease-out: cubic-bezier(.32, .72, 0, 1);
}

:root.theme-light {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --surface-2: #efeff1;
  --line: rgba(0, 0, 0, .10);
  --line-strong: rgba(0, 0, 0, .24);
  --text-1: #1d1d1f;
  --text-2: #333336;
  --text-3: #55555a;
  --text-4: #6e6e73;
}

/* 强调色：沿用原来置顶竖线的红；浅色模式用同色相稍深的一档，保证白底上可读 */
:root             { --accent: #ff3546; }
:root.theme-light { --accent: #d91f32; }

:root, :root.theme-light {
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 62%, transparent);
  /* 把现有主题的变量指向新变量 */
  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-border: var(--line);
  --color-border-light: var(--surface-2);
  --color-border-hover: var(--line-strong);
  --color-text-primary: var(--text-1);
  --color-text-body: var(--text-2);
  --color-text-secondary: var(--text-3);
  --color-text-muted: var(--text-4);
  --color-accent: var(--accent);
  --color-accent-hover: var(--text-1);
  --color-badge-gold: var(--accent);
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --font-mono: var(--font-code);
  --max-width: calc(var(--page) + var(--gutter) * 2);
  --content-width: calc(var(--read) + var(--gutter) * 2);
}

@media (max-width: 640px) {
  :root {
    --fs-micro: 11px;
    --fs-meta: 11px;
    --fs-ui: 12px;
    --fs-item: 13px;
    --fs-h3: 14px;
    --fs-body: 14px;
    --fs-h2: 16px;
    --fs-title: 18px;
    --fs-display: 17px;
    --lh-read: 1.8;
    --gutter: 20px;
  }
}

/* ── 2. 基础 ───────────────────────────────────────────────── */
body { font-family: var(--font-sans); font-size: var(--fs-item); line-height: var(--lh-ui); letter-spacing: 0; color: var(--text-2); background: var(--bg); }
h1, h2, h3, h4 { letter-spacing: 0; color: var(--text-1); }
/* 只避免末行单字成行；不用 balance（会过早换行） */
.post-card__title, .article-title, .hero-title, .related-card__title, .post-nav-card__title, .poster__title, .archive-item__title { text-wrap: pretty; }
.meta-text { font-size: var(--fs-meta); letter-spacing: 0; }
time, .post-card__meta, .article-meta, .archive-item__date { font-variant-numeric: tabular-nums; }
::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); color: var(--text-1); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 标题不截断、不省略 */
.clamp-2, .clamp-3, .post-nav-card__title, .related-card__title, .link-card__desc { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; }
.search-result-item__title, .search-result-item__title mark { white-space: normal; overflow: visible; }

/* ── 3. 版心 ───────────────────────────────────────────────── */
.container, .content-grid, .top-bar, .footer-inner, .hero-content, .cat-hero__inner { max-width: var(--max-width); padding-inline: var(--gutter); }
.container { margin-inline: auto; }
.container .content-grid { padding-inline: 0; }
.container.page--narrow, .article-container, .page-container { max-width: var(--content-width); }
.article-container { padding: var(--s-8) var(--gutter); }

/* ── 4. 页头（图标沿用原样，只把间距做匀） ─────────────────── */
.site-header { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.site-name-link { font-size: var(--fs-h3); font-weight: 600; letter-spacing: .02em; }
.top-bar__right { gap: 4px; margin-right: -9px; }
@media (max-width: 768px) {
  .top-bar__right { gap: 2px; margin-right: -8px; }
  .theme-toggle, .search-btn, .btn-nav-toggle { width: 32px; height: 32px; }
  .theme-toggle svg, .search-btn svg { width: 15px; height: 15px; }
  .hamburger { width: 14px; height: 10px; }
  .hamburger.is-active .hamburger__line--top { transform: translateY(3.25px) rotate(45deg); }
  .hamburger.is-active .hamburger__line--bottom { transform: translateY(-3.25px) rotate(-45deg); }
}
.theme-toggle, .search-btn, .btn-nav-toggle { width: 36px; height: 36px; padding: 0; justify-content: center; align-items: center; transition: opacity .25s var(--ease), color .2s, background-color .2s; }
.theme-toggle:hover, .search-btn:hover { background: var(--surface-2); }
@media (min-width: 769px) { .theme-toggle svg, .search-btn svg { width: 16px; height: 16px; } }

/* 电脑导航 */
.nav-item { padding: 0 14px; font-size: var(--fs-meta); letter-spacing: .02em; text-transform: none; color: var(--text-3); transition: color .25s var(--ease); }
.nav-item:hover, .nav-item[aria-expanded="true"] { color: var(--text-1); }
.nav-item--active { color: var(--text-1); }
.nav-item--active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 11px; height: 2px; border-radius: 2px; background: var(--accent); }
/* 红线是独立元素：悬停时滑到对应项；页面跳转时用跨页过渡滑到新栏目（不支持的浏览器直接显示在新位置） */
.top-bar__nav { position: relative; }
.nav-indicator { position: absolute; left: 0; bottom: 11px; width: 0; height: 2px; border-radius: 2px; background: var(--accent); pointer-events: none; transition: transform .45s var(--ease-out), width .45s var(--ease-out), opacity .25s var(--ease); view-transition-name: nav-indicator; }
.top-bar__nav.has-indicator .nav-item--active::after { display: none; }
@view-transition { navigation: auto; }
/* 页面本身瞬间切换，只让红线滑动 */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-group(nav-indicator) { animation-duration: .45s; animation-timing-function: cubic-bezier(.32, .72, 0, 1); }
@media (max-width: 768px) { .nav-indicator { display: none; } }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(nav-indicator) { animation: none; } }

/* 二级菜单：通栏下拉，页面其余部分虚化 */
.flyout { position: fixed; z-index: 999; top: 57px; left: 0; right: 0; height: 0; overflow: hidden; visibility: hidden; background: color-mix(in srgb, var(--bg) 94%, var(--text-1) 1%); border-bottom: 1px solid var(--line); transition: height .42s var(--ease-out), visibility 0s .42s; }
.flyout.is-open { visibility: visible; transition: height .42s var(--ease-out), visibility 0s; }
.flyout__panel { position: absolute; top: 0; left: 0; right: 0; visibility: hidden; }
.flyout__panel.is-active { visibility: visible; }
.flyout__inner { max-width: var(--max-width); margin: 0 auto; padding: 24px var(--gutter) 32px; }
.flyout__label, .flyout__link { opacity: 0; transform: translateY(-8px); transition: opacity .18s var(--ease), transform .18s var(--ease); }
.flyout__panel.is-active :is(.flyout__label, .flyout__link) { opacity: 1; transform: none; transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), border-color .3s var(--ease); transition-delay: calc(.08s + var(--i) * .03s), calc(.08s + var(--i) * .03s), 0s; }
.flyout__label { margin-bottom: 4px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .14em; color: var(--text-4); }
/* 和友链卡片一个语言：名称、一句说明、右上角箭头、底部细线；悬停时细线变亮、箭头前移 */
.flyout__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--s-7); }
.flyout__link { position: relative; display: block; padding: 16px 28px 16px 0; border-bottom: 1px solid var(--line); color: var(--text-1); }
.flyout__name { display: block; font-size: var(--fs-item); font-weight: 600; line-height: 1.5; color: var(--text-1); }
.flyout__desc { display: block; margin-top: 2px; font-size: var(--fs-micro); line-height: 1.6; color: var(--text-3); }
.flyout__desc:empty { display: none; }
.flyout__arrow { position: absolute; top: 21px; right: 2px; width: 13px; height: 13px; color: var(--text-4); transition: transform .35s var(--ease-out), color .25s var(--ease); }
.flyout__panel.is-active .flyout__link:hover { border-bottom-color: var(--line-strong); }
.flyout__link:hover .flyout__arrow { color: var(--text-1); transform: translateX(3px); }
.flyout__link[target="_blank"]:hover .flyout__arrow { transform: translate(2px, -2px); }
.flyout-scrim { position: fixed; z-index: 998; inset: 57px 0 0 0; background: color-mix(in srgb, var(--bg) 40%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); opacity: 0; visibility: hidden; transition: opacity .36s var(--ease), visibility 0s .36s; }
.flyout-scrim.is-open { opacity: 1; visibility: visible; transition: opacity .36s var(--ease) .08s, visibility 0s; }

/* 手机菜单：整屏展开，二级从右侧滑入 */
.sheet { display: none; }
@media (max-width: 768px) {
  .flyout, .flyout-scrim { display: none; }
  .top-bar__nav { display: none; }
  .site-header { z-index: 1001; }
  html.menu-open { overflow: hidden; }
  html.menu-open .site-header { background: var(--bg); border-bottom-color: transparent; }
  html.menu-open .theme-toggle, html.menu-open .search-btn { opacity: 0; pointer-events: none; }
  .sheet { display: block; position: fixed; z-index: 1000; inset: 56px 0 0 0; overflow: hidden; background: var(--bg); visibility: hidden; clip-path: inset(0 0 100% 0); transition: clip-path .42s var(--ease) .06s, visibility 0s .48s; }
  html.menu-open .sheet { visibility: visible; clip-path: inset(0 0 0 0); transition: clip-path .52s var(--ease-out), visibility 0s; }
  .sheet__view { position: absolute; inset: 0; overflow-y: auto; padding: 20px 40px 48px; transition: transform .44s var(--ease-out), opacity .3s var(--ease), visibility 0s .44s; }
  .sheet__view--sub { transform: translateX(48px); opacity: 0; visibility: hidden; }
  .sheet__view--sub.is-active { transform: none; opacity: 1; visibility: visible; transition: transform .44s var(--ease-out), opacity .3s var(--ease) .06s, visibility 0s; }
  .sheet.has-sub .sheet__view--root { transform: translateX(-48px); opacity: 0; visibility: hidden; }
  .sheet__row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0; font-size: 16px; font-weight: 600; letter-spacing: .02em; color: var(--text-1); text-align: left; }
  .sheet__row--active span { padding-bottom: 4px; background: linear-gradient(var(--accent), var(--accent)) left bottom / 100% 2px no-repeat; }
  .sheet__row svg { width: 16px; height: 16px; color: var(--text-4); }
  .sheet__label { margin: 4px 0 8px; font-size: var(--fs-meta); color: var(--text-4); }
  .sheet__back { display: flex; align-items: center; margin: -8px 0 8px -12px; width: 40px; height: 40px; justify-content: center; color: var(--text-3); }
  .sheet__back svg { width: 18px; height: 18px; }
  .sheet__view > * { opacity: 0; transform: translateY(-10px); transition: opacity .16s var(--ease), transform .16s var(--ease); }
  html.menu-open .sheet__view--root > *, html.menu-open .sheet__view--sub.is-active > * { opacity: 1; transform: none; transition: opacity .44s var(--ease-out), transform .44s var(--ease-out); transition-delay: calc(.1s + var(--i) * .038s); }
}

/* ── 5. 首页 ───────────────────────────────────────────────── */
.hero-section { height: 420px; }
.hero-overlay { background: linear-gradient(to top, rgba(0,0,0,.86) 0%, rgba(0,0,0,.48) 42%, rgba(0,0,0,.04) 100%); }
.hero-content { bottom: var(--s-7); }
.hero-title, .theme-light .hero-title { max-width: none; font-size: var(--fs-display); line-height: 1.38; font-weight: 600; letter-spacing: .01em; color: #fff; }
.hero-subtitle, .theme-light .hero-subtitle { max-width: 40em; margin-top: var(--s-2); font-size: var(--fs-item); color: rgba(255,255,255,.78); }
/* 阅读全文：文字 + 一个左右轻晃的箭头（沿用原来的动效） */
.hero-cta, .theme-light .hero-cta { display: inline-flex; align-items: center; gap: 8px; height: auto; margin-top: var(--s-5); padding: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: #fff; }
.hero-cta:hover { background: none; color: #fff; opacity: 1; }
.hero-cta .meta-text { font-size: var(--fs-ui); font-weight: 500; text-transform: none; letter-spacing: .08em; }
.hero-cta__icon { display: inline-flex; animation: hero-arrow-bounce 1.2s ease-in-out infinite; }
.hero-cta__icon svg { width: 16px; height: 16px; }
@keyframes hero-arrow-bounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.hero-section + .container { margin-top: var(--s-7); }

.content-grid { gap: 72px; }
/* 热门文章：沿用现有的四宫格样式，只统一字号、行高和圆角 */
.compact-grid { margin-bottom: var(--s-7); }
.post-card--compact { padding: var(--s-5) 20px; }
.post-card--compact .post-card__inner { gap: var(--s-4); }
.post-card--compact .post-card__title { font-size: var(--fs-item); font-weight: 600; line-height: 1.55; letter-spacing: 0; }
.post-card--compact .post-card__meta { margin-top: var(--s-2); font-size: var(--fs-micro); letter-spacing: .02em; color: var(--text-4); }
.post-card__thumb-square { width: 72px; height: 72px; border-radius: var(--r-sm); }
@media (min-width: 769px) { .post-card--compact:nth-child(4n+1) { padding-left: 0; } .post-card--compact:nth-child(4n) { padding-right: 0; } }
@media (min-width: 481px) and (max-width: 768px) { .post-card--compact:nth-child(2n+1) { padding-left: 0; } .post-card--compact:nth-child(2n) { padding-right: 0; } }
@media (max-width: 640px) { .post-card--compact { padding: var(--s-4) 0; } .post-card__thumb-square { width: 60px; height: 60px; } }
.section-header { padding-bottom: var(--s-3); margin-bottom: 0; }
.section-title { font-size: var(--fs-meta); font-weight: 600; letter-spacing: .14em; line-height: 1.6; color: var(--text-3); }
.section-more { font-size: var(--fs-meta); color: var(--text-3); }
.sidebar { width: 248px; top: 88px; }
.sidebar__section { padding: var(--s-5) 0; }
.sidebar__avatar { width: 48px; height: 48px; }
.sidebar__title { font-size: var(--fs-h3); font-weight: 600; letter-spacing: .02em; }
.sidebar__desc { font-size: var(--fs-ui); color: var(--text-3); }
.sidebar__section-title { font-size: var(--fs-meta); font-weight: 600; letter-spacing: .14em; text-transform: none; color: var(--text-4); }
.sidebar__all { display: inline-block; margin-top: var(--s-4); font-size: var(--fs-meta); color: var(--text-3); }

/* ── 6. 文章列表 ───────────────────────────────────────────── */
.post-card--list { gap: var(--s-6); padding: 28px 0; align-items: center; border-bottom-color: var(--line); }
.post-card--list:last-child { border-bottom: 0; }
.post-card--list .post-card__title { margin-bottom: var(--s-2); font-size: var(--fs-h3); font-weight: 600; line-height: 1.55; letter-spacing: .01em; }
.post-card__title-link:hover .post-card__title, .post-card--compact .post-card__inner:hover .post-card__title { color: var(--text-3); }
.post-card--list .post-card__excerpt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-bottom: var(--s-3); font-size: var(--fs-ui); line-height: 1.7; color: var(--text-3); }
.post-card--list .post-card__meta { display: flex; align-items: center; gap: 14px; font-size: var(--fs-meta); letter-spacing: .02em; color: var(--text-4); }
.post-card__thumb { width: 156px; height: 104px; border-radius: var(--r-md); transition: transform .7s var(--ease-out); }
.post-card__thumb-link { border-radius: var(--r-md); }
.post-card__thumb-link:hover .post-card__thumb { transform: scale(1.03); }

@media (max-width: 640px) {
  .post-card--list { flex-direction: row; gap: var(--s-4); padding: 20px 0; align-items: flex-start; }
  .post-card--list .post-card__thumb-link { order: 0; width: 76px; margin-top: 3px; border-radius: 6px; }
  .post-card--list .post-card__thumb { order: 0; width: 76px; height: 57px; aspect-ratio: auto; border-radius: 6px; }
  .post-card--list .post-card__title { font-size: var(--fs-item); }
  .post-card--list .post-card__excerpt { display: none; }
  .hero-section { height: 300px; }
  .hero-content { bottom: var(--s-5); }
}

/* ── 7. 置顶与文末记号 ─────────────────────────────────────── */
/* 置顶：沿用原来的短竖线 */
.badge--top, .archive-item__badge { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; font-size: var(--fs-micro); font-weight: 500; line-height: 16px; letter-spacing: .1em; color: var(--text-3); }
.badge--top::before, .archive-item__badge::before { content: ""; width: 3px; height: 12px; flex: none; border-radius: 3px; background: var(--accent); }
.endmark { display: flex; align-items: center; justify-content: center; gap: 14px; margin: var(--s-7) 0 0; font-size: 10px; line-height: 1; letter-spacing: .34em; color: var(--text-4); opacity: .72; }
.endmark::before, .endmark::after { content: ""; width: 28px; height: 1px; background: var(--line-strong); }

/* ── 8. 按钮与标签 ─────────────────────────────────────────── */
.btn { gap: 6px; height: 32px; min-height: 32px; padding: 0 16px; border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 500; letter-spacing: .04em; transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.btn--secondary, .btn--ghost, .theme-light .btn--secondary { background: transparent; border: 1px solid var(--line-strong); color: var(--text-1); }
.btn--secondary:hover, .btn--ghost:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--text-1); }
.btn--primary, .theme-light .btn--primary { background: var(--text-1); border: 1px solid var(--text-1); color: var(--bg); }
.btn--primary:hover, .theme-light .btn--primary:hover { background: var(--text-2); border-color: var(--text-2); color: var(--bg); }
.btn[disabled] { opacity: .35; cursor: default; }
.pagination__info { font-size: var(--fs-meta); color: var(--text-4); }

.tag-pill, .tag-pill--lg, .theme-light .tag-pill { display: inline-flex; align-items: baseline; gap: 3px; min-height: 28px; padding: 0; border: 0; border-radius: 0; background: none; font-size: var(--fs-meta); line-height: 28px; letter-spacing: .02em; color: var(--text-3); transition: color .25s var(--ease); }
.tag-pill:hover { color: var(--text-1); }
.tag-pill--lg { font-size: var(--fs-item); line-height: 40px; color: var(--text-2); }
.tag-pill--lg .tag-pill__name { margin: 0; }
.tag-pill--lg .tag-pill__count { position: relative; top: -7px; font-size: var(--fs-micro); line-height: 1; color: var(--text-4); }
.tag-cloud { gap: var(--s-1) var(--s-6); }
.sidebar__tags { gap: 0 var(--s-4); }

/* ── 9. 页面标题 ───────────────────────────────────────────── */
.page-header { padding-top: var(--s-8); margin-bottom: var(--s-6); }
.page-title { font-size: var(--fs-title); font-weight: 600; line-height: var(--lh-title); letter-spacing: .01em; }
.page-subtitle, .page-description { margin-top: var(--s-2); font-size: var(--fs-ui); color: var(--text-3); }
.page-back { display: inline-block; margin-bottom: var(--s-2); font-size: var(--fs-meta); color: var(--text-3); }
.page-title__hash { margin-right: 4px; color: var(--text-4); font-weight: 400; }
@media (max-width: 640px) { .page-header { padding-top: 40px; } .article-container { padding-top: 32px; } }

/* ── 10. 文章页 ────────────────────────────────────────────── */
.article-header { margin-bottom: var(--s-6); }
.article-title { margin-bottom: var(--s-4); font-size: var(--fs-title); font-weight: 600; line-height: var(--lh-title); letter-spacing: .01em; }
@media (max-width: 768px) { .article-title { font-size: var(--fs-title); } }
.article-meta { font-size: var(--fs-meta); letter-spacing: .02em; color: var(--text-4); }
.article-meta__category, .article-meta__item, .article-meta__sep { color: var(--text-4); }
.article-meta__category:hover { color: var(--text-1); }
.article-content img { border-radius: var(--r-md); cursor: zoom-in; }
.article-content a img { cursor: pointer; }

/* 连续多张图：电脑上 2–3 张并排、按各自比例等高；超过 3 张和手机上改为横向滑动（像 X 长文） */
.gallery { display: flex; gap: 8px; margin: var(--s-6) 0; }
.gallery figure { flex: var(--ar) 1 0; min-width: 0; margin: 0; aspect-ratio: var(--ar); }
.gallery img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: var(--r-md); }
.gallery__count { display: none; }
.gallery { scrollbar-width: none; }
.gallery--scroll { overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.gallery--scroll figure { flex: 0 0 auto; width: min(78%, calc(320px * var(--ar))); height: 320px; aspect-ratio: auto; scroll-snap-align: start; }
.gallery-wrap { position: relative; margin: var(--s-6) 0; }
.gallery-wrap > .gallery { margin: 0; }
.gallery__count { margin-top: var(--s-2); font-size: var(--fs-micro); color: var(--text-4); font-variant-numeric: tabular-nums; }
.gallery--scroll + .gallery__count { display: block; }
@media (max-width: 640px) {
  .gallery-wrap .gallery { overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  /* 每张最多占屏宽 82%，保证露出下一张，读者知道能滑 */
  .gallery-wrap .gallery figure { flex: 0 0 auto; width: min(82vw, calc(220px * var(--ar))); height: 220px; aspect-ratio: auto; scroll-snap-align: start; }
  .gallery-wrap .gallery figure:only-child { height: auto; }
  .gallery-wrap .gallery__count { display: block; }
}

/* 放大查看：从原位置放大到屏幕中央，背景压暗；多张时可左右切换 */
.lightbox { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: rgba(0,0,0,.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .32s var(--ease); cursor: zoom-out; }
.lightbox.is-open { opacity: 1; }
.lightbox__img { position: fixed; left: 0; top: 0; max-width: none; border-radius: var(--r-md); transform-origin: 0 0; will-change: transform; transition: transform .42s var(--ease-out), border-radius .42s var(--ease-out); }
.lightbox.is-open .lightbox__img { border-radius: 4px; }
.lightbox__btn { position: fixed; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; transition: background-color .2s; }
.lightbox__btn:hover { background: rgba(255,255,255,.2); }
.lightbox__btn svg { width: 18px; height: 18px; }
.lightbox__btn--prev { left: 24px; } .lightbox__btn--next { right: 24px; }
.lightbox__count { position: fixed; left: 0; right: 0; bottom: 24px; text-align: center; font-size: var(--fs-meta); color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.lightbox__close { position: fixed; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; color: rgba(255,255,255,.8); cursor: pointer; }
.lightbox__close svg { width: 20px; height: 20px; }
@media (max-width: 640px) { .lightbox__btn { display: none; } }

/* 题图：沉浸——通栏铺到页头下，向页面底色淡出，标题压在淡出处 */
.site-main { overflow-x: clip; }
.article-container { display: flex; flex-direction: column; }
.article-container > * { min-width: 0; }
.article-container:has(> .article-feature) { padding-top: 0; }
.article-container > .article-feature { order: -1; margin: 0 calc(50% - 50vw); }
.article-feature img { display: block; width: 100%; height: min(42vh, 380px); object-fit: cover; border-radius: 0; filter: brightness(.86) saturate(.95);
  -webkit-mask-image: linear-gradient(to bottom, #000 42%, transparent 98%); mask-image: linear-gradient(to bottom, #000 42%, transparent 98%); }
.theme-light .article-feature img { filter: none; }
.article-container > .article-feature + * , .article-container > .article-header:has(+ .article-feature) { position: relative; z-index: 1; }
.article-container > .article-header:has(+ .article-feature) { margin-top: -56px; }
@media (max-width: 640px) {
  .article-feature img { height: 220px; }
  .article-container > .article-header:has(+ .article-feature) { margin-top: -28px; }
}

.article-content, .post-content { font-size: var(--fs-body); line-height: var(--lh-read); letter-spacing: .01em; color: var(--text-2); word-break: normal; overflow-wrap: break-word; line-break: strict; }
.article-content p { margin: 0 0 1.25em; }
.article-content h2 { margin: var(--s-8) 0 var(--s-4); font-size: var(--fs-h2); font-weight: 600; line-height: var(--lh-title); letter-spacing: .01em; }
.article-content h3 { margin: var(--s-7) 0 var(--s-3); font-size: calc(var(--fs-body) + 2px); font-weight: 600; line-height: var(--lh-title); }
.article-content h4 { margin: var(--s-6) 0 var(--s-2); font-size: var(--fs-body); font-weight: 600; line-height: var(--lh-title); }
.article-content > :first-child { margin-top: 0; }
.article-content strong { font-weight: 600; color: var(--text-1); }
.article-content ul, .article-content ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.article-content li { margin: 6px 0; line-height: var(--lh-read); }
.article-content li::marker { color: var(--text-4); }
.article-content blockquote, .theme-light .article-content blockquote { margin: var(--s-6) 0; padding: 2px 0 2px var(--s-5); border-left: 1px solid var(--line-strong); font-style: normal; color: var(--text-3); }
.article-content blockquote > :last-child { margin-bottom: 0; }
.article-content code, .theme-light .article-content code { padding: 2px 6px; border-radius: var(--r-sm); background: var(--surface-2); font-family: var(--font-code); font-size: .86em; color: var(--text-1); overflow-wrap: anywhere; }
.table-wrap { margin: var(--s-6) 0; overflow-x: auto; scrollbar-width: thin; }
.article-content table { display: table; width: 100%; margin: 0; border-collapse: collapse; font-size: var(--fs-ui); line-height: var(--lh-ui); }
.article-content :not(.table-wrap) > table { display: block; overflow-x: auto; }
.article-content th, .article-content td { min-width: 7em; padding: 10px var(--s-5) 10px 0; border: 0; border-bottom: 1px solid var(--line); }
.article-content th { white-space: nowrap; }
.article-content :is(th, td):last-child { padding-right: 0; }
.article-content th { background: none; font-size: var(--fs-meta); font-weight: 600; letter-spacing: .08em; color: var(--text-4); border-bottom-color: var(--line-strong); }
.article-content :is(th, td) code { white-space: nowrap; overflow-wrap: normal; }
.article-content figcaption { margin-top: var(--s-3); font-size: var(--fs-meta); color: var(--text-4); }
.article-content hr { width: 48px; margin: var(--s-8) auto; border-top: 1px solid var(--line-strong); }
.article-content mark, .theme-light mark, mark { padding: 0 2px; border-radius: 2px; background: var(--accent-soft); color: var(--text-1); white-space: normal; }
.article-content kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-sm); font: var(--fs-micro) var(--font-code); }

/* 链接：亮字 + 弱主题色点线；悬停时实线从左向右擦出，移开时向右收走 */
.article-content a, .theme-light .article-content a {
  --base: repeating-linear-gradient(90deg, var(--accent-line) 0 1.5px, transparent 1.5px 4.5px);
  color: var(--text-1); text-decoration: none; padding-bottom: 2px;
  background-image: linear-gradient(var(--accent), var(--accent)), var(--base);
  background-repeat: no-repeat, no-repeat;
  background-position: right bottom, left bottom;
  background-size: 0 1px, 100% 1px;
  transition: background-size .45s var(--ease-out), color .3s var(--ease); }
.article-content a:hover { color: var(--text-1); background-position: left bottom, left bottom; background-size: 100% 1px, 100% 1px; }

/* 代码块：细线框、短竖线语言标、行号；和正文同宽 */
.codeblock { --cb-bg: #0b0b0c; --cb-text: #d6d6db; --cb-dim: #86868b; margin: var(--s-6) 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--cb-bg); }
.theme-light .codeblock { --cb-bg: #fafafa; --cb-text: #1d1d1f; --cb-dim: #626267; }
.codeblock__bar { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.codeblock__lang { display: inline-flex; align-items: center; gap: 9px; font: 600 var(--fs-micro)/1 var(--font-sans); letter-spacing: .14em; color: var(--cb-dim); }
.codeblock__lang::before { content: ""; width: 2px; height: 11px; border-radius: 2px; background: var(--accent); }
.codeblock__copy { height: 26px; padding: 0 8px; border-radius: 6px; font-size: var(--fs-micro); letter-spacing: .06em; color: var(--cb-dim); transition: background-color .2s, color .2s; }
.codeblock__copy:hover { background: color-mix(in srgb, var(--cb-text) 10%, transparent); color: var(--cb-text); }
.article-content .codeblock pre { margin: 0; padding: 12px 0; border: 0; border-radius: 0; background: transparent; overflow-x: auto; font-size: 13px; line-height: 1.75; letter-spacing: 0; }
.article-content .codeblock pre code, .theme-light .article-content .codeblock pre code { display: block; width: max-content; min-width: 100%; padding: 0; background: none; font-size: 1em; color: var(--cb-text); overflow-wrap: normal; counter-reset: ln; }
.codeblock .ln { display: block; padding-right: 20px; min-height: 1.75em; counter-increment: ln; }
.codeblock .ln::before { content: counter(ln); position: sticky; left: 0; display: inline-block; width: 46px; margin-right: 14px; padding-right: 10px; border-right: 1px solid var(--line); background: var(--cb-bg); text-align: right; color: var(--cb-dim); opacity: .7; user-select: none; }
.tok-k { color: var(--accent); } .tok-s { color: #d8b48f; } .tok-c { color: #83838b; } .tok-n { color: #93b4cc; } .tok-t { color: #b9b9c6; font-weight: 600; }
.theme-light .tok-s { color: #8a5320; } .theme-light .tok-c { color: #6e6e73; } .theme-light .tok-n { color: #2c5c80; } .theme-light .tok-t { color: #3a3a46; }
@media (max-width: 640px) { .article-content .codeblock pre { font-size: 11px; } .codeblock__bar { height: 32px; } .codeblock .ln::before { width: 30px; margin-right: 10px; padding-right: 7px; } }

/* TL;DR：杂志导语，不加框 */
.article-content .tldr, .tldr { margin: 0 0 var(--s-7); padding: 0 0 var(--s-5); border-bottom: 1px solid var(--line); }
.tldr__label { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .12em; color: var(--text-3); }
.tldr__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.article-content .tldr ul, .tldr ul { margin: 0; padding: 0; list-style: none; counter-reset: tldr; }
.article-content .tldr li, .tldr li { display: grid; grid-template-columns: 34px 1fr; margin: 0; padding: 5px 0; counter-increment: tldr; font-size: var(--fs-item); line-height: 1.75; color: var(--text-2); }
.tldr li::before { content: counter(tldr, decimal-leading-zero); font: var(--fs-micro)/2.2 var(--font-code); color: var(--text-4); }

.article-header__tags { margin-top: var(--s-6); padding: 0; border: 0; gap: 0 var(--s-4); }
.article-header__tags .tag-pill::before { content: "#"; color: var(--text-4); }

/* 推荐阅读：图在上、标题在下，不装框。篇数为单数时第一篇横排占满一行，双数时两两并排 */
.related-posts { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.related-posts__title { margin-bottom: var(--s-5); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .14em; color: var(--text-3); }
.related-posts__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-5); }
.related-card, .related-card:hover { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); min-height: 0; border: 0; border-radius: 0; background: none; overflow: visible; }
.related-card__img { width: 100%; height: auto; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-md); }
.related-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.related-card:hover .related-card__img img { transform: scale(1.035); }
.related-card__body { padding: 0; gap: 6px; justify-content: flex-start; }
.related-card__title { font-size: var(--fs-item); font-weight: 600; line-height: 1.6; color: var(--text-1); transition: color .3s var(--ease); }
.related-card:hover .related-card__title { color: var(--text-3); }
.related-card__desc { display: none; }
.related-card__meta { font-size: var(--fs-micro); letter-spacing: .04em; color: var(--text-4); }
.related-card:first-child:nth-last-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; gap: var(--s-5); }
/* 右侧文字与图片上下对齐：标题贴顶、日期贴底；文字多时图片随之拉高（只在电脑上，手机是上下排） */
@media (min-width: 641px) {
  .related-card:first-child:nth-last-child(odd) .related-card__img { height: 100%; min-height: 0; }
  .related-card:first-child:nth-last-child(odd) .related-card__body { display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; }
  .related-card:first-child:nth-last-child(odd) .related-card__title { margin-top: -.3em; }
  .related-card:first-child:nth-last-child(odd) .related-card__meta { margin-top: auto; padding-top: var(--s-3); line-height: 1; }
}
.related-card:first-child:nth-last-child(odd):not(:has(img)) { grid-template-columns: 1fr; }
.related-card:first-child:nth-last-child(odd) .related-card__title { font-size: var(--fs-h2); line-height: 1.5; }
.related-card:first-child:nth-last-child(odd) .related-card__desc { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-ui); line-height: 1.75; color: var(--text-3); }
@media (max-width: 640px) {
  .related-posts__grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .related-card, .related-card:hover { flex-direction: row; align-items: flex-start; gap: var(--s-4); }
  .related-card__img { order: 2; width: 76px; flex: none; aspect-ratio: 4 / 3; border-radius: 6px; }
  .related-card__body { order: 1; flex: 1; }
  .related-card__title { font-size: var(--fs-ui); }
  .related-card:first-child:nth-last-child(odd) { display: flex; flex-direction: column; gap: var(--s-3); }
  .related-card:first-child:nth-last-child(odd) .related-card__img { order: 0; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-md); }
  .related-card:first-child:nth-last-child(odd) .related-card__title { font-size: var(--fs-h3); }
}

/* 上一篇 / 下一篇：顺序翻页，只用两行字和箭头，和推荐阅读区分开 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); margin-top: var(--s-8); padding: 0; border-block: 1px solid var(--line); }
.post-nav-card, .post-nav-card:hover, .theme-light .post-nav-card:hover { height: auto; min-height: 0; border: 0; border-radius: 0; background: none; }
.post-nav-card__img, .post-nav-card__arrow { display: none; }
.post-nav-card__body, .post-nav-card--prev .post-nav-card__body { padding: var(--s-5) 0; gap: var(--s-2); justify-content: flex-start; }
.post-nav-card__label { font-size: var(--fs-micro); text-transform: none; letter-spacing: .14em; color: var(--text-4); }
.post-nav-card--prev .post-nav-card__label::before { content: "←"; display: inline-block; margin-right: 8px; transition: transform .35s var(--ease-out); }
.post-nav-card--next .post-nav-card__label::after { content: "→"; display: inline-block; margin-left: 8px; transition: transform .35s var(--ease-out); }
.post-nav-card--prev:hover .post-nav-card__label::before { transform: translateX(-4px); }
.post-nav-card--next:hover .post-nav-card__label::after { transform: translateX(4px); }
.post-nav-card__title { font-size: var(--fs-ui); font-weight: 500; line-height: 1.65; letter-spacing: .01em; color: var(--text-2); }
.post-nav-card:hover .post-nav-card__title { color: var(--text-1); }
.post-nav-card__empty-text { font-size: var(--fs-meta); color: var(--text-4); }
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; gap: 0; }
  .post-nav-card + .post-nav-card { border-top: 1px solid var(--line); }
  .post-nav-card--next { text-align: left; }
  .post-nav-card--next .post-nav-card__body { align-items: flex-start; }
  .post-nav-card__body, .post-nav-card--prev .post-nav-card__body { padding: var(--s-4) 0; }
}
/* ── 评论：和正文同一套线与字；名字、链接都是中性色，红只留给“已赞” ── */
.comment-section, .theme-light .comment-section { margin-top: var(--s-8); padding-top: 0; border-top: 0; }
.comment-section__title { margin-bottom: var(--s-4); font-size: var(--fs-meta); font-weight: 600; letter-spacing: .14em; color: var(--text-3); }
html #waline [data-waline] { --waline-theme-color: var(--text-1); --waline-active-color: var(--text-1); --waline-badge-color: var(--text-3); --waline-color: var(--text-2); --waline-bg-color: var(--bg); --waline-bg-color-light: var(--surface); --waline-bg-color-hover: var(--surface-2); --waline-border-color: var(--line); --waline-info-color: var(--text-4); font-size: var(--fs-ui); }

/* 输入区：一张细线卡片，三栏信息用竖线隔开 */
html #waline .wl-comment { flex-direction: column; align-items: stretch; }
html #waline .wl-panel { margin: 0 0 var(--s-6); padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .25s var(--ease); }
html #waline .wl-panel:focus-within { border-color: var(--line-strong); }
html #waline .wl-header { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
html #waline .wl-header-item { display: block; }
html #waline .wl-header-item + .wl-header-item { border-inline-start: 1px solid var(--line); }
html #waline .wl-header input { height: 44px; padding: 0 16px; border: 0; font-size: var(--fs-ui); color: var(--text-1); }
html #waline .wl-editor { min-height: 128px; padding: 14px 16px; font-size: var(--fs-item); line-height: 1.75; color: var(--text-1); }
html #waline :is(.wl-header input, .wl-editor)::placeholder { color: var(--text-4); }
html #waline .wl-footer { margin: 0; padding: 4px 10px 10px 8px; align-items: center; }
html #waline .wl-actions { gap: 2px; }
html #waline .wl-actions .wl-action { display: grid; place-items: center; width: 32px; height: 32px; margin: 0; border-radius: 8px; color: var(--text-4); transition: background-color .2s, color .2s; }
html #waline .wl-actions .wl-action:hover, html #waline .wl-actions .wl-action.active { background: var(--surface-2); color: var(--text-1); }
html #waline .wl-actions .wl-action svg { width: 18px; height: 18px; }
html #waline .wl-info { gap: 4px; align-items: center; }
html #waline .wl-info .wl-btn { height: 32px; min-height: 32px; margin: 0; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: none; font-size: var(--fs-meta); font-weight: 500; letter-spacing: .04em; color: var(--text-3); transition: background-color .2s, color .2s; }
html #waline .wl-info .wl-btn:hover { background: var(--surface-2); color: var(--text-1); }
html #waline .wl-info .wl-btn.primary, html #waline .wl-info .wl-btn.primary:hover { padding: 0 18px; background: var(--text-1); color: var(--bg); }
html #waline .wl-info .wl-btn.primary:hover { background: var(--text-2); }
/* 预览 */
html #waline .wl-preview { padding: 12px 16px 4px; border-top: 1px dashed var(--line); }
html #waline .wl-preview hr { display: none; }
html #waline .wl-preview h4 { margin: 0 0 6px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .12em; color: var(--text-4); }
html #waline .wl-preview .wl-content { font-size: var(--fs-item); line-height: 1.8; color: var(--text-2); }
/* 表情、动图弹层 */
html #waline :is(.wl-emoji-popup, .wl-gif-popup) { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); box-shadow: 0 24px 48px -20px rgba(0,0,0,.6); }
html #waline .wl-emoji-popup .wl-tabs { border-top: 1px solid var(--line); }
html #waline .wl-emoji-popup .wl-tab.active { background: var(--surface); }
html #waline .wl-emoji-popup button { border-radius: 6px; }
html #waline .wl-emoji-popup button:hover { background: var(--surface); }
/* 已登录：头像、名字，后面是“退出”（博主多一个“管理后台”）；Waline 自带的头像角上的退出按钮隐藏，由模板脚本代为点击 */
html #waline .wl-login-info { display: flex; flex-direction: row; align-items: center; gap: 10px; max-width: none; margin: 0 0 12px; }
html #waline .wl-login-info .wl-avatar { position: relative; width: 28px; height: 28px; margin: 0; border: 0; }
html #waline .wl-login-info .wl-avatar img { width: 28px; height: 28px; border-radius: 50%; }
html #waline .wl-login-info .wl-logout-btn { display: none; }
html #waline .wl-login-info > .wl-login-nick { margin: 0; font-size: var(--fs-ui); font-weight: 600; color: var(--text-1); }
html #waline .wl-login-actions { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 2px; }
html #waline .wl-login-actions :is(a, button) { padding: 2px 6px; border-radius: 6px; font-size: var(--fs-micro); color: var(--text-4); transition: background-color .2s, color .2s; }
html #waline .wl-login-actions :is(a, button):hover { background: var(--surface-2); color: var(--text-1); }
html #waline .wl-login-actions :is(a, button) + :is(a, button)::before { content: ""; }

/* 标题行：评论数 + 订阅；排序只变亮，不上色 */
html #waline .wl-meta-head { padding: 0 0 var(--s-2); border-bottom: 1px solid var(--line); }
html #waline .wl-count { font-size: var(--fs-ui); font-weight: 600; color: var(--text-1); }
html #waline .wl-sort li { font-size: var(--fs-meta); color: var(--text-4); }
html #waline .wl-sort li.active, html #waline .wl-sort li:hover { color: var(--text-1); }

/* 列表：实线分隔，回复挂在一条竖线下 */
html #waline .wl-card-item { padding: var(--s-5) 0 0; }
html #waline .wl-cards .wl-user { --avatar-size: 36px; margin-inline-end: 14px; }
html #waline .wl-user-avatar { border: 1px solid var(--line); }
html #waline .wl-user .verified-icon { color: var(--text-3); background: var(--bg); }
html #waline .wl-card { padding: 0 0 var(--s-5); border-bottom: 1px solid var(--line); }
html #waline .wl-quote .wl-card { padding-bottom: var(--s-4); border-bottom: 0; }
html #waline .wl-card-item:last-child > .wl-card { border-bottom: 0; }
html #waline .wl-head .wl-nick { font-size: var(--fs-ui); font-weight: 600; color: var(--text-1); }
html #waline .wl-head a.wl-nick:hover { color: var(--text-3); }
html #waline .wl-head .wl-badge { margin-inline-end: 8px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 10px; line-height: 16px; letter-spacing: .08em; color: var(--text-3); }
html #waline .wl-head .wl-time { font-size: var(--fs-micro); color: var(--text-4); }
/* 浏览器、系统并进时间那一行之下，很淡 */
html #waline .wl-card .wl-meta { margin-top: 2px; }
html #waline .wl-meta > span { margin-inline-end: 6px; font-size: 11px; color: var(--text-4); opacity: .7; }
html #waline .wl-card .wl-content { margin: 6px 0 0; padding: 0; font-size: var(--fs-item); line-height: 1.8; color: var(--text-2); }
html #waline .wl-content a { color: var(--text-1); text-decoration: none; padding-bottom: 2px;
  background-image: linear-gradient(var(--accent), var(--accent)), repeating-linear-gradient(90deg, var(--accent-line) 0 1.5px, transparent 1.5px 4.5px);
  background-repeat: no-repeat, no-repeat; background-position: right bottom, left bottom; background-size: 0 1px, 100% 1px;
  transition: background-size .45s var(--ease-out); }
html #waline .wl-content a:hover { color: var(--text-1); background-position: left bottom, left bottom; background-size: 100% 1px, 100% 1px; }
html #waline .wl-content .wl-reply-to a, html #waline .wl-content .wl-reply-to a:hover { background: none; color: var(--text-3); }
html #waline .wl-card .wl-quote { margin-top: 4px; padding-inline-start: var(--s-5); border-inline-start: 1px solid var(--line); }
/* 点赞、回复：名字那一行靠右；已赞是唯一的红 */
html #waline .wl-comment-actions button { color: var(--text-4); }
html #waline .wl-comment-actions button:hover, html #waline .wl-comment-actions .wl-reply.active { color: var(--text-1); }
html #waline .wl-comment-actions .wl-like:hover, html #waline .wl-comment-actions .wl-like[title="取消喜欢"] { color: var(--accent); }
/* 博主：编辑、删除、审核状态都收进点赞前的“···”菜单，避免误触；Waline 原来的按钮隐藏，由菜单代为点击 */
html #waline .wl-comment-actions :is(.wl-edit, .wl-delete) { display: none; }
html #waline .wl-admin-actions { display: none; }
html #waline .wl-comment-actions { position: relative; }
/* Waline 给评论头部设了 overflow: hidden 来包住右浮的按钮，会裁掉下拉菜单；改用 flow-root 包浮动 */
html #waline .wl-card .wl-head { display: flow-root; overflow: visible; }
html #waline .wl-more { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0; color: var(--text-4); }
html #waline .wl-more svg { width: 15px; height: 15px; }
html #waline .wl-more:hover, html #waline .wl-more[aria-expanded="true"] { color: var(--text-1); }
/* ···菜单：细线卡片；上面两行操作（线条图标 + 文字），下面一条审核状态分段，当前状态浅底 */
html #waline .wl-more-menu { position: absolute; top: calc(100% + 8px); right: -6px; z-index: 20; width: 196px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface-2) 94%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 20px 44px -20px rgba(0,0,0,.7); opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transform-origin: top right; transition: opacity .16s var(--ease), transform .24s var(--ease-out), visibility 0s .24s; }
html.theme-light #waline .wl-more-menu { box-shadow: 0 20px 44px -22px rgba(0,0,0,.25); }
html #waline .wl-more-menu.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .16s var(--ease), transform .24s var(--ease-out), visibility 0s; }
html #waline .wl-comment-actions .wl-more-menu .wl-more-item { box-sizing: border-box; display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 34px; margin: 0; padding: 0 10px; border-radius: 6px; font-size: var(--fs-meta); line-height: 1; color: var(--text-2); }
html #waline .wl-comment-actions .wl-more-menu .wl-more-item svg { display: block; width: 15px; height: 15px; color: var(--text-4); transition: color .2s; }
html #waline .wl-comment-actions .wl-more-menu .wl-more-item:hover { background: color-mix(in srgb, var(--text-1) 7%, transparent); color: var(--text-1); }
html #waline .wl-comment-actions .wl-more-menu .wl-more-item:hover svg { color: var(--text-1); }
html #waline .wl-comment-actions .wl-more-menu .wl-more-item--danger:hover, html #waline .wl-comment-actions .wl-more-menu .wl-more-item--danger:hover svg { color: var(--accent); }
html #waline .wl-more-menu .wl-more-label { margin: 6px 0 0; padding: 8px 10px 6px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .12em; color: var(--text-4); }
html #waline .wl-more-menu .wl-more-seg { display: flex; gap: 2px; margin: 0 4px 4px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); }
html #waline .wl-comment-actions .wl-more-menu .wl-more-seg button { box-sizing: border-box; flex: 1; justify-content: center; min-height: 26px; margin: 0; padding: 0 6px; border-radius: var(--r-pill); font-size: var(--fs-micro); line-height: 1; color: var(--text-3); white-space: nowrap; transition: background-color .2s, color .2s; }
html #waline .wl-comment-actions .wl-more-menu .wl-more-seg button:hover { color: var(--text-1); }
html #waline .wl-comment-actions .wl-more-menu .wl-more-seg button[aria-checked="true"] { background: color-mix(in srgb, var(--text-1) 12%, transparent); color: var(--text-1); font-weight: 600; cursor: default; }
/* 回复框跟进楼里时，上下留出呼吸 */
html #waline .wl-reply-wrapper { margin: var(--s-4) 0 var(--s-2); }
html #waline .wl-reply-wrapper .wl-panel { margin-bottom: 0; }
/* 空、加载、加载更多、底部署名 */
html #waline .wl-empty { padding: var(--s-7) 0 var(--s-5); font-size: var(--fs-ui); color: var(--text-4); }
html #waline .wl-operation { margin: var(--s-5) 0 0; }
html #waline .wl-operation button { height: 32px; min-height: 32px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: none; font-size: var(--fs-meta); font-weight: 500; letter-spacing: .04em; color: var(--text-1); }
html #waline .wl-operation button:hover { background: var(--surface-2); }
html #waline .wl-loading svg { color: var(--text-4); }
html #waline .wl-power { padding: var(--s-5) 0 0; font-size: 11px; color: var(--text-4); opacity: .7; }
html #waline .wl-power a { color: var(--accent); }
@media (max-width: 580px) {
  html #waline .wl-header { grid-template-columns: 1fr; }
  html #waline .wl-header-item + .wl-header-item { border-inline-start: 0; border-top: 1px solid var(--line); }
  html #waline .wl-header input { height: 42px; }
  html #waline .wl-info .wl-btn { height: 28px; min-height: 28px; padding: 0 10px; font-size: var(--fs-micro); }
  html #waline .wl-info .wl-btn.primary, html #waline .wl-info .wl-btn.primary:hover { padding: 0 14px; }
  html #waline .wl-actions .wl-action { width: 28px; height: 28px; }
  html #waline .wl-actions .wl-action svg { width: 16px; height: 16px; }
  html #waline .wl-card-item > .wl-user { --avatar-size: 30px; top: calc(var(--s-5) + 2px); }
  html #waline .wl-card > .wl-head, html #waline .wl-card > .wl-meta { padding-inline-start: 40px; }
  html #waline .wl-card .wl-quote { padding-inline-start: var(--s-4); }
}

/* ── 11. 归档 / 闪念 / 友链 / 分类 ─────────────────────────── */
.archive-year { display: flex; align-items: baseline; gap: var(--s-3); margin: var(--s-7) 0 var(--s-5); padding: 0; border: 0; font-size: var(--fs-title); font-weight: 200; letter-spacing: .06em; color: var(--text-1); }
.archive-year small { font-size: var(--fs-meta); font-weight: 400; letter-spacing: 0; color: var(--text-4); }
.tl-month { display: grid; grid-template-columns: 72px minmax(0, 1fr); }
.tl-month__label { position: sticky; top: 76px; align-self: start; font-size: var(--fs-ui); font-weight: 600; line-height: 38px; color: var(--text-2); }
.tl-month__label small { display: block; font-size: var(--fs-micro); font-weight: 400; line-height: 1.4; color: var(--text-4); }
.tl-items { position: relative; padding: 0 0 var(--s-5); border-left: 1px solid var(--line); }
.tl-items .archive-item { position: relative; gap: var(--s-4); padding: 9px 0 9px var(--s-5); border: 0; }
.tl-items .archive-item::before { content: ""; position: absolute; left: -4px; top: calc(9px + .75em); width: 7px; height: 7px; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); transition: border-color .25s, background-color .25s; }
.tl-items .archive-item:hover::before { border-color: var(--accent); background: var(--accent); }
.archive-item__date { width: 20px; flex: none; font-size: var(--fs-meta); color: var(--text-4); line-height: var(--lh-ui); }
.archive-item__title { font-size: var(--fs-item); line-height: var(--lh-ui); color: var(--text-2); transition: color .25s, transform .35s var(--ease-out); }
.archive-item:hover .archive-item__title { color: var(--text-1); transform: translateX(3px); }
.archive-item .archive-item__badge { align-self: center; }
@media (max-width: 640px) { .tl-month { grid-template-columns: 46px minmax(0, 1fr); } .tl-items .archive-item { gap: var(--s-3); padding-left: var(--s-4); } }

.tag-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--s-7); border-top: 1px solid var(--line); }
.tag-top a { display: block; padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: 1px solid var(--line); transition: border-color .3s; }
.tag-top a:hover { border-bottom-color: var(--accent); }
.tag-top b { display: block; font-size: var(--fs-title); font-weight: 200; line-height: 1.25; color: var(--text-1); font-variant-numeric: tabular-nums; }
.tag-top span { font-size: var(--fs-ui); color: var(--text-3); }
.tag-index__label { margin-bottom: var(--s-3); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .14em; color: var(--text-4); }
.tag-index { columns: 3; column-gap: var(--s-6); }
.tag-index a { display: flex; align-items: baseline; gap: 8px; break-inside: avoid; font-size: var(--fs-ui); line-height: 32px; color: var(--text-2); }
.tag-index a::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--line-strong); transform: translateY(-3px); }
.tag-index a i { order: 2; font-style: normal; font-size: var(--fs-micro); color: var(--text-4); font-variant-numeric: tabular-nums; }
.tag-index a:hover { color: var(--text-1); }
.tag-index a:hover::after { border-bottom-color: var(--accent); }
@media (max-width: 640px) { .tag-index { columns: 2; column-gap: var(--s-5); } .tag-top span { font-size: var(--fs-micro); } }

/* 闪念：电脑端用热力图（换成朱砂色阶），手机端换成每月条数 */
:root:root { --heatmap-color: var(--accent); }
.heatmap-wrap { margin: 0 0 var(--s-7); padding: var(--s-5) var(--s-5) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); scrollbar-width: none; }
.heatmap-wrap table { border-spacing: 3px; }
.heatmap-wrap td.cell { height: 12px; border-radius: 2px; }
.heatmap-wrap td.cell:hover { outline-color: var(--text-1); }
.heatmap-wrap td.cell[data-level="0"], .heatmap-legend-cell[data-level="0"] { background: color-mix(in srgb, var(--text-1) 7%, var(--bg)); }
.heatmap-wrap td.cell[data-level="1"], .heatmap-legend-cell[data-level="1"] { background: color-mix(in srgb, var(--heatmap-color) 30%, var(--bg)); }
.heatmap-wrap td.cell[data-level="2"], .heatmap-legend-cell[data-level="2"] { background: color-mix(in srgb, var(--heatmap-color) 52%, var(--bg)); }
.heatmap-wrap td.cell[data-level="3"], .heatmap-legend-cell[data-level="3"] { background: color-mix(in srgb, var(--heatmap-color) 76%, var(--bg)); }
.heatmap-month-label { padding-bottom: 6px; font-size: var(--fs-micro); color: var(--text-4); }
.heatmap-day-label { font-size: 10px; color: var(--text-4); }
.heatmap-footer { padding-left: 34px; font-size: var(--fs-micro); color: var(--text-4); }
.memo-mobile { display: none !important; }
@media (max-width: 640px) {
  .heatmap-wrap { display: none; }
  .memo-rhythm.memo-mobile, .memo-months.memo-mobile { display: grid !important; }
}
.memo-rhythm { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 6px; height: 72px; margin-bottom: var(--s-2); }
.memo-rhythm i { position: relative; display: block; min-height: 2px; border-radius: 2px; background: var(--line-strong); }
.memo-rhythm i[data-n]:not([data-n="0"]) { background: color-mix(in srgb, var(--accent) 70%, transparent); }
.memo-rhythm i:not([data-n="0"])::after { content: attr(data-n); position: absolute; left: 0; right: 0; bottom: calc(100% + 3px); text-align: center; font-style: normal; font-size: 10px; color: var(--text-4); }
.memo-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-bottom: var(--s-7); padding-top: 6px; border-top: 1px solid var(--line); text-align: center; font-size: 10px; color: var(--text-4); }
.memo-day { display: grid; grid-template-columns: 88px minmax(0, 1fr); padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.memo-day__date { position: sticky; top: 80px; align-self: start; }
.memo-day__date b { display: block; font-size: var(--fs-display); font-weight: 200; line-height: 1; color: var(--text-1); font-variant-numeric: tabular-nums; }
.memo-day__date span { display: block; margin-top: 6px; font-size: var(--fs-micro); color: var(--text-4); white-space: nowrap; }
.memo-day__notes .memo-item { padding: 0; border: 0; }
.memo-day__notes .memo-item + .memo-item { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px dashed var(--line); }
.memo-item__content, .memo-item__content.article-content { font-size: var(--fs-item); line-height: var(--lh-read); }
.memo-item__content > :last-child { margin-bottom: 0; }
.memo-item__date { display: none; }
@media (max-width: 640px) { .memo-day { grid-template-columns: 60px minmax(0, 1fr); padding: var(--s-5) 0; } .memo-rhythm, .memo-months { gap: 3px; } }

.links-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 var(--s-7); }
.link-card, .link-card:hover, .theme-light .link-card:hover { gap: 6px; padding: var(--s-5) 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.link-card__avatar-wrap, .link-card__avatar-text { width: 40px; height: 40px; }
.link-card__avatar-text { border-radius: 50%; background: var(--surface-2); font-size: var(--fs-item); }
.link-card__top { gap: var(--s-3); }
.link-card__name { font-size: var(--fs-item); font-weight: 600; }
.link-card__desc { padding-left: 52px; font-size: var(--fs-meta); color: var(--text-3); }
.link-card__arrow, .link-card:hover .link-card__arrow, .theme-light .link-card:hover .link-card__arrow { width: 16px; height: 16px; background: none; color: var(--text-4); transition: transform .3s var(--ease-out), color .3s; }
.link-card:hover .link-card__arrow { color: var(--text-1); transform: translate(2px, -2px); }
@media (max-width: 640px) { .links-grid { grid-template-columns: 1fr; } }

/* 分类：目录式索引。每类一行：编号、名称、说明、最近三篇，右侧是篇数；配图在左 */
.cat-index { border-top: 1px solid var(--line); }
.cat-row { display: grid; grid-template-columns: 216px minmax(0, 1fr) 88px; gap: var(--s-6); align-items: start; padding: var(--s-6) 0; border-bottom: 1px solid var(--line); color: inherit; }
.cat-row__media { aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--r-md); background: var(--surface-2); }
.cat-row__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.cat-row:hover .cat-row__media img { transform: scale(1.04); }
.cat-row__fallback { display: grid; place-items: center; height: 100%; font-size: var(--fs-display); font-weight: 200; color: var(--text-4); }
.cat-row__no { display: block; margin-bottom: 6px; font: var(--fs-micro)/1.4 var(--font-code); letter-spacing: .08em; color: var(--text-4); }
.cat-row__no em { display: none; font: inherit; }
.cat-row__name { font-size: var(--fs-h2); font-weight: 600; line-height: 1.4; color: var(--text-1); transition: transform .45s var(--ease-out); }
.cat-row:hover .cat-row__name { transform: translateX(4px); }
.cat-row__desc { max-width: 40em; text-wrap: pretty; margin-top: var(--s-2); font-size: var(--fs-ui); line-height: 1.75; color: var(--text-3); }
.cat-row__latest { margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.cat-row__latest li { position: relative; padding-left: 18px; font-size: var(--fs-meta); line-height: 1.9; color: var(--text-4); text-wrap: pretty; }
.cat-row__latest li::before { content: ""; position: absolute; left: 0; top: .95em; width: 8px; height: 1px; background: var(--line-strong); }
.cat-row__count { text-align: right; }
.cat-row__count b { display: block; font-size: var(--fs-display); font-weight: 200; line-height: 1; color: var(--text-1); font-variant-numeric: tabular-nums; }
.cat-row__count span { font-size: var(--fs-micro); color: var(--text-4); }
@media (max-width: 640px) {
  .cat-row { grid-template-columns: minmax(0, 1fr) 84px; gap: var(--s-4); padding: var(--s-5) 0; }
  .cat-row__media { order: 2; aspect-ratio: 1; }
  .cat-row__body { order: 1; }
  .cat-row__count { display: none; }
  .cat-row__no em { display: inline; }
  .cat-row__latest { margin-top: var(--s-3); }
}
.cat-hero__title { font-size: var(--fs-display); font-weight: 600; line-height: 1.38; letter-spacing: .02em; }
.cat-hero__eyebrow { font-size: var(--fs-meta); letter-spacing: .14em; color: rgba(255,255,255,.7); }
.cat-hero__eyebrow::before { background: currentColor; }
.cat-hero__desc { max-width: 36em; font-size: var(--fs-ui); color: rgba(255,255,255,.82); }
.cat-hero__count, .cat-hero__back { font-size: var(--fs-meta); }

/* ── 书影：统计、最近看过、电影/剧集/书架三个标签页 ─────────── */
.shelf-stats { display: flex; flex-wrap: wrap; gap: var(--s-7); margin: 0 0 var(--s-7); }
.shelf-stats b { display: block; font-size: var(--fs-title); font-weight: 300; line-height: 1.3; color: var(--text-1); font-variant-numeric: tabular-nums; }
.shelf-stats span { font-size: var(--fs-micro); letter-spacing: .14em; color: var(--text-4); }
.shelf-tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--line); margin-bottom: var(--s-5); }
.shelf-tabs button { position: relative; padding: 0 0 var(--s-3); font-size: var(--fs-ui); color: var(--text-3); transition: color .25s var(--ease); }
.shelf-tabs button:hover { color: var(--text-1); }
.shelf-tabs button[aria-selected="true"] { color: var(--text-1); font-weight: 600; }
.shelf-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.shelf-page [data-panel] > .shelf-years { margin: 0 0 var(--s-5); }

/* 最近看过：本页唯一的点睛位置 */
.shelf-feature { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: var(--s-6); align-items: center; margin-bottom: var(--s-8); color: inherit; }
.shelf-feature .shelf-cover { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
a.shelf-feature:hover .shelf-cover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--line-strong), 0 26px 36px -20px rgba(0,0,0,.9); }
.shelf-feature__label { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); font-size: var(--fs-micro); font-weight: 600; letter-spacing: .16em; color: var(--text-1); }
.shelf-feature__label::before { content: ""; width: 16px; height: 1px; background: var(--accent); }
.shelf-feature__title { font-size: var(--fs-h2); font-weight: 600; line-height: 1.5; color: var(--text-1); }
.shelf-feature__meta { margin-top: var(--s-2); font-size: var(--fs-meta); line-height: 1.7; color: var(--text-4); }

/* 电影、剧集：海报网格 */
.shelf-cover { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), 0 14px 28px -18px rgba(0,0,0,.8); }
.theme-light .shelf-cover { box-shadow: 0 0 0 1px var(--line), 0 14px 24px -18px rgba(0,0,0,.45); }
.poster-year[hidden], .poster[hidden] { display: none; }
.poster-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-6) var(--s-4); }
.poster { display: block; min-width: 0; color: inherit; }
.poster .shelf-cover { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
a.poster:hover .shelf-cover { transform: translateY(-5px); box-shadow: 0 0 0 1px var(--line-strong), 0 26px 36px -20px rgba(0,0,0,.9); }
.poster__title { display: block; margin-top: var(--s-3); font-size: var(--fs-meta); font-weight: 600; line-height: 1.55; color: var(--text-1); text-wrap: pretty; }
.poster__meta { display: flex; gap: var(--s-2); align-items: center; margin-top: 2px; font-size: var(--fs-micro); color: var(--text-4); font-variant-numeric: tabular-nums; }
.shelf-more { display: flex; justify-content: center; margin-top: var(--s-7); }
.stars { letter-spacing: 1px; color: var(--text-3); }
.stars i { font-style: normal; color: var(--line-strong); }
@media (max-width: 900px) { .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .shelf-stats { gap: var(--s-5); }
  .shelf-feature { grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); margin-bottom: var(--s-7); }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5) var(--s-3); }
}

/* 书架：书脊立在木搁板上，点一下转出封面（参照 ursb.me 的效果） */
.shelf-tier + .shelf-tier { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.shelf-tier__name { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: var(--fs-ui); font-weight: 600; line-height: 1.6; letter-spacing: .12em; color: var(--text-1); }
.shelf-tier__name span { font-size: var(--fs-micro); font-weight: 400; letter-spacing: 0; color: var(--text-4); font-variant-numeric: tabular-nums; }
.shelf-tier .shelf { margin-top: var(--s-2); }
.shelf-empty { align-self: center; margin: 0 auto; font-size: var(--fs-meta); color: var(--text-4); }
.shelf-card { padding: var(--s-5); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.shelf-years { display: flex; gap: var(--s-5); margin-top: 0; overflow-x: auto; scrollbar-width: none; font-variant-numeric: tabular-nums; }
.shelf-years button { flex: none; padding: 4px 0 6px; font-size: var(--fs-meta); color: var(--text-4); }
.shelf-years button { transition: color .25s var(--ease); }
.shelf-years button:hover { color: var(--text-2); }
/* 标签页下已有一道主题色线，年份只换亮度，不再加线 */
.shelf-years button[aria-pressed="true"] { color: var(--text-1); }
.shelf { --h: 244px; position: relative; margin-top: var(--s-5); }
.shelf::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: 0; height: 14px; border-radius: 3px; background: linear-gradient(#74513a, #4a3224 30%, #2a1b12); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 16px 22px -12px rgba(0,0,0,.85); }
.theme-light .shelf::after { background: linear-gradient(#d9bd98, #c2a079 30%, #a8855f); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 14px 18px -12px rgba(0,0,0,.35); }
.shelf__track { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 3px; height: calc(var(--h) + 30px); padding: 0 10px 13px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.shelf__track[hidden] { display: none; }
.bk { --narrow: 1; position: relative; flex: none; width: calc(var(--sw) * var(--narrow)); height: calc(var(--h) * var(--k)); padding: 0; perspective: 900px; transition: width .6s var(--ease-out), margin .6s var(--ease-out), transform .35s var(--ease-out); }
.bk:not(.on):hover { transform: translateY(-9px); }
.bk.on { width: calc(var(--h) * var(--k) * var(--ar)); margin: 0 7px; }
.bk__spine, .bk__cover { position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; border-radius: 2px 3px 3px 2px; transform-origin: left center; backface-visibility: hidden; transition: transform .6s var(--ease-out), opacity .4s var(--ease); }
.bk__spine { width: calc(var(--sw) * var(--narrow)); display: flex; flex-direction: column; align-items: center; justify-content: space-between; background: var(--sp); color: var(--ink); box-shadow: inset 2px 0 0 rgba(255,255,255,.2), inset -4px 0 7px rgba(0,0,0,.32); }
.bk__spine b { flex: 1; min-height: 0; overflow: hidden; padding: 9px 0; writing-mode: vertical-rl; font-size: 13px; font-weight: 600; line-height: calc(var(--sw) * var(--narrow)); letter-spacing: .12em; white-space: nowrap; }
.bk--long .bk__spine b { font-size: 11px; letter-spacing: .02em; }
.bk__spine em { flex: none; padding: 6px 0 7px; font-style: normal; font-size: 9px; opacity: .7; font-variant-numeric: tabular-nums; writing-mode: vertical-rl; }
.bk__cover { width: calc(var(--h) * var(--k) * var(--ar)); background: var(--sp); transform: rotateY(84deg); opacity: 0; box-shadow: 8px 8px 18px -10px rgba(0,0,0,.8); }
.bk__cover img { width: 100%; height: 100%; object-fit: cover; }
.bk.on .bk__cover { transform: none; opacity: 1; }
.bk.on .bk__spine { transform: rotateY(-84deg); opacity: 0; }
/* 碟盒：顶部一条深色扣边 */
.bk--disc .bk__spine, .bk--disc .bk__cover { border-top: 14px solid #15161a; border-radius: 4px; }
.theme-light .bk--disc .bk__spine, .theme-light .bk--disc .bk__cover { border-top-color: #2b2d33; }
.bk--disc .bk__spine::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 1px; background: rgba(255,255,255,.35); }
/* 书：上下两道书签线 */
.bk--book .bk__spine::before, .bk--book .bk__spine::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor; opacity: .35; }
.bk--book .bk__spine::before { top: 8px; } .bk--book .bk__spine::after { bottom: 30px; }
.shelf-cap { margin-top: var(--s-4); text-align: center; }
.shelf-cap strong { margin-right: var(--s-2); font-size: var(--fs-item); color: var(--text-1); }
.shelf-cap p { margin-top: 2px; font-size: var(--fs-meta); color: var(--text-4); }
.shelf-cap a { color: var(--text-3); }
.shelf-foot { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-meta); color: var(--text-4); }
@media (max-width: 640px) { .shelf-card { padding: var(--s-4); } .shelf { --h: 176px; } .bk { --narrow: .86; } .bk__spine b { font-size: 11px; } }

/* ── 12. 搜索：居中浮层，背景虚化；结果行高亮带一条朱砂竖线 ───── */
.search-overlay, .theme-light .search-overlay { padding: 14vh var(--gutter) 0; background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); animation: search-fade .28s var(--ease) both; }
.search-modal { width: 640px; max-height: min(72vh, 620px); border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 32px 80px -24px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.02) inset; animation: search-in .42s var(--ease-out) both; }
.theme-light .search-modal { box-shadow: 0 32px 80px -28px rgba(0,0,0,.28); }
@keyframes search-fade { from { opacity: 0; } }
@keyframes search-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.search-header, .search-foot { flex: none; }
.search-header { height: 60px; padding: 0 16px 0 20px; gap: 12px; border-bottom: 1px solid var(--line); }
.search-icon { width: 18px; height: 18px; color: var(--text-4); }
.search-input, .theme-light .search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-body); color: var(--text-1); caret-color: var(--accent); }
.search-input::placeholder { color: var(--text-4); }
.search-kbd { padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 5px; font: var(--fs-micro)/1.4 var(--font-sans); letter-spacing: .04em; color: var(--text-4); cursor: pointer; }
.search-close { display: none; }
.search-results { flex: 1; min-height: 0; padding: 6px 8px 10px; scrollbar-width: thin; }
.search-group { padding: 10px 12px 6px; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .12em; color: var(--text-4); }
.search-result-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-4); padding: 10px 12px; border: 0; border-radius: 10px; transition: background-color .18s var(--ease); }
.search-result-item:hover, .search-result-item.is-active { background: color-mix(in srgb, var(--text-1) 6%, transparent); }
.search-result-item.is-active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--accent); }
.search-result-item__title { grid-column: 1; margin: 0; font-size: var(--fs-item); font-weight: 500; line-height: 1.55; color: var(--text-1); }
.search-result-item__excerpt { grid-column: 1; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-meta); line-height: 1.7; color: var(--text-3); }
.search-result-item__meta { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: var(--fs-micro); color: var(--text-4); }
.search-result-item__tags { display: contents; }
.search-result-item__tag, .theme-light .search-result-item__tag { padding: 0 5px; border-radius: 3px; background: color-mix(in srgb, var(--text-1) 8%, transparent); font-size: 11px; line-height: 18px; color: var(--text-3); }
.search-result-item__tag--hit, .theme-light .search-result-item__tag--hit { padding: 0 5px; background: var(--accent-soft); color: var(--accent); }
.search-result-item__date, .theme-light .search-result-item__date { order: -1; margin: 0 4px 0 0; font-size: var(--fs-micro); color: var(--text-4); font-variant-numeric: tabular-nums; }
.search-results mark, .theme-light .search-results mark { padding: 0; background: none; color: var(--accent); }
.search-arrow { grid-column: 2; grid-row: 1 / span 3; align-self: center; float: none; margin: 0; font-size: var(--fs-meta); color: var(--text-4); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .3s var(--ease-out); }
.search-result-item:hover .search-arrow, .search-result-item.is-active .search-arrow { opacity: 1; transform: none; }
.search-empty { padding: 40px 12px; text-align: center; font-size: var(--fs-ui); color: var(--text-3); }
.search-foot { display: flex; gap: var(--s-5); padding: 10px 20px; border-top: 1px solid var(--line); font-size: var(--fs-micro); color: var(--text-4); }
.search-foot kbd { margin-right: 6px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; font: inherit; }
@media (max-width: 640px) {
  /* 手机：浮层从页头下方开始，输入框落在拇指够得着、又不被键盘挡住的位置 */
  .search-overlay, .theme-light .search-overlay { padding: 72px 12px 12px; }
  .search-modal { width: 100%; max-width: none; max-height: calc(100dvh - 84px); border-radius: var(--r-lg); }
  .search-header { height: 52px; padding: 0 6px 0 16px; }
  .search-input { font-size: 16px; }   /* 手机上小于 16 会触发系统自动放大 */
  .search-kbd, .search-foot, .search-arrow { display: none; }
  .search-close { display: grid; place-items: center; width: 40px; height: 40px; color: var(--text-3); }
  .search-close svg { width: 18px; height: 18px; }
  .search-results { padding: 4px 6px 12px; }
}
.empty-state__text { font-size: var(--fs-ui); color: var(--text-3); }
.empty-state__hint { margin-top: var(--s-2); color: var(--text-4); }

/* ── 13. 404 与页脚 ────────────────────────────────────────── */
.error-page__code { font-size: 56px; font-weight: 200; letter-spacing: .06em; }
.error-page__code::after { width: 28px; height: 2px; background: var(--accent); }
.error-page__title { font-size: var(--fs-h2); letter-spacing: .04em; }
.error-page__desc { margin-top: var(--s-3); font-size: var(--fs-ui); color: var(--text-3); }
.site-footer { margin-top: var(--s-9); padding: var(--s-7) 0; }
.footer-nav { gap: var(--s-1) var(--s-5); margin-bottom: var(--s-4); }
.footer-nav__link { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--fs-meta); color: var(--text-3); }
.footer-social { gap: var(--s-2); margin-bottom: var(--s-3); }
.footer-social__link { display: grid; place-items: center; width: 36px; height: 36px; color: var(--text-3); }
.footer-social__link svg { width: 17px; height: 17px; }
.footer-copyright, .footer-powered, .theme-light .footer-powered { font-size: var(--fs-micro); letter-spacing: .04em; color: var(--text-4); }
.footer-powered a { color: var(--text-3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; } }

/* ── 主题落地补充 ──────────────────────────────────────────── */
/* 分类目录：模板输出该分类下全部标题，只显示最近三篇 */
.cat-row__latest li:nth-child(n+4) { display: none; }
.cat-row__latest:empty { display: none; }
