/* ================================================================== */
/* 全职青少年 · 单作品版补充样式                                       */
/* 01 唯一作品 / 像素磁带 / 磁带机 2.5D 补充                           */
/* ================================================================== */

.px-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- 开场：唯一作品挂牌 ---------- */

.open__worktag {
  left: 7vw;
  top: 59vh;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  align-items: center;
  width: min(268px, 23vw);
  padding: 12px 14px 12px 18px;
  color: var(--h-paper);
  background: rgba(8, 7, 6, .9);
  border: 1px solid rgba(242, 236, 221, .34);
  border-left: 4px solid var(--h-red);
  box-shadow: 10px 12px 0 rgba(0, 0, 0, .4), 0 22px 50px rgba(0, 0, 0, .45);
  rotate: 1.6deg;
  z-index: 9;
  transition: translate .3s cubic-bezier(.2, .8, .2, 1), border-color .25s, background .25s;
  backdrop-filter: blur(3px);
}
.open__worktag span {
  grid-column: 1 / 3;
  font-family: var(--h-mono);
  font-size: 6.5px;
  letter-spacing: .24em;
  color: var(--h-grey);
}
.open__worktag b {
  margin-top: 5px;
  font-family: var(--h-serif);
  font-size: clamp(26px, 2.4vw, 40px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .12em;
}
.open__worktag i {
  grid-column: 1;
  margin-top: 7px;
  font-family: var(--h-mono);
  font-style: normal;
  font-size: 6.5px;
  letter-spacing: .18em;
  color: var(--h-red);
}
.open__worktag::after {
  content: "↗";
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: center;
  font-family: var(--h-mono);
  font-size: 20px;
  color: var(--h-red);
  transition: translate .25s, color .25s;
}
.open__worktag:hover {
  translate: 0 -6px;
  border-color: var(--h-red);
  background: rgba(24, 10, 9, .94);
}
.open__worktag:hover::after { translate: 3px 0; color: var(--h-paper); }

/* ---------- 01 唯一作品 ---------- */

.cluster--solo {
  min-height: 108vh;
  margin-top: -5vh;
}

.solo__kicker {
  left: 5vw;
  top: 7vh;
  font-family: var(--h-mono);
  font-size: 8px;
  letter-spacing: .3em;
  color: var(--h-grey);
  z-index: 7;
}

.solo__head {
  left: 6vw;
  top: 12vh;
  width: min(780px, 58vw);
  z-index: 8;
}
.solo__title {
  margin: 0;
  font-family: var(--h-serif);
  font-size: clamp(76px, 11.4vw, 190px);
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.03em;
  color: var(--h-paper);
  text-shadow: 0 0 40px rgba(255, 246, 222, .12);
}
.solo__title em { font-style: normal; color: var(--h-red); }
.solo__title span { color: var(--h-paper); }
.solo__en {
  margin: 14px 0 0;
  font-family: var(--h-mono);
  font-size: 8px;
  letter-spacing: .3em;
  color: var(--h-grey);
}
.solo__desc {
  width: min(520px, 42vw);
  margin: 22px 0 0;
  font-family: var(--h-serif);
  font-size: 13px;
  line-height: 2.1;
  color: var(--h-paper-2);
}
.solo__desc b { color: var(--h-red); font-weight: 900; }

.solo__shot {
  right: 5vw;
  top: 23vh;
  width: min(38vw, 560px);
  margin: 0;
  padding: 9px 9px 0;
  background: var(--h-paper);
  rotate: 1.4deg;
  box-shadow: 16px 20px 0 rgba(0, 0, 0, .4), 0 30px 70px rgba(0, 0, 0, .55);
  z-index: 4;
  transition: rotate .4s cubic-bezier(.2, .8, .2, 1), translate .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
.solo__shot img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.06) brightness(.94);
  transition: filter .35s;
}
.solo__shot:hover {
  rotate: 0deg;
  translate: 0 -8px;
  box-shadow: 22px 28px 0 rgba(0, 0, 0, .42), 0 40px 90px rgba(0, 0, 0, .6);
}
.solo__shot:hover img { filter: grayscale(.25) contrast(1.04) brightness(1); }
.solo__shot:hover .solo__pin { background: #f2ecdd; box-shadow: 0 0 14px rgba(210, 27, 34, .8); }
.solo__shot .solo__pin { transition: background .25s, box-shadow .25s; }
.solo__shot figcaption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 2px 8px;
  font-family: var(--h-mono);
  font-size: 6px;
  letter-spacing: .16em;
  color: var(--h-ink);
}
.solo__pin {
  position: absolute;
  left: 50%;
  top: -9px;
  width: 16px;
  height: 16px;
  translate: -50% 0;
  background: var(--h-red);
  border: 2px solid var(--h-ink);
  rotate: 45deg;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .35);
}

.solo__icon {
  right: 7vw;
  top: 72vh;
  width: clamp(100px, 8.6vw, 144px);
  height: auto;
  z-index: 3;
  rotate: -7deg;
  filter: drop-shadow(12px 14px 0 rgba(0, 0, 0, .45));
  animation: soloTapeFloat 5.6s steps(2, end) infinite;
}
@keyframes soloTapeFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.solo__fine {
  left: 6vw;
  bottom: 3.5vh;
  margin: 0;
  font-family: var(--h-mono);
  font-size: 6.5px;
  letter-spacing: .2em;
  color: var(--h-grey);
  z-index: 6;
}

/* ---------- 02 社交：像素磁带 ---------- */

.follow__tape {
  right: 9vw;
  top: 7vh;
  width: clamp(96px, 9vw, 140px);
  height: auto;
  rotate: -8deg;
  opacity: .92;
  filter: drop-shadow(9px 10px 0 rgba(0, 0, 0, .4));
  z-index: 5;
  animation: soloTapeFloat 6.4s steps(2, end) infinite;
}

/* ---------- 磁带机内部：地面 / 墙上漫画 / 2.5D ---------- */

.room-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(214, 232, 219, .07) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, transparent 0%, rgba(4, 11, 11, .5) 70%, rgba(2, 6, 7, .7) 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 46%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 46%);
}

.room-gallery {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.room-gallery__panel {
  position: absolute;
  margin: 0;
  width: 94px;
  padding: 4px;
  background: #0b0908;
  border: 2px solid rgba(226, 216, 196, .22);
  box-shadow: 8px 10px 0 rgba(0, 0, 0, .4);
  translate:
    calc(var(--gx, 0) * 10px)
    calc(var(--gy, 0) * 8px);
  transition: translate .3s ease-out;
}
.room-gallery__panel img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(.45) contrast(1.14) brightness(.86);
  opacity: .5;
}
.room-gallery__panel--a { left: 2.4vw; top: 24vh; rotate: -7deg; }
.room-gallery__panel--b { left: 6vw; top: 63vh; rotate: 4deg; width: 76px; translate: calc(var(--gx, 0) * 16px) calc(var(--gy, 0) * 12px); }
.room-gallery__panel--c { right: 2.2vw; top: 27vh; rotate: 6deg; }
.room-gallery__panel--d { right: 6vw; top: 65vh; rotate: -4deg; width: 82px; translate: calc(var(--gx, 0) * -14px) calc(var(--gy, 0) * -10px); }

/* 机身随指针微倾 + 像素浮动 */
body.room-open .console {
  transform: perspective(1200px)
    rotateX(var(--tiltX, 0deg))
    rotateY(var(--tiltY, 0deg));
  transition: transform .16s ease-out;
  transform-style: preserve-3d;
}
.case-shell {
  translate: 0 0;
  animation: pxBob 6s steps(2, end) infinite;
}
@keyframes pxBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -2px; }
}
#machine {
  filter: drop-shadow(0 26px 24px rgba(0, 0, 0, .5));
}
body.room-open #machine { touch-action: none; }

#machine .hot { transition: filter .18s ease; }
#machine .hot .hover-ring { transition: opacity .14s; }

/* 3D 走带按键 */
#machine .btn {
  transition: translate .07s steps(2, end), filter .12s;
}
#machine .btn:hover {
  translate: 0 -1.4px;
  filter: brightness(1.38) drop-shadow(0 0 7px rgba(255, 177, 92, .55));
}
#machine .btn:hover .btn-face { fill: #37516b; }
#machine .btn.is-pressed {
  transform: none;
  translate: 0 1.6px;
  filter: brightness(.78) saturate(.8);
}
#machine .btn.is-pressed .btn-face { fill: #101b26; }

/* 电源 */
#powerBtn { transition: filter .18s; }
#powerBtn:hover { filter: drop-shadow(0 0 7px rgba(255, 96, 64, .6)); }
#powerBtn:hover circle:nth-of-type(3) { fill: #e04a38; }
#powerBtn:active { translate: 0 1px; }

/* 音量轮 / 电平 */
#volWheel { transition: filter .18s; }
#volWheel:hover { filter: drop-shadow(0 0 5px rgba(255, 177, 92, .45)); }
#volWheelRidges { transition: transform .09s steps(5, end); }
#volMeter .seg { fill: #22303a; transition: fill .1s steps(2, end); }
#volMeter .seg.is-on { fill: #ffb15c; }

/* 开机屏幕发光 / 外放灯光 */
#lcdScreen { transition: filter .3s ease; }
#machine.is-on #lcdScreen { filter: drop-shadow(0 0 6px rgba(255, 177, 92, .26)); }
#speakerGrille { transition: filter .2s ease; }
#machine.is-on.spk-on #speakerGrille {
  filter: drop-shadow(0 0 7px rgba(255, 177, 92, .55));
}
#machine.is-on.spk-on #speakerGrille text { fill: #ffb15c; }

/* 上盖磁带：待机轻浮 + 悬停抬起 */
#lidTapeAnim { animation: tapeIdle 3.4s steps(2, end) infinite; }
@keyframes tapeIdle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -2.2px; }
}
#lidTape { transition: translate .18s steps(2, end), filter .18s; touch-action: none; cursor: grab; }
#lidTape:active { cursor: grabbing; }
#lidTape:hover { translate: 0 -5px; filter: drop-shadow(0 0 7px rgba(255, 226, 177, .38)); }
#lidTape:hover .hover-ring { opacity: .72; }
#lidTape:active { translate: 0 -2px; }

/* 玻璃舱盖：绕上沿向后翻开（前缩透视） */
#deckLid {
  transform-box: view-box;
  transform-origin: 136px 267px;
  transition: transform .46s cubic-bezier(.28,.72,.24,1), opacity .32s ease, filter .18s;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .55));
}
#deckLid:hover { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .55)) drop-shadow(0 0 6px rgba(220, 240, 238, .3)); }
#machine.lid-open #deckLid {
  transform: scaleY(.3) translateY(-2px);
  opacity: .46;
}
#machine.lid-open #deckLid:hover { opacity: .68; }

/* 玻璃反光跟随指针 */
#lidGlare {
  transform-box: view-box;
  transform-origin: 136px 322px;
  translate: calc(var(--gx, 0) * 17px) calc(var(--gy, 0) * 9px);
  transition: translate .22s ease-out;
}

/* 拖带悬停舱口 */
#wellDropHint,
#wellDropText { transition: opacity .14s ease; }
#machine.drop-ready #wellDropHint {
  opacity: .95;
  animation: dropDash 1.1s steps(7, end) infinite;
}
#machine.drop-ready #wellDropText { opacity: .95; }
@keyframes dropDash {
  to { stroke-dashoffset: -14; }
}
#machine.drop-ready #deckLid { filter: drop-shadow(0 0 9px rgba(255, 177, 92, .55)); }

/* 挂绳 / 狐狸：由脚本驱动摆动 */
#cord {
  transform-box: view-box;
  transform-origin: 30px 380px;
}
#charmGroup {
  transform-box: view-box;
  transform-origin: 190px 384px;
  will-change: transform;
}

/* 舱内磁带 */
#deckTape { cursor: pointer; transition: filter .2s; }
#deckTape:hover { filter: drop-shadow(0 0 9px rgba(255, 206, 138, .34)) brightness(1.05); }
#machine.has-tape #deckTapeAnim { animation: deckFloat 5.2s steps(2, end) infinite; }
@keyframes deckFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1.6px; }
}

/* 狐狸挂件：持续摇摆 / 点击回弹 / 悬停发光 */
#charmSwing {
  transform-origin: 0 0;
  animation: charmSway 4.8s ease-in-out infinite;
}
@keyframes charmSway {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(8deg); }
}
#charm { transition: filter .18s; }
#charm:hover { filter: drop-shadow(0 0 7px rgba(224, 144, 51, .65)); }
#charm:hover #charmSwing { animation-play-state: paused; }
#charm.is-wiggle { animation: none; transform: none; }
#charm.is-wiggle #charmSwing { animation: charmWiggle .62s ease-in-out; }
#powerLed.is-on {
  fill: #7dff9a;
  filter: drop-shadow(0 0 3px #7dff9a);
}
#powerLedGlow.is-on { animation: led-breathe 3.4s ease-in-out infinite; }
@keyframes charmWiggle {
  0%, 100% { transform: rotate(0deg); }
  18% { transform: rotate(13deg); }
  42% { transform: rotate(-9deg); }
  66% { transform: rotate(6deg); }
  84% { transform: rotate(-3deg); }
}

/* 舱门扫光 */
#glassSweep { animation: glassSweep 7.5s ease-in-out infinite; }
@keyframes glassSweep {
  0%, 64% { opacity: 0; transform: translateX(-26px); }
  70% { opacity: 1; }
  84% { opacity: .8; transform: translateX(96px); }
  90%, 100% { opacity: 0; transform: translateX(104px); }
}

/* 装带落位震动 */
#machine.is-jolt { animation: pxJolt .36s steps(2, end) 1; }
@keyframes pxJolt {
  0%, 100% { translate: 0 0; }
  25% { translate: -1px 1px; }
  50% { translate: 1px 0; }
  75% { translate: 0 -1px; }
}

/* 飞行磁带 */
#transportTape { transform-origin: 0 0; }

/* 开机扫描 */
#machine #bootScan { opacity: 0; }
#machine.is-booting #bootScan {
  animation: pxBootScan .72s steps(6, end) 1;
}
@keyframes pxBootScan {
  0% { transform: translateY(0); opacity: .95; }
  85% { opacity: .5; }
  100% { transform: translateY(14px); opacity: 0; }
}
#machine.is-booting #lcdScreen { animation: pxBootFlash .72s steps(3, end) 1; }
@keyframes pxBootFlash {
  0% { filter: brightness(2.1); }
  60% { filter: brightness(1.3); }
  100% { filter: none; }
}
#machine.is-booting { animation: pxShake .72s steps(2, end) 1; }
@keyframes pxShake {
  0%, 100% { translate: 0 0; }
  20% { translate: 1px 0; }
  40% { translate: -1px 1px; }
  60% { translate: 1px -1px; }
  80% { translate: 0 1px; }
}

/* 未装带时提示闪烁；装带后锁定 */
#machine:not(.has-tape) #insertPrompt {
  animation: promptBlink 1.9s steps(2, end) infinite;
}
@keyframes promptBlink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: .18; }
}
#machine.has-tape #insertPrompt { opacity: 0; }
#machine.has-tape #lidTapeAnim { opacity: 0 !important; animation: none; }

/* 卷盘改成阶梯转速 */
#machine.is-spinning .reel-spin { animation-timing-function: steps(8, end); }
#machine.is-spinning .wound { transition: width .18s linear, height .18s linear, x .18s linear, y .18s linear; }

/* ---------- 空气中的像素浮尘 ---------- */

.room-motes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.room-motes i {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #d8c19a;
  opacity: 0;
  animation: moteRise var(--t, 14s) linear var(--d, 0s) infinite;
}
.room-motes i:nth-child(8n+1) { left: 8%; top: 76%; --d: 0s; --t: 13s; }
.room-motes i:nth-child(8n+2) { left: 17%; top: 62%; --d: -3s; --t: 16s; width: 3px; height: 3px; }
.room-motes i:nth-child(8n+3) { left: 26%; top: 84%; --d: -7s; --t: 12s; }
.room-motes i:nth-child(8n+4) { left: 38%; top: 70%; --d: -5s; --t: 18s; width: 3px; height: 3px; }
.room-motes i:nth-child(8n+5) { left: 58%; top: 80%; --d: -9s; --t: 15s; }
.room-motes i:nth-child(8n+6) { left: 70%; top: 66%; --d: -2s; --t: 17s; }
.room-motes i:nth-child(8n+7) { left: 82%; top: 86%; --d: -6s; --t: 14s; width: 3px; height: 3px; }
.room-motes i:nth-child(8n+8) { left: 91%; top: 73%; --d: -11s; --t: 19s; }
@keyframes moteRise {
  0% { opacity: 0; transform: translate(0, 0); }
  14% { opacity: .55; }
  70% { opacity: .3; }
  100% { opacity: 0; transform: translate(14px, -170px); }
}

/* ---------- 磁带机内自定义指针 ---------- */

.room-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
}
body.room-open .room-cursor.is-live { opacity: 1; }
.room-cursor__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #d21b22;
  border: 1px solid #0b0705;
  box-shadow: 0 0 0 2px rgba(8, 7, 6, .55);
  transition: scale .14s steps(2, end);
}
.room-cursor__label {
  position: absolute;
  left: 13px;
  top: 12px;
  padding: 4px 7px;
  font-family: var(--h-mono);
  font-size: 7px;
  letter-spacing: .16em;
  white-space: nowrap;
  color: var(--h-ink);
  background: var(--h-paper);
  border: 2px solid var(--h-ink);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .4);
  opacity: 0;
  translate: 0 4px;
  transition: opacity .14s, translate .14s;
}
.room-cursor.is-hot .room-cursor__label { opacity: 1; translate: 0 0; }
.room-cursor.is-hot .room-cursor__dot { scale: 1.7; background: #f2ecdd; }
.room-cursor.is-down { scale: .9; }
.room-cursor.is-down .room-cursor__label { opacity: .35; }
@media (pointer: fine) {
  body.room-open .room,
  body.room-open .room * { cursor: none; }
}

/* ---------- 移动端 ---------- */

@media (max-width: 1180px) {
  .room-gallery__panel--b,
  .room-gallery__panel--d { display: none; }
}

@media (max-width: 900px) {
  .room-gallery { display: none; }
  .room-floor { height: 30vh; }
  body.room-open .console { transform: none; }
}

@media (max-width: 760px) {
  .open__worktag {
    position: relative;
    left: auto;
    top: auto;
    width: min(300px, 82vw);
    margin: 0 0 6vh 2vw;
    rotate: 1deg;
  }
  .open__worktag b { font-size: 30px; }

  .cluster--solo {
    min-height: 0;
    margin-top: 0;
    padding-top: 13vh;
    padding-bottom: 8vh;
  }
  .solo__kicker { left: auto; top: auto; margin-bottom: 16px; }
  .solo__head {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    margin-bottom: 5vh;
  }
  .solo__title { font-size: 17vw; }
  .solo__desc { width: 100%; max-width: 360px; margin-top: 16px; }

  .solo__shot {
    position: relative;
    right: auto;
    top: auto;
    width: 90vw;
    margin: 0 0 6vh auto;
    rotate: 1deg;
  }

  .solo__icon {
    position: relative;
    right: auto;
    top: auto;
    width: 108px;
    margin: 0 4vw 5vh auto;
  }

  .solo__fine {
    position: relative;
    left: auto;
    bottom: auto;
    margin: 0;
  }

  .follow__tape { display: none; }

  .room-gallery { display: none; }
  .room-cursor { display: none; }
  .room-motes i:nth-child(n+13) { display: none; }
  .case-shell { animation: none; }
  #machine { filter: none; }
  #machine .btn:hover { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .solo__icon,
  .follow__tape,
  .case-shell,
  #charmSwing,
  #glassSweep,
  #lidTapeAnim,
  #machine:not(.has-tape) #insertPrompt { animation: none !important; }
  #lidTape { transition: none; }
}
/* ================================================================== */
/* V3 · 左右结构：左磁带架 / 右横版磁带机                               */
/* ================================================================== */

.room .app {
  display: grid;
  grid-template-columns: minmax(200px, 21vw) minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: clamp(16px, 3vw, 54px);
  height: 100dvh;
  padding: 68px clamp(18px, 4vw, 64px) 54px;
}

.room .rig {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  transform: none;
  transition: none;
}

.room .console {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  perspective: 1500px;
  transform-style: preserve-3d;
}

.room .console::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 3%;
  bottom: 3.5%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .62), rgba(0, 0, 0, .26) 52%, transparent 74%);
  filter: blur(6px);
  pointer-events: none;
  z-index: -1;
}

.room .case-shell {
  width: min(100%, calc((100dvh - 148px) * 1.53333));
  height: auto;
  aspect-ratio: 460 / 300;
  animation: none;
  translate: 0 0;
}

.room #machine {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 34px 26px rgba(0, 0, 0, .55));
}

body.room-open .console {
  transform: perspective(1600px)
    rotateX(var(--tiltX, 0deg))
    rotateY(var(--tiltY, 0deg));
  transition: transform .18s ease-out;
}

/* ---------- 左：磁带陈列架 ---------- */

.rack {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 340px;
  height: min(80dvh, 720px);
  min-width: 0;
  padding: 4px 0 4px 2px;
  color: var(--off-white, #ece5d5);
  z-index: 6;
}

.rack__head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 2px 10px;
  padding: 0 2px 12px;
  border-bottom: 1px dashed rgba(236, 228, 208, .22);
}
.rack__kicker {
  grid-column: 1 / 3;
  font-family: var(--font-pixel, monospace);
  font-size: 8px;
  letter-spacing: .3em;
  color: #8b9a90;
}
.rack__title {
  margin: 0;
  font-family: var(--h-serif, serif);
  font-size: clamp(24px, 2.3vw, 40px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: .06em;
}
.rack__count {
  align-self: end;
  padding-bottom: 4px;
  font-family: var(--font-pixel, monospace);
  font-size: 9px;
  letter-spacing: .18em;
  color: #ffb15c;
  white-space: nowrap;
}

.rack__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-left: 16px;
}
.rack__rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background:
    repeating-linear-gradient(180deg, transparent 0 23px, rgba(0, 0, 0, .5) 23px 25px),
    linear-gradient(90deg, #0a0d0c, #5d6a65 34%, #8e9a94 52%, #3d4744 74%, #0a0d0c);
  box-shadow: 1px 0 0 rgba(0, 0, 0, .6), inset 1px 0 0 rgba(255, 255, 255, .18);
  opacity: .7;
}

.rack__slots {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rack__slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 13px 11px;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(255, 177, 92, .06), transparent 60%),
    linear-gradient(180deg, rgba(18, 24, 22, .72), rgba(5, 8, 8, .9));
  border: 1px solid rgba(232, 224, 205, .12);
  border-bottom: 3px solid rgba(0, 0, 0, .62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 12px 22px rgba(0, 0, 0, .35);
}
.rack__slot::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, #2b3431, #97a49e 38%, #6f7c76 62%, #202826);
  opacity: .8;
}

.rack__slot.is-live {
  flex: 0 0 auto;
  overflow: hidden;
}
.rack__slot.is-live::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--red, #c81018), rgba(200, 16, 24, .15));
  box-shadow: 0 0 12px rgba(200, 16, 24, .5);
}

.rack__slot.is-empty {
  flex: 0 1 74px;
  min-height: 58px;
  justify-content: center;
  border-style: dashed;
  border-color: rgba(232, 224, 205, .1);
  background: linear-gradient(180deg, rgba(12, 17, 16, .35), rgba(4, 7, 7, .5));
}
.rack__slot.is-empty::after { opacity: .35; }
.rack__ghost {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 26px;
  translate: 0 -50%;
  border: 1px dashed rgba(190, 202, 196, .18);
  border-radius: 2px;
}

.rack__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 108%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 120, .14), rgba(255, 150, 70, .04) 46%, transparent 70%);
  pointer-events: none;
}

.rack-tape {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 128 / 80;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  transform: perspective(760px) rotateX(8deg) rotateZ(-4deg);
  transform-origin: 50% 88%;
  filter: drop-shadow(0 16px 15px rgba(0, 0, 0, .55));
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), filter .24s, opacity .2s;
}
.rack-tape:hover {
  transform: perspective(760px) rotateX(1deg) rotateZ(0deg) translateY(-6px);
  filter: drop-shadow(0 22px 20px rgba(0, 0, 0, .6)) brightness(1.07);
}
.rack-tape:focus-visible {
  outline: 1px dashed #ffb15c;
  outline-offset: 4px;
}
.rack-tape:active { cursor: grabbing; }
.rack-tape__svg {
  display: block;
  width: 100%;
  height: 100%;
}
.rack-tape__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -7px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  filter: blur(5px);
  z-index: -1;
}
.rack-tape__grab {
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 2px 5px;
  font-family: var(--font-pixel, monospace);
  font-size: 6px;
  letter-spacing: .18em;
  color: #0d0a07;
  background: #e8c07a;
  opacity: 0;
  translate: 0 3px;
  transition: opacity .2s, translate .2s;
  pointer-events: none;
}
.rack-tape:hover .rack-tape__grab,
.rack-tape:focus-visible .rack-tape__grab {
  opacity: .92;
  translate: 0 0;
}

.rack__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.rack__no {
  font-family: var(--font-pixel, monospace);
  font-size: 8px;
  letter-spacing: .12em;
  color: #ffb15c;
}
.rack__meta b {
  font-family: var(--h-serif, serif);
  font-size: 15px;
  letter-spacing: .14em;
  color: #f0e8d8;
}
.rack__meta i {
  font-family: var(--font-pixel, monospace);
  font-style: normal;
  font-size: 6px;
  letter-spacing: .16em;
  color: #7f8f86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rack__slot.is-empty .rack__meta i { color: #4f5c56; }

.rack__taken {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel, monospace);
  font-size: 8px;
  letter-spacing: .22em;
  color: #8d9a92;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .02) 0 6px, transparent 6px 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.rack__slot.is-taken .rack__taken { opacity: 1; }
.rack__slot.is-taken .rack-tape { opacity: 0; pointer-events: none; }
.rack__slot.is-taken .rack__glow { opacity: .25; }
.rack__slot.is-dragging .rack-tape { opacity: 0; }
.rack__slot.is-dragging .rack__glow { opacity: .4; }

.rack__hint {
  margin: 0;
  padding: 0 2px;
  font-family: var(--font-pixel, monospace);
  font-size: 7px;
  line-height: 1.7;
  letter-spacing: .16em;
  color: #7d8c83;
}
.rack.is-nudge { animation: rackNudge .5s steps(2, end) 1; }
@keyframes rackNudge {
  0%, 100% { translate: 0 0; }
  30% { translate: -3px 0; }
  60% { translate: 2px 0; }
  80% { translate: -1px 0; }
}

/* ---------- 拖拽幽灵 ---------- */

.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: clamp(190px, 18vw, 258px);
  aspect-ratio: 128 / 80;
  pointer-events: none;
  opacity: 0;
  z-index: 85;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 24px 22px rgba(0, 0, 0, .62));
  transition: opacity .12s ease;
  will-change: transform;
}
.drag-ghost.is-live { opacity: 1; }
.drag-ghost svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 走带按键：实体键帽 ---------- */

#machine .btn-cap {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform .055s steps(2, end);
}
#machine .btn:hover .btn-cap { transform: translateY(-1.2px); }
#machine .btn.is-pressed .btn-cap { transform: translateY(3.2px); }
#machine .btn.is-pressed { translate: 0 0; }

/* ---------- 新机位：舱盖 / 反光 / 挂绳 ---------- */

#deckLid {
  transform-box: view-box;
  transform-origin: 260px 83px;
  transition: transform .5s cubic-bezier(.3, .72, .24, 1), opacity .32s ease, filter .18s;
}
#machine.lid-open #deckLid {
  transform: perspective(560px) rotateX(-72deg);
  opacity: .32;
}
#machine.lid-open #deckLid:hover { opacity: .5; }
#machine.drop-ready #deckLid { filter: drop-shadow(0 0 10px rgba(255, 177, 92, .7)); }

#lidGlare {
  transform-origin: 260px 143px;
}
#cord {
  transform-origin: 28px 258px;
}
#charmGroup {
  transform-origin: 181px 283px;
}

/* ---------- 皮箱开盖 ---------- */

.finale__stage { perspective: 1100px; }

.case__box {
  position: absolute;
  left: 50%;
  top: 4%;
  width: 76%;
  translate: calc(-50% + var(--cx, 0px)) calc(var(--cy, 0px) - var(--lift, 0px));
  rotate: var(--crot, -2deg);
  perspective: 950px;
  transform-style: preserve-3d;
  will-change: translate, rotate;
  transition: translate .1s linear;
  z-index: 2;
}
.case__box .case__art {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  translate: none;
  rotate: none;
  filter: grayscale(1) contrast(1.14);
  transition: filter .4s;
  will-change: auto;
}
.case__box {
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .6));
}
#finale.is-lifting .case__box {
  filter: drop-shadow(0 34px 46px rgba(0, 0, 0, .66));
}
.case__art--base {
  clip-path: inset(45.6% 0 0 0);
  z-index: 2;
}
.case__art--top {
  clip-path: inset(0 0 54.4% 0);
}
.case__lid {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform-origin: 50% 45.6%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.3, .72, .22, 1), filter .7s;
}
#finale.is-opening .case__lid {
  transform: rotateX(74deg);
  filter: brightness(.86);
}
.case__inside {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 47%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding-bottom: 9%;
  background:
    radial-gradient(ellipse at 50% 108%, rgba(255, 208, 150, .55), rgba(163, 60, 34, .22) 44%, transparent 72%);
  opacity: 0;
  transition: opacity .5s .3s;
  z-index: 1;
}
.case__inside i {
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 196, .55), transparent);
}
.case__inside b {
  font-family: var(--h-mono, monospace);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .42em;
  color: rgba(255, 236, 205, .82);
  text-indent: .42em;
}
.case__inside em {
  font-family: var(--h-mono, monospace);
  font-style: normal;
  font-size: 7px;
  letter-spacing: .26em;
  color: rgba(255, 220, 170, .55);
}
#finale.is-opening .case__inside { opacity: 1; }
#finale.is-opening .case__dust i { animation: chestDust .9s ease-out forwards; }
@keyframes chestDust {
  0% { opacity: .7; translate: 0 0; }
  100% { opacity: 0; translate: calc(var(--dx, 0) * 1px) -22px; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .room .app {
    grid-template-columns: minmax(176px, 24vw) minmax(0, 1fr);
    gap: 22px;
    padding: 64px 24px 46px;
  }
  .rack { max-width: 280px; }
}

@media (max-width: 720px) {
  .room .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
    gap: 6px;
    padding: 58px 14px 12px;
  }
  .rack {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 2px 12px;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0;
  }
  .rack__head {
    grid-row: 1 / 3;
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 0 10px 0 0;
    border-bottom: 0;
    border-right: 1px dashed rgba(236, 228, 208, .2);
  }
  .rack__kicker { font-size: 6px; letter-spacing: .2em; }
  .rack__title { font-size: 17px; }
  .rack__count { font-size: 7px; padding: 0; }
  .rack__body { padding-left: 0; overflow: visible; }
  .rack__rail { display: none; }
  .rack__slots { flex-direction: row; gap: 8px; height: auto; }
  .rack__slot {
    flex: 0 0 auto;
    width: 122px;
    padding: 6px 6px 5px;
    gap: 4px;
  }
  .rack__slot.is-empty { flex: 0 0 66px; min-height: 0; height: 74px; }
  .rack__ghost { left: 6px; right: 6px; }
  .rack__meta { display: none; }
  .rack__taken { font-size: 6px; letter-spacing: .12em; }
  .rack__glow { display: none; }
  .rack__hint { grid-column: 2; font-size: 6px; letter-spacing: .1em; }
  .rack-tape { transform: perspective(600px) rotateX(5deg) rotateZ(-3deg); }
  .rig { align-items: flex-start; }
  .room .case-shell {
    width: 100%;
    max-height: calc(100dvh - 230px);
  }
  .room .console::after { left: 4%; right: 4%; }
  .case__box { width: 82%; }
}

@media (max-width: 470px) {
  .rack__slot.is-empty { display: none; }
  .rack__slots { gap: 0; }
  .rack__slot { width: 112px; }
  .room .app { padding: 54px 10px 10px; }
  .room .case-shell { max-height: calc(100dvh - 210px); }
}

@media (prefers-reduced-motion: reduce) {
  .rack,
  .rack-tape,
  .drag-ghost,
  .case__lid,
  .case__inside,
  #deckLid,
  #machine .btn-cap { transition: none !important; animation: none !important; }
}

/* 皮箱容器需要固有比例，两个切开的图层都用绝对定位 */
.case__box {
  aspect-ratio: 724 / 595;
}

/* ---- V3 布局校正：避开左上角品牌，机位按可用高度收缩 ---- */
.room .app {
  padding: 148px clamp(18px, 4vw, 64px) 48px;
}
.room .case-shell {
  width: min(100%, calc((100dvh - 214px) * 1.53333));
}
.rack {
  height: auto;
  max-height: calc(100dvh - 190px);
}
.rack__slots {
  height: auto;
}
.room {
  --tiltX: -3.2deg;
  --tiltY: 2.2deg;
}

@media (max-width: 1100px) {
  .room .app { padding: 136px 24px 40px; }
}
@media (max-width: 720px) {
  .room .app { padding: 58px 14px 12px; }
  .room .case-shell { width: 100%; max-height: calc(100dvh - 230px); }
  .rack { max-height: none; }
}
@media (max-width: 470px) {
  .room .app { padding: 54px 10px 10px; }
  .room .case-shell { max-height: calc(100dvh - 210px); }
}

/* 箱盖内衬：翻开的盖子内面 */
.case__inside {
  clip-path: polygon(7% 100%, 13% 2%, 87% 2%, 93% 100%);
  border-radius: 5px 5px 2px 2px;
  background:
    radial-gradient(ellipse at 50% 106%, rgba(255, 206, 148, .58), rgba(160, 64, 36, .2) 48%, transparent 76%),
    linear-gradient(180deg, #120d0a, #22150f 58%, #372117);
  box-shadow:
    inset 0 -16px 30px rgba(0, 0, 0, .58),
    inset 0 0 26px rgba(0, 0, 0, .6);
}
.case__inside::before {
  content: "";
  position: absolute;
  inset: 8% 7% 13%;
  border: 1px dashed rgba(255, 222, 178, .2);
  border-radius: 3px;
}
.case__box::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 44.8%;
  height: 5%;
  z-index: 4;
  background: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
#finale.is-opening .case__box::after { opacity: 1; }

/* 空槽：实心一点，别让背景插画透上来 */
.rack__slot.is-empty {
  background:
    linear-gradient(180deg, rgba(13, 18, 17, .78), rgba(3, 6, 6, .92));
}
.rack__slot.is-empty .rack__ghost { border-color: rgba(190, 202, 196, .1); }
.rack__slot.is-empty .rack__meta i { color: #667670; }

/* 手机：让出顶部品牌区，机位在剩余空间里居中 */
@media (max-width: 720px) {
  body.room-open .brand { display: none; }
  body.room-open .now { top: 14px; right: 12px; }
  .room .app {
    padding: 16px 10px 10px;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .rack { gap: 0 10px; }
  .rack__hint { display: none; }
  .room .rig {
    align-items: center;
    height: 100%;
  }
  .room .case-shell { max-height: 100%; }
}

@media (max-width: 720px) {
  .drag-ghost { width: 118px; }
}

/* 实心槽底，挡住背景插画的红色条纹 */
.rack__slot {
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(255, 177, 92, .05), transparent 60%),
    linear-gradient(180deg, #111816 0%, #070b0a 100%);
}
.rack__slot.is-empty {
  background:
    linear-gradient(180deg, #0d1312 0%, #040707 100%);
}

/* ---- V3 层叠修复：背景插画不得盖住陈列架与磁带机 ---- */
.room .app {
  position: relative;
  z-index: 2;
}

.rack {
  position: relative;
}
.rack::before {
  content: "";
  position: absolute;
  inset: -10px -12px;
  z-index: -1;
  background:
    repeating-linear-gradient(180deg, transparent 0 54px, rgba(0, 0, 0, .22) 54px 56px),
    linear-gradient(180deg, #0d1211 0%, #070b0a 55%, #040706 100%);
  border: 1px solid rgba(232, 224, 205, .09);
  border-left: 2px solid rgba(200, 16, 24, .38);
  box-shadow:
    0 26px 52px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .045);
}
@media (min-width: 721px) {
  .rack::before { inset: -20px -22px -16px -24px; }
}

/* ---- V3 手机：陈列架压缩成紧凑横条，整组居中 ---- */
@media (max-width: 720px) {
  .room .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px 96px;
  }
  .rack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0 2px;
  }
  .rack::before {
    inset: -8px -10px -6px;
  }
  .rack__head {
    display: flex;
    grid-row: auto;
    align-items: center;
    gap: 8px;
    padding: 0 2px 7px;
    border-right: 0;
    border-bottom: 1px dashed rgba(236, 228, 208, .2);
  }
  .rack__kicker { font-size: 6px; letter-spacing: .22em; }
  .rack__title { font-size: 15px; line-height: 1; letter-spacing: .1em; }
  .rack__title br { display: none; }
  .rack__count { margin-left: auto; font-size: 7px; padding: 0; }
  .rack__body { padding-left: 0; overflow: visible; }
  .rack__slots { flex-direction: row; gap: 8px; height: auto; }
  .rack__slot { width: 122px; padding: 6px 6px 5px; }
  .rack__slot.is-empty { height: 74px; }
  .rack__meta { display: none; }
  .rack__hint { display: none; }
  .room .rig { height: auto; align-items: center; }
}
@media (max-width: 470px) {
  .rack__slot { width: 112px; }
  .room .app { padding: 12px 10px 88px; }
}

/* 手机：三格摊开，主带占满剩余宽度 */
@media (max-width: 720px) {
  .rack__slot.is-live { flex: 1 1 auto; width: auto; }
  .rack__slot.is-empty { display: flex; flex: 0 0 62px; width: 62px; }
  .rack-tape { width: 100%; max-width: none; }
}
@media (max-width: 470px) {
  .rack__slot.is-empty { display: flex; flex: 0 0 52px; width: 52px; }
}
