/* ============================================================
   闪得 热门下载榜单 - Elementor 适配样式
   句柄: shande-music-downloads（依赖 shande-scope-base）
   自包含移植首页 css/music.css 中 .music-downloads / .music-track-*
   相关规则，作用域限定在 .shande-music-downloads-widget 内，不污染整页。
   ============================================================ */

.shande-music-downloads-widget {
  --md-primary: #096ddd;
  --md-card-radius: 10px;
  --md-title-color: #1d2129;
}

/* 区块容器 —— 去掉静态版整页背景/上边框，交给 Elementor 段落背景控制 */
.shande-music-downloads-widget .music-downloads-inner {
  max-width: 100%;
  margin: 0 auto;
}

/* 头部：标题 + 副标题 + 查看全部 */
.shande-music-downloads-widget .music-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
  flex-wrap: wrap;
}

.shande-music-downloads-widget .music-section-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--md-title-color);
  margin: 0;
}

.shande-music-downloads-widget .music-section-sub {
  font-size: 14px;
  color: #86909c;
  margin-left: 0;
}

.shande-music-downloads-widget .music-view-all {
  font-size: 14px;
  color: #86909c;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.shande-music-downloads-widget .music-view-all:hover {
  color: var(--md-primary);
}

/* 曲目列表 */
.shande-music-downloads-widget .music-track-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.shande-music-downloads-widget .music-track-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 24px 28px;
  border: 1px solid #e8eaed;
  border-radius: var(--md-card-radius);
  margin-bottom: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.shande-music-downloads-widget .music-track-item:last-child {
  margin-bottom: 0;
}

.shande-music-downloads-widget .music-track-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* 播放按钮 */
.shande-music-downloads-widget .music-track-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--md-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 16px;
  transition: transform 0.2s;
}

.shande-music-downloads-widget .music-track-play:hover {
  transform: scale(1.1);
}

.shande-music-downloads-widget .music-track-play svg {
  width: 44px;
  height: 44px;
}

/* 曲目信息 */
.shande-music-downloads-widget .music-track-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.shande-music-downloads-widget .music-track-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--md-title-color);
  margin: 0 0 4px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shande-music-downloads-widget .music-track-tags {
  font-size: 13px;
  color: #86909c;
  margin-bottom: 3px;
}

.shande-music-downloads-widget .music-track-meta {
  font-size: 12.5px;
  color: #a8abb2;
}

/* 收藏按钮 */
.shande-music-downloads-widget .music-track-fav {
  position: absolute;
  top: 24px;
  right: 28px;
  border: none;
  background: transparent;
  color: #c9cdd4;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.shande-music-downloads-widget .music-track-fav:hover,
.shande-music-downloads-widget .music-track-fav.is-faved {
  color: var(--md-primary);
}

.shande-music-downloads-widget .music-track-fav.is-faved svg {
  fill: var(--md-primary);
}

/* 波形容器 */
.shande-music-downloads-widget .music-track-wave {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-left: 64px;
}

/* 音频波形：双层叠加实现播放进度 */
.shande-music-downloads-widget .music-track-waveform {
  flex: 1;
  height: 30px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.shande-music-downloads-widget .music-track-waveform .wave-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.shande-music-downloads-widget .music-track-waveform .wave-bg span {
  flex: 1 1 0;
  min-width: 0;
  background: #c9cdd4;
  margin-right: 1px;
}

.shande-music-downloads-widget .music-track-waveform .wave-played {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  overflow: hidden;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: width 0.1s linear;
}

.shande-music-downloads-widget .music-track-waveform .wave-played span {
  flex: 1 1 0;
  min-width: 0;
  background: #4e5969;
  margin-right: 1px;
}

.shande-music-downloads-widget .music-track-item.is-playing .music-track-waveform .wave-played span {
  background: var(--md-primary);
}

.shande-music-downloads-widget .music-track-duration {
  font-size: 12.5px;
  color: #86909c;
  white-space: nowrap;
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* 播放中状态 */
.shande-music-downloads-widget .music-track-item.is-playing {
  border-color: var(--md-primary);
  background: #f0f9ff;
}

.shande-music-downloads-widget .music-track-item.is-playing .music-track-play {
  color: var(--md-primary);
}

/* 播放中按钮：音频波形动画 */
.shande-music-downloads-widget .music-track-item.is-playing .music-track-play svg {
  display: none;
}

.shande-music-downloads-widget .music-track-play .audio-bars {
  display: none;
  width: 24px;
  height: 24px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.shande-music-downloads-widget .music-track-item.is-playing .music-track-play .audio-bars {
  display: flex;
}

.shande-music-downloads-widget .audio-bars span {
  display: block;
  width: 3.5px;
  background: var(--md-primary);
  border-radius: 1.5px;
  transform-origin: bottom;
}

.shande-music-downloads-widget .audio-bars span:nth-child(1) {
  animation: shandeMdBar1 1.8s ease-in-out infinite;
}

.shande-music-downloads-widget .audio-bars span:nth-child(2) {
  animation: shandeMdBar2 1.5s ease-in-out infinite;
}

.shande-music-downloads-widget .audio-bars span:nth-child(3) {
  animation: shandeMdBar3 2s ease-in-out infinite;
}

@keyframes shandeMdBar1 {
  0%   { height: 6px; }
  50%  { height: 22px; }
  100% { height: 6px; }
}

@keyframes shandeMdBar2 {
  0%   { height: 20px; }
  50%  { height: 8px; }
  100% { height: 20px; }
}

@keyframes shandeMdBar3 {
  0%   { height: 10px; }
  50%  { height: 24px; }
  100% { height: 10px; }
}

/* 响应式 */
@media (max-width: 768px) {
  .shande-music-downloads-widget .music-track-item {
    padding: 16px 18px;
  }

  .shande-music-downloads-widget .music-track-wave {
    padding-left: 0;
  }

  .shande-music-downloads-widget .music-track-play {
    width: 40px;
    height: 40px;
    margin-right: 12px;
  }

  .shande-music-downloads-widget .music-track-play svg {
    width: 36px;
    height: 36px;
  }

  .shande-music-downloads-widget .music-section-title {
    font-size: 20px;
  }
}
