/* ==========================================================================
   Folio · 纸张档案
   纸张档案风 / 深色纯黑极简
   ========================================================================== */

/* ---------- 字体（与 ComBox 一致） ---------- */
@font-face {
  font-family: "Ali PuHuiTi";
  src: url("../fonts/AliPuHuiTi_Regular.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Ioskeley Mono";
  src: url("../fonts/IoskeleyMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计令牌 ---------- */
:root {
  --paper: #faf8f8;
  --paper-2: #ffffff;
  --ink: #0c0a09;
  --ink-2: #3f3d3a;
  --ink-3: #777169;
  --line: #e7e5e4;
  --line-soft: #f0efed;
  --accent: #292524;
  --accent-soft: #f0efed;
  --brand: #d00;
  --danger: #b4472f;
  --grid: transparent;
  --code-bg: #1f1d1a;
  --code-bar: #2a2723;
  --code-line: #3a352f;
  --code-ink: #e7e1d6;
  --inline-code-bg: #f0efed;
  --inline-code-border: #e7e5e4;
  --inline-code-text: #504945;
  --hl-keyword: #fb4934;
  --hl-string: #b8bb26;
  --hl-number: #d3869b;
  --hl-attr: #83a598;
  --hl-func: #8ec07c;
  --hl-comment: #928374;
  --shadow: 0 1px 0 rgba(12, 10, 9, 0.04);

  /* 兼容站点自定义 CSS 里的旧 ComBox 变量 */
  --radius-lg: 16px;
  --border: var(--line);
  --card: var(--paper-2);
  --foreground: var(--ink);
  --muted-foreground: var(--ink-3);
  --hairline-strong: var(--ink-3);
  --shadow-sm: 0 2px 8px rgba(12, 10, 9, 0.04);
  --shadow-md: 0 4px 16px rgba(12, 10, 9, 0.06);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --sans: "Ali PuHuiTi", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --mono: "Ioskeley Mono", "Ali PuHuiTi", ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --w: 1180px;
  --reading: 740px;
  --card-radius: 16px;
}

[data-theme="dark"] {
  --paper: #1b1916;
  --paper-2: #272420;
  --ink: #e7e1d6;
  --ink-2: #ded8cd;
  --ink-3: #c3b9a6;
  --line: #39352e;
  --line-soft: #2d2925;
  --accent: #f5f5f4;
  --accent-soft: #3a332b;
  --brand: #ff4136;
  --grid: transparent;
  --code-bg: #141210;
  --code-bar: #1e1b18;
  --code-line: #302b26;
  --code-ink: #e7e1d6;
  --inline-code-bg: #3b2e19;
  --inline-code-border: #55411f;
  --inline-code-text: #e7cca2;
  --hl-keyword: #fb4934;
  --hl-string: #b8bb26;
  --hl-number: #d3869b;
  --hl-attr: #83a598;
  --hl-func: #8ec07c;
  --hl-comment: #928374;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #1b1916;
    --paper-2: #272420;
    --ink: #e7e1d6;
    --ink-2: #ded8cd;
    --ink-3: #c3b9a6;
    --line: #39352e;
    --line-soft: #2d2925;
    --accent: #f5f5f4;
    --accent-soft: #3a332b;
    --brand: #ff4136;
    --grid: transparent;
    --code-bg: #141210;
    --code-bar: #1e1b18;
    --code-line: #302b26;
    --code-ink: #e7e1d6;
    --inline-code-bg: #3b2e19;
    --inline-code-border: #55411f;
    --inline-code-text: #e7cca2;
    --hl-keyword: #fb4934;
    --hl-string: #b8bb26;
    --hl-number: #d3869b;
    --hl-attr: #83a598;
    --hl-func: #8ec07c;
    --hl-comment: #928374;
    --shadow: none;
  }
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.12em;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--line);
  opacity: 0.4;
  pointer-events: none;
}
.topbar__inner {
  max-width: var(--w);
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  border-radius: 2px;
  box-shadow: 3px 3px 0 0 var(--accent-soft);
}
.brand__mark--sm { width: 22px; height: 22px; font-size: 12px; box-shadow: none; }
.brand__logo { display: block; width: auto; object-fit: contain; flex: 0 0 auto; }
.brand__logo--dark { display: none; }
[data-theme="dark"] .brand--has-dark .brand__logo--light { display: none; }
[data-theme="dark"] .brand--has-dark .brand__logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand--has-dark .brand__logo--light { display: none; }
  :root:not([data-theme]) .brand--has-dark .brand__logo--dark { display: block; }
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand__en {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  margin-top: 3px;
}
.nav { display: flex; align-items: center; gap: 24px; }
.nav__item {
  position: relative;
  font-size: 14.5px;
  color: var(--ink-2);
  padding: 6px 0;
  transition: color 0.15s;
}
.nav__item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.nav__item:hover, .nav__item.is-active { color: var(--ink); }
.nav__item:hover::after, .nav__item.is-active::after { transform: scaleX(1); }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.tool-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 2px;
  color: var(--ink-2);
  font-size: 18px;
  transition: background 0.15s, color 0.15s;
}
.tool-btn:hover { background: var(--paper-2); color: var(--ink); }
.tool-btn__sun { display: none; }
[data-theme="dark"] .tool-btn__sun { display: block; }
[data-theme="dark"] .tool-btn__moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .tool-btn__sun { display: block; }
  :root:not([data-theme]) .tool-btn__moon { display: none; }
}
.nav-toggle { display: none; }
.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 8px 24px 14px;
  background: var(--paper);
}
.mobile-nav a {
  display: block;
  padding: 10px 2px;
  font-size: 15px;
  border-bottom: 1px dotted var(--line-soft);
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav__label {
  display: block;
  padding: 14px 2px 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* ---------- 首页双栏 ---------- */
.layout {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 52px;
  align-items: start;
}
.layout__main { min-width: 0; }

/* ---------- 档案抬头 ---------- */
.masthead {
  position: relative;
  padding: 44px 0 30px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.masthead::before {
  content: "";
  position: absolute;
  inset: 0 -24px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 88%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 88%);
  pointer-events: none;
}
.masthead > * { position: relative; }
.masthead__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
}
.masthead__eyebrow::before {
  content: "";
  width: 16px;
  height: 3px;
  background: var(--accent);
  display: inline-block;
}
.masthead__title {
  margin: 12px 0 10px;
  font-family: var(--sans);
  font-size: clamp(32px, 4.2vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.masthead__desc {
  margin: 0 0 14px;
  max-width: 640px;
  color: var(--ink-2);
  font-size: 16px;
}
.masthead__meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.masthead__dot { color: var(--accent); }
.masthead--archive .masthead__title { font-size: clamp(30px, 3.8vw, 40px); }
.masthead--home { padding: 36px 0 24px; }
.masthead--home .masthead__title { font-size: clamp(28px, 3.4vw, 38px); margin: 10px 0 8px; }

/* ---------- 文章卡片 ---------- */
.post-list { display: flex; flex-direction: column; gap: 14px; border-top: 0; }
.post-card {
  position: relative;
  padding: 24px 26px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover {
  background: var(--paper-2);
  border-color: var(--ink-3);
  box-shadow: 0 6px 20px rgba(12, 10, 9, 0.06);
}
.post-card::before { content: none; }
.post-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-3);
}
.post-card__date { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.post-card__pin {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--line-soft);
  border: 0;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.6;
}
.post-card__cats { display: flex; align-items: center; flex-wrap: wrap; }
.post-card__cat {
  display: inline-block;
  margin-right: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}
.post-card__cat:hover { color: var(--ink); }
.post-card__title {
  margin: 8px 0;
  font-family: var(--sans);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__title a:hover { color: var(--ink-3); }
.post-card__excerpt {
  margin: 0 0 14px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.post-card__tags { min-width: 0; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  margin-right: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1;
  color: var(--ink-2);
}
.tag-pill::before { content: "#"; opacity: 0.55; }
.tag-pill:hover { color: var(--ink); border-color: var(--ink-3); }
.post-card__stats { display: flex; align-items: center; gap: 20px; flex: 0 0 auto; font-size: 12.5px; }
.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-3);
  border: 0;
  background: none;
  padding: 0;
}
.stat .icon { font-size: 15px; }
a.stat:hover { color: var(--ink); }
button.stat { padding: 0; border: 0; background: none; cursor: pointer; }
button.stat:hover { color: var(--ink); }
.stat.stat--share {
  margin-left: 0;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  transition: color 0.15s;
}
.stat.stat--share:hover { color: var(--ink); }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 34px;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-btn:hover { border-color: var(--ink); color: var(--ink); }
.page-btn.is-current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.page-ellipsis { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }

/* ---------- 侧栏 ---------- */
.sidebar { min-width: 0; padding-top: 44px; }
.sidebar__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
}
.sidebar__eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sidebar .side-block:first-of-type { margin-top: 22px; }
.side-block { margin-top: 32px; }
.side-block__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
.side-block__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cats li { border-bottom: 1px dotted var(--line-soft); }
.side-cats a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.side-cats a:hover { color: var(--ink); }
.side-cats em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-2);
}
.side-posts { list-style: none; margin: 0; padding: 0; }
.side-posts li { border-bottom: 1px dotted var(--line-soft); }
.side-posts a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.side-posts a:hover { color: var(--ink); }
.side-posts__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-posts time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ---------- 文章页 ---------- */
.article-layout {
  max-width: 1020px;
  margin: 0 auto;
  padding: 36px 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 940px);
  gap: 0;
  justify-content: center;
  align-items: start;
}
.article-layout--page {
  max-width: 1020px;
  grid-template-columns: minmax(0, 940px);
}
.article-main { min-width: 0; }
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb__sep { color: var(--line); }
.breadcrumb__current { color: var(--ink-2); }
.article-head { margin-top: 14px; }
.article-head__cats { margin-bottom: 8px; }
.article-head__title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(26px, 3vw, 31px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 0 0 18px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
}
.article-meta .stat { font-family: var(--sans); font-size: 13px; gap: 4px; }
.article-meta__no { display: none; }
.article-meta__sep { width: auto; height: auto; background: none; }
.article-meta__sep::before { content: "·"; color: var(--line); }
.article-meta a:hover { color: var(--ink); }

/* ---------- 正文排版 ---------- */
.entry {
  margin-top: 30px;
  font-size: 17.5px;
  line-height: 1.85;
  overflow-wrap: break-word;
}
.entry > *:first-child { margin-top: 0; }
.entry p { margin: 1.1em 0; }
.entry a {
  color: var(--ink);
  text-decoration: underline dotted;
  text-decoration-color: var(--ink-3);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.entry a:hover { color: var(--ink); text-decoration-color: var(--ink); background: none; }
.entry h2 {
  margin: 2.2em 0 0.8em;
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.entry h3 {
  margin: 1.9em 0 0.6em;
  font-family: var(--sans);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.5;
}
.entry h4 {
  margin: 1.7em 0 0.6em;
  font-size: 17px;
  font-weight: 700;
}
.entry h5, .entry h6 { margin: 1.5em 0 0.5em; font-size: 15px; }
.entry ul, .entry ol { padding-left: 1.45em; margin: 1em 0; }
.entry li { margin: 0.35em 0; }
.entry li::marker { color: var(--accent); }
.entry blockquote {
  margin: 1.6em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  color: var(--ink-2);
}
.entry blockquote p { margin: 0.35em 0; }
.entry hr { border: 0; border-top: 1px dashed var(--line); margin: 2.2em 0; }
.entry img {
  max-width: 100%;
  height: auto;
  padding: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.entry figure { margin: 1.6em 0; }
.entry figcaption { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 6px; }
.entry table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 14px;
  line-height: 1.7;
}
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.entry th { background: var(--paper-2); font-weight: 600; }
.entry code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--inline-code-bg);
  border: 1px solid var(--inline-code-border);
  color: var(--inline-code-text);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 代码块（深炭灰 + Gruvbox 语法色） */
.code-block {
  position: relative;
  margin: 1.7em 0;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: 10px;
  overflow: hidden;
}
.code-block__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  background: var(--code-bar);
  border-bottom: 1px solid var(--code-line);
  font-family: var(--mono);
  font-size: 11px;
  color: #a8a29e;
}
.code-block__dots { display: inline-flex; gap: 6px; }
.code-block__dots i { width: 10px; height: 10px; border-radius: 50%; background: #5a544c; display: block; }
.code-block__dots i:first-child { background: #ff5f57; }
.code-block__dots i:nth-child(2) { background: #febc2e; }
.code-block__dots i:nth-child(3) { background: #28c840; }
.code-block__lang { letter-spacing: 0.08em; }
.code-block__copy {
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #d6d3d1;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 4px;
}
.code-block__copy:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.34); color: #fff; }
.code-block pre { margin: 0; padding: 17px 20px; overflow: auto; background: transparent; }
.code-block code {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--code-ink);
  white-space: pre;
}
pre { max-width: 100%; }

/* highlight.js：Gruvbox 亮/暗 */
.hljs { color: var(--code-ink); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-name, .hljs-tag, .hljs-built_in { color: var(--hl-keyword); }
.hljs-string, .hljs-doctag, .hljs-regexp, .hljs-attribute, .hljs-title, .hljs-section, .hljs-template-tag, .hljs-template-variable { color: var(--hl-string); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-class, .hljs-selector-id { color: var(--hl-number); }
.hljs-attr, .hljs-property, .hljs-variable { color: var(--hl-attr); }
.hljs-function .hljs-title, .hljs-title.function_ { color: var(--hl-func); }
.hljs-params { color: var(--code-ink); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-addition { color: var(--hl-string); background: rgba(121, 116, 14, 0.08); }
.hljs-deletion { color: var(--hl-keyword); background: rgba(175, 58, 58, 0.08); }

/* 短代码：提示框 */
.ds-alert {
  --alert: #4a6fa5;
  display: block;
  margin: 1.5em 0;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--alert);
  font-size: 15px;
  line-height: 1.75;
}
.ds-alert__title {
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--alert);
}
.ds-alert__content { display: block; }
.ds-alert--note { --alert: #4a6fa5; }
.ds-alert--tip { --alert: #4f7d5a; }
.ds-alert--warning { --alert: #b8860b; }
.ds-alert--important { --alert: #7a5ea8; }
.ds-alert--caution { --alert: #c06a2e; }
.ds-alert--danger { --alert: #b4472f; }
[data-theme="dark"] .ds-alert--note { --alert: #7fa3d6; }
[data-theme="dark"] .ds-alert--tip { --alert: #83b28e; }
[data-theme="dark"] .ds-alert--warning { --alert: #d9b45c; }
[data-theme="dark"] .ds-alert--important { --alert: #a98fd6; }
[data-theme="dark"] .ds-alert--caution { --alert: #d99a62; }
[data-theme="dark"] .ds-alert--danger { --alert: #d97f6a; }

/* 短代码：按钮 / 高亮 / 按键 / 缩写 / 相册 / 折叠 / 图片 / 下载 */
.ds-btn {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 4px 13px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}
.ds-btn:hover { background: var(--ink); color: var(--paper); }
.ds-btn--blue { border-color: #4a6fa5; color: #4a6fa5; }
.ds-btn--green { border-color: #4f7d5a; color: #4f7d5a; }
.ds-btn--grey { border-color: var(--ink-3); color: var(--ink-2); }
.ds-btn--red { border-color: var(--danger); color: var(--danger); }
.ds-btn--yellow { border-color: #b8860b; color: #9a6f09; }
.ds-btn--dark { background: var(--ink); color: var(--paper); }
.ds-hl { background: var(--accent-soft); color: var(--ink); padding: 0 3px; }
.ds-kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.82em;
  line-height: 1.6;
}
.ds-abbr { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.ds-gallery {
  display: grid;
  grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
  gap: 8px;
  margin: 1.6em 0;
}
.ds-gallery__item { margin: 0; }
.ds-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 3px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.ds-collapse {
  margin: 1.4em 0;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.ds-collapse__title {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
}
.ds-collapse__title::-webkit-details-marker { display: none; }
.ds-collapse__title::before { content: "+ "; color: var(--accent); }
.ds-collapse[open] .ds-collapse__title::before { content: "− "; }
.ds-collapse__content { padding: 0 16px 12px; border-top: 1px dashed var(--line); }
.ds-figure { margin: 1.8em 0; text-align: center; }
.ds-figure img { padding: 4px; background: var(--paper-2); border: 1px solid var(--line); }
.ds-figure__caption {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}
.ds-download-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.2em 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12.5px;
  text-decoration: none !important;
}
.ds-download-btn:hover { border-color: var(--ink); background: var(--accent-soft); }
.ds-download-icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.ds-download-size { color: var(--ink-3); }

/* 密码保护 */
.post-protect {
  margin: 2em 0;
  padding: 26px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  text-align: center;
}
.post-protect__icon { display: inline-block; font-size: 30px; color: var(--ink-2); }
.post-protect__title { margin: 8px 0 6px; font-family: var(--serif); font-size: 22px; }
.post-protect__desc { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-2); }
.post-protect__row { display: flex; gap: 8px; max-width: 360px; margin: 0 auto; }
.post-protect__input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.post-protect__submit {
  padding: 8px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
}
.post-protect__error { margin: 12px 0 0; color: var(--danger); font-size: 12.5px; }

/* 引用卡片 / 标签 / 操作栏 */
.cite-card {
  display: flex;
  gap: 14px;
  margin-top: 2.2em;
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.cite-card__avatar img {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}
.cite-card__body { min-width: 0; flex: 1; }
.cite-card__label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.cite-card__title {
  margin: 3px 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
}
.cite-card__link { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.cite-card__link a { word-break: break-all; color: var(--ink-2); text-decoration: none; }
.cite-card__link a:hover { color: var(--ink); text-decoration: underline; }
.cite-card__note { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.cite-card__note a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); }
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
}
.copy-btn:hover { border-color: var(--ink); color: var(--ink); }
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
}
.entry-tags .tag-pill {
  margin: 0;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.entry-tags .tag-pill:hover { color: var(--ink); border-color: var(--ink-3); background: var(--paper-2); }
.article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}
.agree-btn, .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.agree-btn:hover, .action-btn:hover {
  border-color: var(--ink-3);
  background: var(--line-soft);
  color: var(--ink);
  transform: translateY(-1px);
}
.agree-btn.is-active { border-color: var(--brand); background: transparent; color: var(--brand); }
.agree-btn.is-active .icon { fill: var(--brand); stroke: var(--brand); }
.agree-btn.is-active .agree-btn__label { color: var(--brand); }
.agree-btn__label { color: var(--ink-3); font-size: 10.5px; }

/* 上下篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
}
.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.post-nav__item + .post-nav__item {
  padding-left: 20px;
  border-left: 1px solid var(--line);
  text-align: right;
}
.post-nav__item:hover {
  border-color: var(--ink-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(12, 10, 9, 0.06);
}
.post-nav__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}
.post-nav__item--next .post-nav__label { justify-content: flex-end; }
.post-nav__title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav__item:hover .post-nav__title { color: var(--ink); }

/* ---------- 目录（浮动面板，向 ComBox 靠拢） ---------- */
.toc-panel {
  position: fixed;
  right: 88px;
  bottom: 60px;
  z-index: 70;
  width: 280px;
  max-height: min(60vh, 520px);
  padding: 18px 6px 18px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(12, 10, 9, 0.14);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.toc-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.toc-panel__title {
  padding-right: 12px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.toc-panel__list {
  max-height: calc(min(60vh, 520px) - 56px);
  overflow: auto;
  padding-right: 8px;
}
.toc-panel__list a {
  display: block;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.toc-panel__list a:hover { color: var(--ink); background: var(--line-soft); }
.toc-panel__list a.is-active {
  color: var(--ink);
  background: var(--line-soft);
  border-left-color: var(--ink);
  font-weight: 600;
}
.toc-panel__list a.toc-level-3 { padding-left: 20px; font-size: 12px; }
.toc-panel__list a.toc-level-4,
.toc-panel__list a.toc-level-5,
.toc-panel__list a.toc-level-6 { padding-left: 32px; font-size: 11.5px; }
.toc-panel__list:empty::after {
  content: "本文暂无可导航标题";
  display: block;
  padding: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

/* 浮动工具按钮（对齐 ComBox：常显、右下竖排圆钮） */
.float-tools {
  position: fixed;
  right: 32px;
  bottom: 40px;
  z-index: 71;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.float-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 8px 24px rgba(12, 10, 9, 0.18);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.float-btn:hover { transform: translateY(-2px) scale(1.05); }
.float-btn .icon { font-size: 18px; stroke-width: 1.9; }

/* ---------- 评论 ---------- */
.comments { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }
.respond {
  margin: 0 0 28px;
  padding: 0 0 26px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.respond__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.respond__title {
  margin: 0;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
}
.respond__head a { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.comment-form { margin-top: 0; }
.comment-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.comment-form__grid input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  font-size: 14px;
  transition: border-color 0.15s;
}
.comment-form__grid input.is-full { grid-column: 1 / -1; }
.comment-form__grid .captcha { grid-column: 1 / -1; }
.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.15s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--ink-3); outline: none; }
.comment-form__submit { display: flex; justify-content: flex-end; margin-top: 10px; }
.btn-primary {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-ghost {
  display: inline-block;
  padding: 8px 22px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.comment-form__user { font-size: 13px; color: var(--ink-2); }
.comment-form__user a { text-decoration: underline; }
.comments__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.comments__title { margin: 0; font-family: var(--sans); font-size: 20px; font-weight: 600; }
.comments__count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.comment-list, .comment-list ul { list-style: none; margin: 0; padding: 0; }
.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  transition: none;
}
.comment:hover { background: transparent; }
.comment__inner { display: flex; gap: 12px; }
.comment__avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}
.comment__main { min-width: 0; flex: 1; }
.comment__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.comment__author { font-size: 14.5px; font-weight: 600; }
.comment__badge {
  margin-left: 5px;
  padding: 0 5px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}
.comment__status {
  margin-left: 5px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 9px;
}
.comment__time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.comment__reply { font-family: var(--mono); font-size: 10px; margin-left: auto; }
.comment__reply a { color: var(--ink-3); }
.comment__reply a:hover { color: var(--ink); }
.comment__content { margin-top: 4px; font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.comment__content p { margin: 0.4em 0; }
.comment__children { margin-left: 28px; padding-left: 16px; border-left: 1px dashed var(--line); }

/* ---------- 独立页：关于 ---------- */
.article--page { max-width: 100%; }
.about-hero { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.about-hero__avatar img {
  width: 76px;
  height: 76px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  object-fit: contain;
  padding: 4px;
}
.about-hero__title {
  margin: 4px 0 4px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.3;
}
.about-hero__desc { margin: 0; font-size: 14px; color: var(--ink-2); }
.stat-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-ledger__item { padding: 16px 12px; text-align: center; border-left: 1px dotted var(--line); }
.stat-ledger__item:first-child { border-left: 0; }
.stat-ledger__num { display: block; font-family: var(--serif); font-size: 27px; font-weight: 700; line-height: 1.2; }
.stat-ledger__label { display: block; margin-top: 2px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--ink-3); }
.info-table { margin-top: 30px; }
.info-table__title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}
.info-table dl { margin: 0; border-top: 1px solid var(--line); }
.info-table dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); border-bottom: 1px dotted var(--line-soft); }
.info-table dt {
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.info-table dd { margin: 0; padding: 8px 0; font-size: 13.5px; }

/* ---------- 独立页：归档 ---------- */
.archive-hero { margin-top: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.archive-hero__title {
  margin: 8px 0 6px;
  font-family: var(--sans);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.archive-hero__meta { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.archive-hero__meta strong { color: var(--ink); font-size: 13px; }
.archive-year { margin-top: 34px; }
.archive-year__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.archive-year__num { font-family: var(--mono); font-size: 32px; font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; }
.archive-year__count { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.archive-list { display: flex; flex-direction: column; list-style: none; margin: 0; padding: 0; }
.archive-list > li { border-bottom: 1px solid var(--line); }
.archive-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  padding: 15px 0;
}
.archive-item__date { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--ink-3); }
.archive-item__title { font-family: var(--sans); font-size: 18px; font-weight: 500; line-height: 25px; color: var(--ink); }
.archive-item:hover .archive-item__title { color: var(--ink-3); }

/* ---------- 独立页：友链 ---------- */
.links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s, transform 0.15s;
}
.link-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.link-card__avatar img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  object-fit: cover;
}
.link-card__body { min-width: 0; }
.link-card__name { display: block; font-family: var(--serif); font-size: 15px; font-weight: 700; }
.link-card__desc {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-info { margin: 14px 0 6px; border-top: 1px solid var(--line); }
.site-info__row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--line-soft); }
.site-info__label { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.site-info__value { display: flex; align-items: center; gap: 8px; font-size: 13px; word-break: break-all; }

/* ---------- 独立页：相册 ---------- */
.photo-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.photo-tabs__btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.photo-tabs__btn span { margin-left: 6px; color: var(--ink-3); font-size: 10px; }
.photo-tabs__btn:hover { border-color: var(--ink); }
.photo-tabs__btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.photo-tabs__btn.is-active span { color: var(--paper); opacity: 0.6; }
.photo-gallery__panel { display: none; }
.photo-gallery__panel.is-active { display: block; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.photo-item { margin: 0; background: var(--paper-2); border: 1px solid var(--line); padding: 6px; }
.photo-item__btn { display: block; width: 100%; padding: 0; border: 0; background: none; }
.photo-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: opacity 0.15s;
}
.photo-item__btn:hover img { opacity: 0.88; }
.photo-item__caption { display: flex; justify-content: space-between; gap: 8px; padding: 7px 2px 2px; }
.photo-item__title { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-item__date { flex: 0 0 auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.empty-note { margin-top: 24px; padding: 20px; background: var(--paper-2); border: 1px dashed var(--line); color: var(--ink-2); font-size: 13.5px; }
.empty-note pre { overflow: auto; padding: 12px; background: var(--paper); border: 1px solid var(--line-soft); font-size: 12px; }
.empty-note code { background: none; padding: 0; }

/* ---------- 404 ---------- */
.notfound { display: grid; place-items: center; min-height: 62vh; padding: 40px 24px; }
.notfound__card {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 40px 36px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 8px 8px 0 0 var(--line-soft);
  text-align: center;
}
.notfound__eyebrow { margin: 0; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ink-3); }
.notfound__code { margin: 14px 0 6px; font-family: var(--serif); font-size: 88px; line-height: 1; letter-spacing: 0.06em; color: var(--ink); }
.notfound__desc { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
.notfound__actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.notfound__meta { margin: 24px 0 0; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--ink-3); }

/* ---------- 页脚 / 快捷栏 / 回顶 ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.site-footer__inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 25px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.site-footer__brand { display: inline-flex; align-items: center; gap: 9px; }
.site-footer__brand .brand__logo { height: 26px; width: auto; }
.site-footer__name { font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.site-footer__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-3);
}
.site-footer__meta a { color: var(--ink-3); }
.site-footer__meta a:hover { color: var(--ink); text-decoration: underline; }
.site-footer__sep { color: var(--ink-3); opacity: 0.42; }
.dock { display: none; }
.dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0 5px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
}
.dock__item .icon { font-size: 20px; }
.dock__item:active { color: var(--ink); }

/* ---------- 搜索弹窗 ---------- */
.search-modal { position: fixed; inset: 0; z-index: 100; }
.search-modal[hidden] { display: none; }
.search-modal__backdrop { position: absolute; inset: 0; background: rgba(24, 22, 19, 0.58); backdrop-filter: blur(8px); }
.search-modal__panel {
  position: relative;
  max-width: 620px;
  margin: 11vh auto 0;
  padding: 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  animation: ds-drop 0.18s ease;
}
@keyframes ds-drop { from { opacity: 0; transform: translateY(-8px); } }
.search-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.search-modal__title { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--ink-2); }
.search-modal__close { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); background: none; font-size: 14px; color: var(--ink-2); }
.search-modal__field { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--ink); background: var(--paper); }
.search-modal__field .icon { font-size: 17px; color: var(--ink-3); }
.search-modal__field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; }
.search-modal__field input::-webkit-search-cancel-button,
.search-modal__field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-modal__list { max-height: 52vh; overflow: auto; margin-top: 6px; }
.search-result {
  display: block;
  padding: 12px 4px;
  border-bottom: 1px dotted var(--line-soft);
}
.search-result:hover { background: var(--paper); }
.search-result__title { display: block; font-family: var(--serif); font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.search-result__meta { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.search-result__excerpt { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result mark { background: var(--accent-soft); color: var(--ink); padding: 0 1px; }
.search-empty { padding: 26px 6px; text-align: center; font-size: 13px; color: var(--ink-3); }
.search-modal__hint { margin-top: 10px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 9.5px;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- 分享弹窗（对齐 ComBox：左海报预览 / 右操作） ---------- */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: grid;
  place-items: center;
  padding: 28px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}
.share-modal.is-open { visibility: visible; opacity: 1; }
.share-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 22, 19, 0.58);
  backdrop-filter: blur(8px);
}
.share-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(800px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.28s ease;
}
.share-modal.is-open .share-modal__dialog { transform: none; }
.share-modal__close,
.poster-lightbox__close,
.wechat-share__close {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--line-soft);
}
.share-modal__close { top: 18px; right: 18px; }
.share-modal__close .icon,
.poster-lightbox__close .icon,
.wechat-share__close .icon { width: 19px; height: 19px; }
.share-modal__preview {
  display: grid;
  place-items: center;
  min-height: 570px;
  padding: 26px 30px;
  background: #f4f0e7;
  border-radius: 18px 0 0 18px;
}
[data-theme="dark"] .share-modal__preview { background: #1b1916; }
.share-poster-block { display: grid; justify-items: center; width: 100%; }
.share-poster-preview {
  position: relative;
  display: block;
  width: min(100%, 326px);
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.share-poster-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(33, 30, 25, 0.22);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.share-poster-preview img.is-ready { opacity: 1; }
.share-poster-preview__loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #d5cdbc;
  color: #77746d;
  font-size: 14px;
  transition: opacity 0.2s ease;
}
.share-poster-preview__loading.is-hidden { opacity: 0; pointer-events: none; }
[data-theme="dark"] .share-poster-preview__loading { color: #c3b9a6; background: #302d29; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .share-modal__preview { background: #1b1916; }
  :root:not([data-theme]) .share-poster-preview__loading { color: #c3b9a6; background: #302d29; }
}
.share-poster-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.share-poster-theme__label { margin-right: 3px; }
.share-poster-theme button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 58px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-3);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.share-poster-theme button .icon { width: 15px; height: 15px; }
.share-poster-theme button:hover { color: var(--ink); border-color: var(--ink-3); }
.share-poster-theme button.is-active,
.share-poster-theme button[aria-pressed="true"] {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}
.share-modal__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 50px 44px 38px;
}
.share-modal__eyebrow {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--brand);
}
.share-modal__head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.3;
}
.share-modal__head p { margin: 8px 0 30px; font-size: 14.5px; color: var(--ink-3); }
.share-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line-soft);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background 0.25s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.share-action--download { color: #fff; background: var(--brand); border-color: var(--brand); }
[data-theme="dark"] .share-action--download { color: #1b1916; }
.share-action:not(:disabled):hover {
  border-color: var(--ink-3);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.share-action:disabled { opacity: 0.52; cursor: wait; }
.share-action .icon { width: 20px; height: 20px; }
.share-social { margin-top: 0; padding-top: 30px; }
.share-social__label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}
.share-social__label::before,
.share-social__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.share-social__items { display: flex; justify-content: space-between; gap: 10px; }
.share-social__item {
  display: grid;
  justify-items: center;
  gap: 7px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.share-social__item span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
}
.share-social__item span svg { width: 26px; height: 26px; }
.share-social__item b { font-size: 12.5px; font-weight: 500; }
.share-social__item--wechat span { background: #2aae67; }
.share-social__item--weibo span { background: #e6162d; }
.share-social__item--qzone span { color: #735d00; background: #fece00; }
.share-social__item:hover { color: var(--ink); }

/* 海报大图预览 */
.poster-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 28px;
  visibility: hidden;
  opacity: 0;
  background: rgba(17, 15, 13, 0.92);
  backdrop-filter: blur(12px);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.poster-lightbox.is-open { visibility: visible; opacity: 1; }
.poster-lightbox img {
  display: block;
  width: auto;
  max-width: min(92vw, 600px);
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}
.poster-lightbox__close { top: 24px; right: 24px; color: #fff; background: rgba(255, 255, 255, 0.14); }

/* 微信扫码 */
.wechat-share {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  background: rgba(24, 22, 19, 0.58);
  backdrop-filter: blur(8px);
  transition: opacity 0.24s ease, visibility 0.24s ease;
}
.wechat-share.is-open { visibility: visible; opacity: 1; }
.wechat-share__panel {
  position: relative;
  width: min(420px, 100%);
  padding: 40px 30px 34px;
  text-align: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.24s ease;
}
.wechat-share.is-open .wechat-share__panel { transform: none; }
.wechat-share__qr {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
}
.wechat-share__qr canvas { display: block; width: 100%; height: auto; }
.wechat-share__title { margin: 18px 0 12px; font-size: 22px; font-weight: 700; }
.wechat-share__desc { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-3); }
.wechat-share__close { top: 12px; right: 12px; }

@media (max-width: 760px) {
  .share-modal { padding: 12px; }
  .share-modal__dialog {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .share-modal__preview { min-height: 0; padding: 32px 24px 24px; border-radius: 18px 18px 0 0; }
  .share-poster-preview { width: min(60vw, 250px); }
  .share-modal__actions { padding: 28px 24px 32px; }
  .share-modal__head { display: none; }
  .share-social__items { justify-content: space-around; }
  .wechat-share { padding: 16px; }
  .wechat-share__qr { width: min(74vw, 270px); }
  .poster-lightbox { padding: 16px; }
  .poster-lightbox img { max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
  .poster-lightbox__close { top: 20px; right: 20px; }
}
@media (max-width: 420px) {
  .share-poster-preview { width: min(52vw, 205px); }
  .share-modal__actions { padding-inline: 18px; }
  .share-social__items { gap: 6px; justify-content: stretch; }
  .share-social__item span { width: 44px; height: 44px; }
  .share-social__item span svg { width: 24px; height: 24px; }
  .share-social__item b { font-size: 12px; }
}

/* ---------- 灯箱 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(8, 10, 14, 0.94); display: grid; grid-template-rows: 1fr auto; }
.lightbox[hidden] { display: none; }
.lightbox__stage { position: relative; display: grid; place-items: center; overflow: hidden; padding: 40px; }
.lightbox__loader {
  position: absolute;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(232, 228, 216, 0.6);
}
.lightbox__loader[hidden] { display: none; }
.lightbox__img { max-width: 92vw; max-height: 78vh; object-fit: contain; transition: transform 0.18s ease, opacity 0.2s ease; user-select: none; }
.lightbox__close, .lightbox__prev, .lightbox__next, .lightbox__zoom, .lightbox__rotate {
  position: absolute;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 24, 32, 0.6);
  color: #e8e4d8;
  font-size: 18px;
}
.lightbox__close { top: 18px; right: 18px; }
.lightbox__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox__zoom { bottom: 78px; right: 18px; }
.lightbox__rotate { bottom: 78px; right: 66px; }
.lightbox__bar { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 20px 22px; font-family: var(--mono); font-size: 11px; color: rgba(232, 228, 216, 0.72); }
.lightbox__caption { max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 940px; }
  .sidebar { display: none; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1099px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
}
@media (max-width: 860px) {
  .topbar__inner { gap: 16px; }
  .mobile-nav.is-open { display: block; }
  .brand__name { font-size: 17px; }
  .article-layout { padding: 24px 20px 64px; }
  .layout { padding: 0 20px 64px; }
  .masthead { padding-top: 32px; }
  .links-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; gap: 12px; }
  .post-nav__item + .post-nav__item { padding-left: 18px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); text-align: left; }
  .post-nav__item--next .post-nav__label { justify-content: flex-start; }
  .stat-ledger { grid-template-columns: repeat(2, 1fr); }
  .stat-ledger__item:nth-child(3) { border-left: 0; }
  .stat-ledger__item { border-top: 1px dotted var(--line); }
  .stat-ledger__item:nth-child(-n+2) { border-top: 0; }
  .comment-form__grid { grid-template-columns: 1fr; }
  .comment-form__grid input.is-full { grid-column: auto; }
  .archive-item { grid-template-columns: 104px minmax(0, 1fr); }
  .about-hero { align-items: flex-start; }
  .about-hero__avatar img { width: 60px; height: 60px; }
  .search-modal__panel { margin: 8vh 14px 0; }
  .search-modal { overflow: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .topbar__inner { height: 56px; padding: 0 16px; }
  .brand__en { display: none; }
  .brand__mark { width: 30px; height: 30px; font-size: 16px; }
  .topbar__tools { gap: 0; }
  .tool-btn { width: 32px; height: 32px; font-size: 17px; }
  .tool-btn--rss { display: none; }
  .layout { padding: 0 16px 58px; }
  .masthead { padding: 28px 0 22px; }
  .masthead__title { font-size: 31px; }
  .masthead__desc { font-size: 13.5px; }
  .post-card { padding: 20px 16px; }
  .post-card::before { left: -16px; }
  .post-card__title { font-size: 26px; line-height: 1.125; }
  .post-card__excerpt { font-size: 15px; }
  .post-card__foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .post-card__stats { gap: 20px; }
  .archive-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .archive-year__num { font-size: 24px; }
  .article-layout { padding: 20px 16px 56px; }
  .article-head__title { font-size: 28px; }
  .article-meta { gap: 8px; font-size: 11.5px; }
  .entry { font-size: 16.5px; }
  .entry h2 { font-size: 23px; }
  .entry h3 { font-size: 20px; }
  .article-actions { gap: 8px; }
  .agree-btn, .action-btn { padding: 7px 12px; font-size: 11px; }
  .float-tools { right: 14px; bottom: 76px; gap: 10px; }
  .float-btn { width: 38px; height: 38px; }
  .toc-panel { left: 12px; right: 12px; bottom: 176px; width: auto; max-height: 52vh; }
  .toc-panel__list { max-height: calc(52vh - 56px); }
  .dock {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 58;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .site-footer__inner { padding: 20px 16px 92px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-footer__meta { font-size: 11.5px; line-height: 1.8; gap: 2px 6px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-item__caption { flex-direction: column; gap: 0; }
  .notfound__card { padding: 30px 20px; }
  .notfound__code { font-size: 68px; }
  .lightbox__stage { padding: 24px 12px; }
  .lightbox__img { max-width: 96vw; max-height: 72vh; }
  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
  .lightbox__zoom { bottom: 66px; right: 10px; }
  .lightbox__rotate { bottom: 66px; right: 56px; }
  .lightbox__caption { max-width: 52vw; }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
