/* ==========================================================================
   作品放映厅 · 样式表
   --------------------------------------------------------------------------
   场景：一面墙 + 一台复古 CRT 电视，电视里放照片。
   全部用 CSS 实现，没有引入任何 3D 库。

   想改电视外观？看下面 :root 里的 --tv-* 变量。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 变量
   -------------------------------------------------------------------------- */
:root {
  /* 房间 */
  --wall-1: #1b1a20;
  --wall-2: #0e0e12;
  --wall-3: #08080b;
  --floor-1: #131217;
  --floor-2: #050507;

  /* 电视外壳：木质 */
  --tv-wood-1: #6b4a30;
  --tv-wood-2: #4a3220;
  --tv-wood-3: #2e1e13;
  --tv-metal-1: #8d8c88;
  --tv-metal-2: #55544f;
  --tv-screen-rim: #16150f;

  /* 霓虹与强调色 */
  --neon: #45e0c8;
  --neon-2: #ff5f8a;
  --amber: #ffb454;
  --ink: #f2efe9;
  --ink-2: #a7a29a;
  --ink-3: #6d685f;

  /* 字体 */
  --font-tech: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --font-cn: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;

  /* 电视机尺寸：同时受视口宽度与高度约束，避免在矮屏上被裁切或压住下方信息 */
  --tv-w: clamp(420px, min(66vmin, 78vw, 980px), 980px);
  --tv-pad: clamp(13px, 1.6vmin, 26px);
  /* 电视机与下方信息区的间距，窄屏时由 JS 调小 */
  --hud-gap: clamp(20px, 3.2vmin, 36px);

  /* 动画曲线 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--wall-3);
  color: var(--ink);
  font-family: var(--font-cn);
  overflow-x: hidden;
}

body { overflow-y: auto; }

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  top: -60px;
  left: 20px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--neon);
  color: #04140f;
  border-radius: 6px;
  transition: top 0.2s;
  font-weight: 700;
}
.skip:focus { top: 16px; }

/* --------------------------------------------------------------------------
   3. 房间：墙与地面
   -------------------------------------------------------------------------- */
.room {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* 内容装得下就居中，装不下自然溢出滚动 */
  padding: max(14px, 3vh) clamp(12px, 3vw, 32px) max(20px, 4.5vh);
  isolation: isolate;
}

.wall {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(120% 90% at 50% 8%, var(--wall-1) 0%, var(--wall-2) 48%, var(--wall-3) 100%);
  transform: translate3d(0, 0, 0);
  transition: transform 0.6s var(--ease-out);
  will-change: transform;
}

/* 墙面拉毛质感 */
.wall__plaster {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 2px, transparent 2px 5px);
  mix-blend-mode: overlay;
}

/* 顶部聚光灯打在墙上 */
.wall__spot {
  position: absolute;
  left: 50%;
  top: -18vh;
  width: min(120vw, 1400px);
  height: 110vh;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(255, 236, 200, 0.16), rgba(255, 236, 200, 0.05) 55%, transparent 78%);
  filter: blur(18px);
  pointer-events: none;
}

/* 墙面颗粒（canvas 动态噪点铺在这里） */
.wall__grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.wall__grain canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.wall__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 85% at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

/* 地面 */
.floor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.floor__plane {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--floor-1) 0%, var(--floor-2) 60%, #000 100%);
  transform: perspective(340px) rotateX(58deg);
  transform-origin: top center;
}
.floor__plane::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 74px);
}
.floor__skirt {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(180deg, #26242a, #0c0b0e);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* --------------------------------------------------------------------------
   4. 墙上装饰
   -------------------------------------------------------------------------- */

/* 左：海报 */
.poster {
  position: fixed;
  left: clamp(12px, 5vw, 90px);
  top: clamp(70px, 14vh, 160px);
  width: clamp(96px, 11vw, 158px);
  transform: rotate(-2.4deg);
  z-index: -1;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.6));
  animation: float-slow 9s ease-in-out infinite;
}
.poster__inner {
  aspect-ratio: 3 / 4.2;
  background: linear-gradient(160deg, #f3ece0, #ded4c4);
  color: #17150f;
  padding: 12px 11px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.poster__no {
  font-family: var(--font-tech);
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0.65;
}
.poster__title {
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: clamp(11px, 1.2vw, 15px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  margin-top: 8px;
}
.poster__lines {
  flex: 1;
  margin: 10px 0;
  background-image: repeating-linear-gradient(0deg, rgba(23, 21, 15, 0.22) 0 1px, transparent 1px 6px);
}
.poster__foot {
  font-family: var(--font-tech);
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

/* 右：霓虹灯牌 */
.neon {
  position: fixed;
  right: clamp(12px, 6vw, 110px);
  top: clamp(80px, 17vh, 190px);
  z-index: -1;
  animation: float-slow 11s ease-in-out infinite reverse;
}
.neon__text {
  position: relative;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.4vw, 66px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow:
    0 0 6px #fff,
    0 0 18px var(--neon),
    0 0 42px var(--neon),
    0 0 90px rgba(69, 224, 200, 0.6);
  animation: neon-flicker 6.5s infinite steps(1, end);
}
.neon__glow {
  position: absolute;
  inset: -60px -40px;
  background: radial-gradient(closest-side, rgba(69, 224, 200, 0.16), transparent 72%);
  pointer-events: none;
}

/* 挂钟 */
.clock {
  position: fixed;
  left: 50%;
  top: clamp(18px, 4vh, 44px);
  transform: translateX(-50%);
  z-index: -1;
}
.clock__face {
  position: relative;
  width: clamp(46px, 5vw, 70px);
  height: clamp(46px, 5vw, 70px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2830, #14131a 70%);
  border: 2px solid #35323c;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.8),
    0 12px 24px rgba(0, 0, 0, 0.55);
}
.clock__hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  background: #d9d4c8;
  border-radius: 2px;
  transition: transform 0.4s var(--ease);
}
.clock__hand--h { width: 2.5px; height: 26%; margin-left: -1.25px; }
.clock__hand--m { width: 2px; height: 36%; margin-left: -1px; }
.clock__hand--s {
  width: 1px;
  height: 40%;
  margin-left: -0.5px;
  background: var(--neon-2);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.clock__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #d9d4c8;
}

/* --------------------------------------------------------------------------
   5. 电视机 —— 外壳
   -------------------------------------------------------------------------- */
.stage {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  perspective: 1600px;
}

.tv {
  position: relative;
  width: var(--tv-w);
  transform-style: preserve-3d;
  transition: transform 0.7s var(--ease-out);
  will-change: transform;
}

/* 电源线 */
.tv__cord {
  position: absolute;
  right: 2%;
  bottom: 6%;
  width: 34%;
  z-index: -1;
  opacity: 0.9;
}

.tv__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 12%, 150px);
  gap: var(--tv-pad);
  padding: var(--tv-pad);
  border-radius: clamp(14px, 1.6vw, 22px);
  background: linear-gradient(160deg, #3a2718, #241710 65%, #180f09);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.14),
    inset 0 -3px 10px rgba(0, 0, 0, 0.7),
    0 40px 80px rgba(0, 0, 0, 0.75),
    0 8px 24px rgba(0, 0, 0, 0.6);
}

/* 木纹 */
.tv__wood {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0.55;
  mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(
      92deg,
      rgba(255, 214, 170, 0.11) 0px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(255, 214, 170, 0.05) 5px,
      rgba(0, 0, 0, 0.16) 9px,
      rgba(255, 214, 170, 0.09) 14px
    ),
    repeating-linear-gradient(88deg, rgba(0, 0, 0, 0.18) 0 3px, transparent 3px 22px);
  pointer-events: none;
}

/* 顶部散热纹 */
.tv__vents {
  position: absolute;
  left: 6%;
  right: 6%;
  top: calc(var(--tv-pad) * 0.42);
  height: 5px;
  opacity: 0.4;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.65) 0 6px,
    transparent 6px 13px
  );
  border-radius: 3px;
  pointer-events: none;
}

/* 铭牌 */
.tv__plate {
  position: absolute;
  left: calc(var(--tv-pad) + 4px);
  bottom: calc(var(--tv-pad) * 0.34);
  display: flex;
  align-items: baseline;
  gap: 10px;
  pointer-events: none;
}
.tv__plate-brand {
  font-family: var(--font-tech);
  font-size: clamp(8px, 0.85vw, 11px);
  font-weight: 700;
  letter-spacing: 0.34em;
  color: #d9b98d;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.08);
}
.tv__plate-model {
  font-family: var(--font-tech);
  font-size: clamp(7px, 0.66vw, 9px);
  letter-spacing: 0.16em;
  color: #9c7d58;
  opacity: 0.85;
}

/* 底座小脚 */
.tv__feet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  display: flex;
  justify-content: space-between;
  padding: 0 9%;
  pointer-events: none;
}
.tv__foot {
  width: 26px;
  height: 12px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #241710, #0d0805);
}
.tv__shadow {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -26px;
  height: 40px;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.72), transparent 75%);
  filter: blur(9px);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. 电视机 —— 屏幕与特效
   -------------------------------------------------------------------------- */
.tv__screen {
  position: relative;
  border-radius: clamp(20px, 4.4vw, 54px);
  padding: clamp(9px, 1.1vw, 16px);
  background: linear-gradient(165deg, #1d1b16, #0d0c09);
  box-shadow:
    inset 0 0 0 1px rgba(255, 235, 200, 0.07),
    inset 0 6px 18px rgba(0, 0, 0, 0.85),
    0 2px 0 rgba(255, 220, 170, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.screen__inner {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: clamp(14px, 3.4vw, 44px);
  overflow: hidden;
  background: #05060a;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.9),
    inset 0 0 4px #000;
  transform: translateZ(0);
}

/* --- 画面本体 --- */
.screen__show {
  position: absolute;
  inset: 0;
}
.show__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.5s var(--ease), transform 6s linear, filter 0.4s;
  filter: saturate(1.06) contrast(1.06);
}
.show__img.is-on {
  opacity: 1;
  transform: scale(1);
}
.show__fallback {
  position: absolute;
  inset: 0;
  background: #0a0b10;
  opacity: 0;
  transition: opacity 0.3s;
}
.show__fallback.is-on { opacity: 1; }

/* --- 特效层通用 --- */
.fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 扫描线（横向细密条纹，模拟隔行扫描） */
.fx--scanlines {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.42) 0px,
    rgba(0, 0, 0, 0.42) 1px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.85;
  z-index: 5;
}

/* 荫罩板（竖条，老电视像素结构） */
.fx--mask {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 0, 60, 0.05) 0px,
    rgba(0, 255, 120, 0.05) 1px,
    rgba(60, 120, 255, 0.05) 2px,
    rgba(0, 0, 0, 0) 3px
  );
  z-index: 6;
}

/* 色散（RGB 分离）：轻微模糊 + 混合，让亮边出现红蓝边 */
.fx--rgb {
  backdrop-filter: blur(0.6px);
  background: linear-gradient(
    90deg,
    rgba(255, 0, 70, 0.075),
    transparent 12%,
    transparent 88%,
    rgba(0, 120, 255, 0.075)
  );
  mix-blend-mode: screen;
  z-index: 7;
  opacity: 0.9;
  transition: opacity 0.2s;
}

/* 荧光余晖 */
.fx--glow {
  background: radial-gradient(120% 110% at 50% 45%, rgba(255, 240, 210, 0.09), transparent 62%);
  mix-blend-mode: screen;
  z-index: 8;
}

/* 缓缓下移的刷新亮线 */
.fx--refresh {
  z-index: 9;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.045) 46%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.045) 54%,
    transparent 100%
  );
  height: 26%;
  inset: auto 0 auto 0;
  animation: refresh-sweep 7.5s linear infinite;
  mix-blend-mode: screen;
}

/* 动态噪点 */
.fx--noise {
  width: 100%;
  height: 100%;
  z-index: 10;
  opacity: 0.16;
  mix-blend-mode: overlay;
  image-rendering: pixelated;
  transition: opacity 0.3s;
}

/* 换台闪白 */
.fx--flash {
  z-index: 12;
  background: #fff;
  opacity: 0;
}
.fx--flash.is-on { animation: flash-hit 0.24s ease-out; }

/* 屏幕弧度：内侧暗角 + 四角压暗，做出曲面玻璃的感觉 */
.fx--curve {
  z-index: 13;
  border-radius: inherit;
  background:
    radial-gradient(130% 120% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(60% 55% at 22% 16%, rgba(255, 255, 255, 0.055), transparent 60%);
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.55);
}

/* 玻璃反光 */
.glass {
  position: absolute;
  inset: 0;
  z-index: 14;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.03) 16%,
    transparent 32%,
    transparent 100%
  );
}
.glass::after {
  content: "";
  position: absolute;
  left: 6%;
  top: 4%;
  width: 46%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.09), transparent 70%);
  filter: blur(9px);
}

/* --- 待机 / 换台 / 关机 状态 --- */
.tv.is-standby .screen__show,
.tv.is-standby .fx--glow,
.tv.is-standby .fx--refresh { opacity: 0; }

.tv.is-standby .screen__inner { background: #03040a; }
.tv.is-standby .fx--noise { opacity: 0.05; }

/* 换台：画面先被压成一条亮线（合拢），换图后再张开 */
.tv.is-changing .screen__show {
  animation: crt-collapse 0.62s var(--ease) forwards;
}
.tv.is-changing .fx--noise { opacity: 0.8; }
.tv.is-changing .fx--rgb { opacity: 1; }
.tv.is-changing .fx--glow { opacity: 0.4; }

.tv.is-opening .screen__show {
  animation: crt-open 0.64s var(--ease-out) forwards;
}
.tv.is-opening .fx--noise { opacity: 0.55; }

/* 关机：整块画面塌缩成一条亮线 */
.tv.is-off .screen__show { animation: crt-off 0.5s var(--ease) forwards; }
.tv.is-off .fx--refresh,
.tv.is-off .fx--glow { opacity: 0; }

/* 开机时那道弹出的横向亮线 */
.power-line {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 20;
  width: 0;
  height: 2px;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 0 22px #fff, 0 0 60px rgba(255, 255, 255, 0.7), 0 0 120px rgba(160, 220, 255, 0.5);
  border-radius: 2px;
  transition: width 0.5s var(--ease-out), height 0.5s var(--ease-out), opacity 0.3s;
  pointer-events: none;
}
.power-line.is-burst { width: 104%; }
.power-line.is-open { height: 104%; opacity: 0.18; }

/* --------------------------------------------------------------------------
   7. 电视机 —— 右侧控制区
   -------------------------------------------------------------------------- */
.tv__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.6vh, 22px);
  padding: clamp(10px, 1.4vh, 20px) 0;
}

/* 旋钮 */
.knob {
  position: relative;
  width: clamp(52px, 6.4vw, 78px);
  height: clamp(52px, 6.4vw, 78px);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #4b4944, #232220 62%, #131211);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.16),
    inset 0 -4px 9px rgba(0, 0, 0, 0.8),
    0 6px 14px rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.45s var(--ease), box-shadow 0.2s;
}
.knob:hover { box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.2), inset 0 -4px 9px rgba(0, 0, 0, 0.8), 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 0 3px rgba(69, 224, 200, 0.14); }
.knob:active { transform: scale(0.96); }
/* 转动：由 JS 累加角度 */
.knob.is-turning { transition: transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1); }

.knob__cap {
  position: relative;
  width: 62%;
  height: 62%;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #5c5a54, #2b2a27 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 5px rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
}
.knob__notch {
  position: absolute;
  top: 6%;
  left: 50%;
  width: 2px;
  height: 30%;
  margin-left: -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffe9c8, rgba(255, 233, 200, 0.2));
  box-shadow: 0 0 5px rgba(255, 233, 200, 0.5);
}
.knob__label {
  position: absolute;
  bottom: -15px;
  font-family: var(--font-tech);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: #9c7d58;
}

/* 喇叭网 */
.speaker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(3px, 0.5vw, 6px);
  padding: clamp(6px, 0.9vw, 10px);
  border-radius: 8px;
  background: linear-gradient(180deg, #241a12, #150e08);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
  width: 100%;
}
.speaker span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3b2c1e, #0d0906 72%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, 0.08);
}

/* 电源指示灯 */
.led {
  display: grid;
  place-items: center;
  gap: 5px;
}
.led__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 6px #ff3b30, 0 0 16px rgba(255, 59, 48, 0.75);
  animation: led-breathe 3.4s ease-in-out infinite;
}
.tv.is-standby .led__dot {
  background: #6b1410;
  box-shadow: none;
  animation: none;
}
.led__text {
  font-family: var(--font-tech);
  font-size: 7px;
  letter-spacing: 0.18em;
  color: #9c7d58;
}

/* --------------------------------------------------------------------------
   8. 屏幕外的信息与操作
   -------------------------------------------------------------------------- */
.hud {
  position: relative;
  z-index: 3;
  width: var(--tv-w);
  max-width: 1000px;
  margin-top: var(--hud-gap);
  display: grid;
  gap: clamp(12px, 1.6vh, 20px);
}

.hud__info { min-height: 1px; }

.hud__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-tech);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--neon);
  opacity: 0.9;
}
.rec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-2);
  box-shadow: 0 0 8px var(--neon-2);
  animation: rec-blink 1.6s steps(1, end) infinite;
}

.hud__title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin: 10px 0 8px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}
.hud__title.is-swap { animation: title-in 0.5s var(--ease-out); }

.hud__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.hud__meta .sep {
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}
.hud__counter b { color: var(--ink); font-weight: 700; }

.hud__caption {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* 胶片式缩略图 */
.filmstrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 4px 14px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.filmstrip::-webkit-scrollbar { height: 6px; }
.filmstrip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}
/* 胶片齿孔 */
.filmstrip::after {
  content: "";
  position: absolute;
}

.frame {
  position: relative;
  flex: 0 0 auto;
  width: clamp(84px, 10vw, 124px);
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c0c10;
  scroll-snap-align: center;
  filter: grayscale(0.5) brightness(0.72);
  transition: filter 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame:hover { filter: none; transform: translateY(-3px); }
.frame.is-active {
  filter: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 1px var(--neon), 0 8px 24px rgba(69, 224, 200, 0.22);
}
.frame.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(69, 224, 200, 0.18));
}
.frame__no {
  position: absolute;
  left: 5px;
  top: 4px;
  font-family: var(--font-tech);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 1px 4px #000;
  z-index: 2;
}

/* 按钮 */
.hud__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(69, 224, 200, 0.09);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(69, 224, 200, 0.14);
}
.btn:active { transform: translateY(0) scale(0.985); }
.btn--ghost { border-style: dashed; opacity: 0.9; }
.hud__divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 4px;
}

.hud__hint {
  margin: 0;
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   9. 开机遮罩 / 提示条
   -------------------------------------------------------------------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: #05060a;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot__inner { width: min(300px, 70vw); text-align: center; }
.boot__brand {
  font-family: var(--font-tech);
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--neon);
  margin-bottom: 16px;
  opacity: 0.9;
}
.boot__bar {
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.boot__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--neon), #fff);
  box-shadow: 0 0 12px var(--neon);
  transition: width 0.3s var(--ease);
}
.boot__text {
  margin-top: 12px;
  font-family: var(--font-tech);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 4vh, 44px);
  transform: translate(-50%, 20px);
  z-index: 400;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.86);
  border: 1px solid rgba(69, 224, 200, 0.3);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.32s var(--ease-out);
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   10. 动画
   -------------------------------------------------------------------------- */

/* 下移的刷新亮线 */
@keyframes refresh-sweep {
  0% { top: -28%; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: 104%; opacity: 0; }
}

/* 换台：画面纵向压扁（配合 JS 的换图时序） */
@keyframes crt-collapse {
  0% { transform: scaleY(1) scaleX(1); filter: brightness(1); opacity: 1; }
  18% { transform: scaleY(0.7) scaleX(1.02); filter: brightness(1.5) saturate(0.7); opacity: 1; }
  60% { transform: scaleY(0.05) scaleX(1.08); filter: brightness(4.2) saturate(0); opacity: 1; }
  100% { transform: scaleY(0.012) scaleX(1.0); filter: brightness(6); opacity: 0.85; }
}

/* 换台后半段：从亮线张开成完整画面 */
@keyframes crt-open {
  0% { transform: scaleY(0.012) scaleX(1); filter: brightness(6) saturate(0); opacity: 0.85; }
  30% { transform: scaleY(0.55) scaleX(1.03); filter: brightness(2.1) saturate(0.5); opacity: 0.9; }
  62% { transform: scaleY(1.05) scaleX(0.985); filter: brightness(1.18) saturate(1); opacity: 1; }
  100% { transform: scaleY(1) scaleX(1); filter: brightness(1); opacity: 1; }
}

/* 关机：塌缩成一条亮线后消失 */
@keyframes crt-off {
  0% { transform: scaleY(1); filter: brightness(1); opacity: 1; }
  38% { transform: scaleY(0.015) scaleX(1.04); filter: brightness(5.5); opacity: 1; }
  70% { transform: scaleY(0.012) scaleX(0.6); filter: brightness(3); opacity: 0.7; }
  100% { transform: scaleY(0.01) scaleX(0); filter: brightness(0); opacity: 0; }
}

@keyframes flash-hit {
  0% { opacity: 0.82; }
  100% { opacity: 0; }
}

@keyframes neon-flicker {
  0%, 88%, 100% { opacity: 1; }
  89% { opacity: 0.55; }
  90% { opacity: 1; }
  93% { opacity: 0.35; }
  94% { opacity: 1; }
}

@keyframes led-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes rec-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.18; }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(-2.4deg); }
  50% { transform: translateY(-9px) rotate(-1.4deg); }
}
.neon { animation-name: float-slow-rev; }
@keyframes float-slow-rev {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-13px); }
}

@keyframes title-in {
  0% { opacity: 0; transform: translateY(12px); filter: blur(5px); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* 屏幕玻璃的细微晃动：动的是外壳，不是画面，避免和换台动画抢 transform */
.tv__screen { animation: crt-jitter 5.2s steps(1, end) infinite; }
@keyframes crt-jitter {
  0%, 96%, 100% { transform: translate(0, 0); }
  97% { transform: translate(0.5px, 0); }
  98% { transform: translate(-0.5px, 0.4px); }
  99% { transform: translate(0.3px, -0.4px); }
}

/* --------------------------------------------------------------------------
   11. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  :root { --tv-w: clamp(390px, min(64vmin, 86vw, 900px), 900px); }
  .poster { left: 2vw; width: 90px; }
  .neon { right: 3vw; }
}

@media (max-width: 820px) {
  /* 手机端按宽度定尺寸，高度交给 JS 的排版逻辑处理 */
  :root { --tv-w: min(92vw, 620px); }

  .tv__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }
  .tv__panel {
    flex-direction: row;
    justify-content: space-around;
    padding: 4px 6px 8px;
  }
  .tv__plate { position: static; display: flex; justify-content: center; margin-top: 8px; }
  .speaker { width: clamp(70px, 22vw, 110px); }
  .knob { width: 46px; height: 46px; }
  .knob__label { display: none; }

  /* 墙上装饰收起来，避免和小屏打架 */
  .poster, .neon, .clock { display: none; }

  .hud { margin-top: 26px; gap: 12px; }
  .hud__caption { font-size: 13.5px; }
  .filmstrip { gap: 8px; }
  .frame { width: 78px; }
  .btn { padding: 9px 14px; font-size: 12.5px; }
  .hud__divider { display: none; }
}

@media (max-width: 480px) {
  .tv__screen { border-radius: 26px; padding: 8px; }
  .screen__inner { border-radius: 20px; }
  .hud__actions { gap: 8px; }
  .btn--ghost { padding: 8px 12px; }
  .hud__hint { font-size: 10px; }
}

/* 矮屏（横屏手机）：压缩纵向留白 */
@media (max-height: 560px) and (min-width: 821px) {
  .hud { margin-top: 20px; gap: 10px; }
  .hud__caption { display: none; }
}

/* --------------------------------------------------------------------------
   12. 无障碍与省电
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tv__screen,
  .fx--refresh,
  .neon__text,
  .led__dot,
  .rec,
  .poster,
  .neon { animation: none !important; }
  .show__img { transition: opacity 0.3s; }
  .tv.is-changing .screen__show { animation: none; }
}
