/* ══════════════════════════════════════════
   GlobalMusic · 全局音乐播放器样式
   ══════════════════════════════════════════ */

/* ── 底部浮动栏 ── */
.gm-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 260px;
  max-width: 400px;
  padding: 10px 16px;
  background: rgba(42, 24, 10, 0.95);
  border: 1px solid rgba(180, 130, 50, 0.35);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  touch-action: manipulation;
}
.gm-bar:hover {
  border-color: rgba(201, 168, 76, 0.5);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(201, 168, 76, 0.1);
}
.gm-bar.panel-open {
  border-color: rgba(201, 168, 76, 0.5);
}

.gm-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gm-bar-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.15);
  color: #f5e4a8;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gm-bar-play:hover { background: rgba(201, 168, 76, 0.3); }
.gm-bar.gm-playing .gm-bar-play {
  animation: gmSpin 4s linear infinite;
}
@keyframes gmSpin { to { transform: rotate(360deg); } }

.gm-bar-info { min-width: 0; }
.gm-bar-title {
  font-size: 13px;
  color: #f5e4a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.gm-bar-sub {
  font-size: 11px;
  color: rgba(201, 168, 76, 0.6);
  margin-top: 1px;
}

.gm-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gm-bar-expand {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  color: rgba(201, 168, 76, 0.7);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gm-bar-expand:hover { background: rgba(201, 168, 76, 0.25); }
.gm-panel.open ~ .gm-bar .gm-bar-expand,
.gm-bar.panel-open .gm-bar-expand { transform: rotate(180deg); }

/* ── 展开面板 ── */
.gm-panel {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  background: rgba(35, 20, 8, 0.97);
  border: 1px solid rgba(180, 130, 50, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  overflow: hidden;
}
.gm-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(180, 130, 50, 0.15);
}
.gm-panel-title {
  font-size: 15px;
  color: #f5e4a8;
  letter-spacing: 0.1em;
}
.gm-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  color: rgba(201, 168, 76, 0.6);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gm-panel-close:hover { background: rgba(201, 168, 76, 0.25); color: #f5e4a8; }

/* ── 播放控制 ── */
.gm-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px 8px;
}
.gm-ctrl-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.08);
  color: rgba(245, 228, 168, 0.8);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.gm-ctrl-btn:hover { background: rgba(201, 168, 76, 0.2); color: #f5e4a8; }
.gm-ctrl-btn.gm-play-btn {
  width: 44px;
  height: 44px;
  font-size: 18px;
  background: rgba(201, 168, 76, 0.2);
}
.gm-ctrl-btn.gm-play-btn:hover { background: rgba(201, 168, 76, 0.35); }
.gm-ctrl-btn.active {
  color: #e8c96a;
  background: rgba(201, 168, 76, 0.2);
}

/* ── 进度条 ── */
.gm-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 20px 8px;
}
.gm-time {
  font-size: 11px;
  color: rgba(201, 168, 76, 0.5);
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gm-progress {
  flex: 1;
  height: 4px;
  background: rgba(201, 168, 76, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}
.gm-progress:hover { height: 6px; }
.gm-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #c9a84c, #e8c96a);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.gm-prog-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #f5e4a8;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s;
}
.gm-progress:hover .gm-prog-thumb { opacity: 1; }

/* ── 音量 ── */
.gm-volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 20px 10px;
}
.gm-vol-icon {
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.gm-vol-icon:hover { opacity: 1; }
.gm-volume {
  flex: 1;
  height: 3px;
  background: rgba(201, 168, 76, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.gm-vol-fill {
  height: 100%;
  background: rgba(201, 168, 76, 0.6);
  border-radius: 2px;
  width: 70%;
}

/* ── 播放列表 ── */

.gm-import-btn:hover {
  background: rgba(201, 168, 76, 0.2);
  border-color: rgba(201, 168, 76, 0.5);
}

/* ── 拖拽区域 ── */

/* ── 歌曲列表 ── */
.gm-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  max-height: 280px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.2) transparent;
}
.gm-list::-webkit-scrollbar { width: 4px; }
.gm-list::-webkit-scrollbar-track { background: transparent; }
.gm-list::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); border-radius: 2px; }

.gm-empty {
  text-align: center;
  padding: 24px 0;
  color: rgba(201, 168, 76, 0.35);
  font-size: 13px;
}

.gm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.gm-item:hover { background: rgba(201, 168, 76, 0.08); }
.gm-item.active {
  background: rgba(201, 168, 76, 0.12);
}
.gm-item.active .gm-item-name { color: #e8c96a; }

.gm-item-play {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 11px;
  color: rgba(201, 168, 76, 0.5);
}
.gm-item.active .gm-item-play {
  color: #e8c96a;
  animation: gmNote 1.2s ease-in-out infinite;
}
@keyframes gmNote {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.gm-item-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: rgba(245, 228, 168, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-item-dur {
  flex-shrink: 0;
  font-size: 11px;
  color: rgba(201, 168, 76, 0.4);
  font-variant-numeric: tabular-nums;
}

.gm-item-del {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(201, 168, 76, 0.3);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s;
}
.gm-item:hover .gm-item-del { opacity: 1; }
.gm-item-del:hover {
  background: rgba(200, 50, 50, 0.2);
  color: #e87070;
}

/* ── 响应式 ── */
@media (max-width: 480px) {
  .gm-bar {
    bottom: 12px;
    min-width: 220px;
    padding: 8px 12px;
  }
  .gm-bar-title { max-width: 130px; font-size: 12px; }
  .gm-panel {
    bottom: 70px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 120px);
  }
  .gm-controls { gap: 8px; }
  .gm-ctrl-btn { width: 32px; height: 32px; font-size: 13px; }
  .gm-ctrl-btn.gm-play-btn { width: 40px; height: 40px; }
}
