/* musicparse — 搜索下拉（站内优先 + 音乐） */

.mp-search-results {
  max-height: min(56vh, 460px);
  overflow: auto;
  margin: 4px 0 0;
  padding: 6px 0 0;
  border-top: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mp-search-results::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.search-panel:has(#mp-search-results:not([hidden])) {
  width: min(560px, 94vw);
}

/* 音源通道：一体式分段条，圆角与上方 .search-form(12px) 一致 */
.mp-src-tabs {
  display: flex;
  gap: 0;
  margin: 12px 0 4px;
  padding: 3px;
  border-radius: 12px;
  background: var(--chip, #e9effd);
  box-sizing: border-box;
}

.mp-src-tabs[hidden] {
  display: none !important;
}

.mp-src-tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-width: 0;
  height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #64748b);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  box-sizing: border-box;
}

.mp-src-tab:hover:not(.on) {
  color: var(--text, #334155);
}

.mp-src-tab.on {
  color: var(--accent-ink, #fff);
  background: var(--accent, #2563eb);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent, #2563eb) 22%, transparent);
  font-weight: 700;
}

.mp-src-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(37, 99, 235, .18));
}

.mp-src-tab.on:focus-visible {
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--accent, #2563eb) 22%, transparent),
    0 0 0 3px var(--accent-soft, rgba(37, 99, 235, .18));
}

.mp-group-label {
  padding: 10px 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #6b7280);
  letter-spacing: .02em;
}

.mp-search-empty,
.mp-search-loading {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #6b7280);
}

.mp-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.mp-item:hover,
.mp-item:focus-visible {
  background: var(--chip, #f3f4f6);
  outline: none;
  padding: 8px;
}

.mp-item.is-busy {
  opacity: .65;
  pointer-events: none;
}

.mp-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  background: #e5e7eb;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
  flex: 0 0 40px;
}

.mp-cover.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 16px;
}

.mp-meta {
  min-width: 0;
}

.mp-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.mp-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.mp-badge-src {
  background: #f3f4f6;
  color: #4b5563;
}

.mp-badge-src.is-kuwo {
  background: #ecfdf5;
  color: #047857;
}

.mp-badge-src.is-qq {
  background: #eff6ff;
  color: #1d4ed8;
}

.mp-badge-src.is-kugou {
  background: #fff7ed;
  color: #c2410c;
}

.mp-badge-local {
  background: #eff6ff;
  color: #2563eb;
}

/* —— 帖内歌曲播放卡片（自有样式，不依赖音频媒体插件） —— */
.mp-song-block {
  --ta-cover: clamp(56px, 18vw, 76px);
  --ta-pad: clamp(8px, 2.2vw, 12px);
  --ta-gap: clamp(8px, 2vw, 12px);
  --ta-radius: clamp(10px, 2.4vw, 14px);
  --ta-title: clamp(12px, 3.2vw, 14px);
  --ta-meta: clamp(11px, 2.8vw, 12px);
  --ta-ico: clamp(18px, 5vw, 24px);
  margin: 8px 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}

.mp-song-block .topic-audio-list {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-song-block .topic-audio-card.js-mp-play-card {
  cursor: pointer;
  user-select: none;
}

.mp-song-block .mp-lyric-panel,
.mp-song-block .mp-auto-tip {
  margin-left: 0;
  margin-right: 0;
}

.mp-lyric-panel {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e8ebf0);
  border-radius: 14px;
  background: #fff;
}

.mp-lyric-head {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #111827);
}

.mp-lyric-sub {
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted, #6b7280);
}

.mp-lyric-viewport {
  position: relative;
}

.mp-lyric-track {
  margin: 0;
}

.mp-lyric-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-soft, #374151);
}

/* 兼容旧帖纯文本歌词 */
.mp-lyric-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-soft, #374151);
  white-space: normal;
}

.mp-lyric-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #9ca3af);
}

/* 滚动歌词：开启后由 JS 加 .is-scroll */
.mp-lyric-panel.is-scroll .mp-lyric-viewport {
  max-height: 320px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.mp-lyric-panel.is-scroll .mp-lyric-track {
  transition: transform .28s ease;
  will-change: transform;
  padding: 10px 0;
}
.mp-lyric-panel.is-scroll .mp-lyric-line {
  color: var(--muted, #9ca3af);
  transition: color .2s, transform .2s, opacity .2s;
  opacity: .72;
}
.mp-lyric-panel.is-scroll .mp-lyric-line.is-on {
  color: var(--accent, #111827);
  font-weight: 700;
  opacity: 1;
}

.mp-auto-tip {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted, #9ca3af);
}

/* 覆盖 .detail-body p { margin: 0 0 .85em }，否则只有下间距、上几乎贴边 */
.detail-body .mp-song-block .mp-auto-tip,
.detail-body p.mp-auto-tip {
  margin-top: 20px;
  margin-bottom: 0;
}

.detail-body .mp-song-block:has(.mp-auto-tip) {
  margin-bottom: 0;
}

.mp-song-block .topic-audio-card {
  display: grid;
  grid-template-columns: var(--ta-cover) minmax(0, 1fr);
  grid-template-rows: var(--ta-cover);
  gap: var(--ta-gap);
  align-items: stretch;
  padding: var(--ta-pad);
  border-radius: var(--ta-radius);
  background: var(--surface, #fff);
  border: 1px solid color-mix(in srgb, var(--line, #e6eef0) 80%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.mp-song-block .topic-audio-cover {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: calc(var(--ta-radius) - 2px);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #5b8def 0%, #7c5cbf 55%, #246384 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(36, 99, 132, .18);
  appearance: none;
  -webkit-appearance: none;
  line-height: 0;
  align-self: stretch;
  justify-self: stretch;
}
.mp-song-block .topic-audio-cover img,
.detail-body .mp-song-block .topic-audio-cover img {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}
.mp-song-block .topic-audio-cover.has-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .28);
  pointer-events: none;
}
.mp-song-block .topic-audio-play-ico {
  position: relative;
  z-index: 2;
  font-size: var(--ta-ico);
  line-height: 1;
  margin-left: 1px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.mp-song-block .topic-audio-body {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 1px 0;
  box-sizing: border-box;
}
.mp-song-block .topic-audio-main {
  min-width: 0;
}
.mp-song-block .topic-audio-main strong {
  display: block;
  font-size: var(--ta-title);
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-song-block .topic-audio-main span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #6b7785);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-song-block .topic-audio-progress-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}
.mp-song-block .topic-audio-cur,
.mp-song-block .topic-audio-dur {
  font-size: 11px;
  color: var(--muted, #6b7785);
  font-variant-numeric: tabular-nums;
}
.mp-song-block .ta-audio {
  display: none;
}
.mp-song-block .audio-range {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(
    to right,
    var(--accent, #246384) var(--audio-pct, 0%),
    color-mix(in srgb, var(--accent, #246384) 16%, #e8eef2) var(--audio-pct, 0%)
  );
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.mp-song-block .audio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #246384);
  border: 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .2);
}
.mp-song-block .audio-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #246384);
  border: 0;
}
.mp-song-block .topic-audio-card.is-playing {
  border-color: color-mix(in srgb, var(--accent, #246384) 35%, var(--line, #e6eef0));
  box-shadow: 0 6px 18px rgba(36, 99, 132, .1);
}
.mp-song-block .topic-audio-card.is-netease .topic-audio-cover {
  background: linear-gradient(145deg, #e60026 0%, #7c5cbf 55%, #246384 100%);
}
@media (max-width: 768px) {
  .mp-song-block .topic-audio-main span {
    margin-top: 4px;
    font-size: 8px;
    line-height: 1.1;
  }
}
