/* Scoped to core playlists; legacy shortcodes and other audio blocks are untouched. */
:is(.wp-block-playlist.rp-playlist, .editor-styles-wrapper .wp-block-playlist) {
	--rp-accent: #eddb00;
	--rp-selected: #861c58;
	--rp-rail: rgb(255 255 255 / 27%);
	--rp-rotation-duration: 20s;
	box-sizing: border-box;
	padding: 20px 15px;
	border: 0;
	border-radius: 11px;
	background: linear-gradient(110deg, #252326 0%, #551f3b 31%, #7c1c50 52%, #242326 100%);
	color: #fff;
	font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color-scheme: dark;
}

.rp-playlist *, .rp-playlist *::before, .rp-playlist *::after { box-sizing: border-box; }
.rp-playlist [hidden] { display: none !important; }
.rp-playlist .rp-now-playing { display: flex; align-items: center; gap: 5px; min-height: 64px; margin-bottom: 5px; }
.rp-playlist .rp-cover { position: relative; display: block; flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border-radius: 50%; direction: ltr; transform-origin: center; animation: rp-cover-spin var(--rp-rotation-duration) linear infinite; animation-play-state: paused; }
.rp-playlist.rp-is-playing .rp-cover { animation-play-state: running; }
.rp-playlist .rp-cover-icon { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: linear-gradient(145deg, #408db1, #254353); color: #d9d3d8; }
.rp-playlist .rp-cover-icon svg { width: 38px; height: 38px; fill: currentColor; }
@keyframes rp-cover-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.rp-playlist .rp-heading { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 400; }
.rp-playlist .rp-audio { display: block; width: 100%; margin-block: 10px; }
.rp-playlist[data-rp-enhanced] .rp-audio { display: none; }
.rp-playlist .rp-controls { display: flex; align-items: center; gap: 12px; min-height: 40px; padding-inline: 10px 15px; margin-bottom: 6px; direction: ltr; }
.rp-playlist .rp-icon-button { display: grid; place-items: center; flex: 0 0 26px; width: 26px; min-width: 26px; height: 36px; padding: 0; margin: 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none; color: #fff; cursor: pointer; }
.rp-playlist .rp-icon-button > span { display: flex; }
.rp-playlist .rp-icon-button svg { display: block; width: 22px; height: 22px; fill: currentColor; }
.rp-playlist .rp-play svg { width: 20px; height: 20px; }
.rp-playlist .rp-icon-button:hover { background: rgb(255 255 255 / 10%); }
.rp-playlist .rp-icon-button:disabled { cursor: not-allowed; opacity: 0.4; }
.rp-playlist :is(button, input):focus-visible { outline: 2px solid #f9e65e; outline-offset: 3px; }
.rp-playlist :is(.rp-elapsed, .rp-duration) { flex: 0 0 auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-playlist .rp-seek-wrap { position: relative; flex: 1; min-width: 30px; height: 36px; }
.rp-playlist .rp-seek-rail { position: absolute; top: 17px; inset-inline: 0; height: 2px; background: var(--rp-rail); pointer-events: none; overflow: hidden; }
.rp-playlist :is(.rp-buffered, .rp-progress) { position: absolute; inset-block: 0; left: 0; width: 0; pointer-events: none; }
.rp-playlist .rp-buffered { width: var(--rp-buffered, 0%); background: rgb(255 255 255 / 80%); }
.rp-playlist .rp-progress { width: var(--rp-progress, 0%); background: var(--rp-accent); }
.rp-playlist input[type="range"] { appearance: none; -webkit-appearance: none; display: block; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
.rp-playlist .rp-seek { position: absolute; inset: 0; width: 100%; height: 36px; background: transparent; color: var(--rp-accent); }
.rp-playlist .rp-seek::-webkit-slider-runnable-track { height: 2px; background: transparent; border: 0; }
.rp-playlist .rp-seek::-moz-range-track { height: 2px; background: transparent; border: 0; }
.rp-playlist .rp-seek::-moz-range-progress { background: transparent; }
.rp-playlist .rp-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--rp-accent); opacity: 0; }
.rp-playlist .rp-seek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--rp-accent); opacity: 0; }
.rp-playlist .rp-seek:is(:hover, :focus-visible, :active)::-webkit-slider-thumb { opacity: 1; }
.rp-playlist .rp-seek:is(:hover, :focus-visible, :active)::-moz-range-thumb { opacity: 1; }
.rp-playlist .rp-seek:disabled { cursor: default; }
.rp-playlist .rp-volume-control { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.rp-playlist .rp-volume { width: 50px; height: 36px; background: transparent; }
.rp-playlist .rp-volume::-webkit-slider-runnable-track { height: 8px; border: 0; border-radius: 8px; background: linear-gradient(to right, #fff var(--rp-volume, 80%), var(--rp-rail) var(--rp-volume, 80%)); }
.rp-playlist .rp-volume::-moz-range-track { height: 8px; border: 0; border-radius: 8px; background: var(--rp-rail); }
.rp-playlist .rp-volume::-moz-range-progress { height: 8px; border-radius: 8px; background: #fff; }
.rp-playlist .rp-volume::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; }
.rp-playlist .rp-volume::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; }

:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist { padding: 0; margin: 0; list-style: none; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track { margin: 0; padding: 0; border: 0; border-radius: 5px; background: transparent; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track + .wp-block-playlist-track { margin-top: 5px; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track:has([aria-current="true"]) { background: transparent; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button { display: flex; align-items: center; gap: 0; width: 100%; min-height: 31px; padding: 5px 9px; border: 0; border-radius: 5px; background: transparent; box-shadow: none; color: inherit; font: inherit; line-height: 21px; text-align: start; cursor: pointer; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button:hover { background: rgb(255 255 255 / 8%); }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button[aria-current="true"] { background: var(--rp-selected); color: #fff; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button:disabled { opacity: 0.5; cursor: not-allowed; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-show-numbers { counter-reset: playlist-track; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-show-numbers > .wp-block-playlist-track { counter-increment: playlist-track; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-show-numbers .wp-block-playlist-track__button::before { content: counter(playlist-track) "."; flex: 0 0 auto; width: auto; min-width: 1ch; margin-inline: 0 5px; font-size: inherit; opacity: 1; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button .wp-block-playlist-track__image { display: none; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button .wp-block-playlist-track__content { display: block; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button .wp-block-playlist-track__title { display: inline; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button .wp-block-playlist-track__artist { display: none; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist-track__button .wp-block-playlist-track__length { flex: 0 0 auto; margin-inline: 12px 0; font-size: 12px; font-variant-numeric: tabular-nums; opacity: 1; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-is-hidden { display: none; }
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-artist-is-hidden .wp-block-playlist-track__artist,
:is(.rp-playlist, .editor-styles-wrapper .wp-block-playlist) .wp-block-playlist__tracklist-length-is-hidden .wp-block-playlist-track__length { display: none; }
.rp-playlist .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rp-playlist .rp-status { margin: 0 9px 8px; color: #ffe4aa; font-size: 12px; }
.rp-playlist figcaption { margin: 14px 9px 0; color: inherit; font-size: 12px; opacity: 0.8; }

/* Retain Gutenberg's editing, metadata fields and waveform preview. */
.editor-styles-wrapper .wp-block-playlist .waveform-player { --wfp-text-color: #fff; --wfp-text-secondary-color: #eee; --wfp-button-color: #fff; }
.editor-styles-wrapper .wp-block-playlist .waveform-track { height: 64px; }
.editor-styles-wrapper .wp-block-playlist .waveform-btn { width: 64px; height: 64px; min-width: 64px; background-color: transparent; }
.editor-styles-wrapper .wp-block-playlist .waveform-btn svg { width: 24px; height: 24px; }
.editor-styles-wrapper .wp-block-playlist .waveform-info { color: #fff; }
.editor-styles-wrapper .wp-block-playlist .waveform-artist { display: none; }

@media (max-width: 480px) {
	:is(.wp-block-playlist.rp-playlist, .editor-styles-wrapper .wp-block-playlist) { padding: 16px 12px; }
	.rp-playlist .rp-controls { gap: 7px; padding-inline: 0; }
	.rp-playlist .rp-cover { flex-basis: 56px; width: 56px; height: 56px; }
	.rp-playlist .rp-volume { width: 38px; }
	.rp-playlist .rp-now-playing { gap: 9px; min-height: 56px; }
}

@media (prefers-reduced-motion: no-preference) {
	.rp-playlist .wp-block-playlist-track__button { transition: background-color 120ms ease; }
}
