/* =============================================================
   ZEHAO.LOG — the tape stylesheet (the easter egg at /tape/; independent of the main site)

   Concept: a VHS tape found in a dream. Y2K retro-futurism (chrome
   wordmark, aqua gel buttons, holographic foil, orbit rings, a
   wireframe floor running to the horizon) over a dreamcore sky
   (WebGL clouds, static/tape/fx.js), with a thin analog-horror
   layer: camcorder OSD, tracking glitches, a moon that blinks at
   night, messages in the SIGNAL panel.

   Rule of the house: spectacle stays on the chrome. The reading
   paper is opaque, calm, serif, high contrast — no effect ever
   sits on top of body text.

   Themes: "day" (dreamcore sky) and "night" (after-hours tape).
   Default follows prefers-color-scheme; the toggle pins one via
   html[data-theme].
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --sky-1: #a9b6ff;
  --sky-2: #ddd6ff;
  --sky-3: #ffe1ee;

  --paper-rgb: 253, 252, 255;
  --paper: rgb(var(--paper-rgb));
  --glass: rgba(255, 255, 255, .64);
  --glass-strong: rgba(250, 249, 255, .93);
  --glass-edge: rgba(255, 255, 255, .9);

  --ink: #1b1930;
  --ink-2: #47445f;
  --ink-3: #7c7998;
  --line: rgba(38, 34, 92, .13);
  --line-2: rgba(38, 34, 92, .06);

  --blue: #2341f5;
  --blue-2: #5a76ff;
  --pink: #f2399f;
  --cyan: #1fc3f0;
  --lilac: #9b85ff;
  --rec: #ff3b3b;

  --osd: #ffffff;
  --osd-shadow: 0 0 1px rgba(14, 10, 50, .95), 1px 1px 0 rgba(14, 10, 50, .45), 0 0 10px rgba(40, 30, 120, .35);

  --shadow-soft: 0 1px 1px rgba(30, 20, 90, .04), 0 10px 30px -14px rgba(50, 40, 140, .28);
  --shadow-lift: 0 2px 2px rgba(30, 20, 90, .05), 0 22px 44px -18px rgba(60, 50, 190, .45);
  --paper-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 40px 90px -46px rgba(60, 40, 160, .55), 0 0 0 1px rgba(255, 255, 255, .7);

  --holo: linear-gradient(100deg, #7cf3ff 0%, #a9a1ff 20%, #ff9fd9 40%, #ffe7a3 60%, #a6ffda 80%, #7cf3ff 100%);
  --chrome: linear-gradient(180deg, #ffffff 0%, #eef1ff 15%, #b5bde0 33%, #5d6290 47%, #20234a 50%, #7380c0 54%, #cad3ff 69%, #ffffff 83%, #aab4dd 100%);
  --gel: linear-gradient(180deg, #c4e8ff 0%, #5aa6ff 46%, #2a68ff 52%, #64b8ff 100%);
  --gel-soft: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(226, 230, 255, .8));

  --measure: 44rem;     /* ~75 Latin / ~38 CJK characters a line */
  --paper-w: 56rem;
  --r-lg: 28px;
  --r-md: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --serif: 'Newsreader', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', 'STSong', Georgia, serif;
  --kai: 'Newsreader', 'Kaiti SC', 'STKaiti', 'KaiTi', 'Songti SC', 'Noto Serif SC', serif;
  --ui: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --display: 'Unbounded', 'Space Grotesk', 'PingFang SC', sans-serif;
  --vhs: 'VT323', 'Space Grotesk', 'PingFang SC', monospace;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html[data-theme="night"] {
  color-scheme: dark;
  --sky-1: #05040b;
  --sky-2: #120d27;
  --sky-3: #2b1238;
  --paper-rgb: 17, 16, 30;
  --glass: rgba(22, 20, 40, .62);
  --glass-strong: rgba(20, 18, 36, .93);
  --glass-edge: rgba(190, 180, 255, .13);
  --ink: #ebe8fa;
  --ink-2: #bab6d6;
  --ink-3: #807ca3;
  --line: rgba(190, 180, 255, .14);
  --line-2: rgba(190, 180, 255, .06);
  --blue: #97a7ff;
  --blue-2: #b9c3ff;
  --pink: #ff7fcf;
  --cyan: #62e0ff;
  --lilac: #b4a3ff;
  --osd: #eafff3;
  --osd-shadow: 0 0 2px rgba(0, 0, 0, .9), 0 0 12px rgba(120, 255, 200, .25);
  --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, .8);
  --shadow-lift: 0 22px 50px -18px rgba(0, 0, 0, .9), 0 0 30px -10px rgba(140, 120, 255, .25);
  --paper-shadow: 0 0 0 1px rgba(190, 180, 255, .1), 0 40px 90px -40px rgba(0, 0, 0, .9);
  --chrome: linear-gradient(180deg, #ffffff 0%, #d9dcff 15%, #8d93c9 33%, #3a3d6e 47%, #0d0e24 50%, #5662a8 54%, #aeb7ff 69%, #ffffff 83%, #8890c0 100%);
  --gel-soft: linear-gradient(180deg, rgba(60, 56, 100, .9), rgba(30, 28, 56, .85));
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="day"]) {
    color-scheme: dark;
    --sky-1: #05040b;
    --sky-2: #120d27;
    --sky-3: #2b1238;
    --paper-rgb: 17, 16, 30;
    --glass: rgba(22, 20, 40, .62);
    --glass-strong: rgba(20, 18, 36, .93);
    --glass-edge: rgba(190, 180, 255, .13);
    --ink: #ebe8fa;
    --ink-2: #bab6d6;
    --ink-3: #807ca3;
    --line: rgba(190, 180, 255, .14);
    --line-2: rgba(190, 180, 255, .06);
    --blue: #97a7ff;
    --blue-2: #b9c3ff;
    --pink: #ff7fcf;
    --cyan: #62e0ff;
    --lilac: #b4a3ff;
    --osd: #eafff3;
    --osd-shadow: 0 0 2px rgba(0, 0, 0, .9), 0 0 12px rgba(120, 255, 200, .25);
    --shadow-soft: 0 10px 30px -14px rgba(0, 0, 0, .8);
    --shadow-lift: 0 22px 50px -18px rgba(0, 0, 0, .9), 0 0 30px -10px rgba(140, 120, 255, .25);
    --paper-shadow: 0 0 0 1px rgba(190, 180, 255, .1), 0 40px 90px -40px rgba(0, 0, 0, .9);
    --chrome: linear-gradient(180deg, #ffffff 0%, #d9dcff 15%, #8d93c9 33%, #3a3d6e 47%, #0d0e24 50%, #5662a8 54%, #aeb7ff 69%, #ffffff 83%, #8890c0 100%);
    --gel-soft: linear-gradient(180deg, rgba(60, 56, 100, .9), rgba(30, 28, 56, .85));
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html {
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%) fixed;
}
/* last frame of the previous page's sky, painted before the shader is ready */
html.has-snap { background: var(--snap) center / cover no-repeat fixed, var(--sky-2); }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body.blog {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--blue); text-decoration: none; }
::selection { background: rgba(255, 111, 200, .3); color: inherit; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .5rem 1rem;
  background: var(--paper); color: var(--ink); border-radius: 999px; box-shadow: var(--shadow-soft);
}
.skip:focus { top: 1rem; }

/* Bilingual: both languages are baked into the HTML; html[data-lang] (set
   before first paint) decides which one renders. */
html[data-lang="cn"] .l10n[data-lang="en"],
html:not([data-lang="cn"]) .l10n[data-lang="cn"],
html[data-lang="cn"] :is(.post-list, .tag-row, .post-lang)[data-lang="en"],
html:not([data-lang="cn"]) :is(.post-list, .tag-row, .post-lang)[data-lang="cn"] { display: none !important; }
html[data-lang="cn"] :is(.post-list, .post-lang)[data-lang="cn"],
html:not([data-lang="cn"]) :is(.post-list, .post-lang)[data-lang="en"] { display: block !important; }
html[data-lang="cn"] .tag-row[data-lang="cn"],
html:not([data-lang="cn"]) .tag-row[data-lang="en"] { display: flex !important; }

/* ---------- Fixed atmosphere: sky, grain ---------- */
.sky {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0;
  display: block; opacity: 0; transition: opacity .35s ease;
  pointer-events: none;
}
.sky.ready { opacity: 1; }
.grain { display: none; }
.site { position: relative; z-index: 2; }

/* ---------- Toy layer (static/tape/toys.js) ----------
   Toys live behind the content. .site lets pointer events fall through
   wherever it has nothing to show, so empty sky / floor is clickable. */
.toys { position: fixed; inset: 0; z-index: 1; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.site { pointer-events: none; }
.site :is(.hero > *, .panel, .year-head, .post-entry, .list-status, .empty,
          .post-head > *, .paper, .toc, .site-foot > *) { pointer-events: auto; }

.bubble {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; will-change: transform; animation: bubble-in .8s ease-out both; background:
    radial-gradient(circle at 31% 27%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, 0) 19%),
    radial-gradient(circle at 70% 76%, rgba(255, 255, 255, .45) 0 4%, rgba(255, 255, 255, 0) 12%),
    radial-gradient(circle, rgba(255, 255, 255, .02) 55%, rgba(255, 255, 255, .2) 78%, rgba(255, 255, 255, 0) 86%);
}
.bubble::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, #7cf3ff, #c9a8ff, #ff9fd9, #fff0b0, #a6ffda, #7cf3ff);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 74%, #000 84%, transparent 87%);
  mask: radial-gradient(circle, transparent 62%, #000 74%, #000 84%, transparent 87%);
  opacity: .7; animation: orb-spin 6s linear infinite;
}
.bubble.popping { animation: bubble-pop .2s ease-out forwards; pointer-events: none; }
@keyframes bubble-pop { to { scale: 1.45; opacity: 0; } }
@keyframes bubble-in { from { scale: .2; opacity: 0; } }
.drop {
  position: absolute; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 6px rgba(170, 150, 255, .9); pointer-events: none;
  animation: drop .55s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes drop { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }

.orb-toy { position: absolute; left: 0; top: 0; width: 34px; height: 34px; cursor: pointer; touch-action: none; animation: orb-spin 4s linear infinite; }
.brand .orb { transition: transform .4s var(--ease), opacity .3s; }
.brand .orb.is-gone { transform: scale(0); opacity: 0; }
.brand .orb.wobble { animation: orb-spin 9s linear infinite, wobble .35s var(--ease); }
@keyframes wobble { 30% { transform: scale(1.3) rotate(-12deg); } 60% { transform: scale(.9) rotate(8deg); } }

.dolphin { position: absolute; left: 0; top: 0; width: 124px; height: 55px; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(80, 60, 200, .45)); }
.dolphin svg { width: 100%; height: 100%; display: block; }
.dolphin.flip svg { transform: scaleX(-1); }

/* floaters (static/tape/floaters.js) */
.floater {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer;
  will-change: transform; opacity: 0; transition: opacity 1.2s ease; -webkit-tap-highlight-color: transparent;
}
.floater.on { opacity: .94; }
.floater .f-in { display: block; transition: transform .35s var(--ease), filter .35s; }
.floater:hover .f-in { transform: scale(1.1); filter: brightness(1.06); }
.f-album img {
  display: block; border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 14px 26px -12px rgba(30, 20, 90, .6);
}
.f-album .f-in { position: relative; }
.f-album .f-in::after {
  content: ""; position: absolute; inset: 0; border-radius: 5px; pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .15));
}
.disc {
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #fff 0 18%, #eef0ff 46%, #c7cdf6 100%);
  box-shadow: inset 0 -5px 10px rgba(80, 70, 170, .25), inset 0 2px 2px #fff, 0 10px 20px -10px rgba(30, 20, 90, .55);
}
.disc img { width: 56%; height: 56%; display: block; }
.f-statue img {
  display: block; width: auto;
  filter: drop-shadow(3px 0 0 rgba(255, 90, 190, .35)) drop-shadow(-3px 0 0 rgba(60, 220, 255, .35)) drop-shadow(0 16px 20px rgba(40, 20, 100, .35));
}
.f-touhou img, .f-relic img {
  display: block; filter: drop-shadow(0 12px 14px rgba(40, 20, 100, .3));
  animation: sprite-bob 1.8s ease-in-out infinite alternate;
}
.art-touhou img, .art-relic img { max-height: 16rem; max-width: 80%; filter: drop-shadow(0 18px 24px rgba(40, 20, 100, .3)); }
.card-credit { display: block; margin: .1rem 0 .3rem; font: .72rem/1.45 var(--ui); color: var(--ink-3); text-align: left; }
a.card-credit:hover { color: var(--blue); }
.sprite {
  display: block; image-rendering: pixelated; background-repeat: no-repeat; background-position: 0 0;
  animation: sprite-blink 4.6s steps(1) infinite, sprite-bob 1.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 8px 6px rgba(40, 20, 100, .25));
}
@keyframes sprite-blink { 0%, 93%, 100% { background-position: 0 0; } 94%, 97% { background-position: calc(-1 * var(--fw)) 0; } }
@keyframes sprite-bob { from { translate: 0 0; } to { translate: 0 -5px; } }

@keyframes k-spin { to { transform: rotate(360deg); } }

/* floater cards */
.zj-card { width: min(24rem, 100%); }
.zj-card .dlg-body { text-align: center; padding-top: 1.3rem; }
.card-art { display: grid; place-items: center; min-height: 9rem; margin-bottom: 1rem; }
.art-album img { width: min(15rem, 70vw); aspect-ratio: 1; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 24px 44px -20px rgba(30, 20, 90, .6); }
.art-statue img { max-height: 15rem; max-width: 80%; filter: drop-shadow(0 18px 24px rgba(40, 20, 100, .35)); }
.art-ai .disc { width: 7.5rem; height: 7.5rem; }
.art-touhou { min-height: 0; }
.card-title { margin: 0; font: 600 1.3rem/1.3 var(--serif); color: var(--ink); text-wrap: balance; }
html[lang^="zh"] .card-title { font-weight: 700; font-size: 1.2rem; }
.card-alt { margin: .15rem 0 0; font: 400 .9rem/1.3 var(--serif); color: var(--ink-3); }
.card-sub { margin: .45rem 0 .9rem; font: 1.05rem/1 var(--vhs); letter-spacing: .1em; color: var(--blue); }
html[lang^="zh"] .card-sub { font-family: var(--ui); font-size: .8rem; letter-spacing: .06em; }
.card-blurb { margin: 0 0 .6rem; font: 400 .92rem/1.6 var(--ui); color: var(--ink-2); text-align: left; }
.card-blurb.alt { font-size: .82rem; color: var(--ink-3); padding-top: .55rem; border-top: 1px dashed var(--line); }
.card-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.card-go, .card-close {
  display: inline-flex; align-items: center; padding: .58rem 1.1rem; border-radius: 999px; cursor: pointer;
  font: 600 .86rem/1 var(--ui);
}
.card-go { color: #fff; background: var(--gel); border: 1px solid rgba(30, 80, 255, .55); text-shadow: 0 1px 1px rgba(0, 20, 90, .45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 6px 16px -6px rgba(40, 100, 255, .6); }
.card-go:hover { color: #fff; filter: brightness(1.08); }
.card-close { color: var(--ink-2); background: var(--gel-soft); border: 1px solid var(--line); }
.card-close:hover { color: var(--ink); }

/* busy channels: give free-standing text a frosted backing so it stays readable */
html[data-scene]:not([data-scene="dream"]) .post-head {
  max-width: var(--paper-w); margin: 0 auto 1.1rem; padding: 2rem 1.5rem 2.2rem;
  border-radius: var(--r-lg); background: var(--glass-strong);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-soft);
}
html[data-scene]:not([data-scene="dream"]) :is(.hero-kicker, .hero-sub, .site-foot > p) {
  padding: .45rem .95rem; border-radius: 14px; background: var(--glass-strong);
}
html[data-scene]:not([data-scene="dream"]) .site-foot > p { display: inline-block; }
html[data-scene]:not([data-scene="dream"]) :is(.yh-side, .list-status, .eot) { text-shadow: 0 0 6px var(--paper), 0 0 14px var(--paper); }

/* background channel switcher */
.gel-btn rect, .gel-btn path { vector-effect: non-scaling-stroke; }
#scene-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chan-menu {
  position: fixed; z-index: 70; width: 16.5rem; padding: .45rem; border-radius: 18px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift);
  animation: dlg-in .3s var(--ease) both;
}
.chan-item {
  display: grid; grid-template-columns: 2.2rem 2.9rem 1fr; align-items: center; gap: .5rem; width: 100%;
  padding: .45rem .55rem; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left;
  font: 500 .88rem/1.2 var(--ui); color: var(--ink-2);
}
.chan-item:hover, .chan-item:focus-visible { background: var(--line-2); color: var(--ink); outline: none; }
.chan-item.is-on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px -4px rgba(40, 30, 120, .35); }
.chan-item b { font: 1.15rem/1 var(--vhs); font-weight: 400; color: var(--ink-3); letter-spacing: .06em; }
.chan-item.is-on b { color: var(--blue); }
.chan-item i { width: 2.2rem; height: 1.45rem; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.ch-dream i { background: linear-gradient(#aab6ff, #e8dcff 60%, #c9b8ff 62%, #ffd9ec); }
.ch-halls i { background: linear-gradient(#d8cf9a 0 22%, #c9b45e 22% 70%, #8b7a3e 70%); }
.ch-pool i { background: linear-gradient(#e9f4f6 0 45%, #bfe0e6 45% 62%, #4fb3c8 62%); }
.ch-arcade i { background: linear-gradient(90deg, #ff4fb0 0 20%, #12131c 20% 40%, #4fe0ff 40% 60%, #12131c 60% 80%, #ffd25a 80%); }
.ch-train i { background: linear-gradient(#ecebe6 0 26%, #6fc3e6 26% 34%, #1a1d24 34% 56%, #ecebe6 56% 66%, #1f4fc9 66% 82%, #8b97a8 82%); }
.ch-city i { background: repeating-linear-gradient(90deg, #3a3d40 0 4px, #ffcf7a 4px 6px, #3a3d40 6px 9px); }
.chan-flash { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.chan-static {
  position: absolute; inset: -60px; background-color: #0a0a12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px; animation: vb-static .3s steps(5) infinite;
  transition: opacity .35s ease;
}
.chan-osd {
  position: fixed; left: 1.6rem; top: 5.2rem; z-index: 60; pointer-events: none;
  font: 2.1rem/1 var(--vhs); letter-spacing: .08em; color: #8dffb0;
  text-shadow: 0 0 2px #000, 0 0 14px rgba(120, 255, 170, .55);
  transition: opacity .6s ease 1.2s;
}
.chan-flash.out .chan-static { opacity: 0; }
.chan-osd.out { opacity: 0; }

.chan-cycle { margin-top: .3rem; border-top: 1px dashed var(--line); border-radius: 0 0 12px 12px; padding-top: .55rem; }
.chan-cycle i { display: grid; place-items: center; font: 700 1rem/1 var(--ui); font-style: normal; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.chan-cycle.is-on i { color: #fff; background: var(--gel); box-shadow: none; }

/* bottom-left dock: bubbles + music */
.dock {
  position: fixed; left: 1.3rem; bottom: 4.9rem; z-index: 45;
  display: flex; flex-direction: column; align-items: flex-start; gap: .4rem;
}
.dock-btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .8rem .36rem .45rem;
  border-radius: 999px; cursor: pointer; border: 1px solid var(--glass-edge);
  background: var(--glass-strong); box-shadow: var(--shadow-soft);
  font: 1.05rem/1 var(--vhs); letter-spacing: .06em; color: var(--ink-2);
  transition: transform .15s, color .2s, border-color .2s;
}
html[lang^="zh"] .dock-btn span { font-family: var(--ui); font-size: .78rem; letter-spacing: .04em; }
.dock-btn:hover { color: var(--ink); border-color: var(--blue-2); transform: translateY(-1px); }
.dock-btn .db-ico {
  width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 50%; font-style: normal;
  font: 700 .8rem/1 var(--ui); color: var(--blue); background: var(--line-2);
}
.dock-btn.is-on .db-ico { color: #fff; background: var(--gel); animation: orb-spin 3s linear infinite; }
.bgm-menu {
  position: fixed; z-index: 72; width: 17rem; padding: .4rem; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift);
  animation: dlg-in .25s var(--ease) both;
}
.bgm-item { display: block; width: 100%; text-align: left; padding: .5rem .65rem; border: 0; border-radius: 11px; background: none; cursor: pointer; }
.bgm-item:hover, .bgm-item.is-on { background: var(--paper); }
.bgm-item b { display: block; font: 600 .86rem/1.3 var(--ui); color: var(--ink); }
.bgm-item span { display: block; font: .78rem/1.3 var(--ui); color: var(--ink-3); }
.bgm-item.is-on b::before { content: "▶ "; color: var(--blue); }
.bgm-win {
  position: fixed; left: 1.3rem; bottom: 10.6rem; z-index: 46; width: 214px; padding: 0 7px 8px;
  border-radius: 14px; overflow: hidden; background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 24px 50px -20px rgba(20, 10, 80, .6);
  animation: dlg-in .3s var(--ease) both;
}
.bgm-head {
  display: flex; align-items: center; gap: .5rem; margin: 0 -7px 7px; padding: .38rem .45rem .38rem .75rem;
  background: linear-gradient(90deg, #1d36d0, #5f7dff 55%, #b18cff);
  font: 1rem/1 var(--vhs); letter-spacing: .1em; color: #fff;
}
.bgm-head span { flex: 1; }
.bgm-yt { font: 600 .7rem/1 var(--ui); color: #fff; opacity: .85; }
.bgm-yt:hover { color: #fff; opacity: 1; }
.bgm-x { width: 1.45rem; height: 1.35rem; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer; font: 700 .85rem/1 var(--ui); }
.bgm-slot { width: 200px; height: 200px; border-radius: 8px; overflow: hidden; background: #000; }
.bgm-slot iframe { display: block; width: 200px; height: 200px; border: 0; }
.bgm-meta { padding: .5rem .2rem 0; }
.bgm-meta b { display: block; font: 600 .8rem/1.3 var(--ui); color: var(--ink); }
.bgm-meta span { display: block; font: .74rem/1.3 var(--ui); color: var(--ink-3); }

/* walking & explore mode */
.walk-hint {
  position: fixed; left: 50%; bottom: 2.2rem; z-index: 80; transform: translateX(-50%); pointer-events: none;
  padding: .55rem 1.1rem .5rem; border-radius: 999px; white-space: nowrap;
  background: rgba(10, 8, 24, .78); color: #dfffe8; font: 1.15rem/1 var(--vhs); letter-spacing: .08em;
  box-shadow: 0 0 0 1px rgba(140, 255, 180, .25), 0 10px 30px rgba(0, 0, 0, .35);
  transition: opacity .7s ease;
}
html[lang^="zh"] .walk-hint { font-family: var(--ui); font-size: .82rem; }
.walk-hint.out { opacity: 0; }
.explore-exit {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 81; transform: translateX(-50%); display: none;
  padding: .55rem 1.1rem .5rem; border-radius: 999px; cursor: pointer; border: 1px solid rgba(140, 255, 180, .35);
  background: rgba(10, 8, 24, .72); color: #dfffe8; font: 1.05rem/1 var(--vhs); letter-spacing: .08em;
}
html[lang^="zh"] .explore-exit { font-family: var(--ui); font-size: .8rem; }
html.explore .explore-exit { display: block; }
html.explore :is(.site, .topbar, .dock, .bgm-win, .zj-toasts, .floater, .bubble, .tape-progress) {
  opacity: 0 !important; pointer-events: none !important; transition: opacity .5s ease;
}
html.explore .toys { pointer-events: none; }
@media (max-width: 700px) { .floater.flock .f-in { transform: scale(.62); } }

/* OSD play button pauses the tape */
.osd-play { pointer-events: auto; cursor: pointer; }
.osd-play:hover { color: var(--cyan); }
html.paused :is(.grain, .wm-text, .wm::before, .wm::after, .wm-star, .orb, .bubble::before, .post-entry::after,
  .paper::before, .sig-bars i, .cursor, .rec, .scroll-cue span, .searchwrap::before, .floater *) { animation-play-state: paused !important; }
html.ff .wm-text { animation: ff-hue .5s linear infinite; }
@keyframes ff-hue { to { filter: hue-rotate(360deg) drop-shadow(0 6px 20px rgba(110, 90, 255, .5)); } }
.y2k-flip { color: var(--pink) !important; animation: rgb-split .3s steps(3, end) 4; }
.yh-num.y2k-flip { -webkit-text-fill-color: var(--pink); }

/* toasts — XP balloon, Y2K finish */
.zj-toasts {
  position: fixed; right: 1.2rem; bottom: 5rem; z-index: 85; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end; gap: .6rem;
}
.zj-toast {
  position: relative; pointer-events: auto;
  width: min(21rem, calc(100vw - 2rem)); padding: .8rem 1rem .85rem 3.2rem; border-radius: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lift);
  animation: toast-in .55s var(--ease) both;
}
.zj-toast::before {
  content: "★"; position: absolute; left: .85rem; top: 50%; width: 1.75rem; height: 1.75rem; margin-top: -.875rem;
  display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: .9rem;
  background: var(--gel); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 3px 10px rgba(40, 100, 255, .45);
}
.zj-toast b { display: block; margin-bottom: .25rem; font: 1.05rem/1 var(--vhs); letter-spacing: .1em; color: var(--blue); font-weight: 400; }
.zj-toast span { display: block; font: 500 .88rem/1.45 var(--ui); color: var(--ink); }
.zj-toast.out { animation: toast-out .4s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* dialogs — a Win98 window that went to art school */
.zj-dialog-backdrop {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 1rem;
  background: rgba(20, 16, 50, .28); animation: fade-in .2s ease both;
}
@keyframes fade-in { from { opacity: 0; } }
.zj-dialog {
  width: min(27rem, 100%); max-height: min(82vh, 42rem); display: flex; flex-direction: column;
  border-radius: 16px; overflow: hidden; background: var(--paper);
  box-shadow: 0 34px 90px -24px rgba(20, 10, 80, .6), 0 0 0 1px var(--line);
  animation: dlg-in .4s var(--ease) both;
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.zj-dialog header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem .55rem .5rem .95rem;
  background: linear-gradient(90deg, #1d36d0, #5f7dff 55%, #b18cff);
  font: 1.2rem/1 var(--vhs); letter-spacing: .1em; color: #fff;
}
.zj-dialog header button {
  width: 1.75rem; height: 1.6rem; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .65); background: rgba(255, 255, 255, .18);
  font: 700 1rem/1 var(--ui); color: #fff;
}
.zj-dialog header button:hover { background: #ff5ca8; }
.dlg-body { padding: 1rem 1.15rem 1.25rem; overflow: auto; font-family: var(--ui); }
.dlg-lead { margin: 0 0 .6rem; font-size: .9rem; color: var(--ink-2); }
.dlg-meter { height: 10px; margin-bottom: .6rem; border-radius: 999px; background: var(--line-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(30, 20, 90, .12); }
.dlg-meter::after { content: ""; display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--holo); border-radius: inherit; }
.secret { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.secret:last-child { border-bottom: 0; }
.secret i {
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  font: 1.1rem/1 var(--vhs); font-style: normal; color: var(--ink-3); background: var(--line-2);
}
.secret.is-found i { color: #fff; background: var(--gel); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7); }
.secret b { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); }
.secret span { display: block; font-size: .82rem; line-height: 1.45; color: var(--ink-3); }
.keys { display: flex; flex-direction: column; gap: .55rem; }
.key-row { display: grid; grid-template-columns: 4rem 1fr; align-items: center; gap: .8rem; font-size: .9rem; color: var(--ink-2); }
.key-row kbd {
  justify-self: start; min-width: 2.1rem; text-align: center; padding: .28rem .5rem .22rem; border-radius: 7px;
  font: 1.1rem/1 var(--vhs); color: var(--ink); background: var(--gel-soft);
  border: 1px solid var(--line); box-shadow: 0 2px 0 var(--line);
}
.dlg-foot { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px dashed var(--line); font-size: .84rem; color: var(--ink-3); }

.foot-tools { display: flex; justify-content: center; gap: .5rem; margin-top: 1.1rem; }
.foot-btn {
  padding: .42rem .9rem .36rem; border-radius: 999px; cursor: pointer;
  font: 1.08rem/1 var(--vhs); letter-spacing: .08em; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow-soft);
  transition: color .2s, border-color .2s, transform .15s;
}
html[lang^="zh"] .foot-btn span { font-family: var(--ui); font-size: .78rem; }
.foot-btn b { font-weight: 400; color: var(--blue); }
.foot-btn:hover { color: var(--ink); border-color: var(--blue-2); transform: translateY(-1px); }

/* ---------- Top bar (floating glass pill) ---------- */
.topbar {
  position: fixed; z-index: 50; top: 14px; left: 50%;
  width: min(calc(100% - 24px), 74rem);
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .4rem .45rem .4rem .8rem;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  transition: transform .5s var(--ease), opacity .4s ease;
  view-transition-name: topbar;
}
.topbar.is-hidden { transform: translate(-50%, calc(-100% - 24px)); opacity: 0; }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-weight: 600; font-size: .78rem; letter-spacing: .12em;
  color: var(--ink);
}
.brand b { color: var(--pink); font-weight: 800; }
.orb {
  width: 22px; height: 22px; border-radius: 50%; flex: none; position: relative;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 12%, rgba(255, 255, 255, 0) 34%),
    conic-gradient(from 200deg, #7cf3ff, #a993ff, #ff9fd9, #ffe7a3, #a6ffda, #7cf3ff);
  box-shadow: inset 0 -3px 6px rgba(40, 20, 120, .35), 0 2px 8px rgba(120, 100, 255, .45);
  animation: orb-spin 9s linear infinite;
}
@keyframes orb-spin { to { transform: rotate(360deg); } }
.brand:hover .orb { animation-duration: 1.4s; }
.tb-nav { display: flex; align-items: center; gap: .45rem; }
.tb-link {
  font-weight: 500; font-size: .88rem; color: var(--ink-2);
  padding: .45rem .8rem; border-radius: 999px;
  transition: color .2s, background .2s;
}
.tb-link:hover { color: var(--ink); background: var(--line-2); }

/* aqua gel buttons */
.gel-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.4rem; height: 2.15rem; padding: 0 .85rem;
  font: 600 .84rem/1 var(--ui); letter-spacing: .02em;
  color: var(--ink); cursor: pointer;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--gel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 3px rgba(30, 20, 90, .12);
  transition: transform .15s ease, box-shadow .25s, color .2s;
}
.gel-btn::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 2px; height: 42%;
  border-radius: 999px; background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.gel-btn:hover {
  color: #fff; border-color: rgba(30, 80, 255, .5);
  background: var(--gel);
  text-shadow: 0 1px 1px rgba(0, 20, 90, .45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 4px 14px rgba(40, 100, 255, .45);
}
.gel-btn:active { transform: scale(.95); }
.gel-btn.icon { padding: 0; width: 2.15rem; }
.gel-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.gel-btn .i-moon { fill: currentColor; stroke: none; }
.gel-btn .i-moon { display: none; }
html[data-theme="night"] .gel-btn .i-moon { display: block; }
html[data-theme="night"] .gel-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="day"]) .gel-btn .i-moon { display: block; }
  html:not([data-theme="day"]) .gel-btn .i-sun { display: none; }
}

/* ---------- Camcorder OSD ---------- */
.osd {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; pointer-events: none;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 1.5rem 1.1rem;
  font: 1.5rem/1 var(--vhs); letter-spacing: .06em;
  color: var(--osd); text-shadow: var(--osd-shadow);
  opacity: .88;
  view-transition-name: osd;
}
.osd-l, .osd-r { display: flex; flex-direction: column; gap: .25rem; }
.osd-r { align-items: flex-end; }
.osd-tc small { font-size: .75em; opacity: .75; margin-left: .35em; }
.osd-play { display: inline-flex; gap: .4em; }
.blog-post .osd { opacity: .7; }

/* ---------- VHS boot overlay (portal arrival only) ---------- */
.vhs-boot { display: none; }
html.boot .vhs-boot {
  display: block; position: fixed; inset: 0; z-index: 999; pointer-events: none;
  background: #06050d;
  animation: vb-out 1.35s steps(14, end) forwards;
}
.vb-static {
  position: absolute; inset: -60px;
  background-image: var(--static); background-size: 220px 220px;
  opacity: .85;
  animation: vb-static .32s steps(5) infinite, vb-static-fade 1.35s ease-in forwards;
}
.vb-band {
  position: absolute; left: 0; right: 0; height: 18vh; top: -20vh;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .55) 45%, rgba(255, 255, 255, .9) 50%, rgba(255, 255, 255, .4) 56%, transparent);
  mix-blend-mode: screen; filter: blur(1px);
  animation: vb-band .55s linear 2;
}
.vb-osd {
  position: absolute; left: 1.6rem; top: 1.4rem; right: 1.6rem;
  display: flex; justify-content: space-between;
  font: 2rem/1 var(--vhs); color: #fff; text-shadow: 0 0 2px #000, 0 0 12px rgba(255, 255, 255, .5);
}
.vb-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  font: 1.6rem/1 var(--vhs); letter-spacing: .3em; color: #fff; text-shadow: 0 0 2px #000;
}
.vb-center span { letter-spacing: .05em; color: #9ff; }
@keyframes vb-static { 0% { transform: translate(0, 0); } 25% { transform: translate(-30px, 40px); } 50% { transform: translate(40px, -20px); } 75% { transform: translate(-50px, -40px); } 100% { transform: translate(0, 0); } }
@keyframes vb-static-fade { 0%, 35% { opacity: .9; } 70% { opacity: .25; } 100% { opacity: 0; } }
@keyframes vb-band { to { top: 105vh; } }
@keyframes vb-out {
  0%, 38% { opacity: 1; background-color: #06050d; }
  52% { opacity: .9; background-color: rgba(6, 5, 13, .5); }
  70% { opacity: .55; background-color: rgba(6, 5, 13, .1); }
  100% { opacity: 0; visibility: hidden; background-color: transparent; }
}
html.boot .site, html.boot .topbar { animation: tape-in 1.35s linear both; }
@keyframes tape-in {
  0%, 36% { opacity: 0; transform: translateX(0) skewX(0); filter: blur(4px) saturate(3); }
  42% { opacity: 1; transform: translateX(-26px) skewX(10deg); filter: blur(3px) saturate(3) hue-rotate(40deg); }
  48% { transform: translateX(18px) skewX(-6deg); }
  55% { transform: translateX(-8px) skewX(3deg); filter: blur(1.5px) saturate(1.8); }
  64% { transform: translateX(4px) skewX(-1deg); filter: blur(.6px); }
  76%, 100% { opacity: 1; transform: none; filter: none; }
}
html.boot .topbar { animation-name: tape-in-bar; }
@keyframes tape-in-bar {
  0%, 40% { opacity: 0; } 50% { opacity: 1; } 56% { opacity: .3; } 62%, 100% { opacity: 1; }
}

/* CRT power-off (leaving the blog for the homepage) */
.crt {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
}
.crt i { position: absolute; left: 0; right: 0; background: #05040b; }
.crt .lid-t { top: 0; height: 50%; transform: translateY(-100%); animation: lid-t .26s cubic-bezier(.7, 0, .9, .4) forwards; }
.crt .lid-b { bottom: 0; height: 50%; transform: translateY(100%); animation: lid-b .26s cubic-bezier(.7, 0, .9, .4) forwards; }
.crt .beam {
  top: 50%; height: 3px; margin-top: -1.5px; background: #fff; opacity: 0;
  box-shadow: 0 0 18px 4px rgba(200, 220, 255, .9), 0 0 60px 10px rgba(160, 140, 255, .6);
  animation: beam .5s ease-in .2s forwards;
}
@keyframes lid-t { to { transform: translateY(-2px); } }
@keyframes lid-b { to { transform: translateY(2px); } }
@keyframes beam {
  0% { opacity: 1; transform: scaleX(1); }
  55% { opacity: 1; transform: scaleX(.004) scaleY(1.6); }
  100% { opacity: 0; transform: scaleX(0) scaleY(0); }
}

/* ---------- Index: hero ---------- */
.hero {
  position: relative; text-align: center;
  padding: clamp(7.5rem, 20vh, 12rem) 1.25rem clamp(4rem, 10vh, 6.5rem);
  min-height: min(92vh, 56rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.skip, .topbar, .hero-kicker, .wordmark, .hero-stats, .yh-num, .yh-side, .osd, .eot, .post-kicker { -webkit-user-select: none; user-select: none; }
.hero-kicker {
  margin: 0 0 1.1rem; font: 1.35rem/1 var(--vhs); letter-spacing: .08em;
  color: var(--ink-2);
}
.cursor {
  display: inline-block; width: .5em; height: .95em; margin-left: .2em; vertical-align: -.1em;
  background: currentColor; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.wordmark { margin: 0; line-height: 1; font-weight: 400; }
.wm {
  position: relative; display: inline-block;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.7rem, 12.4vw, 9.6rem); letter-spacing: -.035em; line-height: .95;
  padding: .12em .1em .16em;
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
  transform-style: preserve-3d;
  transition: transform .2s linear;
}
.wm-text {
  position: relative; z-index: 2; display: inline-block;
  background:
    linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) 160% 0 / 250% 100% no-repeat,
    var(--chrome);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 -1px 0 rgba(255, 255, 255, .9)) drop-shadow(0 2px 0 rgba(255, 255, 255, .85)) drop-shadow(0 5px 0 rgba(60, 50, 140, .28)) drop-shadow(0 22px 36px rgba(110, 90, 255, .38));
}
@keyframes sheen {
  0%, 55% { background-position: 160% 0, 0 0; }
  100% { background-position: -60% 0, 0 0; }
}
/* RGB ghosts that tear apart for a moment every few seconds */
.wm::before, .wm::after {
  content: attr(data-text); position: absolute; inset: 0; z-index: 1;
  padding: inherit; color: transparent; pointer-events: none;
  -webkit-text-stroke: 0; opacity: 0;
}
.wm::before { color: rgba(255, 60, 170, .55); animation: ghost-a 6.5s steps(1) infinite; }
.wm::after { color: rgba(40, 210, 255, .55); animation: ghost-b 6.5s steps(1) infinite; }
@keyframes ghost-a {
  0%, 89%, 100% { opacity: 0; transform: none; clip-path: none; }
  90% { opacity: 1; transform: translate(-6px, 2px); clip-path: inset(10% 0 55% 0); }
  92% { opacity: 1; transform: translate(5px, -1px); clip-path: inset(60% 0 8% 0); }
  94% { opacity: 1; transform: translate(-3px, 0); clip-path: inset(30% 0 40% 0); }
}
@keyframes ghost-b {
  0%, 89%, 100% { opacity: 0; transform: none; clip-path: none; }
  90% { opacity: 1; transform: translate(6px, -2px); clip-path: inset(50% 0 20% 0); }
  92% { opacity: 1; transform: translate(-5px, 1px); clip-path: inset(5% 0 70% 0); }
  94% { opacity: 1; transform: translate(3px, 0); clip-path: inset(70% 0 5% 0); }
}
.wm-orbit {
  position: absolute; left: -6%; top: 2%; width: 112%; height: 100%; z-index: 0;
  overflow: visible; opacity: .8;
  transform: rotate(-8deg) translateZ(-40px);
}
.wm-orbit circle { filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 12px #a993ff); }
.wm-star {
  position: absolute; z-index: 3; right: 1%; top: 2%;
  width: .36em; height: .36em;
  background: #fff;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .9));
  animation: twinkle 3.2s ease-in-out infinite;
}
.wm-star.s2 { right: auto; left: 3%; top: auto; bottom: 8%; width: .2em; height: .2em; animation-delay: -1.6s; }
@keyframes twinkle {
  0%, 100% { transform: scale(.55) rotate(0); opacity: .6; }
  50% { transform: scale(1.1) rotate(45deg); opacity: 1; }
}
.hero-sub {
  max-width: 34rem; margin: 1.6rem auto 0;
  font: italic 400 1.22rem/1.55 var(--serif); color: var(--ink-2);
  text-wrap: balance;
}
html[lang^="zh"] .hero-sub { font-style: normal; font-size: 1.08rem; line-height: 1.8; letter-spacing: .04em; }
.hero-stats {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem;
}
.hero-stats li {
  display: inline-flex; align-items: baseline; gap: .45rem;
  padding: .42rem .95rem .38rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  font: 1.12rem/1 var(--vhs); letter-spacing: .06em; color: var(--ink-3);
  box-shadow: var(--shadow-soft);
}
html[lang^="zh"] .hero-stats li span { font-family: var(--ui); font-size: .8rem; letter-spacing: .04em; }
.hero-stats b { font-weight: 400; color: var(--ink); font-size: 1.25rem; }
.scroll-cue {
  position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border-radius: 999px;
  border: 1.5px solid var(--ink-3); opacity: .7;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 4px; background: var(--ink-2);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }

/* hero entrance (normal page loads) */
html.js .hero > :not(.scroll-cue) { animation: rise 1s var(--ease) both; }
html.js .hero > :nth-child(2) { animation-delay: .08s; }
html.js .hero > :nth-child(3) { animation-delay: .2s; }
html.js .hero > :nth-child(4) { animation-delay: .3s; }
html.js .hero > :nth-child(5) { animation-delay: .6s; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
html.js .hero > .wordmark { animation-name: rise-wm; animation-duration: 1.3s; }
@keyframes rise-wm { from { opacity: 0; transform: translateY(30px) scale(.94); filter: blur(14px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- Index: archive layout ---------- */
.archive {
  display: grid; grid-template-columns: 16.5rem minmax(0, 47rem);
  justify-content: center; gap: 2.4rem;
  max-width: 74rem; margin: 0 auto; padding: 0 1.25rem 4rem;
}
.rail-sticky { position: sticky; top: 5.4rem; }

.panel {
  background: var(--glass); border: 1px solid var(--glass-edge);
  border-radius: var(--r-md); box-shadow: var(--shadow-soft);
  padding: .75rem .85rem .95rem;
}
.panel + .panel { margin-top: .85rem; }
.panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 .7rem; font: 1.05rem/1 var(--vhs); letter-spacing: .14em; color: var(--ink-3);
}
.panel-bar > i {
  width: 8px; height: 8px; border-radius: 50%; margin-right: 24px;
  background: #ff7cbd; box-shadow: 12px 0 0 #ffd36f, 24px 0 0 #6fe0a8;
}

/* search */
.searchwrap { position: relative; display: flex; align-items: center; }
.searchwrap::before {
  content: ""; position: absolute; inset: -2px; border-radius: 999px;
  background: var(--holo); background-size: 200% 100%;
  opacity: 0; transition: opacity .3s; z-index: 0;
}
.searchwrap:focus-within::before { opacity: 1; animation: holo-pan 4s linear infinite; }
@keyframes holo-pan { to { background-position: 200% 0; } }
.searchwrap .s-ico { position: absolute; left: .8rem; width: 1rem; height: 1rem; color: var(--ink-3); pointer-events: none; z-index: 2; }
#post-search {
  position: relative; z-index: 1;
  width: 100%; padding: .62rem 2.3rem .62rem 2.3rem;
  font: 500 .92rem var(--ui); color: var(--ink);
  border-radius: 999px; border: 1px solid var(--line); outline: none;
  background: var(--paper);
  box-shadow: inset 0 2px 4px rgba(30, 20, 90, .08);
  -webkit-appearance: none; appearance: none;
}
#post-search::placeholder { color: var(--ink-3); }
#post-search::-webkit-search-cancel-button { display: none; }
#post-search:focus { border-color: transparent; }
.s-clear {
  position: absolute; right: .4rem; z-index: 2; width: 1.6rem; height: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  font: 1rem/1 var(--ui); color: #fff; background: var(--ink-3);
}
.s-clear:hover { background: var(--pink); }

/* tag chips — gel pills */
.tag-row { display: flex; flex-wrap: wrap; gap: .38rem .32rem; }
.chip {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .34rem .7rem .32rem; border-radius: 999px; cursor: pointer;
  font: 500 .78rem/1.15 var(--ui); color: var(--ink-2);
  border: 1px solid var(--line); background: var(--gel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 2px rgba(30, 20, 90, .08);
  transition: color .2s, border-color .2s, transform .15s, box-shadow .25s;
}
.chip:hover { color: var(--ink); border-color: var(--blue-2); transform: translateY(-1px); }
.chip .count { font: .95rem/1 var(--vhs); color: var(--ink-3); }
.chip.is-active {
  color: #fff; border-color: rgba(30, 80, 255, .6);
  background: var(--gel);
  text-shadow: 0 1px 1px rgba(0, 20, 90, .5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 3px 10px rgba(40, 100, 255, .45);
}
.chip.is-active::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: 1px; height: 45%;
  border-radius: 999px; background: linear-gradient(rgba(255, 255, 255, .85), rgba(255, 255, 255, .05));
}
.chip.is-active .count { color: rgba(255, 255, 255, .8); }
.tag-row.collapsed .chip:nth-child(n+13):not(.chip-more) { display: none; }
.chip-more { border-style: dashed; color: var(--ink-3); background: transparent; box-shadow: none; }

/* signal panel */
.sig-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sig-bars i { width: 3px; background: var(--ink-3); border-radius: 1px; animation: sig 2.4s steps(1) infinite; }
.sig-bars i:nth-child(1) { height: 4px; } .sig-bars i:nth-child(2) { height: 7px; animation-delay: .3s; }
.sig-bars i:nth-child(3) { height: 10px; animation-delay: .6s; } .sig-bars i:nth-child(4) { height: 12px; animation-delay: .9s; }
@keyframes sig { 0%, 60% { opacity: 1; } 61%, 80% { opacity: .2; } }
.signal-line {
  margin: 0; min-height: 2.7em;
  font: 1.25rem/1.3 var(--vhs); letter-spacing: .03em; color: var(--ink-2);
}
html[lang^="zh"] .signal-line { font-family: var(--ui); font-size: .9rem; line-height: 1.6; letter-spacing: .06em; }
.signal-line .cursor { width: .45em; }

/* rail links */
.rail-nav a {
  display: flex; align-items: center; gap: .55rem;
  padding: .32rem .2rem; font-weight: 500; font-size: .9rem; color: var(--ink-2);
  border-radius: 8px; transition: color .2s, transform .2s;
}
.rail-nav a::before { content: "▸"; color: var(--pink); font-size: .8em; transition: transform .2s; }
.rail-nav a:hover { color: var(--ink); }
.rail-nav a:hover::before { transform: translateX(3px); }

/* ---------- Index: entries ---------- */
.list-status { margin: 0 0 1rem; font: 1.2rem/1 var(--vhs); letter-spacing: .08em; color: var(--blue); }
.year-group { margin: 0 0 2.8rem; }
.year-head {
  display: flex; align-items: baseline; gap: .9rem; margin: 0 0 1rem; padding: 0 .2rem;
  font-weight: 400;
}
.yh-num {
  font: 800 2.3rem/1 var(--display); letter-spacing: -.03em;
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 50, 140, .18));
}
.yh-side { font: 1.1rem/1 var(--vhs); letter-spacing: .12em; color: var(--ink-3); white-space: nowrap; }
html[lang^="zh"] .yh-side { font-size: 1.05rem; }
.year-head::after { content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(90deg, var(--line), transparent); }
.year-entries { display: flex; flex-direction: column; gap: .75rem; }

.post-entry {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 4.75rem minmax(0, 1fr) 1.2rem; gap: 1.15rem; align-items: center;
  padding: .95rem 1.1rem .95rem .95rem;
  border-radius: 22px; color: inherit;
  background: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), background-color .3s;
}
/* holographic foil that follows the pointer */
.post-entry::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(16rem 9rem at var(--mx, 30%) var(--my, 50%), rgba(255, 255, 255, .85), transparent 65%),
    var(--holo);
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, var(--hx, 0%) 0;
  opacity: 0; transition: opacity .45s ease;
}
/* iridescent hairline border */
.post-entry::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: var(--holo); background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .45s ease;
}
.post-entry:hover, .post-entry:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.post-entry:hover::before, .post-entry:focus-visible::before { opacity: .42; }
.post-entry:hover::after, .post-entry:focus-visible::after { opacity: 1; animation: holo-pan 5s linear infinite; }
html[data-theme="night"] .post-entry:hover::before { opacity: .14; }
@media (prefers-color-scheme: dark) { html:not([data-theme="day"]) .post-entry:hover::before { opacity: .14; } }

.entry-thumb {
  position: relative; display: block; width: 4.75rem; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  background: var(--line-2);
  box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(40, 30, 120, .5);
}
.entry-thumb img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.5) contrast(.92) brightness(1.06) sepia(.12) hue-rotate(-10deg);
  transform: scale(1.04);
  transition: filter .6s ease, transform 1s var(--ease);
}
.entry-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 42%),
    repeating-linear-gradient(0deg, rgba(20, 10, 60, .14) 0 1px, transparent 1px 3px);
  border-radius: inherit;
}
.entry-thumb.is-orb {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 9%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 50% 55%, hsl(var(--hue) 95% 82%) 0%, hsl(calc(var(--hue) + 50) 85% 68%) 45%, hsl(calc(var(--hue) + 110) 70% 52%) 100%);
}
.post-entry:hover .entry-thumb img { filter: none; transform: scale(1.12); }

.entry-body { display: block; min-width: 0; }
.entry-meta { display: flex; gap: .7rem; font: 1.08rem/1 var(--vhs); letter-spacing: .07em; color: var(--ink-3); }
html[lang^="zh"] .entry-min { font-family: var(--ui); font-size: .76rem; letter-spacing: .04em; }
.entry-title {
  display: block; margin: .3rem 0 .32rem;
  font: 500 1.3rem/1.28 var(--serif); letter-spacing: -.005em; color: var(--ink);
  text-wrap: balance;
}
html[lang^="zh"] .entry-title { font-weight: 600; font-size: 1.17rem; line-height: 1.45; letter-spacing: .02em; }
.post-entry:hover .entry-title { animation: rgb-split .45s steps(3, end) 1; }
@keyframes rgb-split {
  0% { text-shadow: -3px 0 rgba(255, 50, 160, .7), 3px 0 rgba(30, 200, 255, .7); }
  50% { text-shadow: 2px 0 rgba(255, 50, 160, .6), -2px 0 rgba(30, 200, 255, .6); }
  100% { text-shadow: none; }
}
.entry-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .92rem; line-height: 1.6; color: var(--ink-2);
}
html[lang^="zh"] .entry-summary { font-size: .88rem; line-height: 1.75; letter-spacing: .02em; }
.entry-tags {
  display: block; margin-top: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 1rem/1.2 var(--vhs); letter-spacing: .04em; color: var(--ink-3);
}
html[lang^="zh"] .entry-tags { font-family: var(--ui); font-size: .76rem; letter-spacing: .03em; }
.post-entry:hover .entry-tags { color: var(--blue); }
.entry-go {
  font: 1.3rem/1 var(--vhs); color: var(--blue); opacity: 0; transform: translateX(-8px);
  transition: opacity .3s, transform .4s var(--ease);
}
.post-entry:hover .entry-go { opacity: 1; transform: none; }

/* scroll reveal (JS adds .in; without JS everything is simply visible) */
html.js .reveal { opacity: 0; }
html.js .reveal.in { opacity: 1; animation: rise-fast .5s var(--ease) var(--d, 0ms) backwards; }

/* empty search: color bars */
.empty { text-align: center; padding: 3rem 1rem 4rem; font: 1.35rem/1.3 var(--vhs); letter-spacing: .08em; color: var(--ink-3); }
.empty::before {
  content: ""; display: block; width: min(16rem, 80%); height: 7rem; margin: 0 auto 1.2rem; border-radius: 12px;
  background:
    linear-gradient(180deg, transparent 72%, #111 72% 76%, transparent 76%),
    linear-gradient(90deg, #c0c0c0 0 14.3%, #c0c000 0 28.6%, #00c0c0 0 42.9%, #00c000 0 57.2%, #c000c0 0 71.5%, #c00000 0 85.8%, #0000c0 0);
  box-shadow: var(--shadow-soft);
  animation: bars-jitter 2.2s steps(1) infinite;
}
@keyframes bars-jitter { 0%, 92% { transform: none; filter: none; } 93% { transform: translateX(4px) skewX(6deg); filter: hue-rotate(60deg); } 96% { transform: translateX(-3px); } }

/* ---------- Footer ---------- */
.site-foot {
  text-align: center; padding: 2rem 1.25rem 5.5rem;
  font: 1.05rem/1.4 var(--vhs); letter-spacing: .06em; color: var(--ink-3);
}
html[lang^="zh"] .site-foot p { font-family: var(--ui); font-size: .8rem; }
.site-foot p { margin: 1rem 0 0; }
.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem; }
.badge {
  display: inline-flex; width: 88px; height: 31px; overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .35); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 2px 2px 0 rgba(20, 10, 60, .25);
  font: 1.05rem/29px var(--vhs); letter-spacing: .04em; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .4);
  transition: transform .15s;
}
.badge b, .badge span { display: block; padding: 0 6px; font-weight: 400; }
.badge b { background: rgba(0, 0, 0, .25); }
.badge span { flex: 1; text-align: center; }
.badge:hover { transform: translate(-1px, -1px); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5), 3px 3px 0 rgba(20, 10, 60, .3); }
.b-rss { background: linear-gradient(180deg, #ffb24a, #f06a12); }
.b-llm { background: linear-gradient(180deg, #a993ff, #5a3fd8); }
.b-gh { background: linear-gradient(180deg, #6b7088, #23253a); }
.b-home { background: linear-gradient(180deg, #6fd3ff, #1f6dff); }

/* ---------- Post page ---------- */
.tape-progress {
  position: fixed; left: 0; top: 0; right: 0; height: 4px; z-index: 60; pointer-events: none;
  background: var(--holo); background-size: 50vw 100%;
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
  mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 11px);
}
.post-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--paper-w)) minmax(0, 1fr);
  column-gap: 2rem; padding: 6.2rem 1rem 1rem;
}
.post-wrap > article { grid-column: 2; grid-row: 1; min-width: 0; }

.post-head { text-align: center; padding: 2.6rem .5rem 2.8rem; }
.post-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .38rem .95rem .34rem; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-soft);
  font: 1.15rem/1 var(--vhs); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
html[lang^="zh"] .post-kicker { font-family: var(--ui); font-size: .8rem; letter-spacing: .12em; }
.rec {
  display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--rec);
  box-shadow: 0 0 8px var(--rec); animation: blink 1.4s steps(1) infinite;
}
.post-head h1 {
  margin: 1.2rem auto 1rem; max-width: 18em;
  font: 500 clamp(2.05rem, 5.4vw, 3.55rem)/1.1 var(--serif); letter-spacing: -.018em;
  color: var(--ink); text-wrap: balance;
}
html[lang^="zh"] .post-head h1 {
  font-weight: 700; font-size: clamp(1.85rem, 4.6vw, 2.9rem); line-height: 1.32; letter-spacing: .02em; max-width: 16em;
}
.byline {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .3rem .7rem;
  font: 1.12rem/1.2 var(--vhs); letter-spacing: .08em; color: var(--ink-3);
}
html[lang^="zh"] .byline { font-family: var(--ui); font-size: .84rem; letter-spacing: .06em; }
.by-alt { color: var(--blue); border-bottom: 1px dashed currentColor; }
.by-alt:hover { color: var(--pink); }

/* entrance */
html.js .post-head > * { animation: rise-fast .45s var(--ease) both; }
html.js .post-head > h1 { animation-delay: .03s; }
html.js .post-head > .byline { animation-delay: .06s; }
html.js .paper { animation: rise-fast .5s var(--ease) .05s both; }
html.vt-in :is(.post-head > *, .paper, .hero > *) { animation: none !important; }
@keyframes rise-fast { from { opacity: 0; transform: translateY(14px); } }

.paper {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--paper-shadow);
  padding: clamp(1.7rem, 5vw, 4.2rem) clamp(1.15rem, 5vw, 4.4rem) clamp(2rem, 5vw, 3.4rem);
}
.paper::before {
  content: ""; position: absolute; left: 2.2rem; right: 2.2rem; top: -1px; height: 3px; border-radius: 3px;
  background: var(--holo); background-size: 200% 100%;
}
.reading { max-width: var(--measure); margin: 0 auto; }

/* ---------- Prose: the calm core ---------- */
.prose {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.75; font-weight: 400;
  color: var(--ink); counter-reset: ch;
  font-optical-sizing: auto; font-kerning: normal; text-wrap: pretty;
  overflow-wrap: break-word;
}
html[lang^="zh"] .prose { font-size: 1.1rem; line-height: 2; letter-spacing: .03em; text-align: justify; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.3em; }
html[lang^="zh"] .prose p { margin-bottom: 1.15em; }
.prose strong { font-weight: 600; }
html[lang^="zh"] .prose strong { font-weight: 700; }
.prose em { font-style: italic; }
html[lang^="zh"] .prose em { font-style: normal; font-family: var(--kai); }

.prose h2, .prose h3, .prose h4 { scroll-margin-top: 6rem; text-wrap: balance; color: var(--ink); }
.prose h2 {
  counter-increment: ch; position: relative;
  margin: 2.6em 0 .9em; padding-top: 1.5rem;
  font: 600 1.6rem/1.28 var(--serif); letter-spacing: -.01em;
}
.prose h2::before {
  content: "CH." counter(ch, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font: 1.05rem/1 var(--vhs); letter-spacing: .16em; color: var(--blue);
}
.prose h2::after {
  content: ""; display: block; width: 3.2rem; height: 3px; margin-top: .65rem; border-radius: 3px;
  background: var(--holo);
}
html[lang^="zh"] .prose h2 { font-weight: 700; font-size: 1.42rem; line-height: 1.5; letter-spacing: .03em; text-align: left; }
.prose h3 { margin: 2.1em 0 .7em; font: 600 1.28rem/1.35 var(--serif); }
html[lang^="zh"] .prose h3 { font-weight: 700; font-size: 1.2rem; line-height: 1.55; text-align: left; }
.prose h3::before { content: "◆ "; color: var(--lilac); font-size: .7em; vertical-align: .12em; }
.prose h4 { margin: 1.8em 0 .5em; font: 600 1.08rem/1.4 var(--serif); color: var(--ink-2); }

.prose a {
  color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .22em; text-decoration-color: rgba(90, 118, 255, .45);
  transition: color .2s, text-decoration-color .2s, background-size .35s var(--ease);
  background: linear-gradient(transparent 62%, rgba(255, 159, 217, .35) 62%) 0 0 / 0 100% no-repeat;
}
.prose a:hover { color: var(--pink); text-decoration-color: var(--pink); background-size: 100% 100%; }

.prose blockquote {
  position: relative; margin: 1.9em 0; padding: 1.15em 1.4em 1.15em 1.65em;
  border-radius: 18px; color: var(--ink-2);
  background: linear-gradient(135deg, rgba(169, 147, 255, .11), rgba(124, 243, 255, .08) 60%, rgba(255, 159, 217, .08));
}
.prose blockquote::before {
  content: ""; position: absolute; left: .55rem; top: 1rem; bottom: 1rem; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, #7cf3ff, #a993ff, #ff9fd9);
}
html:not([lang^="zh"]) .prose blockquote { font-style: italic; }
html[lang^="zh"] .prose blockquote { font-family: var(--kai); text-align: left; }
.prose blockquote p { margin: 0 0 .7em; }
.prose blockquote p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.5em; }
.prose li { margin: .45em 0; padding-left: .25em; }
.prose li::marker { color: var(--lilac); }
.prose ol li::marker { font-family: var(--vhs); font-size: 1.1em; color: var(--blue); }

/* figures: image + italic caption line beneath */
.prose p:has(> img), .prose p:has(> .img-prog) { margin: 2.1em 0; text-align: center; }
.prose img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 14px; }
.prose img, .prose .img-prog { max-width: min(100%, 34rem); }
.prose img[alt*="[wide]"], .prose .img-prog:has(img[alt*="[wide]"]) { max-width: 100%; }
.prose p:has(> img) > em, .prose p:has(> .img-prog) > em {
  display: block; margin-top: .9em; font: 400 .84rem/1.55 var(--ui); font-style: normal;
  color: var(--ink-3); letter-spacing: .01em; text-align: center;
}
.prose p:has(> img) > em::before, .prose p:has(> .img-prog) > em::before { content: "▲ "; font-size: .7em; color: var(--lilac); vertical-align: .1em; }

.img-prog {
  display: block; position: relative; margin: 0 auto; max-width: 100%;
  border-radius: 14px; overflow: hidden; background: var(--line-2);
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px var(--line), 0 22px 44px -26px rgba(40, 30, 120, .6);
}
.img-prog.has-lqip { background-image: var(--lqip); }
.img-prog.has-lqip::before {
  content: ""; position: absolute; inset: -2px; z-index: 0;
  background: inherit; background-size: cover; background-position: center;
  filter: blur(14px); transform: scale(1.06);
}
.img-prog img {
  position: relative; z-index: 1; display: block; width: 100%; height: auto; margin: 0 !important;
  border-radius: inherit; opacity: 0; transition: opacity .7s ease, filter 1s ease;
  filter: saturate(1.4) blur(6px);
}
.img-prog.is-loaded img { opacity: 1; filter: none; }
.img-prog.is-loaded.has-lqip::before { opacity: 0; transition: opacity .4s ease .3s; }

.prose hr { border: 0; height: auto; margin: 2.8em 0; text-align: center; overflow: visible; }
.prose hr::after { content: "✦ ✧ ✦"; display: inline-block; font-size: .85rem; letter-spacing: .9em; padding-left: .9em; color: var(--lilac); }

.prose :not(pre) > code {
  font-family: var(--mono); font-size: .84em; padding: .12em .4em; border-radius: 6px;
  background: rgba(124, 100, 255, .1); color: var(--ink);
}
.prose pre {
  margin: 1.6em 0; padding: 1.1em 1.3em; border-radius: 16px;
  background: #14122a; color: #dcd8ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 40px -26px rgba(20, 10, 60, .8);
  font: .82rem/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; overflow-x: auto;
  text-align: left; letter-spacing: 0;
}
.prose pre code { font: inherit; background: none; color: inherit; padding: 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font: .95rem/1.5 var(--ui); }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .6em .8em; text-align: left; }
.prose th { font-weight: 600; color: var(--ink-2); }

.prose mjx-container { overflow-x: auto; overflow-y: hidden; max-width: 100%; }

/* footnotes (python-markdown "extra") */
.prose sup { line-height: 0; }
.prose .footnote-ref {
  font: 600 .72em/1 var(--ui); text-decoration: none; background: none;
  padding: .1em .3em; margin-left: .1em; border-radius: 5px; color: var(--blue); background-color: rgba(90, 118, 255, .1);
}
.prose .footnote { margin-top: 3em; font: .86rem/1.65 var(--ui); color: var(--ink-2); text-align: left; letter-spacing: 0; }
.prose .footnote > hr { display: none; }
.prose .footnote::before {
  content: "NOTES"; display: block; padding-top: 1.1rem; margin-bottom: .4rem; border-top: 1px solid var(--line);
  font: 1.05rem/1 var(--vhs); letter-spacing: .16em; color: var(--ink-3);
}
.prose .footnote ol { padding-left: 1.3em; }
.prose .footnote p { margin: 0 0 .4em; }
.prose .footnote a { overflow-wrap: anywhere; }
.prose .footnote-backref { text-decoration: none; background: none; }

/* ---------- Post footer ---------- */
.post-foot { max-width: var(--measure); margin: 3.4rem auto 0; }
.eot {
  display: flex; align-items: center; gap: .9rem;
  font: 1.15rem/1 var(--vhs); letter-spacing: .16em; color: var(--ink-3);
}
.eot i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), var(--lilac), var(--line)); }
.post-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 0; }
.post-tags .tag {
  padding: .34rem .75rem .3rem; border-radius: 999px;
  font: 500 .8rem/1.2 var(--ui); color: var(--ink-2);
  border: 1px solid var(--line); background: var(--gel-soft);
  transition: color .2s, border-color .2s, transform .15s;
}
.post-tags .tag:hover { color: var(--blue); border-color: var(--blue-2); transform: translateY(-1px); }
.tape-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.8rem; }
.tape-card {
  position: relative; display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem 1.15rem 1.1rem; border-radius: 18px; color: inherit;
  background: var(--line-2); border: 1px solid var(--line);
  transition: transform .4s var(--ease), box-shadow .4s, border-color .3s;
}
.tape-card.next { text-align: right; }
.tape-card.is-empty { visibility: hidden; }
.tape-card:hover { transform: translateY(-2px); border-color: var(--blue-2); box-shadow: var(--shadow-lift); }
.tc-dir { font: 1.05rem/1 var(--vhs); letter-spacing: .12em; color: var(--ink-3); }
html[lang^="zh"] .tc-dir { font-family: var(--ui); font-size: .78rem; letter-spacing: .1em; }
.tc-title { font: 500 1.02rem/1.4 var(--serif); color: var(--ink); text-wrap: balance; }
html[lang^="zh"] .tc-title { font-weight: 600; font-size: .96rem; line-height: 1.6; }
.tape-card:hover .tc-title { color: var(--blue); }
.back-row { text-align: center; margin-top: 2rem; }
.back-link {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.35rem; border-radius: 999px;
  font: 600 .9rem/1 var(--ui); color: #fff;
  background: var(--gel); border: 1px solid rgba(30, 80, 255, .55);
  text-shadow: 0 1px 1px rgba(0, 20, 90, .45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 6px 18px -6px rgba(40, 100, 255, .6);
  transition: transform .15s, box-shadow .3s;
}
.back-link::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: 2px; height: 44%; border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, .85), rgba(255, 255, 255, .05));
}
.back-link:hover { transform: translateY(-1px); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 10px 26px -6px rgba(40, 100, 255, .7); }
.back-link:active { transform: scale(.97); }

/* ---------- Table of contents (wide screens) ---------- */
.toc {
  grid-column: 3; grid-row: 1; align-self: start; justify-self: start;
  position: sticky; top: 7rem; margin-top: 15rem; width: min(100%, 14rem);
  padding: .8rem .6rem; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-soft);
}
.toc-title { margin: 0 .5rem .5rem; font: 1.05rem/1 var(--vhs); letter-spacing: .16em; color: var(--ink-3); }
.toc a {
  display: grid; grid-template-columns: 2.1rem 1fr; align-items: baseline;
  padding: .36rem .5rem; border-radius: 10px;
  font: 500 .82rem/1.4 var(--ui); color: var(--ink-3);
  transition: color .2s, background .25s;
}
.toc a .n { font: 1.05rem/1 var(--vhs); letter-spacing: .04em; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); background: var(--paper); box-shadow: 0 2px 8px -4px rgba(40, 30, 120, .35); }
.toc a.active .n { color: var(--blue); }
@media (max-width: 1359px) { .toc { display: none !important; } }

/* ---------- Pointer sparkles (index, fine pointers) ---------- */
.spark {
  position: fixed; z-index: 70; pointer-events: none; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: spark .9s ease-out forwards;
}
@keyframes spark {
  from { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx, 0), var(--dy, 18px)) scale(.2) rotate(120deg); opacity: 0; }
}

/* ---------- View transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-fade-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-fade-in .26s ease-out both, vt-lift .32s var(--ease) both; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-lift { from { transform: translateY(10px); } }
::view-transition-group(topbar), ::view-transition-group(osd) { animation-duration: .25s; }

/* same-document: language switch glitch, theme switch iris */
html.vt-theme .topbar, html.vt-theme .osd { view-transition-name: none; }
html.vt-lang::view-transition-old(root) { animation: lang-out .22s steps(3, end) both; }
html.vt-lang::view-transition-new(root) { animation: lang-in .34s steps(5, end) both; }
@keyframes lang-out {
  40% { transform: translateX(-8px) skewX(5deg); filter: hue-rotate(90deg) saturate(3); clip-path: inset(0 0 30% 0); }
  to { opacity: 0; transform: translateX(14px); clip-path: inset(40% 0 20% 0); }
}
@keyframes lang-in {
  from { opacity: 0; transform: translateX(-14px); clip-path: inset(45% 0 40% 0); filter: hue-rotate(-90deg) saturate(3); }
  40% { opacity: 1; transform: translateX(8px) skewX(-4deg); clip-path: inset(8% 0 22% 0); }
  70% { transform: translateX(-3px); clip-path: inset(0); filter: none; }
  to { transform: none; }
}
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: iris .8s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes iris {
  from { clip-path: circle(0 at var(--cx, 90%) var(--cy, 30px)); }
  to { clip-path: circle(150vmax at var(--cx, 90%) var(--cy, 30px)); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .osd { display: none; }
  .dock { bottom: 1.1rem; }
  .bgm-win { bottom: 6.6rem; }
}
@media (max-width: 1359px) {
  .post-wrap { grid-template-columns: minmax(0, var(--paper-w)); justify-content: center; column-gap: 0; }
  .post-wrap > article { grid-column: 1; }
}
@media (max-width: 960px) {
  .archive { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; max-width: 46rem; }
  .rail-sticky { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; align-items: start; }
  .rail-sticky .panel + .panel { margin-top: 0; }
  .rail-sticky .panel:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .rail-sticky .panel-signal { display: none; }
}
@media (max-width: 700px) {
  .topbar { top: 10px; padding: .32rem .32rem .32rem .65rem; }
  .brand-text { font-size: .72rem; }
  .tb-link { padding: .4rem .55rem; font-size: .82rem; }
  .gel-btn { height: 2rem; min-width: 2rem; padding: 0 .7rem; }
  .gel-btn.icon { width: 2rem; }
  .dock { left: .7rem; bottom: .7rem; flex-direction: row; }
  .blog-post .dock { display: none; }
  .bgm-win { left: .7rem; bottom: 3.6rem; }
  .hero { min-height: auto; padding-top: 8rem; padding-bottom: 4.5rem; }
  .hero-kicker { font-size: 1.1rem; }
  .hero-sub { font-size: 1.08rem; }
  .scroll-cue { display: none; }
  .rail-sticky { grid-template-columns: 1fr; }
  .rail-sticky .rail-nav { display: none; }
  .archive { padding: 0 .85rem 3rem; }
  .post-entry { grid-template-columns: 3.6rem minmax(0, 1fr); gap: .9rem; padding: .85rem .9rem .85rem .8rem; border-radius: 18px; align-items: start; }
  .entry-thumb { width: 3.6rem; border-radius: 12px; margin-top: .2rem; }
  .entry-go { display: none; }
  .entry-title { font-size: 1.16rem; }
  html[lang^="zh"] .entry-title { font-size: 1.06rem; }
  .yh-num { font-size: 1.9rem; }
  .post-wrap { padding: 4.6rem .4rem .5rem; }
  .post-head { padding: 1.9rem .6rem 2rem; }
  .paper { border-radius: 22px; padding: 1.7rem 1.15rem 2rem; }
  .paper::before { left: 1.4rem; right: 1.4rem; }
  .prose { font-size: 1.1rem; line-height: 1.72; }
  html[lang^="zh"] .prose { font-size: 1.03rem; line-height: 1.95; letter-spacing: .02em; }
  .prose h2 { font-size: 1.4rem; }
  .prose blockquote { margin-left: -.3rem; margin-right: -.3rem; padding: 1em 1.05em 1em 1.4em; }
  .tape-nav { grid-template-columns: 1fr; }
  .tape-card.next { text-align: left; }
  .tape-card.is-empty { display: none; }
  .site-foot { padding-bottom: 4rem; }
  .zj-toasts { right: .6rem; left: .6rem; bottom: .8rem; align-items: center; }
}

/* ---------- Reduced motion: keep the look, drop the motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html.js .reveal { opacity: 1; }
  .wm::before, .wm::after { display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Print: just the text ---------- */
@media print {
  html { background: #fff; }
  .sky, .grain, .topbar, .osd, .tape-progress, .toc, .site-foot, .tape-nav, .back-row, .vhs-boot { display: none !important; }
  .paper { box-shadow: none; background: #fff; padding: 0; }
  .paper::before { display: none; }
  .post-wrap { display: block; padding: 0; }
  body.blog { color: #000; }
}
