/* ══════════════════════════════════════════════════════════════
   毛毛放映厅 / Theater Player
   深色沉浸唱片播放界面 — 黑胶 + 唱针 + 歌词 + 完整播放控制
   ══════════════════════════════════════════════════════════════ */

/* ── 主容器：全屏沉浸 ─────────────────────────────────────── */
.theater-view {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 180px);
  overflow: hidden;
  border-radius: 22px;
  background: #040a18;
}

/* ── 模糊照片背景层 ──────────────────────────────────────── */
.theater-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(70px) brightness(0.28);
  transform: scale(1.15);
  transition: background-image 0.8s ease;
}

/* ── 暗色渐变叠加层 — 保证文字可读 ──────────────────────── */
.theater-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 35% 50%, rgba(37, 99, 235, 0.13) 0%, transparent 55%),
    linear-gradient(180deg, rgba(4, 10, 24, 0.88) 0%, rgba(4, 10, 24, 0.92) 60%, rgba(4, 10, 24, 0.97) 100%);
}

/* ── 内容层 ──────────────────────────────────────────────── */
.theater-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── 精选歌曲卡片行 ──────────────────────────────────────── */
.theater-curated {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 18px clamp(20px, 3vw, 48px) 10px;
}

.theater-curated-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 80px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theater-curated-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
}

.theater-curated-card > span {
  color: var(--blue-bright);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 11px;
}

.theater-curated-card b,
.theater-curated-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theater-curated-card b {
  font-size: 13px;
  color: var(--text);
}

.theater-curated-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.theater-curated-card em {
  display: none;
}

.theater-curated-card button {
  min-height: 34px;
  padding: 0 12px;
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.theater-curated-card button:hover:not(:disabled) {
  border-color: var(--blue-bright);
  background: rgba(37, 99, 235, 0.24);
}

.theater-curated-card button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 主布局：左唱片 + 右歌词 ────────────────────────────── */
.theater-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 0.44fr) minmax(0, 1fr);
  gap: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 8px clamp(20px, 4vw, 48px) 20px;
}

/* ── 左侧：黑胶唱片区域 ──────────────────────────────────── */
.theater-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vinyl-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 20px;
}

/* 黑胶唱片本体 */
.vinyl-disc {
  position: relative;
  width: min(360px, 40vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%,
      rgba(25, 25, 38, 0.9) 17%,
      #15151f 18%,
      #1c1c28 19.5%,
      #0f0f18 33%,
      #181822 33.5%,
      #0f0f18 54%,
      #181822 54.5%,
      #0f0f18 74%,
      #181822 74.5%,
      #0f0f18 96%
    );
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
  /* 旋转动画 — 默认暂停 */
  animation: vinyl-spin 6s linear infinite;
  animation-play-state: paused;
}

.vinyl-disc.is-spinning {
  animation-play-state: running;
}

/* 唱片光泽 */
.vinyl-disc::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 38% 32%,
    rgba(255, 255, 255, 0.07) 0%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 2;
}

/* 唱片中心照片 */
.vinyl-disc::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 20%;
  right: 20%;
  bottom: 20%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1a1a2e;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* 中心银色圆孔 */
.vinyl-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #8899aa, #334455);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  z-index: 3;
}

@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 唱针 */
.vinyl-arm {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 100px;
  height: 150px;
  transform-origin: top right;
  transform: rotate(-25deg);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 4;
}

.vinyl-arm.is-playing {
  transform: rotate(-12deg);
}

/* 唱针视觉：用伪元素画 */
.vinyl-arm::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #8899aa 0%, #556677 40%, #334455 100%);
  border-radius: 2px;
  transform: rotate(8deg);
  transform-origin: top right;
}

.vinyl-arm::after {
  content: '';
  position: absolute;
  top: 0;
  right: -2px;
  width: 18px;
  height: 24px;
  background: linear-gradient(135deg, #667788, #445566);
  border-radius: 4px 4px 2px 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* 更换照片按钮 */
.theater-photo-picker {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 2;
}

.theater-photo-picker:hover {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.6);
}

/* ── 照片选择面板 ────────────────────────────────────────── */
.theater-photo-panel {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(10, 15, 30, 0.94);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 5;
  overflow-x: auto;
  max-width: calc(100vw - 40px);
}

.theater-photo-panel[hidden] {
  display: none;
}

.theater-photo-option {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.theater-photo-option.is-active {
  border-color: var(--blue-bright);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.theater-photo-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ── 右侧：歌曲信息 + 歌词 ────────────────────────────────── */
.theater-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 20px;
}

.theater-track-info {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.theater-track-info h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.theater-track-info p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ── 歌词滚动区 ──────────────────────────────────────────── */
.theater-lyrics {
  flex: 1;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 28px 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 430px);
  scroll-behavior: smooth;
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 1) 12%,
    rgba(0, 0, 0, 1) 88%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 1) 12%,
    rgba(0, 0, 0, 1) 88%,
    transparent 100%
  );
}

.theater-lyric-line {
  padding: 4px 12px;
  color: rgba(255, 255, 255, 0.22);
  font-size: 15px;
  line-height: 1.75;
  border-radius: 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.35s ease;
  white-space: normal;
  word-break: break-word;
}

.theater-lyric-line:hover {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.03);
}

.theater-lyric-line.is-current {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
}

/* 无歌词提示 */
.theater-lyrics-empty {
  display: grid;
  place-items: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.7;
}

/* ── 底部播放控制栏 ──────────────────────────────────────── */
.theater-controls {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 48px) 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.theater-controls-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theater-now-playing {
  min-width: 0;
}

.theater-now-playing b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theater-now-playing small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theater-controls-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theater-nav-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theater-nav-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.theater-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.theater-play-btn {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #041126;
  font-size: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 4px 24px rgba(56, 189, 248, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.theater-play-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 32px rgba(56, 189, 248, 0.4);
}

.theater-play-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.theater-controls-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.theater-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theater-volume-icon {
  color: var(--muted);
  font-size: 14px;
  flex: 0 0 auto;
}

.theater-volume input[type="range"] {
  width: 80px;
}

/* 进度条行 */
.theater-progress {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.theater-progress output {
  min-width: 72px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 10px;
  text-align: right;
}

/* ── 响应式 ───────────────────────────────────────────────── */

@media (max-width: 1050px) {
  .theater-layout {
    grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
    gap: 16px;
  }

  .vinyl-disc {
    width: min(290px, 42vw);
  }

  .theater-curated {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 14px 16px 8px;
  }

  .theater-curated-card {
    min-height: 64px;
    padding: 10px 12px;
    gap: 8px;
  }

  .theater-curated-card b {
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .theater-layout {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 20px 16px;
  }

  .theater-left {
    flex-direction: row;
    padding: 10px 0;
  }

  .vinyl-stage {
    padding: 10px;
  }

  .vinyl-disc {
    width: min(240px, 50vw);
  }

  .vinyl-arm {
    width: 70px;
    height: 110px;
  }

  .theater-right {
    padding-top: 0;
  }

  .theater-lyrics {
    max-height: 380px;
    padding: 16px 0;
  }

  .theater-controls {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 20px 20px;
  }

  .theater-controls-left,
  .theater-controls-right {
    display: none;
  }

  .theater-curated {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 16px 4px;
  }
}

@media (max-width: 520px) {
  .theater-view {
    min-height: calc(100vh - 140px);
    border-radius: 0;
  }

  .theater-layout {
    padding: 4px 10px 12px;
  }

  .vinyl-disc {
    width: 200px;
  }

  .vinyl-arm {
    width: 60px;
    height: 90px;
  }

  .theater-lyrics {
    max-height: 300px;
    padding: 12px 0;
  }

  .theater-lyric-line {
    font-size: 13px;
    padding: 3px 8px;
  }

  .theater-lyric-line.is-current {
    font-size: 17px;
  }

  .theater-controls {
    padding: 10px 10px 16px;
    gap: 8px;
  }

  .theater-play-btn {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .theater-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .theater-curated {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 10px 4px;
  }

  .theater-curated-card {
    min-height: 56px;
    padding: 8px 10px;
  }

  .theater-curated-card b {
    font-size: 11px;
  }

  .theater-photo-panel {
    padding: 8px 10px;
    gap: 6px;
  }

  .theater-photo-option {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }
}

/* ── 减少动画偏好 ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vinyl-disc {
    animation-duration: 0.01ms !important;
  }

  .vinyl-arm {
    transition: none !important;
  }

  .theater-lyrics {
    scroll-behavior: auto !important;
  }
}
