/* 虛舟之呂 HollowVessel — 介面與排版 */

@font-face { font-family: 'HV Serif TC'; src: url('../assets/fonts/NotoSerifTC-Regular.subset.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'HV Serif TC'; src: url('../assets/fonts/NotoSerifTC-SemiBold.subset.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'HV Garamond'; src: url('../assets/fonts/EBGaramond.subset.woff2') format('woff2'); font-weight: 400 800; font-display: block; }
@font-face { font-family: 'HV Garamond'; src: url('../assets/fonts/EBGaramond-Italic.subset.woff2') format('woff2'); font-weight: 400 800; font-style: italic; font-display: block; }

:root {
  --ink: #2b2933;
  --ink-soft: #625e6c;
  --ink-faint: rgba(43, 41, 51, .42);
  --paper: #eeecf1;
  --paper-rgb: 238, 236, 241;
  --night: #0b0b0e;
  --hinge: 0px;
  --ease: cubic-bezier(.33, 0, .15, 1);
  --zh: 'HV Serif TC', 'Noto Serif CJK TC', 'Songti TC', serif;
  --en: 'HV Garamond', 'EB Garamond', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--night); }
body { -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#stage { position: fixed; inset: 0; overflow: hidden; overflow: clip; background: var(--paper); cursor: default; outline: none; }
#stage.reading { cursor: pointer; }

/* ---------- 場景 ---------- */
#scene { position: absolute; overflow: hidden; background: #cfccd6; }
.plate { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease); will-change: opacity; }
.plate.on { opacity: 1; }
.plate.cut { transition: none; }
.plate.quick { transition: opacity .55s ease-out; }
.plate.black { background: var(--night); }

/* ---------- 演出層：鏡頭、呼吸、搖晃、回憶、閃爍、霧、黑暗、撕裂 ---------- */
.plate .frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.plate .drift { position: absolute; inset: 0; transform-origin: 50% 60%; animation: camBreath 46s ease-in-out infinite alternate; transition: filter 2.2s ease; }
.plate .drift img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; -webkit-user-drag: none; }
.plate .drift canvas { position: absolute; left: 0; width: 100%; pointer-events: none; }
.plate .drift canvas.moss, .plate .drift canvas.touchfx, .plate .drift canvas.skysap, .plate .drift canvas.skyfx { top: 0; height: 100%; }
.plate .drift.walking { animation: walkSway 1.56s ease-in-out infinite; transform-origin: 50% 70%; }
.plate .drift.running { animation: walkSway .78s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes walkSway { 0%, 100% { transform: scale(1.045) translate(0, 0) rotate(0deg); } 25% { transform: scale(1.045) translate(.25%, -.35%) rotate(.12deg); } 50% { transform: scale(1.045) translate(0, 0) rotate(0deg); } 75% { transform: scale(1.045) translate(-.25%, -.35%) rotate(-.12deg); } }
#scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(8,8,12,0) 38%, rgba(8,8,12,.6) 100%); opacity: 0; transition: opacity 1.4s ease; }
#scene.held::after { opacity: 1; }
#scene.held .drift { filter: saturate(.7) brightness(.9); }
@keyframes camBreath { from { transform: scale(1); } to { transform: scale(1.035); } }
.plate .drift.bob { animation: bob 7.8s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes bob { 0%, 100% { transform: scale(1.05) translateY(0) rotate(0deg); } 30% { transform: scale(1.05) translateY(-.55%) rotate(.28deg); } 62% { transform: scale(1.05) translateY(.4%) rotate(-.22deg); } }
#scene.mem .drift { filter: saturate(.28) contrast(.9) brightness(1.07) blur(.7px); }
#scene.flick .drift img { animation: flick 6.7s steps(1) infinite; }
@keyframes flick { 0% { filter: none; } 37% { filter: brightness(.9); } 38% { filter: none; } 39.5% { filter: brightness(.84); } 40.5% { filter: none; } 71% { filter: brightness(.94); } 72% { filter: none; } }
#scene.pulse { animation: pulse var(--beat, 1s) ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); } 7% { transform: scale(1.006); } 28% { transform: scale(1); } }
#rfog { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1.5s; }
#fxDark { position: absolute; inset: -30%; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(6,6,9,0) 28%, rgba(6,6,9,.97) 64%); opacity: 0; transform: scale(1.45); }
#fxFlash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 45; }
#pageFog { position: absolute; inset: -6%; pointer-events: none; opacity: 0; background: radial-gradient(ellipse 60% 56% at 50% 50%, rgba(var(--paper-rgb),0) 34%, rgba(var(--paper-rgb),.5) 78%, rgba(var(--paper-rgb),.8) 100%); }
#stage.shake { animation: shake .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%, 90% { transform: translate(calc(var(--shake) * -.2), 0) scale(1.035); } 20%, 80% { transform: translate(calc(var(--shake) * .4), calc(var(--shake) * .15)) scale(1.035); } 30%, 50%, 70% { transform: translate(calc(var(--shake) * -.8), calc(var(--shake) * -.2)) scale(1.035); } 40%, 60% { transform: translate(var(--shake), calc(var(--shake) * .2)) scale(1.035); } }   /* 放大一點，搖晃時不露出畫面外的黑邊 */
#stage.jitter #text p.now { animation: jit .1s steps(2) infinite; }
@keyframes jit { 0% { transform: translate(.5px,-.4px); } 50% { transform: translate(-.6px,.5px); } 100% { transform: translate(.3px,.2px); } }
.tearbox { position: absolute; inset: 0; pointer-events: none; }
.tearbox .slice { position: absolute; inset: 0; animation: tear 1.9s cubic-bezier(.5,0,.8,.4) forwards; }
.tearbox .slice .frame { transition: none !important; }
@keyframes tear { 0% { transform: none; opacity: 1; } 18% { transform: translate(var(--dx), 0) rotate(calc(var(--rot) * .3)); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.6), calc(var(--dy) * 6)) rotate(var(--rot)); opacity: 0; } }

/* 獨幕：一行字單獨出現在全黑之中 */
#stage.solo #text p { text-indent: 0; text-align: center; }
#stage.solo #text h1 { display: none; }

/* 觸碰互動：光圈與掌心的暖意 */
.ring { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; border: 1px solid rgba(255,248,240,.75); box-shadow: 0 0 24px rgba(255,236,214,.35); pointer-events: none; opacity: 0; transition: opacity 1.2s; animation: ringPulse 2.4s ease-in-out infinite; }
.ring.on { opacity: 1; }
@keyframes ringPulse { 0%, 100% { transform: scale(.82); } 50% { transform: scale(1.08); } }
.glow { position: absolute; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(255,222,186,.62) 0%, rgba(255,214,170,.26) 38%, rgba(255,210,160,0) 70%); transform: scale(.15); opacity: 0; transition: transform 1.4s cubic-bezier(.3,0,.2,1), opacity .5s; }
.glow.on { transform: scale(1); opacity: 1; }

#fog { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 2.4s var(--ease); }
#fog.on { opacity: 1; }

/* ---------- 紙面與文字 ---------- */
#veil { position: absolute; inset: 0; pointer-events: none; transition: opacity 1.2s var(--ease), background 1.2s; }
/* 全黑場景：整個畫面沉入黑暗；離開時慢慢亮起來（文字顏色同步轉換） */
#night { position: absolute; inset: 0; pointer-events: none; background: var(--night); opacity: 0; transition: opacity 2.8s var(--ease); }
#stage.night #night { opacity: 1; }
#text { transition: color 2.8s var(--ease); }
#page { position: absolute; transition: opacity .9s var(--ease); }
#page.dim { opacity: .07; }
#page.out { opacity: 0; }

.textbox { position: absolute; inset: 0; color: var(--ink); overflow: hidden; }
.textbox.zh { font-family: var(--zh); writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; text-orientation: mixed; line-break: strict; word-break: normal; text-align: justify; letter-spacing: .04em; font-feature-settings: 'vert' 1, 'vkrn' 1; }
.textbox.en { font-family: var(--en); text-align: left; hyphens: auto; -webkit-hyphens: auto; font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1; letter-spacing: .005em; word-spacing: .02em; }
.textbox p { margin: 0; }
.textbox.zh p { text-indent: 2em; }
.textbox.en p { text-indent: 1.4em; }
.textbox.en h1 + p, .textbox.en p.first { text-indent: 0; }
.textbox p.cont { text-indent: 0; }
.textbox p.lyric { text-indent: 0; }
.textbox.en p.lyric { white-space: pre-line; padding-left: 2.2em; margin: .5em 0; font-style: italic; }
.textbox.zh p.lyric { padding-top: 3em; letter-spacing: .2em; }
.textbox.zh p.note { padding-top: 2em; }
.textbox.en p.note { padding-left: 1.6em; }
.textbox h1 { font-weight: 600; }
.textbox.zh h1 { font-size: 1.55em; letter-spacing: .18em; margin-left: 1.1em; }
.textbox.en h1 { font-weight: 500; font-size: .74em; letter-spacing: .32em; color: var(--ink-soft); margin: .2em 0 1.4em; font-feature-settings: 'kern' 1, 'lnum' 1; }

/* will-change：讓每段文字常駐獨立圖層。Safari 在直排容器內，段落淡入結束、圖層拆除後不會重繪該區，文字會消失 */
#text p { opacity: 0; transition: opacity 1.1s var(--ease), filter 1.1s var(--ease); filter: blur(1.4px); will-change: opacity, filter; }
#text p.shown { opacity: 1; filter: none; }
#text h1 { transition: opacity 1.4s var(--ease); }
#text.instant p, #text.instant h1 { transition: none; }

#measure { visibility: hidden; pointer-events: none; }

#more { position: absolute; width: 18px; height: 18px; opacity: 0; transition: opacity .8s; pointer-events: none; z-index: 2; }
#more.on { opacity: .55; animation: breathe 2.6s ease-in-out infinite; }
#more::before { content: ''; position: absolute; left: 6px; top: 3px; width: 6px; height: 6px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg); }
.en-reading #more::before { transform: rotate(-45deg); }
@keyframes breathe { 0%,100% { opacity: .25; } 50% { opacity: .6; } }

/* ---------- 顆粒 ---------- */
#grain { position: absolute; inset: -50%; pointer-events: none; opacity: .055; mix-blend-mode: soft-light; animation: grain 1s steps(8) infinite; background-size: 220px 220px; }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); } 50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-1%); } 100% { transform: translate(1%,3%); } }

/* ---------- 章名卡、章末卡 ---------- */
#card { position: absolute; inset: 0; background: var(--night); color: #d9d6de; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 1.6s var(--ease); }
#card.on { opacity: 1; pointer-events: auto; }
#card .inner { display: flex; flex-direction: column; align-items: center; gap: 1.6em; opacity: 0; transition: opacity 1.8s var(--ease); }
#card.show-text .inner { opacity: 1; }
#card .zh { font-family: var(--zh); writing-mode: vertical-rl; letter-spacing: .5em; font-size: 2.4rem; font-weight: 400; }
#card .en { font-family: var(--en); letter-spacing: .42em; font-size: .95rem; color: #8f8b99; text-transform: uppercase; font-variant-numeric: lining-nums; }
#card .line { font-family: var(--zh); font-size: 1.6rem; letter-spacing: .6em; }
#card .line:not(.en) { writing-mode: vertical-rl; text-orientation: upright; font-size: 1.9rem; letter-spacing: .7em; padding-top: .7em; }   /* 落幕：與書頁一樣直排（北靜 2026-09-29） */
#card .line.en { font-family: var(--en); font-size: 1.5rem; letter-spacing: .12em; text-transform: none; color: #d9d6de; }
#card .sub { font-family: var(--en); font-size: .8rem; letter-spacing: .2em; color: #6f6b78; }
#card .sub.zh-sub { font-family: var(--zh); letter-spacing: .3em; }

/* ---------- 互動 ---------- */
#hint { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 14px; opacity: 0; transition: opacity 1.2s var(--ease); pointer-events: none; filter: drop-shadow(0 0 10px rgba(0,0,0,.45)); z-index: 3; }
#hint.on { opacity: .9; }
#hint .icon svg { width: 46px; height: 46px; display: block; overflow: visible; }
#hint .skip { color: #f4f2f7; font: 22px var(--en); line-height: 1; opacity: .7; padding: 6px 8px; }
#hint .skip:hover { opacity: 1; }
.ic-pulse { transform-box: fill-box; transform-origin: center; animation: icPulse 1.8s ease-out infinite; }
@keyframes icPulse { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.ic-slide { animation: icSlide 2.2s ease-in-out infinite; }
@keyframes icSlide { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(32px, 0); } }
.ic-foot { animation: icFoot 1.6s steps(1) infinite; }
.ic-foot.b { animation-delay: .8s; }
@keyframes icFoot { 0% { opacity: .95; } 50% { opacity: .2; } }
.ic-breath { transform-box: fill-box; transform-origin: center; animation: icBreath 4.4s ease-in-out infinite; }
@keyframes icBreath { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
#interact { position: absolute; pointer-events: none; touch-action: none; }
#interact.on { pointer-events: auto; cursor: crosshair; }
#interact.touch { pointer-events: auto; cursor: default; touch-action: none; }

/* 視角語言：眼瞼（睜眼、閉眼、眨眼） */
#lids { position: absolute; inset: 0; pointer-events: none; z-index: 8; opacity: 0; overflow: hidden; }
#lids.on { opacity: 1; }
#lids i { position: absolute; left: -20%; right: -20%; height: 54%; background: #050507; }
#lids i.t { top: 0; border-radius: 0 0 50% 50% / 0 0 26% 26%; transform: translateY(-101%); box-shadow: 0 14px 42px 22px #050507; }
#lids i.b { bottom: 0; border-radius: 50% 50% 0 0 / 26% 26% 0 0; transform: translateY(101%); box-shadow: 0 -14px 42px 22px #050507; }

/* ---------- 標題 ---------- */
.screen { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 1.6s var(--ease); }
.screen.on { opacity: 1; pointer-events: auto; }
#title .side { position: absolute; display: flex; }
#title .en-side { flex-direction: column; font-family: var(--en); color: var(--ink); }
#title .zh-side { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; display: block; font-family: var(--zh); color: var(--ink); }
#title .zh-side > * { display: block; }
#title .name-en { font-size: 1em; font-weight: 500; letter-spacing: .03em; line-height: 1; }
#title .sub-en { font-style: italic; color: var(--ink-soft); font-size: .34em; margin: .45em 0 1.5em .05em; letter-spacing: .02em; }
#title .name-zh { font-size: 1em; letter-spacing: .32em; font-weight: 400; line-height: 1; }
#title .by { font-size: .26em; letter-spacing: .3em; color: var(--ink); opacity: .78; }   /* 作者名要讀得到（北靜 2026-09-30） */
#title .en-side .by { margin: 0 0 2.2em .06em; letter-spacing: .06em; font-family: var(--en); font-weight: 500; }
#title .zh-side .by { margin: 0 1.1em 0 0; padding-top: .35em; letter-spacing: .5em; }
#title .menu { display: flex; gap: .9em; }
#title .en-side .menu { flex-direction: column; font-size: .3em; letter-spacing: .26em; }
#title .zh-side .menu { font-size: .34em; letter-spacing: .5em; margin-right: 2.4em; padding-top: 1.1em; }
#title .zh-side .menu button { display: block; margin-left: 1.1em; text-align: start; }
#title .menu button { text-align: left; opacity: .82; transition: opacity .4s, letter-spacing .6s var(--ease); padding: .15em 0; }
#title .menu button:hover, #title .menu button:focus-visible { opacity: 1; outline: none; }

#title .menu button[disabled] { opacity: .28; cursor: default; }
/* 觸控裝置：點擊區至少 44×44（字不變大，只加透明的可點範圍） */
#title.touchy .menu button { min-width: 44px; min-height: 44px; }
#title.touchy .en-side .menu button { padding: 0 .2em; }
#title.touchy .zh-side .menu button { padding: .2em 0; }
#title.touchy.tall .en-side .menu { gap: 1.2em; }
#title.tall .en-side .by { margin-bottom: 1.5em; }
#title.tall .en-side .menu { flex-direction: row; gap: 1.7em; }
/* 試玩版標示：一開始就讓讀者知道這是試玩版（北靜 2026-09-30） */
#title .demo { position: absolute; left: 50%; bottom: 2.4vh; transform: translateX(-50%); display: flex; gap: 1.6em; white-space: nowrap; font-size: 12px; color: var(--ink-soft); pointer-events: none; }
#title .demo [lang=zh-Hant] { font-family: var(--zh); letter-spacing: .3em; }
#title .demo [lang=en] { font-family: var(--en); letter-spacing: .22em; text-transform: uppercase; font-size: 11px; }
#title.tall .demo { left: 9vw; top: 3.2vh; bottom: auto; transform: none; flex-direction: column; gap: .5em; }

/* ---------- 內容提示 ---------- */
/* 封面：闔上的書（北靜 2026-09-30 決定）。書脊在左；翻開時封面向左掀開，整本書移到畫面中線攤開，再接到標題頁。
   閒置時封面右緣會輕輕掀起一下，是無字的「可以翻開」提示。 */
#cover { background: var(--night); display: flex; align-items: center; justify-content: center; perspective: 2400px; cursor: pointer; }
#cover .book { position: relative; height: min(80vh, 128vw); aspect-ratio: 1100 / 1700; transform-style: preserve-3d; transition: transform 1.5s cubic-bezier(.55, .05, .25, 1); }
#cover .block { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.16), rgba(0,0,0,0) 7%), #ebe8ee; border-radius: 1px 3px 3px 1px;
  box-shadow: 1px 1px 0 #dedae3, 2px 2px 0 #f1eff4, 3px 3px 0 #d6d2dc, 4px 4px 0 #ebe8ef, 5px 5px 0 #cdc9d4, 0 34px 70px -22px rgba(0,0,0,.8), 0 10px 24px rgba(0,0,0,.45); }
#cover .lid { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; transition: transform 1.5s cubic-bezier(.55, .05, .25, 1); }
#cover .front, #cover .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 1px 3px 3px 1px; overflow: hidden; }
#cover .front img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-select: none; }
#cover .front::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.3) 0, rgba(255,255,255,.12) 1.1%, rgba(0,0,0,.08) 2.4%, rgba(0,0,0,0) 5%); }
#cover .back { transform: rotateY(180deg); background: linear-gradient(270deg, rgba(0,0,0,.14), rgba(0,0,0,0) 7%), #e6e3ea; }
#cover.on:not(.open) .lid { animation: lidNudge 5.5s 3s ease-in-out infinite; }
@keyframes lidNudge { 0%, 26%, 100% { transform: rotateY(0deg); } 11% { transform: rotateY(-11deg); } }
#cover.open .lid { transform: rotateY(-178deg); }
#cover.open .book { transform: translateX(50%) scale(1.03); }
.tall #cover.open .book { transform: scale(1.03); }   /* 直拿的手機：不移到中線，封面翻出畫面左側 */
#cover.instant .lid, #cover.instant .book { transition: none !important; animation: none !important; }
/* 試玩版結尾：第一日落幕後書闔上，書縮小一點，下方告訴讀者這是試玩版，並附上作品網站 */
#cover { flex-direction: column; }
#cover .book { transition: transform 1.5s cubic-bezier(.55, .05, .25, 1), height 1.4s var(--ease); }
#cover.ended .book { height: min(54vh, 86vw); }
#cover.ended .lid { animation: none; }
#cover.nobook .book { display: none; }
#cover .endnote { max-height: 0; opacity: 0; overflow: hidden; text-align: center; color: #cfccd6; transition: opacity 1.6s .5s var(--ease), max-height 1.4s var(--ease), margin 1.4s var(--ease); pointer-events: none; }
#cover.ended .endnote { max-height: 40vh; opacity: 1; margin-top: 4.5vh; pointer-events: auto; }
#cover .endnote .zh, #cover .endnote .en { display: none; }
#cover.zh .endnote .zh, #cover.en .endnote .en { display: block; }
#cover .endnote .zh { font-family: var(--zh); font-size: 1.05rem; line-height: 2; letter-spacing: .16em; }
#cover .endnote .en { font-family: var(--en); font-size: 1.12rem; line-height: 1.7; letter-spacing: .01em; }
#cover .endnote .more { margin-top: 1.1em; font-size: .86em; color: #9d99a8; }
#cover .endnote .link { display: inline-block; margin-top: .5em; font: 1.02rem var(--en); letter-spacing: .08em; color: #f0eef4; text-decoration: none; border-bottom: 1px solid rgba(240,238,244,.35); padding: .2em 0; }
#cover .endnote .link:hover, #cover .endnote .link:focus-visible { border-bottom-color: #f0eef4; outline: none; }
.touch #cover .endnote .link, #cover .endnote .link { min-height: 44px; line-height: 44px; padding: 0; }
@media (prefers-reduced-motion: reduce) { #cover .lid, #cover .book { transition: none; animation: none !important; } }

#notice { background: var(--night); color: #cfccd6; display: flex; align-items: center; justify-content: center; }
#notice .box { display: flex; gap: 6vw; align-items: stretch; max-width: 88vw; }
#notice .zh-part { writing-mode: vertical-rl; font-family: var(--zh); font-size: 1.05rem; line-height: 2.1; letter-spacing: .14em; height: 14em; }
#notice .zh-part p { white-space: nowrap; margin: 0; }
#notice .zh-part p.gap { margin-right: 1.4em; }
#notice .en-part { font-family: var(--en); font-size: 1.12rem; line-height: 1.7; max-width: 24em; align-self: center; }
#notice .en-part p + p, #notice .zh-part p + p { margin-top: 1em; }

#notice .demo-line { color: #f0eef4; }
#notice .zh-part p.demo-line { margin-left: 1.4em; }
#notice .ok { margin-top: 2em; letter-spacing: .3em; opacity: .85; border-top: 1px solid rgba(207,204,214,.35); padding-top: 1em; }
#notice .ok:hover { opacity: 1; }
.tall #notice .box { flex-direction: column; gap: 3vh; }
.tall #notice .zh-part { height: 14em; align-self: flex-end; }

/* ---------- 支持資源 ---------- */
/* 支持資源：各地區的 24 小時專線 */
#support { background: var(--night); color: #cfccd6; display: flex; align-items: center; justify-content: center; z-index: 6; }
#support .box { width: min(40em, 88vw); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: .8em; padding: 1em 0; scrollbar-width: thin; }
#support .lead { margin: 0; color: #e4e1e8; font-family: var(--zh); font-size: 1rem; line-height: 1.9; letter-spacing: .06em; }
#support .lead.en { font-family: var(--en); font-size: 1.05rem; line-height: 1.6; letter-spacing: 0; margin-bottom: .2em; }
#support .lines { margin: 0; border-top: 1px solid rgba(207,204,214,.18); }
#support .lines > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1em; padding: .42em 0; border-bottom: 1px solid rgba(207,204,214,.18); }
#support dt { display: flex; flex-direction: column; min-width: 7.5em; color: #9d99a8; }
#support dt [lang=zh-Hant] { font-family: var(--zh); font-size: .95rem; letter-spacing: .12em; color: #cfccd6; }
#support dt [lang=en] { font-family: var(--en); font-size: .82rem; letter-spacing: .04em; }
#support dd { margin: 0; display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: .2em 1em; text-align: right; }
#support .n { font-size: .88rem; color: #9d99a8; }
#support .n[lang=zh-Hant] { font-family: var(--zh); letter-spacing: .08em; }
#support .n[lang=en] { font-family: var(--en); }
#support b { font: 600 1.08rem var(--en); color: #f0edf3; letter-spacing: .06em; font-variant-numeric: lining-nums; white-space: nowrap; }
#support a { color: #e4e1e8; font-family: var(--en); letter-spacing: .04em; }
#support .note { margin: .3em 0 0; display: flex; flex-direction: column; gap: .2em; font-size: .9rem; color: #9d99a8; }
#support .note [lang=zh-Hant] { font-family: var(--zh); letter-spacing: .06em; }
#support .note [lang=en] { font-family: var(--en); }
#support .ok { align-self: flex-start; margin-top: .6em; letter-spacing: .3em; opacity: .85; border-top: 1px solid rgba(207,204,214,.35); padding-top: 1em; }
#settings .support-link { margin-top: 1.8em; text-align: center; font-size: .85rem; letter-spacing: .16em; }
#settings .support-link button { opacity: .55; }
#settings .support-link button:hover { opacity: 1; }

/* ---------- 設定 ---------- */
#settings { background: rgba(var(--paper-rgb), .94); display: flex; align-items: center; justify-content: center; color: var(--ink); }
#settings .panel { font-family: var(--en); min-width: min(26em, 86vw); }
#settings.zh .panel { font-family: var(--zh); }
#settings h2 { font-weight: 400; letter-spacing: .4em; font-size: .85rem; color: var(--ink-soft); margin-bottom: 2.2em; text-align: center; }
#settings .row { display: flex; justify-content: space-between; align-items: center; padding: 1em 0; border-bottom: 1px solid rgba(43,41,51,.12); gap: 2em; }
#settings .row .k { letter-spacing: .12em; font-size: 1rem; }
#settings .opts { display: flex; gap: 1.2em; }
#settings .opts button { opacity: .38; letter-spacing: .08em; transition: opacity .3s; }
#settings .opts button.sel { opacity: 1; border-bottom: 1px solid var(--ink); }
#settings input[type=range] { width: 9em; accent-color: #5b5866; }
#settings .actions { display: flex; justify-content: space-between; margin-top: 2.4em; letter-spacing: .2em; font-size: .9rem; }
#settings .actions button { opacity: .7; }
#settings .actions button:hover { opacity: 1; }

/* ---------- 暫代標記 ---------- */
#phlabel { position: absolute; left: 12px; bottom: 9px; font: 11px 'HV Serif TC', sans-serif; letter-spacing: .12em; color: rgba(40,38,48,.55); background: rgba(var(--paper-rgb), .55); padding: 3px 8px; border-radius: 2px; opacity: 0; transition: opacity .8s; pointer-events: none; }
#phlabel.on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .plate .drift, #grain, #more.on, #scene.pulse, .ring, .ic-pulse, .ic-slide, .ic-foot, .ic-breath { animation: none; }
  .plate, #text p, #page, #card, .screen { transition-duration: .01s; }
}

#stage { transition: background-color 2.8s var(--ease); }
#stage.night { background: var(--night); }

/* ---------- 閱讀中的選單鈕 ---------- */
#menu { position: absolute; width: 40px; height: 40px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .6s var(--ease), background .4s; z-index: 5; }
#menu i { display: block; width: 18px; height: 1px; background: var(--ink); }
#stage.reading:not(.menu-open) #menu { opacity: .5; pointer-events: auto; }
#stage.reading:not(.menu-open) #menu:hover, #menu:focus-visible { opacity: .9; outline: none; }
#stage.tall #menu { background: rgba(var(--paper-rgb), .6); }
#stage.night #menu i { background: #d6d3dc; }
#stage.night.tall #menu { background: rgba(11,11,14,.5); }

/* ---------- iPhone Duo 外屏：哈氣玻璃（覆蓋一切；展開＝霧散） ---------- */
#glass { position: fixed; left: 0; top: 0; width: 100%; height: 100%; display: none; pointer-events: none; z-index: 50; opacity: 0; transition: opacity 2.6s ease; }
#glass.on { opacity: 1; }
#glass.on.hide { opacity: 0; transition: opacity .8s ease; }
#glass.lift { opacity: 0; filter: blur(10px); transform: scale(1.05); transition: opacity 1.5s ease, filter 1.5s ease, transform 1.5s ease; }
html.glass-on, html.glass-on body, html.glass-on #stage { touch-action: none; }

/* ---------- 第一日分鏡（v0.7）：記憶、疊印、黑暗中的目光、邊緣模糊、黑色汁液、跑馬燈 ---------- */
#memVeil, #ghost, #edgeBlur, #sap, #gaze, #montage { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
#memVeil { transition: opacity 2.4s ease; background: radial-gradient(ellipse 72% 68% at 50% 48%, rgba(250,248,252,0) 50%, rgba(250,248,252,.45) 84%, rgba(250,248,252,.75) 100%); }
#scene.mem #memVeil { opacity: 1; }
#scene.pain #memVeil { opacity: 1; animation: painVeil 4.4s ease-in-out infinite; }
#scene.pain .plate.on { animation: painBlur 4.4s ease-in-out infinite; }
@keyframes painVeil { 0%, 36%, 100% { opacity: .85; } 44% { opacity: 1; } 56% { opacity: .9; } 74% { opacity: 1; } 80% { opacity: .85; } }
@keyframes painBlur { 0%, 36%, 100% { filter: none; } 44% { filter: blur(2.6px) brightness(1.2); } 56% { filter: blur(.6px); } 72% { filter: none; } 75% { filter: blur(1.8px) brightness(1.12); } 82% { filter: none; } }
#scene.warm .plate { filter: sepia(.2) saturate(1.12) brightness(1.05); transition: opacity 1.8s var(--ease), filter 5s ease; }
#ghost { object-fit: cover; transition: opacity 3s ease; filter: saturate(.22) contrast(.86) brightness(1.1) blur(.6px); }
#ghost.on { opacity: .4; animation: ghostDrift 26s ease-in-out infinite alternate; }
@keyframes ghostDrift { from { transform: scale(1.03); } to { transform: scale(1.1) translate(-1.2%, .8%); } }
#edgeBlur { transition: opacity 3s ease; -webkit-backdrop-filter: blur(7px) brightness(.88); backdrop-filter: blur(7px) brightness(.88);
  -webkit-mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, transparent 38%, #000 100%); mask-image: radial-gradient(ellipse 60% 56% at 50% 50%, transparent 38%, #000 100%); }
#sap { filter: blur(1.2px); }
#gaze { --gx: 50%; --gy: 50%; --ga: .9; --r0: 40px; --r1: 90px; --r2: 150px;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(3,3,6,0) 0, rgba(3,3,6,0) var(--r0), rgba(3,3,6,calc(var(--ga) * .72)) var(--r1), rgba(3,3,6,var(--ga)) var(--r2)); }
#montage { object-fit: cover; transition: opacity .05s linear; filter: saturate(.25) contrast(1.05) brightness(1.12) blur(.4px); }
.seashadow { position: absolute; left: -45%; width: 42%; border-radius: 50%; pointer-events: none; opacity: 0; filter: blur(10px); mix-blend-mode: multiply;
  background: radial-gradient(ellipse at 50% 50%, rgba(10,14,22,.85), rgba(10,14,22,0) 70%); }
.seashadow.go { animation: seaShadow 15s ease-in-out forwards; }
@keyframes seaShadow { 0% { left: -45%; opacity: 0; } 15% { opacity: .55; } 85% { opacity: .5; } 100% { left: 105%; opacity: 0; } }
#stage.still .drift, #stage.still #grain, #stage.still #ghost.on { animation-play-state: paused; }
#scene.glitch { animation: glitch .26s steps(2) 1; }
@keyframes glitch { 0% { transform: none; filter: none; } 25% { transform: translate(-7px, 1px); filter: contrast(1.5) hue-rotate(28deg) saturate(1.6); } 50% { transform: translate(5px, -2px); filter: contrast(1.3) hue-rotate(-20deg); } 75% { transform: translate(-3px, 0); } 100% { transform: none; filter: none; } }
#stage.grainy #grain { opacity: .16; }
@media (prefers-reduced-motion: reduce) { #scene.pain .plate.on, #scene.pain #memVeil, #ghost.on, #scene.glitch, .seashadow.go { animation: none; } }
/* 林中的身影：霧裡要看得出來，但仍只是一個暗影 */
.plate .drift img.app { filter: brightness(.82) contrast(1.15); }

/* 第 49～50 段：撲過來、擊中（2026-09-29） */
.speedlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41; }
#scene.knocked .plate.on { transform: rotate(-2.6deg) scale(1.09); transition: opacity 1.8s var(--ease), transform .5s cubic-bezier(.2,.8,.2,1); }
#scene.fallen .plate.on { transform: rotate(4deg) translateY(4%) scale(1.15); transition: opacity 1.8s var(--ease), transform .42s cubic-bezier(.3,1.25,.5,1); }
#scene.shove .plate.on { animation: shove .32s ease-out; }
@keyframes shove { 0% { translate: 0 0; } 28% { translate: 0 -2.4%; } 100% { translate: 0 0; } }
#scene.dazed .plate.on { filter: blur(2.6px) saturate(.35) brightness(1.12); animation: daze 5.5s ease-in-out infinite; transition: opacity 1.8s var(--ease), transform .5s ease, filter 3s ease; }
@keyframes daze { 0%, 100% { rotate: 0deg; } 50% { rotate: 1.8deg; } }
@media (prefers-reduced-motion: reduce) { #scene.shove .plate.on, #scene.dazed .plate.on { animation: none; } }
/* 海面下的東西游過舟底：舟身被托高（第 15 段） */
.plate.swell .frame { animation: swell 4.2s ease-in-out 1; }
@keyframes swell { 0%, 100% { translate: 0 0; rotate: 0deg; } 45% { translate: 0 -1.6%; rotate: .5deg; } 70% { translate: 0 .5%; rotate: -.2deg; } }
