/*
 * 本程序由【小马克程序定制】设计与制作，如有售后和开发需求官网：https://xiaomaker.cn
 * 前台播放页样式：背景图置顶展示 + 下缘羽化模糊，控件直接置于背景之上，播放键页面居中、毛玻璃质感
 */

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #fff;
  background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
}

.play-page {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 模糊背景层：基于同一张上传图片铺满，加大高斯模糊做边缘虚化，保证色调与清晰图一致 */
.bg-blur {
  position: absolute;
  inset: -80px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(50px) brightness(0.5) saturate(1.2);
  transform: scale(1.2);
  z-index: 0;
}

/* 清晰背景图层：宽度恒等于屏幕宽度、高度等比自适应不拉伸变形，靠顶部展示；仅下缘渐变融入底层模糊背景 */
.bg-main {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  z-index: 1;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 60%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
}

/* 渐变压暗层，保证文字可读 */
.bg-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.1) 35%, rgba(15, 23, 42, 0.55) 100%);
  z-index: 2;
}

.play-overlay {
  position: relative;
  z-index: 3;
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
}

/* ---------- 播放器区块：整体锚定在距屏幕顶部 65% 位置，高度随内容自适应 ---------- */
.player-block {
  flex: 0 0 auto;
  margin-top: 55vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ---------- 歌曲信息（无外框，直接置于背景之上） ---------- */
.song-head {
  text-align: center;
  margin-bottom: 24px;
}

.song-title {
  font-size: 22px;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.song-artist {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.85;
}

/* ---------- 进度条 ---------- */
.progress-block {
  margin-bottom: 26px;
}

.progress-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #fff;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  left: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.progress-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

/* ---------- 控制区：主播放键页面居中，两侧按钮对称定位，间距拉开 ---------- */
.controls {
  position: relative;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s ease, transform 0.1s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.control-btn:active {
  transform: scale(0.94);
}

.side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.side-btn:active {
  transform: translateY(-50%) scale(0.94);
}

#backBtn {
  right: calc(50% + 80px);
}

#forwardBtn {
  left: calc(50% + 80px);
}

/* 主播放键：毛玻璃底色，不再使用纯色白底 */
.play-main-btn {
  width: 76px;
  height: 76px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 30px;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.28);
}

.play-main-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.speed-select {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.speed-select option {
  color: #1e293b;
}

/* ---------- 歌词：仅在播放器下方至屏幕底部的剩余区域内滚动，整页不滚动 ---------- */
.lyrics-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  text-align: center;
  padding: 18px 4px 20px;
  scroll-behavior: smooth;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.lyric-line {
  padding: 9px 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.25s ease, transform 0.25s ease, font-weight 0.25s ease;
}

.lyric-line.active {
  color: #fff;
  font-weight: 600;
  transform: scale(1.05);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.lyric-empty {
  margin-top: 40px;
  opacity: 0.7;
  font-size: 14px;
}

/* ---------- 加载 / 错误状态 ---------- */
.state-box {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
}

.state-box .state-icon {
  font-size: 44px;
  opacity: 0.8;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .play-overlay {
    padding: 0 16px 20px;
  }
  .song-head {
    margin-bottom: 18px;
  }
  .song-title {
    font-size: 19px;
  }
  .controls {
    height: 70px;
  }
  .control-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  #backBtn {
    right: calc(50% + 70px);
  }
  #forwardBtn {
    left: calc(50% + 70px);
  }
  .play-main-btn {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }
  .speed-select {
    padding: 6px 8px;
    font-size: 12px;
  }
  .lyric-line {
    font-size: 15px;
    padding: 8px 0;
  }
}
