/* =========================================
   音乐播放器 — 赛博朋克风格定制
   适配 APlayer + MetingJS
   ========================================= */

/* ====== Widget 容器外框 ====== */
.widget-wrapper.music-player-widget {
  position: relative;
  padding: 8px 10px 10px;
  margin-bottom: 14px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(236, 72, 153, 0.06) 100%),
    rgba(20, 14, 38, 0.55);
  border: 1px solid transparent;
  border-radius: 12px;
  background-clip: padding-box;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 渐变描边（双层伪元素实现） */
.widget-wrapper.music-player-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #06b6d4 100%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
}

/* 顶部霓虹光带 */
.widget-wrapper.music-player-widget::after {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c084fc, #f472b6, transparent);
  filter: blur(0.5px);
  opacity: 0.8;
  pointer-events: none;
}

/* ====== Widget 标题 ====== */
.widget-wrapper.music-player-widget .widget-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;  /* 覆盖 Stellar 默认的 space-between，避免标题被推到右边 */
  gap: 6px;
  margin: 0 0 8px !important;
  padding: 4px 0 6px !important;
  border-bottom: 1px dashed rgba(192, 132, 252, 0.25);
  font-size: 13px;
  letter-spacing: 0.5px;
  position: relative;
}

.widget-wrapper.music-player-widget .widget-header .name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(90deg, #c084fc, #f472b6);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
  order: 1;
}

/* 音符图标（通过 name 前的伪元素实现，不会被 flex 推到另一端） */
.widget-wrapper.music-player-widget .widget-header .name::before {
  content: "♪";
  display: inline-block;
  font-size: 13px;
  -webkit-text-fill-color: #f472b6;
  color: #f472b6;
  text-shadow: 0 0 6px rgba(244, 114, 182, 0.6);
  animation: music-note-pulse 2s ease-in-out infinite;
}

@keyframes music-note-pulse {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50%      { transform: translateY(-2px); opacity: 1; }
}

/* ====== Widget 内容区（覆盖 Stellar 默认 margin） ====== */
.widget-wrapper.music-player-widget .widget-body {
  margin: 0 !important;
  padding: 0 !important;
}

/* ====== APlayer 容器覆写（紧凑模式：不显示列表） ====== */
.widget-wrapper.music-player-widget .aplayer {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  margin: 0 !important;
}

/* APlayer 主体（含封面、信息、控制） */
.widget-wrapper.music-player-widget .aplayer .aplayer-body {
  background: rgba(30, 22, 56, 0.4) !important;
  border-radius: 8px;
  border: 1px solid rgba(192, 132, 252, 0.15);
  min-height: 0 !important;
  height: auto !important;
}

/* ====== 隐藏播放列表（紧凑模式核心） ====== */
.widget-wrapper.music-player-widget .aplayer .aplayer-list {
  display: none !important;
}

/* 封面区域 — 缩小到 60×60 */
.widget-wrapper.music-player-widget .aplayer .aplayer-pic {
  width: 60px !important;
  height: 60px !important;
  min-width: 60px !important;
  min-height: 60px !important;
  border-radius: 6px 0 0 6px !important;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.5));
  position: relative;
  background-size: cover !important;
}

/* 封面播放按钮 — 缩小 */
.widget-wrapper.music-player-widget .aplayer .aplayer-pic .aplayer-play {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.65);
  backdrop-filter: blur(4px);
  transition: all 0.25s ease;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-pic .aplayer-play:hover {
  background: rgba(236, 72, 153, 0.8);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.7);
  transform: scale(1.08);
}

.widget-wrapper.music-player-widget .aplayer .aplayer-pic .aplayer-play .aplayer-icon-play {
  color: #fff;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.widget-wrapper.music-player-widget .aplayer .aplayer-pic .aplayer-pause {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
}

/* 信息区域 — 压缩 padding */
.widget-wrapper.music-player-widget .aplayer .aplayer-info {
  padding: 6px 8px !important;
  background: transparent !important;
  height: 60px !important;
  min-height: 60px !important;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-music {
  margin-bottom: 4px;
  overflow: hidden;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-music .aplayer-title {
  color: #e9d5ff !important;
  font-size: 12px !important;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(192, 132, 252, 0.4);
  line-height: 1.2;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-music .aplayer-author {
  color: #a78bfa !important;
  font-size: 10px !important;
  opacity: 0.85;
}

/* 进度条 — 缩小高度 */
.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {
  margin: 4px 0;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 3px;
  height: 2px;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
  background: linear-gradient(90deg, #7c3aed, #ec4899) !important;
  box-shadow: 0 0 6px rgba(236, 72, 153, 0.6);
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {
  background: #f472b6 !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 8px rgba(244, 114, 182, 0.9);
  height: 7px !important;
  width: 7px !important;
  right: -3.5px !important;
  top: -2.5px !important;
}

/* 时间显示 + 控制按钮 */
.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-time {
  color: #c4b5fd !important;
  font-size: 10px !important;
  position: relative !important;
  top: -16px !important;
  opacity: 0.85;
}

.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {
  fill: #c4b5fd !important;
  width: 12px !important;
  height: 12px !important;
}

/* 控制按钮悬停 */
.widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover {
  fill: #f472b6 !important;
  filter: drop-shadow(0 0 4px rgba(244, 114, 182, 0.7));
}

/* ====== 加载/错误状态 ====== */
.music-player-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  font-size: 12px;
  color: #c4b5fd;
  background: rgba(30, 22, 56, 0.3);
  border-radius: 8px;
  border: 1px dashed rgba(192, 132, 252, 0.3);
  margin: 4px;
}

.music-player-loading .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f472b6;
  animation: music-dot-bounce 1.2s ease-in-out infinite;
}

.music-player-loading .dot:nth-child(2) { animation-delay: 0.15s; background: #c084fc; }
.music-player-loading .dot:nth-child(3) { animation-delay: 0.3s;  background: #06b6d4; }

@keyframes music-dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

.music-player-error {
  margin: 4px;
  padding: 12px 8px;
  font-size: 12px;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  text-align: center;
  line-height: 1.5;
}

/* ====== 暗色主题兼容 ====== */
html[data-theme="dark"] .widget-wrapper.music-player-widget {
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%),
    rgba(13, 10, 28, 0.7);
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .widget-wrapper.music-player-widget {
    padding: 12px 10px 10px;
  }
  .widget-wrapper.music-player-widget .aplayer .aplayer-info .aplayer-music .aplayer-title {
    font-size: 12px !important;
  }
}

/* ====== 浮动模式（备用，未启用） ====== */
.music-player-float {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 999;
  max-width: 320px;
}
