/* ===== 全局音乐播放器（参考 Mizuki） ===== */
:root {
  --mz-primary: #4f7cf7;
  --mz-primary-soft: rgba(79, 124, 247, 0.14);
  --mz-bg: #ffffff;
  --mz-text: #1f2937;
  --mz-sub: #6b7280;
  --mz-line: rgba(0, 0, 0, 0.08);
  --mz-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
}
html.dark {
  --mz-bg: #20242f;
  --mz-text: #f3f4f6;
  --mz-sub: #9ca3af;
  --mz-line: rgba(255, 255, 255, 0.1);
  --mz-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}

/* 音乐 FAB（并入全站右下角 .pz-float 组） */
.mz-fab {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 10px;
  border: none;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}
.mz-fab:hover { background: rgba(0, 0, 0, 0.55); color: #fff; }
.mz-fab:active { transform: scale(0.94); }
html.dark .mz-fab { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
html.dark .mz-fab:hover { background: rgba(255, 255, 255, 0.16); }
.mz-fab.active { background: var(--mz-primary); color: #fff; }
html.dark .mz-fab.active { background: var(--mz-primary); }
.mz-fab__icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; pointer-events: none; }
.mz-fab__dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mz-primary);
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.mz-fab.playing::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--mz-primary) 45%, transparent);
  animation: mz-fab-pulse 1.8s ease-out infinite;
}
@keyframes mz-fab-pulse {
  0% { opacity: 0; transform: scale(0.9); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1.15); }
}

/* 控制中心面板 */
.mz-cc {
  position: fixed;
  right: 70px;
  bottom: 30px;
  z-index: 9999;
  width: 20rem;
  max-width: calc(100vw - 96px);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.mz-cc.mz-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.mz-cc-card {
  background: var(--mz-bg);
  color: var(--mz-text);
  border: 1px solid var(--mz-line);
  border-radius: 1.25rem;
  box-shadow: var(--mz-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem;
  font-family: var(--pz-font-family, inherit);
}
.mz-cc-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.75rem; }
.mz-cc-cover {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--mz-primary-soft);
  border: 1px solid var(--mz-line);
}
.mz-cc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mz-cc-cover img.mz-spin { animation: mz-spin 3s linear infinite; animation-play-state: running; }
@keyframes mz-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.mz-cc-info { min-width: 0; flex: 1; overflow: hidden; }
.mz-cc-title { font-weight: 600; color: var(--mz-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-cc-artist { font-size: 0.75rem; color: var(--mz-sub); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0.1rem 0 0.36rem; }
.mz-cc-meta { display: flex; align-items: center; gap: 0.55rem; justify-content: space-between; min-width: 0; }
.mz-cc-time { display: flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; color: var(--mz-sub); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mz-time-div { opacity: 0.6; }
.mz-cc-volwrap { display: flex; align-items: center; gap: 0.35rem; min-width: 0; justify-content: flex-end; margin-left: auto; }
.mz-vol-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border: none; background: transparent; color: var(--mz-sub); cursor: pointer; border-radius: 0.375rem; transition: color 150ms ease; }
.mz-vol-btn:hover { color: var(--mz-primary); }
.mz-vol { position: relative; width: 4rem; height: 0.25rem; border-radius: 9999px; background: color-mix(in srgb, var(--mz-sub) 22%, transparent); cursor: pointer; }
.mz-vol-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 9999px; background: var(--mz-primary); }
.mz-progress { position: relative; width: 100%; height: 0.25rem; border-radius: 9999px; background: color-mix(in srgb, var(--mz-sub) 22%, transparent); cursor: pointer; margin: 0.25rem 0 0.75rem; }
.mz-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 9999px; background: var(--mz-primary); }
.mz-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mz-ctl { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: none; background: transparent; color: var(--mz-text); cursor: pointer; border-radius: 0.55rem; transition: color 150ms ease, transform 150ms ease; font-size: 0.95rem; }
.mz-ctl:hover { color: var(--mz-primary); }
.mz-ctl.active { color: var(--mz-primary); }
.mz-ctl:active { transform: scale(0.9); }
.mz-ctl.mz-play { width: 2.9rem; height: 2.9rem; border-radius: 50%; background: var(--mz-primary); color: #fff; font-size: 1rem; box-shadow: 0 4px 14px var(--mz-primary-soft); }
.mz-ctl.mz-play:hover { background: color-mix(in srgb, var(--mz-primary) 88%, #000 12%); color: #fff; }

/* 播放列表 */
.mz-playlist-wrap { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid color-mix(in srgb, var(--mz-sub) 12%, transparent); display: block; }
.mz-playlist-wrap[hidden] { display: none; }
.mz-playlist-title { font-size: 0.72rem; color: var(--mz-sub); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.mz-playlist { overflow-y: auto; max-height: 12rem; padding-right: 0.25rem; padding-bottom: 0.25rem; display: flex; flex-direction: column; gap: 0.25rem; scrollbar-width: none; -ms-overflow-style: none; }
.mz-playlist::-webkit-scrollbar { display: none; }
.mz-track { display: flex; align-items: center; gap: 0.6rem; padding: 0.42rem; border-radius: 0.75rem; cursor: pointer; transition: background-color 180ms ease, transform 180ms ease; }
.mz-track:hover { background: color-mix(in srgb, var(--mz-primary) 10%, transparent); }
.mz-track.is-current { background: var(--mz-primary-soft); }
.mz-track-cover { position: relative; width: 2rem; height: 2rem; border-radius: 0.5rem; overflow: hidden; flex-shrink: 0; background: var(--mz-primary-soft); }
.mz-track-cover img { width: 100%; height: 100%; object-fit: cover; }
.mz-track-content { flex: 1; min-width: 0; }
.mz-track-title { font-size: 0.75rem; font-weight: 700; color: var(--mz-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-track-artist { font-size: 10px; color: var(--mz-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-track.is-current .mz-track-title, .mz-track.is-current .mz-track-artist { color: var(--mz-primary); }
.mz-track .mz-now { color: var(--mz-primary); width: 1.1rem; text-align: center; flex-shrink: 0; font-size: 0.85rem; }
.mz-empty { font-size: 0.8rem; color: var(--mz-sub); text-align: center; padding: 0.8rem 0; }

/* 动画：封面旋转 */
@keyframes mz-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 640px) {
  .mz-cc { right: 12px; bottom: 12px; width: 18rem; }
  .mz-cc-card { padding: 0.85rem; border-radius: 1rem; }
  .mz-ctl { width: 1.9rem; height: 1.9rem; }
  .mz-ctl.mz-play { width: 2.6rem; height: 2.6rem; }
  .mz-cc-cover { width: 3rem; height: 3rem; }
}

