/* ========== 酷我音乐播放器（kuwo_player）==========
   设计语言：alpha-style
   强调色 #6f88ff / hover #435eeb · 冷蓝灰 #ebf0f6 · 墨色 #1f2328
   flat card · hairline divider · radius 6 · 180ms · 零渐变
==================================================== */

.em-kwmusic {
  margin: 10px 0;
}

.em-kwmusic-loading,
.em-kwmusic-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  font-size: 13px;
  color: #6b7280;
  background: #f6f8fb;
  border-radius: 6px;
}

.em-kwmusic-error {
  color: #9ca3af;
}

/* ---- 播放器卡片：flat，无边框无阴影；限宽、左对齐随文流 ---- */
.em-kwmusic-player {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 10px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 6px;
  transition: border-color 0.18s ease;
}

.em-kwmusic-player:hover {
  border-color: #d5dbe8;
}

/* ---- 封面：固定尺寸盒子，防止主题 img 规则（如 #diaryopenhtml img）把原图放大 ---- */
.em-kwmusic-coverbox {
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: #ebf0f6;
}

.em-kwmusic-coverbox img,
.em-kwmusic-coverbox .em-kwmusic-cover-empty {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.em-kwmusic-coverbox .em-kwmusic-cover-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c3cbdb;
}

.em-kwmusic-coverbox .em-kwmusic-cover-empty svg {
  width: 28px;
  height: 28px;
}

/* ---- 信息区 ---- */
.em-kwmusic-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.em-kwmusic-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2328;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.em-kwmusic-artist {
  font-size: 12px;
  line-height: 1.3;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 进度条：14px 隐形热区 + 3px 视觉轨道，hover 出现拖拽点 ---- */
.em-kwmusic-bar {
  position: relative;
  height: 14px;
  margin-top: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.em-kwmusic-track {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #ebf0f6;
}

.em-kwmusic-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 2px;
  background: #6f88ff;
}

.em-kwmusic-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6f88ff;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.18s ease;
  pointer-events: none;
}

.em-kwmusic-bar:hover .em-kwmusic-thumb,
.em-kwmusic-bar.is-seeking .em-kwmusic-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* ---- 底部时间行：标题下等宽注脚 ---- */
.em-kwmusic-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

/* ---- 播放按钮 ---- */
.em-kwmusic-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #6f88ff;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.em-kwmusic-btn:hover {
  background: #435eeb;
}

.em-kwmusic-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.em-kwmusic-btn.is-playing .em-kwmusic-icon-play {
  display: none;
}

.em-kwmusic-btn:not(.is-playing) .em-kwmusic-icon-pause {
  display: none;
}

/* ---- 深色模式 ---- */
@media (prefers-color-scheme: dark) {
  .em-kwmusic-loading,
  .em-kwmusic-error {
    background: #374151;
    color: #9ca3af;
  }

  .em-kwmusic-player {
    background: #1f2937;
    border-color: #374151;
  }

  .em-kwmusic-player:hover {
    border-color: #4b5563;
  }

  .em-kwmusic-coverbox {
    background: #374151;
  }

  .em-kwmusic-coverbox .em-kwmusic-cover-empty {
    color: #4b5563;
  }

  .em-kwmusic-title {
    color: #f3f4f6;
  }

  .em-kwmusic-artist {
    color: #9ca3af;
  }

  .em-kwmusic-track {
    background: #374151;
  }
}
