/*!
 * player-core.css — 全局播放器样式
 * 包含：右上角圆形迷你播放器 + Toast
 */

/* ============================================================
 * 右上角圆形迷你播放器
 * ============================================================ */
#gp-mini {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  z-index: 99998;
  cursor: pointer;
  background: #1e2a3a;

  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.9);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

#gp-mini.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#gp-mini:hover {
  transform: translateY(0) scale(1.06);
}

/* 进度环：conic-gradient，角度由 --gp-p 控制
   注意：遮罩只加在环本身，不能加在容器上，否则会裁掉关闭按钮和角标 */
.gp-mini-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(#f3b34c var(--gp-p, 0%), rgba(255, 255, 255, .28) 0);
  -webkit-mask: radial-gradient(circle, transparent 24.5px, #000 25px);
  mask: radial-gradient(circle, transparent 24.5px, #000 25px);
  pointer-events: none;
}

/* 封面 */
.gp-mini-img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #2b3a4d;
  -webkit-user-drag: none;
  user-select: none;
}

/* 播放中：轻微呼吸光圈 */
#gp-mini.is-playing::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(243, 179, 76, .45);
  animation: gp-pulse 2.2s ease-out infinite;
  pointer-events: none;
}

@keyframes gp-pulse {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* 中心小圆点：播放/暂停状态 */
.gp-mini-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(20, 28, 38, .9);
  border: 1.5px solid rgba(255, 255, 255, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
}

/* 关闭按钮：悬停出现 */
.gp-mini-close {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(20, 28, 38, .92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .18s ease, transform .18s ease;
}

#gp-mini:hover .gp-mini-close {
  opacity: 1;
  transform: scale(1);
}

/* 移动端稍微小一点，避开状态栏 */
@media (max-width: 640px) {
  #gp-mini {
    width: 50px;
    height: 50px;
    top: 10px;
    right: 10px;
  }
  .gp-mini-ring {
    -webkit-mask: radial-gradient(circle, transparent 21.5px, #000 22px);
    mask: radial-gradient(circle, transparent 21.5px, #000 22px);
  }
  .gp-mini-img { inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); }
}

/* ============================================================
 * Toast（核心里面和播放页共用）
 * ============================================================ */
.gp-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(12px);
  max-width: 86%;
  padding: .62rem 1.4rem;
  border-radius: 30px;
  background: rgba(30, 42, 58, .9);
  color: #f0eee9;
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  animation: gp-toast-in .28s ease forwards;
}

.gp-toast.out {
  animation: gp-toast-out .3s ease forwards;
}

@keyframes gp-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes gp-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(18px); }
}

/* 尊重系统「减少动效」设置 */
@media (prefers-reduced-motion: reduce) {
  #gp-mini,
  #gp-mini.is-playing::after,
  .gp-toast { transition: none; animation: none; }
}