/* ============================================================
   悬浮音乐播放器
   ============================================================ */
.mp-player {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 70;
  width: 292px;
  border-radius: 16px;
  border: 1px solid #4a7a22;
  background: linear-gradient(150deg, rgba(20, 32, 12, .97), rgba(10, 16, 8, .98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(140, 226, 42, .12) inset,
              0 0 26px rgba(140, 226, 42, .18);
  backdrop-filter: blur(12px);
  color: #eaf1e2;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  transition: width .28s var(--ease, cubic-bezier(.22, .9, .28, 1)),
              transform .28s var(--ease, cubic-bezier(.22, .9, .28, 1)),
              opacity .25s ease;
  overflow: hidden;
  user-select: none;
}
.mp-player.collapsed { width: 58px; }
.mp-player.collapsed .mp-body { display: none; }
.mp-player.collapsed .mp-head { padding: 10px; justify-content: center; }

.mp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px 10px;
  cursor: grab;
}
.mp-head:active { cursor: grabbing; }
.mp-orb {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #8ce22a, #3d6b12);
  box-shadow: 0 0 14px rgba(140, 226, 42, .45);
  position: relative;
}
.mp-orb svg { width: 15px; height: 15px; color: #08120a; }
.mp-player.waiting .mp-orb {
  animation: mpNudge 1.6s ease-in-out infinite;
}
@keyframes mpNudge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.mp-player.playing .mp-orb::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(140, 226, 42, .55);
  animation: mpPulse 1.8s ease-out infinite;
}
@keyframes mpPulse {
  0% { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
.mp-title { flex: 1; min-width: 0; }
.mp-title b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #dcebd0;
}
.mp-title span { display: block; font-size: 10.5px; color: #7d8b70; margin-top: 1px; }

.mp-body { padding: 0 12px 11px; }
.mp-bar {
  height: 4px;
  border-radius: 3px;
  background: #1b2713;
  overflow: hidden;
  margin-bottom: 9px;
  cursor: pointer;
}
.mp-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #5fc21a, #8ce22a);
  box-shadow: 0 0 10px rgba(140, 226, 42, .6);
  transition: width .2s linear;
}
.mp-ctrls { display: flex; align-items: center; gap: 7px; }
.mp-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  border: 1px solid #2c3a20;
  background: #111a0c;
  color: #b9c9ab;
  display: grid; place-items: center;
  cursor: pointer;
  transition: .18s;
}
.mp-btn:hover { border-color: #8ce22a; color: #8ce22a; }
.mp-btn.play {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #8ce22a, #5fc21a);
  color: #08120a; border-color: transparent;
}
.mp-btn svg { width: 14px; height: 14px; }
.mp-btn.play svg { width: 16px; height: 16px; }

.mp-vol {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
  flex: 1;
  min-width: 0;
}
.mp-vol svg { width: 14px; height: 14px; color: #7d8b70; flex: none; }
.mp-vol input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 3px;
  background: #24301a; outline: none; cursor: pointer;
}
.mp-vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: #8ce22a;
  box-shadow: 0 0 8px rgba(140, 226, 42, .7);
  cursor: pointer;
}
.mp-vol input[type=range]::-moz-range-thumb {
  width: 11px; height: 11px; border: none; border-radius: 50%;
  background: #8ce22a; cursor: pointer;
}
.mp-hint {
  margin-top: 7px;
  font-size: 10.5px;
  color: #6b7a6b;
  text-align: center;
}
.mp-player.muted .mp-orb {
  background: radial-gradient(circle at 35% 30%, #4a5a3a, #25301c);
  box-shadow: none;
}
@media (max-width: 640px) {
  .mp-player { right: 12px; bottom: 76px; width: 236px; }
  .mp-player.collapsed { width: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-player, .mp-orb::after { transition: none; animation: none; }
}

/* 缓冲中：进度条闪烁 */
.mp-player.buffering .mp-bar i {
  animation: mpBuff 1s ease-in-out infinite;
  background: linear-gradient(90deg, #5fc21a, #c9f08c, #5fc21a);
  background-size: 200% 100%;
}
@keyframes mpBuff {
  0% { background-position: 0 0; }
  100% { background-position: 200% 0; }
}
