/* ============================================================
   zt's Blog — Terminal Engineer Design System
   IBM Plex Sans (body) + IBM Plex Mono (code/labels)
   Ported from Claude Design "zt's Blog-v4" into Hexo.
   ============================================================ */

/* ---------- Self-hosted fonts (IBM Plex, Latin subset woff2) ----------
   Replaces the third-party Google Fonts request. CJK falls back to system
   fonts (IBM Plex has no CJK). Paths are relative to this file (/css/). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/plex-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/plex-mono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/plex-mono-600.woff2") format("woff2"); }

/* ---------- Scale tokens (size, radius, rhythm — theme-independent) ---------- */
:root {
  /* type scale */
  --fs-2xs: 11px;  --fs-xs: 12px;   --fs-sm: 13px;  --fs-md: 14px;
  --fs-ml: 15px;   --fs-base: 16px; --fs-lg: 17px;  --fs-xl: 19px;
  --fs-2xl: 24px;  --fs-3xl: 28px;
  /* radius scale */
  --r-xs: 6px;  --r-sm: 8px;  --r-md: 10px;  --r-lg: 12px;  --r-xl: 14px;
  /* shared page rhythm: gap from the sticky topbar to the first heading */
  --page-top: 48px;
}

/* ---------- Tokens: Dark (default) ---------- */
:root,
[data-theme="dark"] {
  --bg:          #0c0e10;
  --bg-grid:     #14171a;
  --surface:     #16191e;
  --surface-2:   #1c2127;
  --surface-3:   #242b31;
  --border:      #313942;
  --border-soft: #20262c;

  --text:        #e7eaed;
  --text-dim:    #98a1aa;
  --text-faint:  #848d95;

  --accent:        oklch(0.80 0.16 152);
  --accent-dim:    oklch(0.80 0.16 152 / 0.14);
  --accent-line:   oklch(0.80 0.16 152 / 0.32);
  --accent-text:   oklch(0.84 0.15 152);

  /* syntax accents (used by the terminal variant + note/label tag styles) */
  --tok-key: oklch(0.78 0.13 330);
  --tok-num: oklch(0.82 0.13 60);
  --tok-fn:  oklch(0.80 0.12 235);

  --shadow: 0 1px 0 rgba(0,0,0,0.4), 0 8px 30px -12px rgba(0,0,0,0.6);
  color-scheme: dark;
}

/* ---------- Tokens: Light ---------- */
[data-theme="light"] {
  --bg:          #f6f5f1;
  --bg-grid:     #efede7;
  --surface:     #ffffff;
  --surface-2:   #faf9f5;
  --surface-3:   #f0eee8;
  --border:      #e2dfd5;
  --border-soft: #ece9e0;

  --text:        #1a1d1f;
  --text-dim:    #5c636a;
  --text-faint:  #676e75;

  --accent:        oklch(0.55 0.15 152);
  --accent-dim:    oklch(0.55 0.15 152 / 0.10);
  --accent-line:   oklch(0.55 0.15 152 / 0.30);
  --accent-text:   oklch(0.48 0.15 152);

  --tok-key: oklch(0.50 0.18 330);
  --tok-num: oklch(0.52 0.15 50);
  --tok-fn:  oklch(0.50 0.15 250);

  --shadow: 0 1px 0 rgba(0,0,0,0.02), 0 12px 30px -16px rgba(0,0,0,0.18);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.3s ease, color 0.3s ease;
}
::selection { background: var(--accent-dim); color: var(--accent-text); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
img { max-width: 100%; }

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.dim  { color: var(--text-dim); }
.faint{ color: var(--text-faint); }
.accent { color: var(--accent-text); }

/* subtle background grid */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  transform: translateZ(0); /* own GPU layer — avoids repaint smear under the blurred sticky topbar */
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.55;
}

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 28px; }
.wrap-wide { max-width: 1120px; }
.wrap-article { max-width: 800px; }
.col { display: flex; flex-direction: column; }
/* shared top gap from the sticky topbar to the first heading on list/index pages */
.page-top { padding-top: var(--page-top); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); }
.brand .path { color: var(--text); font-size: var(--fs-ml); }
.brand .blink { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: var(--fs-xs); color: var(--text-dim);
  padding: 7px 9px; border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  position: relative; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent-text); }
.nav-link.active::before { content: ""; position: absolute; left: 9px; right: 9px; bottom: 1px; height: 1.5px; background: var(--accent); }
.nav-ext { display: inline-flex; align-items: center; gap: 3px; }

.iconbtn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-dim);
  transition: all 0.15s;
}
.iconbtn:hover { color: var(--text); border-color: var(--accent-line); }

/* right cluster: nav links + always-visible action icons */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
/* mobile nav toggle (hidden on desktop) */
.nav-toggle { display: none; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm);
  padding: 9px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all 0.15s; cursor: pointer;
}
.btn:hover { border-color: var(--accent-line); color: var(--accent-text); }
.btn-accent { background: var(--accent); color: #04130a; border-color: var(--accent); font-weight: 600; }
.btn-accent:hover { filter: brightness(1.08); color: #04130a; }
/* shared pressed state — gives touch taps feedback (flattened under reduced-motion) */
.btn:active, .iconbtn:active, .pager a:active, .vswitch button:active,
.nav-link:active, .code-copy:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: none; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs);
  padding: 3px 9px; border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--text-dim);
  border: 1px solid var(--border-soft); transition: all 0.15s; cursor: pointer;
}
.tag:hover { color: var(--accent-text); border-color: var(--accent-line); }
.tag.on { background: var(--accent-dim); color: var(--accent-text); border-color: var(--accent-line); }
.tag .hash { color: var(--text-faint); }
/* decorative (non-link) tag nested inside a card link — no false clickable affordance */
.tag.static { cursor: default; }
.tag.static:hover { color: var(--text-dim); border-color: var(--border-soft); }

/* ---------- Category badge ---------- */
.catbadge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs);
  color: var(--text-dim); white-space: nowrap; transition: color 0.15s;
}
.catbadge .catdot,
.catchain .catdot {
  width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
  background: oklch(0.74 0.15 var(--ch));
  box-shadow: 0 0 0 3px oklch(0.74 0.15 var(--ch) / 0.16);
}

/* category chain: 一类 / 二类 ... each level linked */
.catchain {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs);
  color: var(--text-dim); white-space: nowrap;
}
.catchain .catlink { color: var(--text-dim); transition: color 0.15s; }
.catchain .catlink:hover { color: oklch(0.80 0.13 var(--ch)); }
.catchain .catsep { color: var(--text-faint); margin: 0 -1px; }
[data-theme="light"] .catchain .catlink:hover { color: oklch(0.48 0.16 var(--ch)); }
[data-theme="light"] .catbadge .catdot,
[data-theme="light"] .catchain .catdot { background: oklch(0.58 0.16 var(--ch)); box-shadow: 0 0 0 3px oklch(0.58 0.16 var(--ch) / 0.16); }

/* category cards on archive */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cat-card {
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; min-height: 124px;
  background: var(--surface); cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 7px; position: relative; overflow: hidden;
}
.cat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: oklch(0.74 0.15 var(--ch)); opacity: 0; transition: opacity 0.15s;
}
.cat-card:hover { border-color: oklch(0.74 0.15 var(--ch) / 0.5); transform: translateY(-2px); }
.cat-card:hover::before, .cat-card.on::before { opacity: 1; }
.cat-card.on { border-color: oklch(0.74 0.15 var(--ch) / 0.5); background: var(--surface-2); }
.cat-card .cc-top { display: flex; align-items: center; justify-content: space-between; }
.cat-card .cc-name { font-weight: 600; font-size: var(--fs-base); display: flex; align-items: center; gap: 8px; }
.cat-card .cc-name .catdot2 { width: 9px; height: 9px; border-radius: 3px; background: oklch(0.74 0.15 var(--ch)); }
[data-theme="light"] .cat-card .cc-name .catdot2 { background: oklch(0.58 0.16 var(--ch)); }
[data-theme="light"] .cat-card::before { background: oklch(0.58 0.16 var(--ch)); }
.cat-card .cc-en { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-2xs); color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.cat-card .cc-count { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); }
.cat-card .cc-desc { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.5; }
.cat-card .cc-subs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.cat-card .cc-sub { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-2xs); color: var(--text-faint); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 5px; padding: 1px 6px; }
/* sub-category links under a category section on the overview */
.cat-subs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px 21px; }

.kbd {
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-2xs);
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-dim);
}

/* ---------- Section label ---------- */
.eyebrow {
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow .prompt { color: var(--accent); }

/* ---------- Post list (Variant A: stream) ---------- */
.post-row {
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: baseline;
  padding: 20px; border-radius: var(--r-lg); margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.post-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.post-row:hover { background: var(--surface-2); border-color: var(--accent-line); }
.post-row:hover .post-title { color: var(--accent-text); }
/* keyboard focus on the whole card (it's focusable via tabindex) — mirrors hover */
.post-row:focus-visible { outline: none; background: var(--surface-2); border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-line); }
.post-row:focus-visible .post-title { color: var(--accent-text); }
.post-date { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); white-space: nowrap; }
.post-title { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; transition: color 0.15s; margin-bottom: 6px; }
.post-excerpt { color: var(--text-dim); font-size: var(--fs-ml); line-height: 1.55; }
.post-meta { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.post-read { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); white-space: nowrap; }

/* ---------- Variant B: terminal ls ---------- */
.term {
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
}
.term-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.term-bar .lights { display: flex; gap: 6px; }
.term-bar .lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.term-bar .title { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); margin-left: 6px; }
.term-body { padding: 20px 22px; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-md); line-height: 1.75; }
.term-cmd { color: var(--text); margin-bottom: 4px; }
.term-cmd .ps { color: var(--accent); }
.term-cmd .arg { color: var(--tok-fn); }
.term-ls-row {
  display: grid; grid-template-columns: 90px 60px 110px 1fr; gap: 16px; align-items: center;
  padding: 5px 8px; border-radius: var(--r-xs); cursor: pointer; transition: background 0.12s;
}
.term-ls-row:hover { background: var(--surface-3); }
.term-ls-row:hover .fname { color: var(--accent-text); }
.term-ls-row .perm { color: var(--text-faint); }
.term-ls-row .size { color: var(--tok-num); }
.term-ls-row .mtime { color: var(--text-dim); }
.term-ls-row .fname { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-ls-row .fname .ext { color: var(--text-faint); }
.term-ls-row .catdir { color: oklch(0.74 0.15 var(--ch)); }
[data-theme="light"] .term-ls-row .catdir { color: oklch(0.50 0.16 var(--ch)); }
/* medium widths: drop the least-useful columns first so the filename keeps priority
   (before the full single-column collapse at 620px) */
@media (max-width: 760px) {
  .term-ls-row { grid-template-columns: 110px 1fr; gap: 12px; }
  .term-ls-row .perm, .term-ls-row .size { display: none; }
}

/* ---------- Variant C: magazine index ---------- */
.mag-feature {
  border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden;
  background: var(--surface); display: grid; grid-template-columns: 1.15fr 1fr; cursor: pointer;
  transition: border-color 0.15s;
}
/* no cover image -> the featured card is a single full-width text column
   (avoids the empty placeholder art slot) */
.mag-feature.no-art { grid-template-columns: 1fr; }
.mag-feature:hover { border-color: var(--accent-line); }
.mag-feature .mf-body { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.mag-feature .mf-art { background: var(--surface-2) center / cover no-repeat; position: relative; min-height: 240px; }
.mag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--r-lg); overflow: hidden; }
.mag-cell { background: var(--surface); padding: 22px; cursor: pointer; transition: background 0.15s; }
.mag-cell:hover { background: var(--surface-2); }
.mag-cell:hover .mag-cell-title { color: var(--accent-text); }
.mag-cell-title { font-size: var(--fs-lg); font-weight: 600; margin: 10px 0 8px; transition: color 0.15s; }

/* placeholder art */
.ph {
  position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(135deg, var(--surface-3) 0 11px, transparent 11px 22px);
}
.ph::after {
  content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-2xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint);
}

/* ---------- Hero ---------- */
.hero { padding: 40px 0 24px; }
.hero p { color: var(--text); font-size: 20px; max-width: 640px; line-height: 1.55; }
.hero .typ { color: var(--accent-text); }

/* ---------- Article page ---------- */
.article { min-width: 0; }
.article h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; margin-bottom: 16px; }
.article-head-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.prose { font-size: var(--fs-lg); line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.prose > * { margin: 0 0 22px; }
.prose h1 { font-size: var(--fs-3xl); margin: 44px 0 16px; scroll-margin-top: 90px; }
.prose h2 { font-size: var(--fs-2xl); margin: 44px 0 16px; scroll-margin-top: 90px; }
.prose h3 { font-size: var(--fs-xl); margin: 32px 0 12px; scroll-margin-top: 90px; }
.prose h4 { font-size: var(--fs-base); margin: 24px 0 10px; scroll-margin-top: 90px; }
/* heading anchor links — hover to reveal a #, click to copy the section URL */
.prose h2, .prose h3, .prose h4 { position: relative; }
.head-anchor {
  position: absolute; left: -0.9em; top: 0; bottom: 0;
  display: inline-flex; align-items: center;
  color: var(--text-faint); font-weight: 400; text-decoration: none;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.prose h2:hover .head-anchor, .prose h3:hover .head-anchor, .prose h4:hover .head-anchor,
.head-anchor:focus-visible { opacity: 1; }
.head-anchor:hover { color: var(--accent-text); }
@media (max-width: 620px) { .head-anchor { display: none; } }
.prose p { color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; color: var(--text); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent-text); border-bottom: 1px solid var(--accent-line); }
.prose strong { font-weight: 600; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--border-soft); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 20px; margin-left: 0;
  color: var(--text-dim); font-style: normal;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code:not(pre code) {
  font-family: "IBM Plex Mono", monospace; font-size: 0.88em;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 1px 6px; border-radius: 5px; color: var(--accent-text);
}
.prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-size: var(--fs-ml); }
.prose th, .prose td { border: 1px solid var(--border-soft); padding: 8px 12px; text-align: left; }
.prose thead th { background: var(--surface-2); font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); }

/* generic code block (design CodeBlock + Hexo highlight.js output) */
.code, .prose figure.highlight, .prose pre {
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); margin: 0 0 24px;
}
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); }
.code-lang { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-dim); }
.code-copy { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); background: none; border: none; padding: 2px 4px; transition: color 0.15s; }
.code-copy:hover { color: var(--accent-text); }
.code pre { margin: 0; padding: 16px 0; overflow-x: auto; border: none; background: none; }
.code code { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); line-height: 1.7; }

/* ---------- Hexo highlight.js code blocks ---------- */
/* Config: syntax_highlighter: highlight.js, line_number: true, wrap: true
   => <figure class="highlight LANG"><table><tr><td class="gutter"><pre>..line nums..</pre></td>
        <td class="code"><pre>..code..</pre></td></tr></table></figure> */
.prose figure.highlight { position: relative; padding: 0; font-family: "IBM Plex Mono", monospace; }
.prose figure.highlight::before {
  content: attr(class); /* shows "highlight go" etc.; trimmed via JS to lang only */
  display: none;
}
.prose figure.highlight figcaption { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-dim); }
.prose figure.highlight figcaption a { border: none; }
.prose figure.highlight pre { margin: 0; padding: 0; background: none; border: none; }
.prose figure.highlight table { width: 100%; border: none; margin: 0; font-size: var(--fs-sm); line-height: 1.7; display: block; overflow-x: auto; }
.prose figure.highlight td { border: none; padding: 0; vertical-align: top; }
.prose figure.highlight .gutter { width: 1%; white-space: nowrap; user-select: none; }
.prose figure.highlight .gutter pre { padding: 16px 0 16px 16px; color: var(--text-faint); opacity: 0.55; text-align: right; }
.prose figure.highlight .code pre { padding: 16px 18px; color: var(--text); white-space: pre; }
.prose figure.highlight .code { width: 100%; }

/* Token colors come from the official highlight.js theme stylesheet
   (#hljs-theme, swapped dark/light by app.js; needs highlight.hljs: true).
   We only neutralize the theme's own container styling so our code-block
   frame (surface bg, padding, line-number gutter) stays consistent. */
.prose figure.highlight .hljs,
.prose figure.highlight pre.hljs,
.prose figure.highlight code.hljs {
  background: transparent; padding: 0; color: inherit;
}

/* ---------- Mermaid diagrams ---------- */
.prose pre.mermaid {
  margin: 0 0 24px; padding: 18px; text-align: center; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: "IBM Plex Sans", system-ui, sans-serif; line-height: 1.4;
}
.prose pre.mermaid svg { max-width: 100%; height: auto; }
/* hide the raw source while mermaid is rendering (revealed as a fallback
   if mermaid never loads, via the safety timeout in app.js) */
.mermaid-pending .prose pre.mermaid:not([data-processed]) { visibility: hidden; min-height: 60px; }

/* TOC */
.toc { position: sticky; top: 90px; font-family: "IBM Plex Mono", monospace; }
.toc-title { font-size: var(--fs-2xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.toc a, .toc .toc-link { display: block; font-size: var(--fs-sm); color: var(--text-dim); padding: 5px 0 5px 12px; border-left: 2px solid var(--border); transition: all 0.15s; line-height: 1.4; }
.toc a:hover, .toc .toc-link:hover { color: var(--text); }
.toc a.h3, .toc .toc-level-3 .toc-link { padding-left: 24px; font-size: var(--fs-xs); }
.toc a.active, .toc .toc-link.active { color: var(--accent-text); border-left-color: var(--accent); }
/* hexo toc() emits nested <ol> — strip default list styling */
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc .toc-number { display: none; }

/* TOC lives outside the article container, fixed in the right gutter.
   The article column is centered (max-width 800 ≈ 744 prose), so the TOC
   sits just to its right. Hidden when the viewport is too narrow to fit it
   beside the article (content stays fully readable without it). */
.toc-floating {
  position: fixed; top: 88px; left: calc(50% + 410px);
  width: 200px; max-height: calc(100vh - 120px); overflow-y: auto;
  z-index: 20; padding-bottom: 20px;
}
.toc-floating .toc { position: static; top: auto; }
@media (max-width: 1240px) { .toc-floating { display: none; } }

/* In-flow collapsible TOC for medium/narrow widths where the floating one
   can't fit beside the 800px article — keeps contents nav at every width. */
.toc-inflow { display: none; margin: 0 0 28px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.toc-inflow > summary { list-style: none; cursor: pointer; padding: 11px 16px; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
.toc-inflow > summary::-webkit-details-marker { display: none; }
.toc-inflow > summary::before { content: "\25B8"; display: inline-block; transition: transform 0.15s; }
.toc-inflow[open] > summary::before { transform: rotate(90deg); }
.toc-inflow .toc { position: static; display: block; padding: 0 16px 12px; }
@media (max-width: 1240px) { .toc-inflow { display: block; } }

/* reading progress */
.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 60; transition: width 0.1s linear; }

/* ---------- About / resume ---------- */
.about-head { display: grid; grid-template-columns: 132px 1fr; gap: 28px; align-items: start; }
.avatar { width: 132px; height: 132px; border-radius: var(--r-xl); border: 1px solid var(--border); object-fit: cover; }
/* initial-based avatar when no image is configured (instead of an empty striped box) */
.avatar-fallback { display: grid; place-items: center; font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 44px; color: #04130a; background: var(--accent); }
.statline { display: flex; gap: 32px; flex-wrap: wrap; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); }
.statline > span { display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.statline .k { color: var(--text-faint); font-size: var(--fs-2xs); letter-spacing: 0.08em; text-transform: uppercase; }
.statline .v { color: var(--text); font-size: var(--fs-md); }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.skill-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; background: var(--surface); }
.skill-card .name { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.timeline { border-left: 2px solid var(--border); padding-left: 26px; display: flex; flex-direction: column; gap: 30px; }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: -33px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-when { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); }
.tl-role { font-size: var(--fs-xl); font-weight: 600; margin: 4px 0 2px; }
.tl-org { color: var(--accent-text); font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 20px; }
.proj-card { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); transition: border-color 0.15s, transform 0.15s; cursor: pointer; }
.proj-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.proj-card:hover .proj-name { color: var(--accent-text); }
/* project card with no real link — don't fake a clickable affordance */
.proj-card.no-link { cursor: default; }
.proj-card.no-link:hover { border-color: var(--border); transform: none; }
.proj-card.no-link:hover .proj-name { color: inherit; }
.proj-art { height: 150px; border-bottom: 1px solid var(--border-soft); }
.proj-body { padding: 18px 20px; }
.proj-name { font-size: var(--fs-xl); font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; transition: color 0.15s; }
.proj-desc { color: var(--text-dim); font-size: var(--fs-md); line-height: 1.55; margin-bottom: 14px; }
.proj-foot { display: flex; align-items: center; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); }
.proj-foot .stars { display: flex; align-items: center; gap: 5px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- Archive ---------- */
.year-head { display: flex; align-items: baseline; gap: 14px; margin: 36px 0 8px; }
.year-head .y { font-family: "IBM Plex Mono", monospace; font-size: 30px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.year-head .n { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); }
.year-head .rule { flex: 1; height: 1px; background: var(--border-soft); }
.arch-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 18px; align-items: baseline; padding: 11px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background 0.12s; }
.arch-row:hover { background: var(--surface-2); }
.arch-row:hover .arch-title { color: var(--accent-text); }
.arch-row .arch-date { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); }
.arch-title { font-size: var(--fs-base); transition: color 0.15s; }
.arch-row-4 { grid-template-columns: 70px 1fr auto auto; gap: 16px; }
@media (max-width: 620px) {
  .arch-row-4 { grid-template-columns: 60px 1fr; }
  .arch-row-4 .catbadge, .arch-row-4 .arch-lang { display: none; }
}

/* ---------- Search modal ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg) 60%, rgba(0,0,0,0.5));
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: ovIn 0.15s ease;
}
@keyframes ovIn { from { opacity: 0; } to { opacity: 1; } }
.search-box {
  width: min(620px, calc(100vw - 40px)); min-width: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.5);
  animation: boxIn 0.18s ease;
}
@keyframes boxIn { from { transform: translateY(-8px) scale(0.99); } to { transform: none; } }
.search-input-row { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); }
.search-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: "IBM Plex Sans", sans-serif; font-size: var(--fs-lg); }
.search-input::placeholder { color: var(--text-faint); }
.search-results { max-height: 46vh; overflow-y: auto; padding: 8px; }
.search-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 9px; cursor: pointer; transition: background 0.12s;
}
.search-item.sel { background: var(--accent-dim); }
/* Tab focus uses the same accent treatment as arrow-key .sel (one "current" signal) */
.search-item:focus-visible { outline: none; background: var(--accent-dim); }
.search-item .si-title { font-size: var(--fs-ml); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item.sel .si-title, .search-item:focus-visible .si-title { color: var(--accent-text); }
.search-item .si-meta { font-size: var(--fs-xs); color: var(--text-faint); }
.search-empty { padding: 28px; text-align: center; color: var(--text-faint); font-size: var(--fs-md); }
.search-foot { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-top: 1px solid var(--border-soft); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-faint); }

/* ---------- word/read meta ---------- */
.wc { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.wc .num { color: var(--text-dim); }

/* ---------- Collections ---------- */
.coll-group { margin-bottom: 40px; }
.coll-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.coll-head .cdot { width: 9px; height: 9px; border-radius: 3px; background: oklch(0.74 0.15 var(--ch)); }
[data-theme="light"] .coll-head .cdot { background: oklch(0.56 0.16 var(--ch)); }
.coll-head .ct { font-size: 20px; font-weight: 600; }
.coll-head .ce { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.coll-head .crule { flex: 1; height: 1px; background: var(--border-soft); }
.coll-list { display: flex; flex-direction: column; }
.coll-item {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: baseline;
  padding: 14px 12px; border-radius: 9px; cursor: pointer; transition: background 0.12s;
  border-bottom: 1px solid var(--border-soft);
}
.coll-item:hover { background: var(--surface-2); }
.coll-item:hover .ci-title { color: var(--accent-text); }
.coll-item:last-child { border-bottom: none; }
.coll-item .ci-n { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); }
.coll-item .ci-title { font-size: var(--fs-base); font-weight: 500; transition: color 0.15s; display: block; }
.coll-item .ci-note { font-size: var(--fs-sm); color: var(--text-dim); margin-top: 3px; display: block; }
.coll-item .ci-url { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-faint); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.coll-item:hover .ci-url { color: var(--accent-text); }

/* ---------- Article footer / license ---------- */
.article-foot {
  margin-top: 44px; padding: 20px 22px; border: 1px dashed var(--border);
  border-radius: var(--r-lg); background: var(--surface-2);
}
.af-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); }
.af-meta .k { color: var(--text-faint); display: block; font-size: var(--fs-2xs); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.af-meta .v { color: var(--text); }
.af-meta .v.lic { color: var(--accent-text); }

/* ---------- Comments ---------- */
/* Real comments render via Waline (#waline, themed below). The static
   comment-thread styles (.cmt list/avatar/body) were never rendered and
   were removed; only the unconfigured-state compose box remains. */
.comments { margin-top: 44px; }
.cmt-compose { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cmt-compose textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 76px; padding: 14px 16px; background: none; border: none; outline: none; color: var(--text); font-family: "IBM Plex Sans", sans-serif; font-size: var(--fs-md); line-height: 1.5; }
.cmt-compose textarea::placeholder { color: var(--text-faint); }
.cmt-compose textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.cmt-compose-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border-soft); background: var(--surface-2); }

/* Waline — blend with the terminal theme tokens */
#waline {
  --waline-theme-color: var(--accent);
  --waline-active-color: var(--accent-text);
  --waline-font-size: var(--fs-ml);
  --waline-color: var(--text);
  --waline-bgcolor: var(--surface);
  --waline-bgcolor-light: var(--surface-2);
  --waline-bgcolor-hover: var(--surface-3);
  --waline-border-color: var(--border);
  --waline-border: 1px solid var(--border);
  --waline-info-bgcolor: var(--surface-2);
  --waline-info-color: var(--text-dim);
  margin-top: 4px;
}
#waline .wl-btn { border-radius: var(--r-sm); }
#waline .wl-editor { background: var(--surface-2); border-radius: var(--r-sm); }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pager a, .pager span.page-number, .pager .pager-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim); border-radius: var(--r-sm);
  font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.pager a:hover { color: var(--text); border-color: var(--accent-line); }
.pager .current, .pager span.page-number.current { background: var(--accent-dim); color: var(--accent-text); border-color: var(--accent-line); }
.pager .space { border: none; background: none; }

/* ---------- Categories page ---------- */
.cat-section { margin-bottom: 40px; }
.cat-sec-desc { font-size: var(--fs-md); margin: -4px 0 12px 21px; max-width: 720px; }
.cat-posts { display: flex; flex-direction: column; }

/* ---------- Tags page / cloud ---------- */
.tag-cloud {
  display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: baseline;
  padding: 28px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface);
}
.cloud-tag {
  font-family: "IBM Plex Mono", monospace; color: var(--text-dim); cursor: pointer;
  line-height: 1.1; transition: color 0.15s, transform 0.15s; white-space: nowrap;
}
.cloud-tag .ct-hash { color: var(--text-faint); }
.cloud-tag sup { font-size: 0.5em; color: var(--text-faint); margin-left: 2px; vertical-align: super; }
.cloud-tag:hover { color: var(--accent-text); transform: translateY(-1px); }
.cloud-tag:hover .ct-hash { color: var(--accent); }
.cloud-tag.on { color: var(--accent-text); }
.cloud-tag.on .ct-hash { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-soft); margin-top: 80px; padding: 36px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-family: "IBM Plex Mono", monospace; font-size: var(--fs-sm); color: var(--text-faint); }
.footer a { color: var(--text-dim); transition: color 0.15s; }
.footer a:hover { color: var(--accent-text); }
.social { display: flex; gap: 16px; }
/* unset social: shown muted + non-clickable instead of a dead "#" link */
.social .social-off { color: var(--text-faint); opacity: 0.35; cursor: default; display: inline-flex; }

/* ---------- Variant switcher ---------- */
.vswitch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.vswitch button { font-family: "IBM Plex Mono", monospace; font-size: var(--fs-xs); color: var(--text-dim); background: none; border: none; padding: 6px 13px; border-radius: var(--r-xs); transition: all 0.15s; }
.vswitch button:hover { color: var(--text); }
.vswitch button.on { background: var(--accent-dim); color: var(--accent-text); }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}.mt48{margin-top:48px}
.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}.mb32{margin-bottom:32px}.mb48{margin-bottom:48px}
.wrapw { flex-wrap: wrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* visible keyboard focus everywhere (inputs explicitly opt back in too) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }
.search-input:focus-visible, .cmt-compose textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

.fade-in { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .fade-in { animation: slideUp 0.4s ease; }
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes navIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* touch devices: enlarge tag chips toward a comfortable tap target */
@media (pointer: coarse) {
  .tag { padding: 7px 11px; }
}

/* honor reduced-motion globally: kills the blink cursor, hero rotation,
   theme transitions, slide-ups and smooth scroll */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  .toc { display: none; }
  .mag-feature { grid-template-columns: 1fr; }
  .mag-feature .mf-art { min-height: 160px; }
  .about-head { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* collapse nav into a hamburger before the 7 links overflow the bar */
  .nav-toggle { display: grid; }
  .nav { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
         background: color-mix(in srgb, var(--bg) 96%, transparent); border-bottom: 1px solid var(--border);
         padding: 8px; display: none; }
  .nav.open { display: flex; animation: navIn 0.18s ease; }
  .nav .nav-link { font-size: var(--fs-md); padding: 11px 12px; }
  .topbar-inner { position: relative; }
}
/* ============================================================
   Markdown tag plugins ({% note %} {% label %} {% fold %} {% gi %})
   ported from the previous theme — styled to match terminal.
   ============================================================ */
.prose .note {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); background: var(--surface-2);
  padding: 14px 18px; margin: 0 0 22px;
}
.prose .note > :first-child { margin-top: 0; }
.prose .note > :last-child { margin-bottom: 0; }
.prose .note-info, .prose .note-default { border-left-color: var(--tok-fn); }
.prose .note-success { border-left-color: var(--accent); }
.prose .note-warning { border-left-color: var(--tok-num); }
.prose .note-danger, .prose .note-error { border-left-color: oklch(0.70 0.18 20); }
.prose .note-primary { border-left-color: var(--tok-key); }

.prose .label {
  font-family: "IBM Plex Mono", monospace; font-size: 0.82em;
  padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border-soft);
  background: var(--surface-2); color: var(--text-dim); white-space: nowrap;
}
.prose .label-info, .prose .label-primary { color: var(--tok-fn); }
.prose .label-success { color: var(--accent-text); }
.prose .label-warning { color: var(--tok-num); }
.prose .label-danger { color: oklch(0.70 0.18 20); }

.prose .fold { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin: 0 0 22px; background: var(--surface); }
.prose .fold-title {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font-family: "IBM Plex Sans", sans-serif; font-size: var(--fs-ml); font-weight: 500; color: var(--text);
  background: var(--surface-2); border: none; border-radius: 0; padding: 12px 16px; cursor: pointer;
}
.prose .fold-title:hover { color: var(--accent-text); }
.prose .fold-arrow { display: inline-block; font-size: 10px; color: var(--text-faint); transition: transform 0.15s; }
.prose .fold-title.open .fold-arrow { transform: rotate(90deg); }
.prose .fold-content { padding: 14px 16px; border-top: 1px solid var(--border-soft); }
.prose .fold-content > :first-child { margin-top: 0; }
.prose .fold-content > :last-child { margin-bottom: 0; }

.prose .cb { display: inline-flex; align-items: center; gap: 8px; }
.prose input[type="checkbox"] { accent-color: var(--accent); }

.prose .group-image-container { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; }
.prose .group-image-row { display: flex; gap: 8px; }
.prose .group-image-wrap { flex: 1; min-width: 0; }
.prose .group-image-wrap img { width: 100%; height: 100%; object-fit: cover; margin: 0; }

@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .post-row { grid-template-columns: 1fr; gap: 8px; }
  .post-aside { flex-direction: row; justify-content: flex-end; align-items: center; gap: 12px; }
  .post-read { display: none; }
  .mag-grid { grid-template-columns: 1fr; }
  .term-ls-row { grid-template-columns: 1fr; gap: 0; }
  .term-ls-row .perm, .term-ls-row .size, .term-ls-row .mtime { display: none; }
  .arch-row { grid-template-columns: 60px 1fr; }
  /* collections: drop the URL onto its own line and let it wrap */
  .coll-item { grid-template-columns: 28px 1fr; }
  .coll-item .ci-url { grid-column: 2; justify-self: start; margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
}
