/* ========== 悬浮球音乐播放器 ========== */
#music-ball {
  position: fixed;
  left: 30px;
  bottom: 35%;
  z-index: 9999;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#music-ball:active { cursor: grabbing; }

#music-ball .ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b48ead, #f4a9c0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(180, 142, 173, 0.5);
  transition: transform .3s, box-shadow .3s;
  animation: ballPulse 3s ease-in-out infinite;
}
#music-ball .ball:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(244, 169, 192, 0.6);
}
#music-ball .ball .icon {
  font-size: 22px;
  color: #fff;
  pointer-events: none;
}
#music-ball .ball.playing {
  animation: ballSpin 4s linear infinite;
}
@keyframes ballPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(180, 142, 173, 0.4); }
  50% { box-shadow: 0 4px 28px rgba(244, 169, 192, 0.6); }
}
@keyframes ballSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
#music-ball .ball.playing:hover {
  animation: none;
  transform: scale(1.12);
}

/* 迷你播放器面板 */
#music-panel {
  position: absolute;
  left: 64px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: rgba(26, 16, 37, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(180, 142, 173, 0.2);
  border-radius: 16px;
  padding: 16px;
  color: #f0e6f6;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
#music-panel.show {
  display: block;
  animation: panelIn .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes panelIn {
  0% { opacity: 0; transform: translateY(-50%) scale(0.9) translateX(-10px); }
  100% { opacity: 1; transform: translateY(-50%) scale(1) translateX(0); }
}

#music-panel .song-info { margin-bottom: 12px; }
#music-panel .song-title {
  font-size: 14px;
  font-weight: 600;
  color: #d4b5e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#music-panel .song-artist {
  font-size: 11px;
  color: #c8b8d4;
  margin-top: 2px;
}
#music-panel .controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 10px 0;
}
#music-panel .ctrl-btn {
  background: none;
  border: none;
  color: #f0e6f6;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all .2s;
}
#music-panel .ctrl-btn:hover {
  background: rgba(180, 142, 173, 0.2);
}
#music-panel .ctrl-btn.main {
  font-size: 24px;
  background: rgba(180, 142, 173, 0.15);
  padding: 8px;
}
#music-panel .progress-wrap {
  width: 100%;
  height: 4px;
  background: rgba(180, 142, 173, 0.2);
  border-radius: 2px;
  cursor: pointer;
  margin: 8px 0;
}
#music-panel .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #b48ead, #f4a9c0);
  border-radius: 2px;
  width: 0%;
  transition: width .3s;
}
#music-panel .time-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #c8b8d4;
}
#music-panel .playlist {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 10px;
  border-top: 1px solid rgba(180, 142, 173, 0.15);
  padding-top: 8px;
}
#music-panel .playlist::-webkit-scrollbar { width: 4px; }
#music-panel .playlist::-webkit-scrollbar-thumb {
  background: rgba(180, 142, 173, 0.3);
  border-radius: 2px;
}
#music-panel .pl-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background .2s;
}
#music-panel .pl-item:hover {
  background: rgba(180, 142, 173, 0.15);
}
#music-panel .pl-item.active {
  background: rgba(244, 169, 192, 0.15);
  color: #f4a9c0;
}
#music-panel .pl-item .pl-idx {
  width: 20px;
  color: #c8b8d4;
  font-size: 10px;
}
#music-panel .pl-item .pl-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#music-panel .pl-item .pl-auth {
  font-size: 10px;
  color: #8a7a94;
  margin-left: 8px;
  white-space: nowrap;
}

/* 隐藏原生 APlayer */
.aplayer { display: none !important; }

@media (max-width: 768px) {
  #music-ball { display: none; }
}
