/* ================================================================
   千云鸟 · 全局悬浮音乐播放器（v3 · 左侧抽屉式）
   结构：左侧竖向停靠栏（.mf-dock）含两个圆角按钮
     · 音乐按钮  → 点击从左侧滑出抽屉（抽屉即「音乐播放下拉菜单」）
     · 前往按钮  → 跳转 /pages/music 完整音乐播放器页面
   抽屉内部：单列紧凑布局（当前播放 / 波形 / 进度 / 控制 / 歌单）
   配色与站点主题变量联动，跟随 light / dark / eye-care 三套主题。
   位于左侧、z-index 低于顶部导航栏，不遮挡页面内容与导航，
   彻底替代原来右下角 / 左下角钉死的播放器。
   挂载点：<div id="music-fab-root"></div>（由 pack-deploy 注入每个页面）
   ================================================================ */

#music-fab-root {
  /* 挂载容器，本身无样式 */
}

/* ---------- 左侧竖向停靠栏 ---------- */
.mf-dock {
  position: fixed;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.mf-dock-btn {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .3)) 60%, transparent);
  background: color-mix(in srgb, var(--panel-solid, #0a1020) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: #eafcff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, .6);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
}

.mf-dock-btn:hover {
  transform: translateX(3px) scale(1.05);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .65), 0 0 18px -4px rgba(121, 196, 208, .55);
}

.mf-dock-btn:active {
  transform: scale(.94);
}

.mf-dock-btn i {
  font-size: 16px;
}

/* 音乐按钮里的旋转唱片 */
.mf-dock-disc {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #04121a;
  background:
    radial-gradient(circle at 50% 50%, #0b1224 0 30%, transparent 32%),
    conic-gradient(from 0deg, #79c4d0, #7791cf, #a992cc, #79c4d0);
  box-shadow: 0 0 12px -2px rgba(121, 196, 208, .7);
  animation: mf-spin 8s linear infinite;
  animation-play-state: paused;
}

.mf-dock.mf-playing .mf-dock-disc {
  animation-play-state: running;
}

@keyframes mf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 前往按钮：强调色描边 + 微染青 */
.mf-dock-btn.mf-go {
  color: #bfe9ff;
  background: color-mix(in srgb, var(--panel-solid, #0a1020) 78%, rgba(121, 196, 208, .18));
}

.mf-dock-btn.mf-go:hover {
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .65), 0 0 18px -4px rgba(121, 196, 208, .6);
}

/* 播放状态指示灯 */
.mf-dock-btn .mf-dot {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #79c4d0;
  box-shadow: 0 0 8px #79c4d0;
  opacity: 0;
  transition: opacity .2s ease;
}

.mf-dock.mf-playing .mf-dot {
  opacity: 1;
}

/* 悬浮提示标签 */
.mf-dock-btn .mf-tip {
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--text, #e7eef9);
  background: color-mix(in srgb, var(--panel-solid, #0a1020) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .3)) 60%, transparent);
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.mf-dock-btn:hover .mf-tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---------- 左侧抽屉（音乐播放下拉菜单面板） ---------- */
.mf-drawer {
  position: fixed;
  left: 72px;
  top: 50%;
  width: 300px;
  max-width: calc(100vw - 92px);
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  padding: 14px;
  border-radius: 18px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--panel-solid, #0a1020) 90%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .3)) 70%, transparent);
  box-shadow: 0 24px 70px -22px rgba(0, 0, 0, .72);
  color: var(--text, #e7eef9);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transform: translate(calc(-100% - 96px), -50%);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .24s ease;
}

.mf-drawer.mf-open {
  transform: translate(0, -50%);
  opacity: 1;
  pointer-events: auto;
}

/* 抽屉头部 */
.md-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}

.md-brand {
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--text-mute, #74869e);
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
}

.md-brand i {
  color: var(--cyan, #79c4d0);
}

.md-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  background: rgba(126, 166, 255, .08);
  color: var(--text-dim, #a6b6cd);
  font-size: 14px;
  transition: .2s ease;
}

.md-close:hover {
  background: rgba(126, 166, 255, .18);
  color: #fff;
}

/* 当前播放 */
.mf-now {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.mf-cover {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex: none;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .3)) 60%, transparent);
}

.mf-meta {
  min-width: 0;
  flex: 1;
}

.mf-title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-image: linear-gradient(100deg, #79c4d0, #7791cf 46%, #a992cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.mf-artist {
  font-size: 11.5px;
  color: var(--text-dim, #a6b6cd);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-fav {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  flex: none;
  cursor: pointer;
  background: rgba(126, 166, 255, .1);
  color: var(--text-dim, #a6b6cd);
  font-size: 13px;
  transition: .2s ease;
}

.mf-fav:hover {
  color: #ff5b7f;
}

.mf-fav.on {
  color: #ff5b7f;
  background: rgba(255, 91, 127, .14);
}

/* 波形可视化（紧凑） */
.mf-viz {
  flex: none;
  height: 72px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--cyan, #79c4d0) 10%, transparent), transparent 60%),
    color-mix(in srgb, var(--bg-0, #070b16) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .18)) 70%, transparent);
}

.mf-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mf-viz-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--text-mute, #74869e);
  pointer-events: none;
  opacity: .65;
}

/* 进度条 */
.mf-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.mf-time {
  font-size: 10.5px;
  color: var(--text-mute, #74869e);
  font-variant-numeric: tabular-nums;
  width: 32px;
  text-align: center;
  flex: none;
}

.mf-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line, rgba(140, 190, 255, .2)) 80%, transparent);
  cursor: pointer;
}

.mf-track::before {
  content: "";
  position: absolute;
  inset: -8px 0;
}

.mf-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, #79c4d0, #7791cf 46%, #a992cc);
  box-shadow: 0 0 10px -2px rgba(121, 196, 208, .6);
}

.mf-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #eafcff;
  box-shadow: 0 0 8px rgba(121, 196, 208, .8);
  pointer-events: none;
}

/* 控制条 */
.mf-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex: none;
}

.mf-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(126, 166, 255, .08);
  color: var(--text, #e7eef9);
  font-size: 14px;
  transition: .2s ease;
}

.mf-btn:hover {
  background: rgba(126, 166, 255, .18);
  color: #fff;
  box-shadow: 0 0 16px -4px rgba(121, 196, 208, .5);
}

.mf-play {
  width: 46px !important;
  height: 46px !important;
  font-size: 17px !important;
  background: linear-gradient(100deg, #79c4d0, #7791cf 46%, #a992cc) !important;
  color: #04121a !important;
  box-shadow: 0 0 22px -4px rgba(121, 196, 208, .5);
}

.mf-play:hover {
  filter: brightness(1.08);
  color: #04121a !important;
}

.mf-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 92px;
  margin-left: 4px;
}

.mf-vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line, rgba(140, 190, 255, .25)) 80%, transparent);
  outline: none;
  cursor: pointer;
}

.mf-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #79c4d0;
  box-shadow: 0 0 8px rgba(121, 196, 208, .8);
}

.mf-vol input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #79c4d0;
}

/* 歌单区 */
.md-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.mf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mf-tab {
  padding: 5px 9px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11.5px;
  background: rgba(126, 166, 255, .07);
  color: var(--text-dim, #a6b6cd);
  transition: .2s ease;
  white-space: nowrap;
}

.mf-tab:hover {
  color: var(--text, #e7eef9);
}

.mf-tab.active {
  background: rgba(121, 196, 208, .14);
  color: var(--cyan, #79c4d0);
  box-shadow: inset 0 0 16px -6px rgba(121, 196, 208, .5);
}

.mf-list {
  list-style: none;
  margin: 0;
  padding: 2px 2px 4px;
  overflow-y: auto;
  max-height: 132px;
}

.mf-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: .16s ease;
}

.mf-list li:hover {
  background: rgba(126, 166, 255, .1);
}

.mf-list li.active {
  background: rgba(121, 196, 208, .12);
}

.mf-list li.active .mf-li-t {
  color: var(--cyan, #79c4d0);
}

.mf-li-c {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: none;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--line, rgba(140, 190, 255, .3)) 60%, transparent);
}

.mf-li-main {
  min-width: 0;
  flex: 1;
}

.mf-li-t {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-li-s {
  font-size: 10.5px;
  color: var(--text-mute, #74869e);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--text-mute, #74869e);
  font-size: 12px;
}

/* ---------- 响应式：窄屏改为左下横排 + 底部抽屉 ---------- */
@media (max-width: 640px) {
  .mf-dock {
    left: 14px;
    bottom: 92px;
    top: auto;
    transform: none;
    flex-direction: row;
  }

  .mf-dock-btn:hover {
    transform: translateY(-3px) scale(1.05);
  }

  .mf-dock-btn .mf-tip {
    left: 50%;
    top: -36px;
    transform: translateX(-50%) translateY(6px);
  }

  .mf-dock-btn:hover .mf-tip {
    transform: translateX(-50%) translateY(0);
  }

  .mf-drawer {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 150px;
    width: auto;
    max-width: none;
    transform: translateY(calc(100% + 160px));
    max-height: calc(100vh - 170px);
  }

  .mf-drawer.mf-open {
    transform: translateY(0);
  }
}
