/* player.css — Fixed mini-player at bottom (#fixed-player + .player-* + .play-btn) */

#fixed-player {
  position: fixed;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 400px;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  z-index: 950;
  cursor: pointer;
  color: var(--text-dark);
  transition: transform 0.2s, opacity 0.2s;
  /* [Perf v4] 内部时长 / 收听数 / logo 频繁更新, paint 隔离防止外溢到 view 层 */
  contain: layout paint style;

  display: none;
}

#fixed-player:not(.hidden) { display: block; }
#fixed-player.force-visible { display: block !important; }

#fixed-player.chat-mode {
  bottom: auto;
  top: 0;
  left: 0; transform: none;
  width: 100%; max-width: none;
  border-radius: 0;
  border-left: none; border-right: none;
  background: var(--glass-bg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  z-index: 920;
  padding-top: var(--safe-top);

  display: flex;
  flex-direction: column;
}

@media (prefers-color-scheme: dark) {
  #fixed-player.chat-mode {
    background: rgba(28, 28, 30, 0.96);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
  }
}

.player-top-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 48px;
}

#fixed-player.chat-mode .player-inner {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 var(--edge-pad);
  height: 100%;
  order: 1;
}
#fixed-player.chat-mode .player-logo {
  width: 32px; height: 32px; border-radius: 6px;
}
#fixed-player.chat-mode .player-name { font-size: 13px; }
#fixed-player.chat-mode .player-sub { font-size: 11px; }

.player-inner {
  padding: 6px var(--edge-pad);
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}

.player-logo {
  width: 40px; height: 40px;
  object-fit: contain; border-radius: 10px;
  flex-shrink: 0;
  /* [Perf v7] 移除 transition: opacity 0.3s ease。
     参照 Apple Music：mini 播放器切歌时封面直接换，零过渡——
     · 尺寸小（40×40），换图没有视觉割裂感
     · 淡入淡出反而让用户感觉「响应慢了一拍」
     · 与 mediaSession（锁屏/灵动岛 0ms 响应）保持视觉同步
     .loading 类保留为兜底（JS 仍可加，但效果为 no-op），不再触发动画。 */
}
.player-logo.loading { opacity: 1; }  /* [Perf v7] 由淡出改为常亮，等价于"取消动画" */
.player-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.player-name {
  display: block; font-size: 14px; font-weight: 700;
  line-height: 1.3; overflow: hidden;

  white-space: nowrap;
  min-width: 0;
}
.player-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 1px; min-width: 0;
}
.player-sub {
  font-size: 12px; color: var(--tab-inactive);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-controls { flex-shrink: 0; }
.play-btn {
  padding: 2px; transition: transform 0.2s;
  background: none; border: none; cursor: pointer;
}
.play-btn:active { transform: scale(0.9); }
