/* 夜戏：一夜四拍（docs/NIGHT_DESIGN.md）。整屏竖版夜画；电脑上居中成一幅立轴，两边铺同图的虚影 */

.night.nv-on .nt-shade { opacity: 0; }
.night.nv-on .nt-stage { padding: 0; }

/* ——月下长廊：宫灯一盏盏亮向她的宫门—— */
.nt-corridor { position: absolute; inset: 0; }
.nc-lamps i {
  position: absolute; left: calc(12% + var(--i) * 10.5%); top: calc(66% - var(--i) * 4.6%);
  width: calc(30px - var(--i) * 2.6px); aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border-radius: 42% 42% 46% 46%; background: #2a0b0b; box-shadow: inset 0 0 0 1px rgba(242, 207, 122, 0.22);
  transition: background 0.7s, box-shadow 0.7s;
}
.nc-lamps i::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 60%; background: rgba(242, 207, 122, 0.3); }
.nc-lamps i.on {
  background: radial-gradient(ellipse at 50% 58%, #ffe2a0, #ec6a34 58%, #8e1f17);
  box-shadow: 0 0 calc(28px - var(--i) * 2px) rgba(255, 140, 60, 0.8), 0 0 70px rgba(255, 120, 40, 0.22);
  animation: nc-sway 3.2s ease-in-out infinite alternate;
}
@keyframes nc-sway { to { rotate: 3deg; } }
.nc-call {
  position: absolute; left: 0; right: 0; top: 18%; margin: 0; text-align: center;
  font: 400 34px/1.7 var(--f-brush); color: #f2d8a8; letter-spacing: 0.4em; text-shadow: 0 0 18px rgba(255, 150, 70, 0.5);
  animation: nc-call 2.4s ease-out 0.3s both;
}
@keyframes nc-call { from { opacity: 0; letter-spacing: 0.9em; filter: blur(4px); } }
.nc-wait { position: absolute; left: 16px; right: 16px; bottom: calc(9% + var(--safe-b)); margin: 0; text-align: center; color: var(--dim); font-size: 13px; letter-spacing: 0.2em; }

/* ——夜画—— */
.nv { position: absolute; inset: 0; display: grid; place-items: center; background: #050202; }
.nv-blur { position: absolute; inset: -60px; background: center / cover no-repeat; filter: blur(34px) brightness(0.3) saturate(0.8); transition: background-image 1s; }
.nv-frame {
  position: relative; height: 100%; width: min(100%, calc(100dvh * 9 / 16)); overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; box-shadow: 0 0 90px rgba(0, 0, 0, 0.85);
}
.nv-cam { position: absolute; inset: 0; transform: translateY(var(--y, 0)) scale(var(--z, 1)); transform-origin: 50% 26%; transition: transform 7s cubic-bezier(0.25, 0.1, 0.25, 1), filter 1.4s; }
.nv-pic, .nv-layer { position: absolute; inset: 0; }
.nv-img { position: absolute; inset: 0; background: center 28% / cover no-repeat; animation: nv-breathe 7s ease-in-out infinite alternate; }
@keyframes nv-breathe { to { transform: scale(1.014); } }

/* 缺夜画：寝宫底图 + 她的立绘，一更比一更暗、一更比一更近 */
.nv-img.proc { animation: none; }
.nv-room { position: absolute; inset: 0; filter: blur(3px) brightness(0.5) saturate(0.85); }
.nv-room .bg-pane { opacity: 1; }
.nv-tachie { position: absolute; left: 50%; bottom: -4%; height: 92%; aspect-ratio: 2 / 3; translate: -50% 0; animation: breath 4.6s ease-in-out infinite; transform-origin: 50% 100%; }
.nv-img.proc.g2 .nv-tachie { height: 108%; bottom: -16%; filter: brightness(0.92) sepia(0.12); }
.nv-img.proc.g3 .nv-tachie { height: 124%; bottom: -32%; filter: brightness(0.82) sepia(0.2); }
.nv-img.proc.g4 .nv-tachie { height: 140%; bottom: -48%; filter: brightness(0.74) sepia(0.26); }
.nv-img.proc.g3 .nv-room, .nv-img.proc.g4 .nv-room { filter: blur(6px) brightness(0.32); }

/* 烛光一跳一跳；上下压暗，字落在下面那一截 */
.nv-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 20% 32%, rgba(255, 170, 90, 0.2), transparent 58%); mix-blend-mode: screen; animation: nv-flicker 2.6s ease-in-out infinite alternate; }
@keyframes nv-flicker { 0% { opacity: 0.65; } 38% { opacity: 1; } 52% { opacity: 0.8; } 100% { opacity: 0.95; } }
.nv-vig { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 16%, transparent 56%, rgba(6, 2, 2, 0.86)), radial-gradient(ellipse at 50% 38%, transparent 55%, rgba(0, 0, 0, 0.5)); }

/* 吹了灯：暗从烛火那里漫开 */
.nv-frame::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(circle at var(--cx, 85%) var(--cy, 88%), rgba(0, 0, 0, 0.5), #000 55%); opacity: 0; }
.nv-frame.dark::after { animation: nv-dark 1.4s ease-in forwards; }
.nv-frame.dark .nv-glow { animation: none; opacity: 0; transition: opacity 0.4s; }
@keyframes nv-dark { to { opacity: 1; } }

/* 纱帐：程序画的两幅，手指拨开时跟着走 */
.nv-gauze {
  position: absolute; top: -2%; bottom: -2%; width: 60%; z-index: 2; pointer-events: none; opacity: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 214, 190, 0) 0 16px, rgba(255, 214, 190, 0.14) 24px, rgba(255, 214, 190, 0) 36px),
    linear-gradient(180deg, rgba(160, 44, 40, 0.3), rgba(90, 20, 20, 0.42));
  transition: transform 1s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.9s;
}
.nv-gauze.l { left: 0; transform: translateX(-100%); box-shadow: inset -18px 0 30px rgba(255, 190, 150, 0.08); }
.nv-gauze.r { right: 0; transform: translateX(100%); box-shadow: inset 18px 0 30px rgba(255, 190, 150, 0.08); }
.veiled .nv-gauze { opacity: 1; }
.veiled .nv-gauze.l { transform: translateX(calc(-12% - var(--pull, 0) * 88%)); }
.veiled .nv-gauze.r { transform: translateX(calc(12% + var(--pull, 0) * 88%)); }
.fallen .nv-gauze { background-color: rgba(30, 6, 6, 0.4); }
.fallen .nv-gauze.l, .fallen .nv-gauze.r { transform: translateX(0); transition-duration: 0.7s; }
@media (min-width: 861px) { .nv-gauze { backdrop-filter: blur(2px); } }

/* 她的话：浮在画上，像耳语 */
.nv-words { position: absolute; left: 7%; right: 7%; bottom: calc(15% + var(--safe-b)); z-index: 3; pointer-events: none; text-align: center; transition: bottom 0.5s; }
.nv-frame:has(.nv-acts.on) .nv-words { bottom: calc(44% + var(--safe-b)); }
.nv-words p { margin: 0; font: 400 19px/1.8 var(--f-serif); color: #f7e8cd; letter-spacing: 0.06em; text-shadow: 0 0 14px rgba(0, 0, 0, 0.95), 0 2px 4px rgba(0, 0, 0, 0.85); }
.nv-hint { position: absolute; left: 0; right: 0; bottom: calc(5.5% + var(--safe-b)); z-index: 3; text-align: center; font-size: 13px; letter-spacing: 0.4em; color: rgba(242, 216, 168, 0.75); opacity: 0; transition: opacity 0.6s; pointer-events: none; }
.nv-hint.on { opacity: 1; animation: breathe 2.2s ease-in-out infinite; }
.veiled .nv-hint.on::before { content: "⟵　"; }
.veiled .nv-hint.on::after { content: "　⟶"; }

/* 第二拍的三个动作 */
.nv-acts { position: absolute; left: 50%; bottom: calc(13% + var(--safe-b)); z-index: 3; transform: translateX(-50%); display: none; flex-direction: column; gap: 10px; width: min(78%, 320px); }
.nv-acts.on { display: flex; }
.nv-act {
  padding: 12px 18px; border-radius: 3px; border: 1px solid rgba(242, 207, 122, 0.42); cursor: pointer;
  background: linear-gradient(180deg, rgba(64, 16, 16, 0.8), rgba(28, 6, 6, 0.88)); color: #f6e2bd;
  font: 400 18px/1.3 var(--f-brush); letter-spacing: 0.22em; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.nv-act small { display: block; margin-top: 4px; font: 400 12px/1.4 var(--f-serif); letter-spacing: 0.06em; color: rgba(246, 226, 189, 0.62); }
.nv-wait { margin: 0; text-align: center; font: 400 14px/1.8 var(--f-serif); letter-spacing: 0.1em; color: #f6e2bd; text-shadow: 0 2px 8px #000; }
.nv-act.later { padding: 8px 14px; font-size: 14px; letter-spacing: 0.3em; background: transparent; border-color: rgba(242, 207, 122, 0.18); color: rgba(246, 226, 189, 0.55); box-shadow: none; }
.nv-act:hover, .nv-act:focus-visible { border-color: var(--gold-bright); box-shadow: 0 0 18px rgba(242, 207, 122, 0.35); transform: translateY(-1px); }
.nv-note {
  position: absolute; left: 4%; right: 4%; top: calc(8% + env(safe-area-inset-top, 0px)); z-index: 3; padding: 8px 12px; text-align: center; pointer-events: none;
  font: 400 16px/1.6 var(--f-brush); color: #f2cf7a; letter-spacing: 0.12em;
  background: linear-gradient(90deg, transparent, rgba(20, 8, 4, 0.76) 18%, rgba(20, 8, 4, 0.76) 82%, transparent);
}
.nv-note.bad { color: #e8a59a; }

/* 吹灯：按住烛火，火苗一点点矮下去 */
.nv-candle {
  position: absolute; right: 8%; bottom: calc(8% + var(--safe-b)); z-index: 5; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; touch-action: none; background: radial-gradient(circle, rgba(255, 170, 80, 0.28), transparent 70%);
}
.nv-candle .hold-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.nv-candle .hold-ring circle { fill: none; stroke: #f2cf7a; stroke-width: 2.5; opacity: 0.9; }
.nv-candle .hold-ring circle.track { stroke: rgba(242, 207, 122, 0.22); stroke-width: 1.5; animation: breathe 2.2s ease-in-out infinite; }
.nv-candle .flame { transform: scale(1.5) translateY(-4px); }
.nv-candle::before { content: ""; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 160, 70, 0.32), transparent 65%); animation: nv-flicker 2s ease-in-out infinite alternate; pointer-events: none; }
.nv-candle .flame b { transform: scaleY(calc(1 - var(--hold, 0) * 0.75)); opacity: calc(1 - var(--hold, 0) * 0.45); animation-duration: 0.9s; }
.nv-candle.out .flame b { opacity: 0; transform: scaleY(0); }

/* 结尾的旁白：断了的夜，屏上留一支没灭的蜡烛 */
.nt-fade.lit { background: radial-gradient(ellipse at 50% 60%, rgba(70, 14, 10, 0.6), #000 72%); }
.nt-fade.lit { grid-template-rows: auto auto; align-content: center; gap: 28px; }
.nf-candle { justify-self: center; transform: scale(0.6); }

/* ——晨起：这一夜最后停在的那幅画，冷蓝、柔焦—— */
.nv-dawn { position: absolute; inset: 0; overflow: hidden; }
.nv-dawn .nv-img { inset: -3%; filter: saturate(0.45) brightness(0.8) blur(2px); animation: none; background-position: center 25%; }
.nv-dawn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(90, 125, 175, 0.42), rgba(16, 26, 46, 0.62)); }

/* ——到了新的一更—— */
.nv-geng { position: absolute; inset: 0; z-index: 6; background: rgba(4, 2, 2, 0.9); cursor: pointer; }
.ng-pic { position: absolute; top: 0; bottom: 0; left: 50%; translate: -50% 0; width: min(100%, calc(100dvh * 9 / 16)); overflow: hidden; }
.ng-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(4, 2, 2, 0.92)); }
.ng-pic .nv-img { animation: none; }
.ng-text { position: absolute; left: 16px; right: 16px; bottom: calc(10% + var(--safe-b)); z-index: 1; text-align: center; }
.ng-text small { color: #e8d6b8; letter-spacing: 0.3em; }
.ng-text b { display: block; margin: 6px 0; font: 400 34px/1.4 var(--f-brush); color: var(--gold-bright); letter-spacing: 0.28em; text-shadow: 0 0 22px rgba(255, 160, 80, 0.6); }
.ng-text p { margin: 0; color: #f0dfc0; letter-spacing: 0.1em; }
.nv-geng .aud-next { position: absolute; left: 50%; bottom: calc(4% + var(--safe-b)); top: auto; right: auto; }

/* ——绿头牌：牌头的小灯是她陪朕到第几更；小金点是摸到了几样心思—— */
.lv-head { position: relative; width: 100%; }
.lv-geng { position: absolute; left: 0; right: 0; bottom: 5px; display: flex; justify-content: center; gap: 3px; }
.lv-geng i { width: 5px; height: 7px; border-radius: 40%; background: rgba(10, 30, 20, 0.55); box-shadow: inset 0 0 0 1px rgba(242, 207, 122, 0.25); }
.lv-geng i.on { background: radial-gradient(#ffe2a0, #e0542e); box-shadow: 0 0 6px rgba(255, 140, 60, 0.9); }
.lv-known { position: absolute; top: 52px; right: -5px; width: 16px; height: 16px; border-radius: 50%; font: normal 11px/16px var(--f-serif); color: #2a1e15; background: var(--gold-bright); box-shadow: 0 0 8px rgba(242, 207, 122, 0.8); }

@media (max-width: 860px) {
  .nc-call { font-size: 26px; }
  .nv-words p { font-size: 17px; }
  .nv-act { font-size: 16px; padding: 11px 14px; }
  .lv-geng { bottom: 3px; gap: 2px; }
  .lv-geng i { width: 4px; height: 5px; }
  .lv-known { top: 37px; width: 14px; height: 14px; line-height: 14px; font-size: 10px; }
  .ng-text b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .nv-cam { transition-duration: 0.01s; }
  .nv-img, .nc-lamps i.on { animation: none; }
}

/* ——枕边往事：小标题、往事录—— */
.nv-story {
  position: absolute; left: 0; right: 0; top: 38%; z-index: 4; display: grid; justify-items: center; gap: 6px; pointer-events: none;
  padding: 18px 0; background: linear-gradient(90deg, transparent, rgba(12, 4, 2, 0.7) 22%, rgba(12, 4, 2, 0.7) 78%, transparent);
}
.nv-story small { color: #e8d6b8; font-size: 13px; letter-spacing: 0.6em; }
.nv-story b { font: 400 30px/1.3 var(--f-brush); color: var(--gold-bright); text-shadow: 0 0 20px rgba(255, 160, 80, 0.55); }
.nv-story.last b { color: #ffe0b0; text-shadow: 0 0 28px rgba(255, 120, 90, 0.75); }
.nh-five { display: flex; justify-content: center; gap: 8px; margin: 10px 0 12px; padding: 0; list-style: none; flex-wrap: wrap; }
.nh-five li { display: grid; gap: 2px; padding: 4px 8px; border: 1px solid rgba(242, 207, 122, 0.25); color: rgba(240, 223, 192, 0.35); font: 400 15px/1.3 var(--f-brush); letter-spacing: 0.1em; transition: color 0.4s, border-color 0.4s, box-shadow 0.4s; }
.nh-five li small { font: 11px/1 var(--f-body, inherit); letter-spacing: 0.2em; }
.nh-five li.on { color: var(--gold-bright); border-color: rgba(242, 207, 122, 0.7); box-shadow: 0 0 12px rgba(242, 207, 122, 0.3); }

.hc-heart { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 2px 0 6px; }
.hc-heart em { font-style: normal; font-size: 12px; color: var(--dim); margin-right: 2px; letter-spacing: 0.2em; }
.hh { display: inline-flex; align-items: baseline; gap: 3px; padding: 1px 5px; border: 1px dashed rgba(255, 255, 255, 0.14); border-radius: 2px; font-size: 12px; color: rgba(255, 255, 255, 0.28); background: none; }
.hh small { font-size: 10px; }
.hh.on { border: 1px solid rgba(242, 207, 122, 0.45); color: var(--gold-bright); background: rgba(242, 207, 122, 0.08); cursor: pointer; }
.hh.on:hover { background: rgba(242, 207, 122, 0.16); }
.heart-letter { max-width: 420px; margin: 0 auto; padding-top: 32px; }
.heart-letter .hl-who { margin: 0; text-align: center; font-size: 12px; color: var(--dim); letter-spacing: 0.2em; }
.heart-letter > p:not(.hl-who) { margin: 0 0 10px; font: 400 17px/1.8 var(--f-brush); color: #f0dfc0; letter-spacing: 0.06em; }
