/* ============================================================
   小灰网络 H5 · 悬浮音乐组件（玻璃拟态版）
   视觉对齐 H5 底部导航栏：白色半透明毛玻璃 + 高光描边 + 轻阴影
   主色：琥珀橙 #F2A93B（呼应底部导航激活态），无黑色、无紫色
   ============================================================ */

/* 非首页：整个组件 UI 隐藏（音乐仍在后台播放，不受影响） */
.mw-root.mw-hidden .mw-fab,
.mw-root.mw-hidden .mw-panel { display: none !important; }

.mw-root {
  --gold: #F2A93B;
  --gold-deep: #E08A15;
  --ink: #2B3A4A;
  --muted: #8A96A3;
  --glass-bg: rgba(255, 255, 255, .62);
  --glass-bg-strong: rgba(255, 255, 255, .82);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-shadow: 0 6px 22px rgba(31, 45, 61, .14);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ============ 悬浮球（收起态，缩小版） ============ */
.mw-fab {
  position: fixed;
  right: 16px;
  bottom: 92px;
  width: 40px;              /* 原 58 → 40，更小 */
  height: 40px;
  z-index: 9998;
  cursor: pointer;
  border: none;
  padding: 0;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition: transform .25s cubic-bezier(.2, .8, .3, 1);
}
.mw-fab:hover { transform: scale(1.07); }
.mw-fab:active { transform: scale(.95); }

/* 玻璃球体 */
.mw-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1.5px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 1px rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 高光斜切面 */
.mw-glass::before {
  content: "";
  position: absolute;
  top: -40%; left: -30%;
  width: 90%; height: 90%;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

/* 旋转的封面图 / 图标（后台可配置图片） */
.mw-rotor {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  animation: mw-spin 7s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.mw-fab.playing .mw-rotor { animation-play-state: running; }

/* 默认图标（无封面图时）：精致音符 */
.mw-icon-fallback {
  width: 22px;
  height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-deep);
  animation: mw-spin 7s linear infinite;
  animation-play-state: paused;
}
.mw-fab.playing .mw-icon-fallback { animation-play-state: running; }
.mw-icon-fallback svg { width: 20px; height: 20px; fill: currentColor; }

/* 琥珀高亮呼吸环 */
.mw-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(242, 169, 59, .45);
  opacity: 0;
  animation: mw-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
.mw-fab.playing .mw-ring { opacity: 1; }

/* 播放/暂停小角标 */
.mw-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(224, 138, 21, .45);
  border: 1.5px solid #fff;
}
.mw-badge svg { width: 8px; height: 8px; fill: #fff; }

/* 悬浮提示歌曲名（玻璃胶囊） */
.mw-tip {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: var(--glass-shadow);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mw-fab:hover .mw-tip { opacity: 1; transform: translateY(-50%) translateX(-3px); }

@keyframes mw-spin { to { transform: rotate(360deg); } }
@keyframes mw-pulse {
  0% { transform: scale(1); opacity: .7; }
  70% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ============ 展开播放器面板（缩小版，玻璃拟态） ============ */
.mw-panel {
  position: fixed;
  right: 14px;
  bottom: 92px;
  width: 190px;             /* 宽度略微加宽，高度继续压缩 */
  z-index: 9999;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1.5px solid var(--glass-border);
  border-radius: 16px;
  padding: 7px 12px;        /* 纵向再收紧 */
  color: var(--ink);
  box-shadow: 0 14px 40px rgba(31, 45, 61, .2), inset 0 1px 0 rgba(255,255,255,.9);
  transform-origin: bottom right;
  transform: scale(.9) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.15), opacity .22s;
}
.mw-panel.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }

/* 顶部：封面 + 信息 + 关闭 */
.mw-head { display: flex; gap: 8px; align-items: center; }
.mw-cover {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(31,45,61,.18);
  border: 1px solid rgba(255,255,255,.8);
  animation: mw-spin 8s linear infinite;
  animation-play-state: paused;
}
.mw-panel.is-playing .mw-cover { animation-play-state: running; }
.mw-meta { flex: 1; min-width: 0; }
.mw-song {
  font-size: 12px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
}
.mw-artist { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-close {
  flex: 0 0 auto; width: 22px; height: 22px; border: none; cursor: pointer;
  border-radius: 50%; background: rgba(31,45,61,.07); color: var(--muted);
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.mw-close:hover { background: rgba(31,45,61,.13); color: var(--ink); }
.mw-close svg { width: 10px; height: 10px; }

/* 音波可视化（琥珀） */
.mw-wave {
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  height: 10px; margin: 5px 0 3px;
}
.mw-wave i {
  width: 3px; border-radius: 2px; background: var(--gold);
  height: 3px; opacity: .9;
}
.mw-panel.is-playing .mw-wave i { animation: mw-wave 1s ease-in-out infinite; }
@keyframes mw-wave { 0%, 100% { height: 3px; } 50% { height: 9px; } }

/* 进度条 */
.mw-progress-wrap { margin: 0 0 5px; }
.mw-bar {
  height: 4px; border-radius: 3px; background: rgba(31,45,61,.1);
  overflow: hidden; cursor: pointer;
}
.mw-bar-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width .2s linear;
}
.mw-times { display: flex; justify-content: space-between; font-size: 9px; color: var(--muted); margin-top: 3px; }

/* 控制按钮 */
.mw-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.mw-ctrl {
  border: none; background: transparent; cursor: pointer; color: var(--ink);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: transform .15s, color .2s;
}
.mw-ctrl:hover { color: var(--gold-deep); transform: scale(1.1); }
.mw-ctrl svg { width: 16px; height: 16px; fill: currentColor; }
.mw-play {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  color: #fff;
  box-shadow: 0 5px 14px rgba(224, 138, 21, .42);
}
.mw-play:hover { color: #fff; }
.mw-play svg { width: 17px; height: 17px; }

.mw-foot { text-align: center; font-size: 8px; color: var(--muted); margin-top: 6px; letter-spacing: .2px; }

@media (max-width: 380px) { .mw-panel { width: 188px; } }
