:root {
  --ink: #05060a;
  --ok: #7ff0c8;
  --amber: #d8a35d;
  --w: #a9d8d0;
  --fg: #e6f1ee;
  --dim: rgba(214, 232, 228, .62);
  --line: rgba(214, 232, 228, .22);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "PingFang TC", "Microsoft JhengHei", monospace;
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --m: clamp(16px, 3vw, 34px);
  --safe: env(safe-area-inset-bottom, 0px);
  --sb: var(--safe);
  --st: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--ink); color: var(--fg);
  font: 300 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--w); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#leaders { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#leaders line { stroke: var(--w); stroke-width: 1; opacity: .55; }
#leaders circle { fill: none; stroke: var(--w); stroke-width: 1; }
#leaders circle.c { fill: var(--w); stroke: none; }

/* ── 儀器外框 ── */
#hud { position: fixed; inset: 0; pointer-events: none; transition: opacity .9s; isolation: isolate; }
#hud > * { pointer-events: auto; }
#hud, #p-works, #p-contact { text-shadow: 0 0 10px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .8); }
[data-phase="gate"] #hud, [data-phase="gate"] #nodes, [data-phase="gate"] #leaders { opacity: 0; pointer-events: none; }
[data-phase="gate"] #hud > * { pointer-events: none; }

.x { position: absolute; width: 11px; height: 11px; pointer-events: none !important; opacity: .55; }
.x::before, .x::after { content: ""; position: absolute; background: var(--w); }
.x::before { left: 5px; top: 0; width: 1px; height: 11px; }
.x::after { top: 5px; left: 0; height: 1px; width: 11px; }
.tl { left: var(--m); top: calc(var(--m) + var(--st)); }
.tr { right: var(--m); top: calc(var(--m) + var(--st)); }
.bl { left: var(--m); bottom: calc(var(--m) + var(--sb)); }
.br { right: var(--m); bottom: calc(var(--m) + var(--sb)); }

#mark {
  position: absolute; left: calc(var(--m) + 22px); top: calc(var(--m) + var(--st) - 4px);
  font: 400 12px/20px var(--mono); letter-spacing: .28em; color: var(--fg);
  padding: 0 4px;
}
/* 右上角兩個控制：終端與音量，同一種寫法 */
#ctl { position: absolute; right: calc(var(--m) + 22px); top: calc(var(--m) + var(--st) - 4px); display: flex; align-items: center; gap: 18px; height: 20px; }
#ctl button { display: flex; align-items: center; gap: 7px; height: 32px; font: 400 11px/1 var(--mono); letter-spacing: .18em; color: var(--dim); touch-action: manipulation; transition: color .2s; }
@media (hover: hover) { #ctl button:hover { color: var(--ok); } }
#t-toggle i { width: 5px; height: 11px; background: currentColor; opacity: .5; }
#t-toggle[aria-expanded="true"] { color: var(--ok); }
#t-toggle[aria-expanded="true"] i { opacity: 1; }
#t-toggle[data-busy] i { background: var(--ok); opacity: 1; animation: t-blink .7s steps(2, jump-none) infinite; }
#sound[aria-pressed="false"] { color: rgba(214, 232, 228, .56); }
#scope { display: block; width: 44px; height: 14px; }

/* 尺度軸：永遠看得到全部的地方。位置是對數，所以刻意不平均。 */
#ruler {
  position: absolute; right: var(--m); top: 50%; transform: translateY(-50%);
  width: 104px; height: min(44vh, 300px);
}
#ruler::before {
  content: ""; position: absolute; right: 5px; top: 0; bottom: 0; width: 1px; background: var(--line);
}
#ruler u { position: absolute; right: 5px; top: calc(var(--p)*100%); width: 5px; height: 1px; background: var(--line); }
#ruler a {
  position: absolute; right: 0; top: calc(var(--p)*100%); transform: translateY(-50%);
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  height: 44px; padding-left: 28px;
  font: 400 12px/1 var(--sans); letter-spacing: .32em; color: var(--dim);
  transition: color .4s;
}
#ruler a::after { content: ""; width: 11px; height: 1px; background: var(--dim); }
#ruler a[aria-current="true"] { color: var(--w); }
#ruler i {
  position: absolute; right: 0; top: calc(var(--at, .21)*100%); width: 24px; height: 1px;
  background: var(--w); box-shadow: 0 0 8px var(--w); pointer-events: none;
}

#scale {
  position: absolute; left: calc(var(--m) + 22px); bottom: calc(var(--m) + var(--sb) - 4px);
  display: flex; align-items: center; gap: 10px;
  font: 400 11px/20px var(--mono); letter-spacing: .12em; color: var(--dim);
}
#scale i {
  display: block; width: 72px; height: 7px;
  border-left: 1px solid var(--w); border-right: 1px solid var(--w);
  background: linear-gradient(var(--w), var(--w)) center / 100% 1px no-repeat;
}
#scale b { font-weight: 400; }

/* 胞器標籤 */
#nodes { position: fixed; inset: 0; pointer-events: none; transition: opacity .22s; }
.node {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: block; min-width: 96px; padding: 10px 0 10px;
  text-align: left;
  font: 300 21px/1.1 var(--sans); letter-spacing: .3em; color: var(--fg);
  will-change: transform;
}
.node.r { text-align: right; }
.node::after {
  content: ""; display: block; height: 1px; margin-top: 8px;
  background: var(--w); transform-origin: left; transform: scaleX(.42); transition: transform .35s;
}
.node.r::after { transform-origin: right; }
.node:hover::after, .node:focus-visible::after { transform: scaleX(1); }
.node small { display: block; margin-top: 6px; font: 400 10px/1.2 var(--mono); letter-spacing: .16em; color: var(--dim); }

/* 面板 */
.panel { position: fixed; opacity: 0; pointer-events: none; transition: opacity .6s; }
[data-world="1"][data-phase="world"] #p-works,
[data-world="2"][data-phase="world"] #p-contact { opacity: var(--ui, 1); pointer-events: auto; }
[data-moving] .panel { transition: none; pointer-events: none; }
[data-world="1"][data-phase="world"] #p-read { opacity: 1; }
[data-world="1"][data-phase="world"] .rd { pointer-events: auto; }

#p-works {
  left: calc(var(--m) + 22px); top: calc(var(--m) + var(--st) + 44px); bottom: calc(var(--m) + var(--sb) + 40px);
  width: min(320px, 44vw); display: flex; flex-direction: column;
  justify-content: flex-end; gap: 18px;
}
#strand { display: block; text-align: left; font: 400 11px/1.6 var(--mono); letter-spacing: .1em; color: var(--dim); }
#strand b { display: block; font: 200 clamp(30px, 4.4vw, 46px)/1.1 var(--mono); letter-spacing: .02em; color: var(--fg); font-variant-numeric: tabular-nums; }
#works { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
#works button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 10px;
  padding: 7px 0; text-align: left; border-bottom: 1px solid rgba(214, 232, 228, .09);
  font: 300 14px/1.3 var(--sans); letter-spacing: .1em; color: var(--dim); transition: color .25s;
}
#works button b { font-weight: inherit; }
#works button span { font: 400 11px/1 var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
#works em {
  margin-left: 8px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 2px;
  font: 400 10px/1.3 var(--mono); font-style: normal; letter-spacing: .08em; color: var(--w);
  white-space: nowrap; vertical-align: 1px;
}
#works em::after {
  content: ""; display: inline-block; width: 1px; height: 9px; margin-left: 3px;
  background: currentColor; vertical-align: -1px; animation: blink 1.06s steps(1) infinite;
}
#works button:hover, #works button[aria-pressed="true"] { color: var(--w); }

/* 轉錄：字母拉出來的線尾 */
#p-read { inset: 0; overflow: hidden; transition: none; }
.rd {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity; opacity: 0;
  font: 300 12px/18px var(--sans); letter-spacing: .05em; color: rgba(206, 236, 226, .96); cursor: pointer; pointer-events: none;
  text-shadow: 0 0 6px rgba(2, 8, 7, .95), 0 0 2px rgba(2, 8, 7, .9);
}
.rd.rn { font-size: 10.5px; letter-spacing: .14em; color: var(--w); }
.rd.on { color: #fff; font-weight: 400; }
.rd:hover { color: var(--w); }
#works button.now { color: var(--fg); }
#works button.now span { color: var(--w); }

@keyframes blink { 50% { opacity: 0; } }
#works b i { margin-left: 8px; font: 400 8px/1 var(--mono); font-style: normal; color: var(--w); vertical-align: 1px; }

/* 作品片段：從那一對鹼基長出來，碰旁邊就收回去。 */
#p-ev { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(2, 8, 7, .82); }
#p-ev[hidden] { display: none; }
#ev-box { width: min(86vw, calc(74vh*var(--r, .5625))); }
#ev-video { display: block; width: 100%; aspect-ratio: var(--r, .5625); background: #000; border: 1px solid var(--line); }
#ev-cap { margin: 10px 0 0; font: 400 11px/1.6 var(--mono); letter-spacing: .08em; color: var(--dim); }
#ev-cap b { margin-right: 12px; font: 300 14px/1.4 var(--sans); letter-spacing: .14em; color: var(--w); }
#ev-n { margin-left: 12px; font-variant-numeric: tabular-nums; }
#ev-title { display: block; margin-top: 3px; font: 400 13px/1.5 var(--sans); letter-spacing: .12em; color: var(--ok); }
#ev-prev, #ev-next { position: absolute; top: 50%; width: 44px; height: 88px; margin-top: -60px; font: 300 30px/1 var(--mono); color: var(--fg); opacity: .75; touch-action: manipulation; }
#ev-prev { left: max(2px, calc(50% - min(43vw, 37vh*var(--r, .5625)) - 48px)); } #ev-next { right: max(2px, calc(50% - min(43vw, 37vh*var(--r, .5625)) - 48px)); }
#ev-prev:hover, #ev-next:hover { opacity: 1; color: var(--w); }
#ev-prev[hidden], #ev-next[hidden] { display: none; }
#ev-note { display: block; margin-top: 2px; font: 300 12.5px/1.6 var(--sans); letter-spacing: .06em; color: var(--fg); }
#ev-close { position: absolute; top: calc(var(--m) + var(--st) - 12px); right: calc(var(--m) + 6px); width: 44px; height: 44px; font: 300 24px/1 var(--mono); color: var(--fg); }

#p-contact { left: 0; top: 0; will-change: transform; }
#contact { display: grid; min-width: min(300px, 78vw); border-top: 1px solid var(--line); user-select: text; -webkit-user-select: text; }
#contact > * {
  display: grid; grid-template-columns: 84px 1fr; align-items: center; min-height: 44px; padding: 8px 0;
  border-bottom: 1px solid rgba(214, 232, 228, .09);
}
#contact small { font: 400 11px/1.4 var(--mono); letter-spacing: .1em; color: var(--dim); }
#contact b { font: 300 clamp(15px, 1.5vw, 18px)/1.3 var(--mono); letter-spacing: .02em; }
#contact a { transition: color .25s; }
#contact a:hover { color: var(--w); }
#contact .off b { color: var(--dim); }
#contact i { display: block; margin-top: 2px; font: 400 11px/1.4 var(--mono); font-style: normal; letter-spacing: .12em; color: var(--dim); }
#p-contact { display: grid; gap: 18px; }
#portals { display: grid; align-content: start; min-width: min(300px, 78vw); max-width: min(340px, 84vw); border-top: 1px solid var(--line); }
#portals > * { display: block; padding: 7px 0; border-bottom: 1px solid rgba(214, 232, 228, .09); transition: color .25s; }
#portals b { display: block; font: 300 14px/1.4 var(--sans); letter-spacing: .12em; }
#portals i { display: block; font: 300 11.5px/1.5 var(--sans); font-style: normal; letter-spacing: .04em; color: var(--dim); }
#portals a:hover b { color: var(--w); }
#portals .off { cursor: default; pointer-events: none; user-select: none; border-bottom-color: rgba(214, 232, 228, .03); }   /* 2026-11-12 深夜：玄凜閣那一格留著，但暗掉、不能點 */
#portals .off b { display: inline-block; opacity: .34; }                /* 暗的是名字和介紹，不是整格：標記（維護中）要看得清楚 */
#portals .off i { opacity: .34; }
#portals .off em { margin-left: 10px; padding: 2px 6px; border: 1px solid var(--line); font: 400 10px/1 var(--mono); font-style: normal; letter-spacing: .08em; color: var(--dim); vertical-align: middle; }   /* 2026-11-14：網域終端「維護中」 */

/* ── 入口：先落地，按下接入才開始量，量到的東西一行一行印出來 ── */
#gate {
  position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px;
  background: var(--ink);
  transition: opacity .7s, visibility 0s .7s;
}
[data-phase="world"] #gate { opacity: 0; visibility: hidden; pointer-events: none; }
[data-pass] #gate { display: none; }
.ring-out { position: fixed; z-index: 7; pointer-events: none; overflow: visible; transform-origin: 50% 50%; }
.ring-out line, .ring-out circle { fill: none; stroke: var(--ok); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ring-out circle { opacity: .45; }
[data-bare] #hud, [data-bare] #nodes, [data-bare] #leaders, [data-bare] .panel, [data-bare] #p-contact, [data-bare] #term { display: none; }
.boot { width: min(100%, 340px); display: grid; justify-items: center; gap: 22px; }
#dial { width: 176px; height: 176px; overflow: visible; filter: drop-shadow(0 0 10px rgba(127, 240, 200, .16)); transition: width .55s, height .55s; }
#dial line { stroke: rgba(214, 232, 228, .34); stroke-width: .7; transition: stroke .3s; }
/* 等人按的時候，一道光沿著刻度繞。 */
body:not([data-gate]) #dial line { animation: sweep 3.6s linear infinite; animation-delay: calc(var(--i)*37.5ms - 3.6s); }
@keyframes sweep { 0% { stroke: var(--ok); } 16%, 100% { stroke: rgba(214, 232, 228, .34); } }
#dial line.on { stroke: var(--ok); }
#dial circle { fill: none; stroke: rgba(214, 232, 228, .22); stroke-width: .5; }
#g-name { font: 400 15px/1 var(--mono); letter-spacing: .46em; text-indent: .46em; color: var(--fg); }
#g-log { width: 100%; margin: 0; padding: 0; list-style: none; font: 400 12px/1.8 var(--mono); }
#g-log:empty, #cf:empty { display: none; }
#g-log li { display: grid; grid-template-columns: 12px 92px 1fr; gap: 0 6px; }
#g-log i { font-style: normal; color: var(--ok); }
#g-log b { font-weight: 400; letter-spacing: .08em; color: var(--dim); }
#g-log span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-variant-numeric: tabular-nums; color: var(--ok); }
#g-log .end { grid-template-columns: 18px 1fr; margin-top: 8px; }
#g-log .end i, #g-log .end span { color: var(--amber); }
#g-log .bad i, #g-log .bad span { color: var(--amber); white-space: normal; }
.bar { width: 100%; height: 2px; background: rgba(214, 232, 228, .1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--ok); box-shadow: 0 0 10px var(--ok); transform: scaleX(0); transform-origin: left; transition: transform .35s; }
#enter {
  width: 196px; height: 52px; border: 1px solid rgba(127, 240, 200, .5);
  font: 400 14px/1 var(--sans); letter-spacing: .62em; text-indent: .62em; color: var(--ok);
  box-shadow: inset 0 0 20px rgba(127, 240, 200, .07), 0 0 24px rgba(127, 240, 200, .08);
  transition: background .2s, box-shadow .2s;
}
#enter:hover { background: rgba(127, 240, 200, .08); box-shadow: inset 0 0 20px rgba(127, 240, 200, .14), 0 0 30px rgba(127, 240, 200, .16); }
body:not([data-gate]) .bar { display: none; }
[data-gate] #dial { width: 92px; height: 92px; }
[data-gate] #g-name { display: none; }
[data-gate] #enter { display: none; }
[data-gate="fail"] .bar { display: none; }

/* ── 指令列：跟滑動、點選同一層，輸出疊在世界上 ── */
#term {
  --top: calc(var(--m) + var(--st) + 24px);
  position: fixed; top: var(--top); right: var(--m); z-index: 4;
  display: none; flex-direction: column;
  width: min(620px, calc(100vw - var(--m)*2));
  max-height: min(76vh, 660px);
  max-height: min(calc(100dvh - var(--top) - var(--m) - var(--kb, 0px)), 660px);
  /* 凜 11-08：綠框、半透明，後面的螺旋要看得到在動。字靠暗邊撐住，不靠底色 */
  background: rgba(5, 6, 10, .56); border: 1px solid rgba(127, 240, 200, .42);
  box-shadow: inset 0 0 22px rgba(127, 240, 200, .05), 0 0 18px rgba(127, 240, 200, .06);
  text-shadow: 0 0 3px rgba(5, 6, 10, .95), 0 0 8px rgba(5, 6, 10, .8);
  font: 400 12px/1.65 var(--mono);
}
#term[data-open] { display: flex; animation: t-open .16s ease-out; }
[data-phase="gate"] #term { display: none; }
@keyframes t-open { from { opacity: 0; transform: translateY(-6px); } }
#t-head {
  flex: none; display: flex; align-items: center; gap: 12px; height: 26px; padding: 0 12px;
  border-bottom: 1px solid rgba(127, 240, 200, .16); font-size: 11px; letter-spacing: .08em; color: var(--dim); white-space: nowrap;
}
#t-net { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#t-wave { width: 48px; height: 14px; margin-left: auto; opacity: .85; }
#t-up, #t-clock { font-variant-numeric: tabular-nums; }
#t-out {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 12px 12px;
  touch-action: pan-y; user-select: text; -webkit-user-select: text;
}
#t-out:empty { display: none; }
#t-form { flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 0 12px; border-top: 1px solid rgba(127, 240, 200, .16); }
#t-path { white-space: nowrap; color: var(--w); }
#t-path i { font-style: normal; color: var(--dim); }
#t-in {
  flex: 1; min-width: 0; height: 40px; padding: 0; background: none; border: 0; border-radius: 0; outline: 0;
  font: 400 16px/1 var(--mono); color: var(--fg); caret-color: var(--ok);
  touch-action: manipulation; user-select: text; -webkit-user-select: text;
}
#t-in::placeholder { font-size: 12px; color: rgba(214, 232, 228, .56); opacity: 1; }
#term[data-busy] #t-path { opacity: .35; }
#term[data-busy] #t-in::placeholder { color: var(--ok); }
#t-chips { flex: none; display: flex; gap: 5px; padding: 0 12px 10px; }
#t-chips button { flex: 1; height: 30px; padding: 0 2px; border: 1px solid var(--line); font: 400 11px/1 var(--mono); color: var(--dim); touch-action: manipulation; transition: color .2s, border-color .2s; }
#t-chips button[data-on] { color: var(--ok); border-color: rgba(127, 240, 200, .5); background: rgba(127, 240, 200, .08); }
@media (hover: hover) { #t-chips button:hover { color: var(--ok); border-color: rgba(127, 240, 200, .5); } }
.l { color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.l.cmd { color: var(--w); margin-top: 6px; }
.l.cmd:first-child { margin-top: 0; }
.l.err { color: var(--amber); }
.l.dim { color: var(--dim); }
.l.ok { color: var(--ok); }
.l.w { color: var(--w); }
.l.sec { margin-top: 8px; color: var(--dim); }
.l.typing::after, #term[data-busy] #t-out > .l:last-child:not(.r, .h, .b, .f, .m)::after {
  content: '▌'; margin-left: 1px; color: var(--ok); animation: t-blink 1s steps(2, jump-none) infinite;
}
@keyframes t-blink { from { opacity: 1; } to { opacity: 0; } }
.l.r { display: grid; grid-template-columns: var(--k, 12ch) 1fr; gap: 0 10px; width: 100%; padding: 1px 0; text-align: left; font: inherit; }
.l.r b { font-weight: 400; color: var(--fg); white-space: pre; }
.l.r span { min-width: 0; color: var(--dim); }
button.l.r b { color: var(--w); }
button.l.r:hover b, button.l.r:hover span, button.l.b:hover b { color: var(--ok); }
/* traceroute 的一跳：序號、名字、毫秒、備註 */
.l.h { display: grid; grid-template-columns: 2ch 14ch 10ch 1fr; gap: 0 8px; }
.l.h u { text-decoration: none; color: var(--dim); text-align: right; }
.l.h b { font-weight: 400; }
.l.h em { font-style: normal; text-align: right; color: var(--ok); font-variant-numeric: tabular-nums; }
.l.h span { min-width: 0; color: var(--dim); }
/* 一列一條量：名字、長條、數字 */
.l.b { display: grid; grid-template-columns: var(--k, 12ch) 1fr 9ch; align-items: center; gap: 0 10px; width: 100%; padding: 1px 0; text-align: left; font: inherit; }
.l.b b { font-weight: 400; color: var(--fg); }
button.l.b b { color: var(--w); }
.l.b i { position: relative; display: block; height: 5px; background: rgba(214, 232, 228, .1); overflow: hidden; }
.l.b i::before { content: ''; position: absolute; inset: 0; background: var(--ok); transform-origin: left; transform: scaleX(var(--v)); transition: transform .2s linear; animation: t-grow .32s ease-out backwards; }
.l.b em { font-style: normal; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
@keyframes t-grow { from { transform: scaleX(0); } }
/* neofetch：左邊是最後幾對真實的鹼基 */
.l.f { display: grid; grid-template-columns: 9ch 8ch 1fr; gap: 0 10px; }
.l.f code { font: inherit; white-space: pre; color: var(--ok); }
.l.f b { font-weight: 400; color: var(--dim); }
.l.f span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l.f.top b { grid-column: 2 / 4; color: var(--w); }
.l.f.top span { display: none; }
.seq { display: block; width: 100%; height: 104px; margin: 6px 0 8px; }
.l.m { display: grid; grid-template-columns: 26px 1fr 44px; align-items: end; gap: 0 8px; width: 100%; height: 30px; padding: 3px 0; font: inherit; }
.l.m b { font-weight: 400; color: var(--dim); }
.l.m span { display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.l.m i { flex: 1; min-width: 0; height: calc(var(--h)*100%); background: var(--ok); opacity: .75; transform-origin: bottom; animation: t-rise .24s ease-out backwards; animation-delay: calc(var(--i)*7ms); }
.l.m i.z { height: 1px; opacity: .22; }
.l.m em { font-style: normal; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
button.l.m:hover b, button.l.m:hover em { color: var(--ok); }
@keyframes t-rise { from { transform: scaleY(0); } }
@media (pointer: fine) { #t-in { font-size: 13px; } #t-out { font-size: 13px; } }
@media (pointer: coarse) { button.l.r, button.l.b { padding: 4px 0; } }
@media (prefers-reduced-motion: reduce) { .l.b i::before, .l.m i { animation: none; } .l.typing::after { animation: none; } }
@media (min-aspect-ratio: 1/1) {
  #p-contact { grid-template-columns: auto auto; gap: 0 30px; }
  /* 寬螢幕的標尺是直的，三個刻度都落在終端後面；終端以前不透明會整個蓋掉，現在要壓暗 */
  body:has(#term[data-open]) #ruler { filter: opacity(.12); pointer-events: none; }
}

.plain { position: fixed; inset: 0; padding: 40px; background: var(--ink); }

/* ── 手機：標尺躺到底部，標籤上下分開 ── */
@media (max-aspect-ratio: 1/1) {
  #term { max-height: 68vh; max-height: min(68dvh, calc(100dvh - var(--top) - var(--m) - var(--kb, 0px))); }
  /* 終端半透明之後，手機上它蓋滿整個寬度，世界上的字會跟終端的字疊在一起。
     打開時把那些字壓暗、不接點擊，只留螺旋在後面動；收起來就回來。
     用 filter 不用 opacity：#p-read、#nodes 的透明度是 main.js 每幀寫在行內樣式上的，
     filter 跟它相乘，本來藏著的（例如作品世界的 #leaders 是 0）不會被叫出來。
     細胞上的兩個標籤由 main.js 的 drawNodes() 自己判斷有沒有被蓋到 */
  body:has(#term[data-open]) :is(.panel, #leaders) { filter: opacity(.12); pointer-events: none; }
  body:has(#term[data-open]) :is(.rd, .panel *) { pointer-events: none; }
  #t-path i { display: none; }
  #t-net { display: none; }
  #ctl { gap: 14px; }
  #scope { width: 36px; }
  #hud::after {
    content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 40vh;
    background: linear-gradient(transparent, rgba(0, 0, 0, .74) 62%); pointer-events: none;
  }
  #ruler {
    left: 36px; right: 36px; top: auto; bottom: calc(var(--sb) + 8px); transform: none;
    width: auto; height: 46px;
  }
  #ruler::before { left: 0; right: 0; top: auto; bottom: 8px; width: auto; height: 1px; }
  #ruler u { left: calc(var(--p)*100%); right: auto; top: auto; bottom: 8px; width: 1px; height: 5px; }
  #ruler a {
    left: calc(var(--p)*100%); right: auto; top: auto; bottom: 0; transform: translateX(-50%);
    flex-direction: column; justify-content: flex-end; gap: 8px; height: 46px; padding: 0 2px;
    font-size: 12px; letter-spacing: .16em; min-width: 52px;
  }
  #ruler a::after { width: 1px; height: 7px; }
  #ruler i { left: calc(var(--at, .21)*100%); right: auto; top: auto; bottom: 0; width: 1px; height: 15px; }
  #scale { bottom: calc(var(--sb) + 62px); }
  .bl, .br { display: none; }
  .node { font-size: 18px; min-width: 84px; }
  #p-works { top: auto; bottom: calc(var(--sb) + 92px); width: auto; right: calc(var(--m) + 22px); gap: 10px; max-height: 44vh; }
  #works { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .rd { font-size: 11px; line-height: 16px; letter-spacing: .02em; }
  .rd.rn { font-size: 9.5px; letter-spacing: .1em; }
  #p-works::before { content: ""; position: absolute; inset: -22px -26px -14px; z-index: -1; background: rgba(2, 8, 7, .62); filter: blur(14px); }
  #works button { padding: 5px 0; font-size: 12.5px; letter-spacing: .04em; }
  #p-contact::before { content: ""; position: absolute; inset: -14px -16px; z-index: -1; background: rgba(2, 4, 6, .58); filter: blur(12px); }
}

@media (prefers-reduced-motion: reduce) {
  #works em::after, #dial line { animation: none !important; }
  * { transition-duration: .01s !important; }
}

/* ══ 2026-11-12：整站改成同一條線之後的排版。上面沒用到的舊規則先留著，這裡的寫在後面所以算數。 ══ */
#ov { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
[data-phase="fly"] #hud { opacity: 0; pointer-events: none; }
[data-phase="fly"] #hud > * { pointer-events: none; }
[data-phase="fly"] #term { display: none; }

/* 入口：刻度圈是畫出來的，這裡只剩圈底下的字。按下接入之後，同一個位置換成量到的東西。 */
#gate { display: block; padding: 0; background: none; pointer-events: none; }
body:not([data-phase="gate"]) #gate { opacity: 0; visibility: hidden; }
.boot { position: absolute; left: 50%; top: var(--gy, 62%); transform: translateX(-50%); width: min(calc(100% - 48px), 340px); gap: 22px; pointer-events: auto; }
[data-gate] .boot { gap: 12px; }
#g-log { text-shadow: 0 0 8px rgba(0, 0, 0, .9); }

/* 作品紀錄：左上角一行讀數（哪一天、第幾對），點開才是作品清單 */
#p-works {
  left: calc(var(--m) + 22px); right: auto; top: calc(var(--m) + var(--st) + 28px); bottom: auto;
  width: min(330px, calc(100vw - var(--m)*2 - 44px)); max-height: none; display: block;
}
#p-works::before { display: none; }
#strand { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 12px; width: 100%; padding: 6px 0; font: 400 11px/1.7 var(--mono); letter-spacing: .08em; color: var(--dim); touch-action: manipulation; }
#strand b { display: inline; font: 400 12px/1.7 var(--mono); letter-spacing: .08em; color: var(--fg); }
#strand i { grid-column: 1 / -1; justify-self: start; font-style: normal; font-variant-numeric: tabular-nums; letter-spacing: .06em; color: var(--ok); opacity: .82; }
#w-toggle { display: block; padding: 2px 0 6px; font: 400 11px/1.7 var(--sans); letter-spacing: .16em; color: var(--w); touch-action: manipulation; }
#w-toggle::after { content: " ▾"; }
#w-toggle[aria-expanded="true"]::after { content: " ▴"; }
#works { display: none; position: relative; margin-top: 4px; }
#p-works[data-open] #works { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
#p-works[data-open] #works::before { content: ""; position: absolute; inset: -16px -20px; z-index: -1; background: rgba(2, 8, 7, .84); filter: blur(12px); }
#works button.now { color: var(--fg); }
#works button i { margin-left: 6px; font-style: normal; font-size: 10px; color: var(--ok); }
[data-moving] .panel { transition: opacity .3s; }

@media (max-aspect-ratio: 1/1) {
  /* 底部只墊住標尺那一條，不要把環的下半壓暗 */
  #hud::after { height: 20vh; background: linear-gradient(transparent, rgba(0, 0, 0, .62) 70%); }
}

/* ── 2026-11-12 表層的展示卡：十一件作品輪流被標出來 ── */
[data-world="0"][data-phase="world"] #p-show { opacity: var(--ui, 1); pointer-events: auto; }
body:has(#term[data-open]) #p-show { opacity: 0; pointer-events: none; }
#p-show {
  --c: #a9d8d0;
  left: calc(var(--m) + 22px); top: calc(var(--m) + var(--st) + 46px); width: min(300px, calc(100vw - var(--m)*2 - 44px));
  text-shadow: 0 0 10px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .8);
}
#sh-go { display: block; width: 100%; padding: 0; text-align: left; color: var(--fg); animation: sh-in .7s ease-out; }
@keyframes sh-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #sh-go { animation: none; } }
#sh-name small { margin-left: 10px; font: 400 11px/1 var(--mono); letter-spacing: .14em; color: var(--dim); }
#sh-idx { display: block; font: 400 10px/1.7 var(--mono); letter-spacing: .24em; color: var(--c); transition: color .5s; }
#sh-name { display: block; font: 300 clamp(26px, 7.4vw, 34px)/1.25 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; letter-spacing: .1em; }
#sh-name em { margin-left: 10px; padding: 2px 6px; border: 1px solid var(--line); font: 400 10px/1 var(--mono); font-style: normal; letter-spacing: .08em; color: var(--dim); vertical-align: middle; }
/* 卡的右上角：點下去會看到什麼（影片只有少數幾件有，先講明白） */
#sh-act { float: right; margin-top: -1px; font: 400 10.5px/1.7 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; letter-spacing: .1em; color: var(--dim); }
#sh-act[data-film] { padding: 0 7px; border: 1px solid var(--c); color: var(--c); }
#sh-act:empty { display: none; }
#sh-text { display: block; margin-top: 3px; font: 400 12px/1.65 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; color: rgba(222, 238, 234, .8); white-space: pre-line; }
[data-kind="about"] #sh-name { font-size: clamp(19px, 5.4vw, 23px); letter-spacing: .08em; }
[data-kind="about"] #sh-text { margin-top: 5px; }
[data-kind="about"] #sh-spark { display: none; }   /* 自我介紹那張字比較多，不放長條，免得壓到環上 */
#sh-meta { display: block; margin-top: 5px; font: 400 10.5px/1.7 var(--mono); letter-spacing: .06em; color: var(--dim); font-variant-numeric: tabular-nums; }
#sh-spark { display: block; width: 100%; height: 26px; margin-top: 7px; }
#sh-bar { display: flex; gap: 2px; margin-top: -2px; }
#sh-bar button { flex: 1 1 0; min-width: 9px; height: 30px; padding: 0; position: relative; }
#sh-bar button[data-infra] { margin-left: 9px; }
#sh-bar button[data-infra]::before { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 6px); }
#sh-bar button::before {
  content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--c); opacity: .34;
  transition: opacity .35s, box-shadow .35s;
}
#sh-bar button[aria-current="true"]::before { opacity: 1; box-shadow: 0 0 8px var(--c); }
/* 作品清單：已停止的標記不閃 */
#works em[data-off] { margin-left: 5px; padding: 1px 3px; font-size: 9px; letter-spacing: 0; color: var(--dim); }   /* 兩欄的窄格子裡要跟名字、筆數排在同一行 */
#works em[data-off]::after { display: none; }

/* ── 2026-11-12 關於：凜的自我介紹，自己一頁（停在細胞核外面） ── */
[data-world="3"][data-phase="world"] #p-about { opacity: var(--ui, 1); }   /* 只有字，不攔手勢：在字上面滑也能換頁 */
#p-about {
  left: calc(var(--m) + 22px); top: calc(var(--m) + var(--st) + 58px); width: min(360px, calc(100vw - var(--m)*2 - 44px));
  text-shadow: 0 0 12px #000, 0 0 4px #000;
}
#ab-text h2 { margin: 0 0 10px; font: 300 clamp(22px, 6.4vw, 28px)/1.3 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; letter-spacing: .1em; color: var(--fg); }
#ab-text p { margin: 0 0 7px; font: 400 clamp(14px, 3.8vw, 15.5px)/1.78 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; letter-spacing: .04em; color: rgba(226, 240, 236, .88); word-break: break-all; }
#ab-text p.sp { height: 1.15em; margin: 0; }   /* 2026-11-13：空一行（凜：「都要空行」） */
#ab-meta { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font: 400 10.5px/1.7 var(--mono); letter-spacing: .06em; color: var(--dim); font-variant-numeric: tabular-nums; }
/* 2026-11-13：矮的直式螢幕（手機瀏覽器扣掉上下工具列以後大多在這裡）字排緊一點，底下才留得住細胞核 */
@media (max-height: 780px) and (max-aspect-ratio: 1/1) {
  #p-about { top: calc(var(--m) + var(--st) + 46px); }
  #ab-text h2 { margin-bottom: 6px; }
  #ab-text p { margin-bottom: 4px; line-height: 1.6; }
  #ab-text p.sp { height: .8em; }
  #ab-meta { margin-top: 6px; padding-top: 6px; }
}
@media (min-aspect-ratio: 1/1) { #p-about { top: 50%; transform: translateY(-56%); left: calc(var(--m) + 5vw); width: min(380px, 32vw); } }

/* ── 2026-11-12 第一次進站的操作提示（右下，幾行白話；動過一次就收） ── */
#hint {
  position: fixed; right: calc(var(--m) + 22px); bottom: calc(var(--m) + var(--sb) + 20px); margin: 0; padding: 0; list-style: none; text-align: right;
  font: 400 12px/2 system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif; letter-spacing: .08em; color: var(--dim);
  text-shadow: 0 0 10px #000, 0 0 3px #000; opacity: 0; transition: opacity .9s; pointer-events: none;
}
#hint[data-on] { opacity: 1; }
[data-phase="gate"] #hint, [data-phase="fly"] #hint, [data-moving] #hint { opacity: 0; }
#hint b { display: inline-block; min-width: 4.4em; margin-right: 10px; padding: 0 7px; border: 1px solid var(--line); font-weight: 400; color: var(--w); text-align: center; line-height: 1.7; }
@media (max-aspect-ratio: 1/1) { #hint { bottom: calc(var(--m) + var(--sb) + 62px); } }
