/* ========== 全局悬浮播放器 ========== */
/* 页面底部留白，避开播放器 */
body {
  padding-bottom: 72px;
}
@media (max-width: 640px) {
  body { padding-bottom: 64px; }
}

.global-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(20, 20, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-player.show {
  transform: translateY(0);
}

/* 底部给播放器留出空间 */
body.has-player {
  padding-bottom: 72px;
}

.player-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: grid;
  grid-template-columns: 300px 1fr 200px;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

/* ---------- 左侧：歌曲信息 ---------- */
.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #2a2a30;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-cover-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.player-cover:hover .player-cover-mask {
  opacity: 1;
}

.player-cover-mask svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.player-meta {
  min-width: 0;
  flex: 1;
}

.player-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---------- 中间：控制 + 进度 ---------- */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
  padding: 0;
}

.player-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.player-btn svg {
  width: 18px;
  height: 18px;
}

.player-play-btn {
  width: 36px;
  height: 36px;
  background: #fff;
  color: #000;
}

.player-play-btn:hover {
  background: #f0f0f0;
  color: #000;
  transform: scale(1.05);
}

.player-play-btn svg {
  width: 18px;
  height: 18px;
}

/* 进度条 */
.player-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 600px;
}

.player-time {
  font-size: 11px;
  color: #888;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: center;
  flex-shrink: 0;
}

.player-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.player-progress-buffered {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  width: 0%;
}

.player-progress-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #ff9f43);
  border-radius: 2px;
  width: 0%;
}

.player-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-progress:hover .player-progress-handle {
  opacity: 1;
}

.player-progress:hover {
  height: 6px;
}

/* ---------- 右侧：音量 ---------- */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-volume-slider {
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.player-volume-filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 70%;
}

.player-volume-handle {
  position: absolute;
  top: 50%;
  left: 70%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}

.player-volume-slider:hover .player-volume-handle {
  opacity: 1;
}

/* 响应式 */
/* 移动端播放器高度优化 */

/* ========== 移动端 ========== */
@media (max-width: 768px) {
  /* 页面底部留白，避开播放器 */
body {
  padding-bottom: 72px;
}
@media (max-width: 640px) {
  body { padding-bottom: 64px; }
}

.global-player { height: auto; min-height: 72px; }
  body.has-player { padding-bottom: 72px; }

  .player-inner {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "info controls"
      "progress progress";
    padding: 8px 12px;
    gap: 6px;
  }

  /* 封面 + 标题 */
  .player-info { grid-area: info; gap: 8px; }
  .player-cover { width: 36px; height: 36px; border-radius: 6px; }
  .player-title { font-size: 12px; max-width: 120px; }
  .player-artist { display: none !important; }

  /* 移动端独立播放按钮隐藏（中间控制栏有） */
  .player-play-btn-mobile { display: none !important; }

  /* 中间控制按钮组 */
  .player-center {
    grid-area: controls;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
  }
  .player-controls { gap: 4px; }
  .player-btn { width: 28px; height: 28px; }
  .player-btn svg { width: 16px; height: 16px; }
  .player-play-btn { width: 34px; height: 34px; }
  .player-play-btn svg { width: 16px; height: 16px; }

  /* 进度条 */
  .player-progress-wrap {
    grid-area: progress;
    width: 100%;
    max-width: none;
    gap: 6px;
  }
  .player-time { font-size: 10px; min-width: 30px; }

  /* 右侧音量隐藏 */
  .player-right { display: none !important; }
}

