/* ==========================================================================
   凇语工坊 · 右下角可折叠悬浮唱片播放器
   融入 yui540.com/motions/76（再生・停止胶囊动效）与 /motions/1（10柱声波）
   ========================================================================== */

.mp-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 920;
  font-family: var(--font-sans, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif);
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 收起态：右下角悬浮旋转唱片 ---------- */
.mp-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(106, 170, 214, 0.34);
  background: rgba(250, 252, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(45, 92, 130, 0.14), 0 2px 6px rgba(45, 92, 130, 0.06);
  color: var(--text, #1f2b38);
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease, border-color 0.25s ease, opacity 0.25s ease;
}
html[data-mode="dark"] .mp-fab {
  background: rgba(24, 32, 44, 0.88);
  border-color: rgba(126, 192, 235, 0.28);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
}
.mp-fab:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(106, 170, 214, 0.65);
  box-shadow: 0 14px 32px rgba(45, 92, 130, 0.2);
}
.mp-root.is-open .mp-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.84) translateY(8px);
}

/* 黑胶/冰蓝唱片本体 */
.mp-disc {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle at center, #fdf7e3 0 19%, #f6c95c 19% 25%, #2b3a4b 25% 28%, #1e2a38 28% 36%, #2a3b4e 36% 40%, #1d2836 40% 56%, #2a3c50 56% 60%, #1b2633 60% 100%);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.22), 0 3px 10px rgba(24, 48, 72, 0.22);
  animation: mpSpin 8.5s linear infinite;
  animation-play-state: paused;
  overflow: hidden;
}
.mp-root.is-playing .mp-disc {
  animation-play-state: running;
}
.mp-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 25deg,
    rgba(255, 255, 255, 0) 0deg 35deg,
    rgba(195, 230, 255, 0.24) 55deg,
    rgba(255, 255, 255, 0) 80deg 215deg,
    rgba(246, 201, 92, 0.22) 238deg,
    rgba(255, 255, 255, 0) 265deg 360deg
  );
  pointer-events: none;
}
.mp-disc-cover {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
}
.mp-disc-cover.has-img { display: block; }
.mp-disc-hole {
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fafcff;
  box-shadow: 0 0 0 1.5px rgba(106, 170, 214, 0.5);
}

@keyframes mpSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mp-fab-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 118px;
  min-width: 0;
}
.mp-fab-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.mp-fab-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-3, #6d7f92);
  margin-top: 2px;
}

/* 迷你 4 柱声波（收起态） */
.mp-mini-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}
.mp-mini-eq i {
  display: block;
  width: 2px;
  height: 3px;
  border-radius: 99px;
  background: var(--blue, #6aaad6);
  transition: height 0.2s ease;
}
.mp-root.is-playing .mp-mini-eq i {
  animation: mpMiniEq 0.9s ease-in-out infinite;
}
.mp-root.is-playing .mp-mini-eq i:nth-child(2) { animation-delay: 0.18s; background: #f0b840; }
.mp-root.is-playing .mp-mini-eq i:nth-child(3) { animation-delay: 0.36s; }
.mp-root.is-playing .mp-mini-eq i:nth-child(4) { animation-delay: 0.54s; background: #8cbdde; }
@keyframes mpMiniEq {
  0%, 100% { height: 3px; }
  45% { height: 10px; }
}

/* ---------- 展开态：悬浮迷你唱片播放器面板 ---------- */
.mp-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 306px;
  border-radius: 22px;
  border: 1px solid rgba(106, 170, 214, 0.34);
  background: rgba(250, 252, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(38, 82, 118, 0.18), 0 4px 12px rgba(38, 82, 118, 0.07);
  padding: 15px 16px 14px;
  color: var(--text, #1f2b38);
  transform-origin: right bottom;
  opacity: 0;
  transform: scale(0.82) translateY(16px);
  pointer-events: none;
  transition:
    opacity 0.26s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-mode="dark"] .mp-panel {
  background: rgba(22, 29, 40, 0.94);
  border-color: rgba(126, 192, 235, 0.26);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.48);
}
.mp-root.is-open .mp-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* 面板头部：唱片 + 曲名 + yui 10柱波形 + 折起按钮 */
.mp-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.mp-head .mp-disc {
  width: 50px;
  height: 50px;
}
.mp-meta {
  flex: 1;
  min-width: 0;
}
.mp-title {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-artist {
  font-size: 11.5px;
  color: var(--text-3, #6d7f92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* yui540 /motions/1 同款 10 柱均衡器波形 */
.mp-yui-eq {
  display: grid;
  grid-template-columns: repeat(10, 2px);
  column-gap: 2.2px;
  align-items: center;
  height: 22px;
  margin-right: 2px;
  flex-shrink: 0;
}
.mp-yui-eq span {
  position: relative;
  display: block;
  width: 2px;
  height: 22%;
  border-radius: 99px;
  background: transparent;
  --max-h: 60%;
}
.mp-yui-eq span::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 100%;
  transform: translateY(-50%);
  border-radius: 99px;
  background: var(--blue, #6aaad6);
  opacity: 0.45;
  transition: opacity 0.25s;
}
.mp-root.is-playing .mp-yui-eq span {
  animation: yuiEqPulse 1.1s ease-in-out infinite both;
}
.mp-root.is-playing .mp-yui-eq span::before {
  opacity: 0.95;
  animation: yuiEqJitter 0.16s ease-in-out infinite both;
}
.mp-yui-eq span:nth-child(2n) { --max-h: 48%; animation-delay: 0.45s; }
.mp-yui-eq span:nth-child(2n)::before { animation-delay: 0.08s; background: #8cbdde; }
.mp-yui-eq span:nth-child(3n) { --max-h: 76%; animation-delay: 0.85s; }
.mp-yui-eq span:nth-child(3n)::before { background: #f0b840; }
.mp-yui-eq span:nth-child(4n) { --max-h: 54%; animation-delay: 0.95s; }
.mp-yui-eq span:nth-child(5n) { --max-h: 68%; animation-delay: 0.65s; }
.mp-yui-eq span:nth-child(6n) { --max-h: 92%; animation-delay: 0.25s; }
.mp-yui-eq span:nth-child(10n) { --max-h: 100%; animation-delay: 0.72s; }

@keyframes yuiEqPulse {
  0%, 32%, 100% { height: 22%; }
  15% { height: var(--max-h); }
}
@keyframes yuiEqJitter {
  0%, 100% { height: 100%; }
  50% { height: calc(100% + 3px); }
}

.mp-fold-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(106, 170, 214, 0.12);
  color: var(--text-2, #4d6073);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s, transform 0.22s ease, color 0.18s;
}
.mp-fold-btn:hover {
  background: rgba(106, 170, 214, 0.24);
  color: var(--text, #1f2b38);
  transform: scale(1.08);
}

/* 进度条 */
.mp-prog-wrap {
  margin: 13px 0 11px;
}
.mp-prog-bar {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: rgba(106, 170, 214, 0.18);
  cursor: pointer;
  overflow: visible;
}
.mp-prog-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8cbdde, #6aaad6);
  transition: width 0.12s linear;
}
.mp-prog-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f6c95c;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(45, 92, 130, 0.28);
  transform: translateY(-50%) scale(0.85);
  transition: transform 0.18s ease;
}
.mp-prog-bar:hover .mp-prog-fill::after {
  transform: translateY(-50%) scale(1.15);
}
.mp-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3, #6d7f92);
  margin-top: 5px;
}

/* ---------- 核心控制栏：复刻 yui540 /motions/76 「再生・停止」胶囊 ---------- */
.mp-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mp-yui-pill {
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(106, 170, 214, 0.14);
}
html[data-mode="dark"] .mp-yui-pill {
  background: rgba(126, 192, 235, 0.12);
}

/* 上一首 / 下一首按钮（yui /motions/76 弹性冲刺动效） */
.mp-skip {
  position: relative;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-skip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(106, 170, 214, 0.22);
  transition: background 0.18s;
}
.mp-skip:hover::before {
  background: rgba(106, 170, 214, 0.34);
}
.mp-skip-inner {
  position: relative;
  width: 16px;
  height: 14px;
  display: block;
}
.mp-skip.is-prev .mp-skip-inner {
  transform: scaleX(-1);
}
.mp-skip-tri {
  position: absolute;
  top: 50%;
  left: 28%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--text, #2b3c4f);
}
.mp-skip-bar {
  position: absolute;
  right: 1px;
  top: 50%;
  width: 2.5px;
  height: 12px;
  transform: translateY(-50%);
  border-radius: 99px;
  background: var(--text, #2b3c4f);
}

/* 点击触发 yui 0.6s 弹性冲刺 */
.mp-skip.anim-kick::before {
  animation: yuiSkipCircle 0.56s ease-in-out both;
}
.mp-skip.anim-kick .mp-skip-tri {
  animation: yuiSkipTri 0.56s ease-in-out both;
}
.mp-skip.anim-kick .mp-skip-bar {
  animation: yuiSkipBar 0.56s ease-in-out both;
}
@keyframes yuiSkipCircle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.24); }
  75% { transform: scale(0.95); }
}
@keyframes yuiSkipTri {
  0%, 100% { left: 28%; }
  50% { left: 60%; }
  75% { left: 24%; }
}
@keyframes yuiSkipBar {
  0%, 100% { height: 12px; }
  50% { height: 20px; }
  75% { height: 10px; }
}

/* 中央播放/暂停按钮（yui /motions/76 圆形 clip-path 擦除 + 弹性缩放） */
.mp-play-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-play-base {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--blue, #6aaad6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(106, 170, 214, 0.36);
}
.mp-play-base svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  transform: translateX(1.5px);
}
.mp-pause-layer {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--blue, #6aaad6);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.3s ease-in-out;
}
html[data-mode="dark"] .mp-pause-layer {
  background: #1b2432;
}
.mp-pause-layer svg {
  width: 16px;
  height: 16px;
  fill: var(--blue, #6aaad6);
}
.mp-root.is-playing .mp-pause-layer {
  clip-path: circle(52% at 50% 50%);
}
.mp-play-btn.anim-to-play {
  animation: yuiPlayPop 0.56s ease-in-out both;
}
.mp-play-btn.anim-to-pause {
  animation: yuiPauseSquash 0.56s ease-in-out both;
}
@keyframes yuiPlayPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
  75% { transform: scale(0.97); }
}
@keyframes yuiPauseSquash {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.82); }
  75% { transform: scale(1.05); }
}

/* 右侧辅助按钮（循环模式 + 歌单） */
.mp-aux-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mp-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-2, #4d6073);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, transform 0.18s;
}
.mp-icon-btn:hover,
.mp-icon-btn.is-active {
  background: rgba(106, 170, 214, 0.16);
  color: var(--blue-dark, #4b8ec0);
}
.mp-icon-btn:active {
  transform: scale(0.92);
}

/* 音量条 */
.mp-vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(106, 170, 214, 0.22);
}
.mp-vol-slider {
  flex: 1;
  height: 4px;
  accent-color: var(--blue, #6aaad6);
  cursor: pointer;
}
.mp-vol-pct {
  font-size: 10.5px;
  color: var(--text-3, #6d7f92);
  width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 可折叠歌单列表 */
.mp-list-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.25s ease;
}
.mp-panel.show-list .mp-list-wrap {
  max-height: 186px;
  margin-top: 10px;
  overflow-y: auto;
}
.mp-list {
  list-style: none;
  padding: 6px 0 2px;
  margin: 0;
  border-top: 1px solid rgba(106, 170, 214, 0.18);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background 0.15s, color 0.15s;
}
.mp-item:hover {
  background: rgba(106, 170, 214, 0.12);
}
.mp-item.is-cur {
  background: rgba(106, 170, 214, 0.2);
  color: var(--blue-dark, #3e7fb0);
  font-weight: 700;
}
html[data-mode="dark"] .mp-item.is-cur {
  color: #8fd0f8;
}
.mp-item-l {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.mp-item-idx {
  font-size: 10.5px;
  color: var(--text-3, #6d7f92);
  width: 16px;
  flex-shrink: 0;
}
.mp-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-item-art {
  font-size: 11px;
  color: var(--text-3, #6d7f92);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .mp-root { right: 12px; bottom: 14px; }
  .mp-panel { width: calc(100vw - 24px); max-width: 310px; }
  .mp-fab-info { max-width: 92px; }
}
