/* ============================================================
   assets/css/player.css — 底部玻璃音乐播放器
   跟随 liquid-glass.css 的主题令牌，浅色 / 深色都自适应
   ============================================================ */

#floating-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 72px;
  padding: 0 22px;
  border-radius: 0;
  border-top-left-radius: var(--lg-radius);
  border-top-right-radius: var(--lg-radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 -14px 40px -20px rgba(16, 24, 40, 0.5);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* 左侧：封面 + 曲目 */
#floating-player #song-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 230px;
  min-width: 0;
}

#floating-player #cover-img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(120, 135, 165, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 14px -10px rgba(16, 24, 40, 0.6);
}

#floating-player #song-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#floating-player #song-name {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--lg-text);
}

#floating-player #song-artist {
  font-size: 12px;
  color: var(--lg-text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#floating-player #song-album {
  display: none;
}

/* 中间：控制 + 进度 */
#floating-player #player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 10px;
}

#floating-player .buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

#floating-player .control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 4px 8px;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  color: var(--lg-text);
  background: rgba(255, 255, 255, 0.35);
  border: 0;
  border-radius: var(--lg-pill);
  cursor: pointer;
  transition: transform var(--lg-fast) var(--lg-ease), background var(--lg-base) var(--lg-ease);
}

#floating-player .control-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

#floating-player .control-btn:active {
  transform: scale(0.92);
}

#floating-player #play-pause-btn {
  font-size: 20px;
  min-width: 42px;
  min-height: 42px;
  background: linear-gradient(150deg, #4aa3ff, #0a6bf0);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px -10px rgba(10, 80, 200, 0.9);
}

:root[data-theme="dark"] #floating-player .control-btn {
  background: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] #floating-player .control-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

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

#floating-player #current-time,
#floating-player #duration {
  flex: 0 0 auto;
  min-width: 34px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--lg-text-mute);
}

#floating-player #duration {
  text-align: right;
}

#floating-player #progress-bar {
  position: relative;
  flex: 1 1 auto;
  height: 4px;
  border-radius: var(--lg-pill);
  background: rgba(120, 135, 165, 0.28);
  cursor: pointer;
  transition: height var(--lg-fast) var(--lg-ease), background var(--lg-base) var(--lg-ease);
}

#floating-player #progress-bar:hover,
#floating-player #progress-bar:focus-visible {
  height: 7px;
  background: rgba(120, 135, 165, 0.4);
}

#floating-player #progress-fill {
  height: 100%;
  width: 0;
  border-radius: var(--lg-pill);
  background: linear-gradient(90deg, #35c7d8, #4aa3ff 60%, #b08cff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 右侧 */
#floating-player #player-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

#floating-player #player-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--lg-text-mute);
}

#floating-player #playlist-toggle {
  padding: 4px 8px;
  font-size: 17px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--lg-base) var(--lg-ease);
}

#floating-player #playlist-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] #floating-player #playlist-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  #floating-player {
    height: 66px;
    padding: 0 12px;
    gap: 8px;
  }
  #floating-player #song-info {
    flex: 0 1 140px;
  }
  #floating-player #cover-img {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 10px;
  }
  #floating-player #player-header h3 {
    display: none;
  }
  #floating-player .time-progress {
    max-width: none;
  }
}

@media (max-width: 560px) {
  #floating-player #song-name {
    font-size: 12.5px;
  }
  #floating-player #song-artist {
    font-size: 11px;
  }
  #floating-player .control-btn {
    min-width: 30px;
    min-height: 30px;
    font-size: 14px;
  }
  #floating-player #play-pause-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 17px;
  }
  #floating-player #current-time,
  #floating-player #duration {
    min-width: 28px;
    font-size: 10px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  #floating-player {
    background: #f5f7fb;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  :root[data-theme="dark"] #floating-player {
    background: #161b28;
  }
}
