/* =========================================================
   css/player.css —— 网易云风格悬浮小播放器（两页共用）
   ========================================================= */

/* ---- 悬浮容器（玻璃质感） ---- */
.np {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.20), rgba(255,255,255,.07) 50%, rgba(255,255,255,.14));
  -webkit-backdrop-filter: blur(12px) saturate(210%);
  backdrop-filter: blur(12px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 18px 44px rgba(6, 8, 34, .30), inset 0 1px 0 rgba(255, 255, 255, .55);
  color: #fff;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  animation: npIn .8s ease .1s backwards;
  transition: opacity .7s ease, transform .7s cubic-bezier(.5, 0, .22, 1);
}
@keyframes npIn {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
/* 整页离场时播放器一并淡出（配合加载页跳转） */
body.leaving .np {
  opacity: 0 !important;
  transform: translateY(22px) scale(.96);
}

/* ---- 旋转小唱片（点击=播放/暂停） ---- */
.np-disc {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .75);
  background: #16162a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255,255,255,.12);
  cursor: pointer;
  position: relative;
}
.np-disc::after {           /* 唱片中心孔 */
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 11px; height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 2px rgba(0,0,0,.25);
}
.np-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: npSpin 16s linear infinite;
  animation-play-state: paused;   /* 暂停时静止 */
}
.np.playing .np-cover { animation-play-state: running; }
@keyframes npSpin { to { transform: rotate(360deg); } }

/* ---- 右侧信息 + 进度 ---- */
.np-main { flex: 1; min-width: 0; }
.np-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, .55);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.np-track {
  display: flex; align-items: center; gap: 7px;
  margin-top: 6px;
}
.np-time {
  flex: none;
  min-width: 30px;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .6);
}
.np-bar {
  flex: 1; height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .22);
  cursor: pointer;
  position: relative;
}
.np-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff8a80, #e0343b);
  box-shadow: 0 0 8px rgba(224, 52, 59, .6);
}
.np-thumb {
  position: absolute; top: 50%;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, .5);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .2s;
}
.np:hover .np-thumb { opacity: 1; }

/* ---- 红心播放/暂停键 ---- */
.np-play {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ff5b5b, #d92b3a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(224, 52, 59, .45);
  transition: transform .15s, box-shadow .2s;
}
.np-play:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(224, 52, 59, .6); }
.np-play:active { transform: scale(.94); }
.np-play svg { width: 16px; height: 16px; fill: #fff; display: block; }
.np .ic-pause { display: none; }
.np.playing .ic-play { display: none; }
.np.playing .ic-pause { display: block; }

/* ---- 音频元素：占位不可见（不用 display:none，兼容旧 iOS） ---- */
.np-audio {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
  clip: rect(0 0 0 0);
}

/* ---- 文件缺失提示气泡 ---- */
.np-tip {
  position: absolute;
  right: 8px; bottom: calc(100% + 10px);
  max-width: 260px;
  padding: 8px 12px;
  font-size: 11.5px; line-height: 1.6;
  color: #ffe9b3;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 122, .45);
  background: rgba(30, 26, 12, .85);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: opacity .25s, transform .25s;
}
.np-tip.show { opacity: 1; pointer-events: auto; transform: none; }

/* 无 backdrop-filter 的兜底 */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .np { background: linear-gradient(135deg, rgba(30, 28, 54, .94), rgba(14, 14, 30, .96)); }
}

@media (prefers-reduced-motion: reduce) {
  .np, .np-cover { animation: none !important; }
}

@media (max-width: 400px) {
  .np { right: 8px; bottom: 8px; gap: 9px; padding: 10px 11px; }
  .np-disc { width: 46px; height: 46px; }
}
