/* ================= 悬浮音乐播放器（橙色主题） ================= */
#player { display: none; }
#player.on { display: block; }

/* ---------- 展开态：悬浮卡片 ---------- */
#player .bar {
  position: fixed; z-index: 70; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px 15px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .14);
  transition: opacity .22s ease, transform .22s ease;
}
#player.mini .bar { opacity: 0; transform: translateY(16px) scale(.94); pointer-events: none; }

#player .seek {
  position: absolute; left: 14px; right: 14px; bottom: 6px; height: 3px;
  border-radius: 3px; background: #EEEEEE; cursor: pointer;
}
#player .seek i {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: var(--primary); transition: width .15s linear;
}

#player .cover {
  width: 44px; height: 44px; flex: none; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-size: 17px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}
#player .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
#player .meta { min-width: 0; flex: 1; }
#player .meta b {
  display: block; font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#player .meta small {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#player .btns { display: flex; align-items: center; gap: 3px; flex: none; }

.pbtn {
  width: 36px; height: 36px; border-radius: 8px; border: 0; cursor: pointer;
  background: transparent; color: var(--dim); font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  transition: transform .18s, background .2s, color .2s;
}
.pbtn:hover { background: var(--primary-soft); color: var(--primary); }
.pbtn:active { transform: scale(.9); }
.pbtn.main {
  width: 44px; height: 44px; font-size: 17px; color: #fff; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 6px 16px -6px rgba(255, 121, 0, .8);
}
.pbtn.main:hover { background: var(--primary-dark); color: #fff; }

/* ---------- 收起态：悬浮球 ---------- */
#player .ball {
  position: fixed; z-index: 70; right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; padding: 3px; border-radius: 50%; cursor: pointer;
  display: none; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
#player.mini .ball { display: block; }
#player .ball .disc {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-size: 18px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}
#player .ball .disc img { width: 100%; height: 100%; object-fit: cover; display: block; }
#player .ball.playing .disc { animation: spin 8s linear infinite; }
#player .ball .badge {
  position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 10px; color: var(--primary);
}

/* ---------- 播放列表：悬浮面板 ---------- */
#player .sheet {
  position: fixed; z-index: 72; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-height: 60vh; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
  opacity: 0; transform: translateY(112%); pointer-events: none;
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), opacity .25s;
}
#player.open .sheet { opacity: 1; transform: none; pointer-events: auto; }
#player .sheet-h {
  display: flex; align-items: center; gap: 8px; padding: 12px 10px 10px 16px;
  border-bottom: 1px solid var(--line); flex: none;
}
#player .sheet-h span { flex: 1; font-size: 14px; font-weight: 600; }
#player .sheet-list { overflow: auto; padding: 8px; }

.pl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: 0; background: none; border-radius: 6px;
  font: inherit; color: var(--text); cursor: pointer;
}
.pl-item:hover { background: var(--primary-soft); }
.pl-item.active { background: var(--primary-soft); }
.pl-item .no { width: 18px; flex: none; font-size: 11.5px; color: var(--muted); text-align: center; }
.pl-item.active .no { color: var(--primary); }
.pl-item .nm { min-width: 0; flex: 1; }
.pl-item .nm b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .nm small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item .eq { font-size: 12px; color: var(--primary); }

/* 页面底部留白，别被悬浮条压住内容 */
body.hasplayer .app { padding-bottom: 100px; }

/* ---------- 平板 / 电脑端：居中悬浮，最宽 700px ---------- */
@media (min-width: 760px) {
  #player .bar, #player .sheet {
    left: 50%; right: auto; transform: translateX(-50%);
    width: calc(100% - 40px); max-width: 700px;
  }
  #player.mini .bar { transform: translate(-50%, 16px) scale(.94); }
  #player .sheet { transform: translate(-50%, 112%); }
  #player.open .sheet { transform: translate(-50%, 0); }
  #player .bar { padding: 12px 14px 16px; }
  #player .ball { right: calc(50% - 350px + 4px); }
  body.hasplayer .app { padding-bottom: 108px; }
}

@media (max-width: 480px) {
  #player .bar { gap: 9px; padding: 10px 10px 14px; }
  #player .cover { width: 40px; height: 40px; }
  #player .meta b { font-size: 13px; }
  .pbtn { width: 32px; height: 32px; }
  .pbtn.main { width: 42px; height: 42px; }
  #player .ball { width: 52px; height: 52px; }
}
