/* 放映画面：操作页里的预览和放映窗口共用。画面按固定的逻辑尺寸（默认 1366×768）排版，
   外层按窗口大小整体缩放，所以预览里看到的位置、字号和现场大屏上一模一样。
   配色延续婚礼请柬：柿子橘、万寿菊黄、橄榄绿、牛皮纸；底色是深的暖褐，照片在上面最显色，大厅里也不刺眼。 */
@property --glow { syntax: '<color>'; inherits: true; initial-value: #4a3322; }

.hm-fit {
  position: absolute; inset: 0; overflow: hidden; background: #0d0a08;
  display: flex; align-items: center; justify-content: center;
}
.hm-fit.hide-cursor, .hm-fit.hide-cursor * { cursor: none !important; }

.hm-stage {
  --paper: #fff8e9; --kraft: #f4d7a0; --kraft-dim: #c9ad80; --honey: #ffd98a; --marigold: #f2b03a;
  --persimmon: #e0612a; --olive: #7e8443; --ink: oklch(0.18 0.022 55); --ink-2: oklch(0.23 0.026 55);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --script: "Long Cang", "Kaiti SC", "STKaiti", "KaiTi", var(--serif);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative; flex: none; overflow: hidden; transform-origin: center center;
  background: var(--ink); color: var(--paper); font-family: var(--serif);
  -webkit-font-smoothing: antialiased; font-synthesis: none;
  transition: --glow 2.4s linear;
}

/* 底：暖褐色，加一团跟着当前照片变色的光，让两半画面像放在同一张桌子上 */
.hm-backdrop { position: absolute; inset: 0; pointer-events: none; }
.hm-backdrop::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(42% 52% at var(--glow-x, 30%) 48%, color-mix(in oklch, var(--glow) 70%, transparent), transparent 72%),
    radial-gradient(60% 70% at var(--deck-cx, 75%) 40%, oklch(0.26 0.03 60 / .55), transparent 75%);
  opacity: .9;
}
.hm-backdrop::after {
  /* 极轻的纸纹，避免大面积纯色在电视上起色带 */
  content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 左右两半 ---------- */
.hm-visual, .hm-deck { position: absolute; top: 0; height: 100%; transition: opacity .8s var(--ease-out); }
.hm-visual { left: var(--vis-x); width: var(--vis-w); }
.hm-deck { left: var(--deck-x); width: var(--deck-w); }

.hm-layer { position: absolute; inset: 0; transition: opacity .9s var(--ease-out); }
.hm-stack { perspective: 1600px; }

/* 相纸：照片四周一圈纸边 + 柔和投影，叠在桌上微微歪着 */
.hm-print {
  position: absolute; left: 50%; top: 50%; background: var(--paper); padding: var(--mat, 12px);
  border-radius: 2px; transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  box-shadow: 0 1px 2px rgba(0,0,0,.35), 0 24px 46px -18px rgba(0,0,0,.7);
  will-change: transform, opacity;
}
.hm-print canvas { display: block; width: 100%; height: 100%; }
.hm-print.full { padding: 0; background: transparent; box-shadow: none; border-radius: 0; }

/* 满版：照片铺满这一半，空出来的地方用同一张照片模糊后垫底 */
.hm-fullbleed { position: absolute; inset: 0; overflow: hidden; will-change: opacity, transform; }
.hm-fullbleed .bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); filter: blur(28px) brightness(.55) saturate(1.1); }
.hm-fullbleed .fg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* ---------- 音乐台 ---------- */
.hm-deck {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 46px 44px 40px; box-sizing: border-box;
}
.hm-title { flex: none; }
.hm-title .l1 {
  font-family: var(--script); font-size: 50px; line-height: 1.15; color: var(--honey);
  letter-spacing: .02em; text-wrap: balance;
}
.hm-title .l1 .amp { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: .72em; margin: 0 .18em; color: var(--kraft); vertical-align: .06em; }
.hm-title .l2 { margin-top: 6px; font-size: 19px; line-height: 1.5; color: var(--kraft); letter-spacing: .18em; }
.hm-title .l2:empty, .hm-title .l1:empty { display: none; }

.hm-player { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.hm-disc-wrap { position: relative; width: var(--disc, 232px); height: var(--disc, 232px); margin: 8px 0 26px; flex: none; }
.hm-disc {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, oklch(0.15 0.01 60) 0 1.5px, oklch(0.12 0.01 60) 1.5px 3.2px);
  box-shadow: 0 0 0 1px oklch(0.3 0.02 60 / .6), 0 18px 40px -14px rgba(0,0,0,.75);
}
.hm-disc::after {
  /* 唱片上一道反光，转起来才看得出在转 */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 8%, rgba(255,240,220,.10) 12%, transparent 18% 58%, rgba(255,240,220,.07) 62%, transparent 68%);
}
.hm-label {
  position: absolute; left: 50%; top: 50%; width: 41%; height: 41%; transform: translate(-50%, -50%);
  border-radius: 50%; overflow: hidden; background: var(--persimmon);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px oklch(0.12 0.01 60);
}
.hm-label img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-label .mono { font-family: var(--script); font-size: 34px; color: var(--paper); line-height: 1; }
.hm-label::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: oklch(0.12 0.01 60);
}
/* 唱臂：平面线稿，放歌时落到唱片上，暂停时抬起 */
.hm-arm {
  position: absolute; right: -34px; top: -18px; width: 96px; height: 196px; overflow: visible;
  transform-origin: 70px 20px; transform: rotate(-26deg); transition: transform .9s var(--ease-out);
}
.hm-stage.music-on .hm-arm { transform: rotate(0deg); }

.hm-track { width: 100%; flex: none; }
.hm-song {
  font-size: 30px; font-weight: 600; line-height: 1.3; color: var(--paper); text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hm-artist { margin-top: 4px; font-size: 18px; line-height: 1.5; color: var(--kraft); min-height: 1.5em; }

.hm-viz { display: block; width: 100%; height: 38px; margin: 18px 0 8px; flex: none; }
.hm-progress { width: 100%; flex: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; font-size: 15px; color: var(--kraft-dim); font-variant-numeric: tabular-nums; }
.hm-progress .bar { height: 3px; border-radius: 2px; background: oklch(0.36 0.02 60); overflow: hidden; }
.hm-progress .bar i { display: block; height: 100%; width: 100%; background: var(--marigold); transform-origin: left center; transform: scaleX(0); }

.hm-lyrics { flex: none; width: 100%; min-height: 84px; margin-top: 22px; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; }
.hm-lyrics .cur { font-size: 22px; line-height: 1.45; color: var(--honey); text-wrap: balance; }
.hm-lyrics .next { font-size: 17px; line-height: 1.5; color: var(--kraft-dim); text-wrap: balance; }
.hm-lyrics .up { font-size: 16px; line-height: 1.6; color: var(--kraft-dim); letter-spacing: .04em; }
.hm-lyrics .up b { font-weight: 400; color: var(--kraft); }
.hm-lyrics.swap .cur, .hm-lyrics.swap .next, .hm-lyrics.swap .up { animation: hm-rise .7s var(--ease-out) both; }
@keyframes hm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hm-track.swap { animation: hm-rise .8s var(--ease-out) both; }

/* ---------- 整屏层：全屏海报 / 视频 / 黑屏 ---------- */
.hm-full { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .8s var(--ease-out); }
.hm-full video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.hm-full .poster { position: absolute; inset: 0; }
.hm-black { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .9s var(--ease-out); }

.hm-stage[data-scene="idle"] .hm-visual, .hm-stage[data-scene="idle"] .hm-deck { opacity: 0; }
.hm-stage[data-scene="idle"] .hm-black { opacity: 1; }
.hm-stage[data-scene="poster-full"] .hm-full, .hm-stage[data-scene="video"] .hm-full { opacity: 1; }
.hm-stage[data-scene="black"] .hm-black { opacity: 1; }
.hm-stage[data-scene="deck"] .hm-poster { opacity: 0; }
.hm-stage[data-scene="poster-side"] .hm-stack { opacity: 0; }

/* 放映窗口还没全屏时的提示（只在放映窗口里出现，几秒后自动淡出） */
.hm-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2;
  padding: 10px 18px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff;
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: opacity .6s; pointer-events: none; white-space: nowrap;
}
.hm-hint.gone { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hm-arm, .hm-layer, .hm-visual, .hm-deck, .hm-full, .hm-black { transition-duration: .3s; }
  .hm-lyrics.swap .cur, .hm-lyrics.swap .next, .hm-lyrics.swap .up, .hm-track.swap { animation: none; }
}
