/* 歌单播放器 · 前台样式（移动端优先） */

body.mp-fullscreen-body {
	margin: 0;
	background: #0d1116;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.mp-app {
	--mp-theme: #7c9cbf;
	--mp-dim: 45%;
	--mp-interval: 8s;
	--mp-radius: 24px;
	--mp-ease: cubic-bezier(.16, 1, .3, 1);
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: var(--mp-radius);
	background: #0d1116;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
	font-size: 15px;
	line-height: 1.6;
	-webkit-tap-highlight-color: transparent;
	box-shadow: 0 12px 32px rgba(16, 24, 40, .09);
	isolation: isolate;
}

.mp-app.mp-mode-embed {
	height: var(--mp-h, clamp(620px, 82vh, 900px));
}

.mp-app.mp-mode-full {
	position: fixed;
	inset: 0;
	height: 100vh;
	height: 100dvh;
	border-radius: 0;
}

.mp-app:fullscreen {
	border-radius: 0;
}

/* ---------- 背景层 ---------- */

.mp-bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}

.mp-layer-solid,
.mp-layer-gradient,
.mp-layer-slides {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 600ms var(--mp-ease);
}

.mp-app.mp-bg-solid .mp-layer-solid,
.mp-app.mp-bg-gradient .mp-layer-gradient,
.mp-app.mp-bg-slideshow .mp-layer-slides {
	opacity: 1;
}

.mp-layer-solid {
	background: radial-gradient(130% 120% at 22% 12%, var(--mp-theme) 0%, #131a22 62%, #0d1116 100%);
}

.mp-layer-gradient {
	background: linear-gradient(120deg, var(--mp-theme), #35485f 35%, #6a5570 60%, #2f4257 85%, var(--mp-theme));
	background-size: 300% 300%;
	animation: mpFlow 26s ease-in-out infinite;
}

@keyframes mpFlow {
	0%   { background-position: 0% 50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

.mp-slide {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0;
	transform: scale(1.06);
	transition: opacity 1400ms var(--mp-ease);
}

.mp-slide.is-active {
	opacity: 1;
	animation: mpKenBurns calc(var(--mp-interval) * 3.2) linear both;
}

@keyframes mpKenBurns {
	from { transform: scale(1.02) translate3d(0, 0, 0); }
	to   { transform: scale(1.14) translate3d(-1.2%, -1%, 0); }
}

.mp-bg-mask {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(10, 14, 18, .55) 0%, rgba(10, 14, 18, .12) 38%, rgba(10, 14, 18, .72) 100%),
		rgba(8, 11, 15, var(--mp-dim));
	backdrop-filter: saturate(115%);
}

/* ---------- 结构 ---------- */

.mp-ui {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	box-sizing: border-box;
}

.mp-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

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

.mp-pl-title {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

.mp-pl-sub {
	font-size: 12.5px;
	color: rgba(255, 255, 255, .68);
}

.mp-top-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.mp-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 8px;
	background: rgba(255, 255, 255, .14);
	backdrop-filter: blur(14px) saturate(140%);
	color: #fff;
	font: inherit;
	font-size: 12.5px;
	cursor: pointer;
	transition: transform 220ms var(--mp-ease), background 220ms var(--mp-ease), border-color 220ms var(--mp-ease);
}

.mp-chip:active {
	transform: scale(.97);
}

.mp-chip.is-on {
	background: color-mix(in srgb, var(--mp-theme) 76%, transparent);
	border-color: rgba(255, 255, 255, .34);
}

.mp-chip .mp-ico {
	width: 18px;
	height: 18px;
}

/* ---------- 主舞台 ---------- */

.mp-stage {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	padding-top: 8px;
}

.mp-cover-wrap {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 10px;
}

.mp-cover {
	width: min(42%, 150px);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(255, 255, 255, .12);
	box-shadow: 0 18px 44px rgba(0, 0, 0, .38), 0 0 0 8px rgba(255, 255, 255, .08);
	animation: mpSpin 26s linear infinite;
	animation-play-state: paused;
	flex-shrink: 0;
}

.mp-app.is-playing .mp-cover {
	animation-play-state: running;
}

@keyframes mpSpin {
	to { transform: rotate(360deg); }
}

.mp-cover img,
.mp-cover-ph {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mp-cover-ph {
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .34) 0 14%, transparent 15%),
		linear-gradient(150deg, var(--mp-theme), rgba(255, 255, 255, .08));
}

.mp-now {
	text-align: center;
	width: 100%;
	padding: 0 8px;
}

.mp-now-title {
	font-size: 19px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-shadow: 0 1px 14px rgba(0, 0, 0, .4);
}

.mp-now-artist {
	margin-top: 2px;
	font-size: 13px;
	color: rgba(255, 255, 255, .7);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- 进度 ---------- */

.mp-progress {
	width: 100%;
	max-width: 560px;
	margin-top: 14px;
}

.mp-bar {
	position: relative;
	height: 22px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
}

.mp-bar::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .24);
}

.mp-bar-fill {
	position: absolute;
	left: 0;
	height: 6px;
	width: 0;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 0 12px rgba(255, 255, 255, .35);
}

.mp-bar-dot {
	position: absolute;
	left: 0;
	width: 12px;
	height: 12px;
	margin-left: -6px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
	transition: transform 220ms var(--mp-ease);
}

.mp-bar.is-dragging .mp-bar-dot {
	transform: scale(1.35);
}

.mp-time {
	display: flex;
	justify-content: space-between;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .72);
	font-variant-numeric: tabular-nums;
}

/* ---------- 控制按钮 ---------- */

.mp-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin: 10px 0 6px;
	width: 100%;
}

.mp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	backdrop-filter: blur(12px);
	color: #fff;
	cursor: pointer;
	transition: transform 220ms var(--mp-ease), background 220ms var(--mp-ease);
}

.mp-btn:active {
	transform: scale(.97);
}

.mp-btn-sm {
	width: 46px;
	height: 46px;
}

.mp-btn-sm .mp-ico {
	width: 22px;
	height: 22px;
}

.mp-btn-play {
	width: 66px;
	height: 66px;
	background: rgba(255, 255, 255, .92);
	color: #16202b;
	border-color: transparent;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.mp-btn-play .mp-ico {
	width: 30px;
	height: 30px;
}

.mp-ico {
	display: block;
}

/* ---------- 底部小工具 ---------- */

.mp-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	max-width: 560px;
	padding-top: 4px;
}

.mp-mini {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 6px 10px;
	border: 0;
	background: transparent;
	color: rgba(255, 255, 255, .74);
	font: inherit;
	font-size: 12.5px;
	cursor: pointer;
	border-radius: 8px;
	transition: transform 220ms var(--mp-ease), color 220ms var(--mp-ease);
}

.mp-mini:active {
	transform: scale(.97);
}

.mp-mini.is-on {
	color: #fff;
}

.mp-mini .mp-ico {
	width: 18px;
	height: 18px;
}

.mp-vol {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	max-width: 220px;
}

.mp-vol-ico {
	display: inline-flex;
	color: rgba(255, 255, 255, .78);
	cursor: pointer;
}

.mp-vol-ico .mp-ico {
	width: 18px;
	height: 18px;
}

.mp-vol-range {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 22px;
	background: transparent;
}

.mp-vol-range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .26);
}

.mp-vol-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -5px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

.mp-vol-range::-moz-range-track {
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .26);
}

.mp-vol-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 0;
	border-radius: 50%;
	background: #fff;
}

/* ---------- 抽屉 ---------- */

.mp-scrim {
	position: absolute;
	inset: 0;
	z-index: 3;
	background: rgba(6, 9, 12, .48);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 240ms var(--mp-ease);
}

.mp-scrim.is-open {
	opacity: 1;
}

.mp-sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	max-height: 68%;
	overflow-y: auto;
	padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
	border-radius: 24px 24px 0 0;
	background: rgba(22, 28, 36, .82);
	backdrop-filter: blur(22px) saturate(140%);
	border-top: 1px solid rgba(255, 255, 255, .14);
	transform: translateY(102%);
	transition: transform 300ms var(--mp-ease);
	-webkit-overflow-scrolling: touch;
}

.mp-sheet.is-open {
	transform: translateY(0);
}

.mp-sheet-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	font-size: 15px;
}

.mp-sheet-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, .1);
	color: #fff;
	cursor: pointer;
}

.mp-sheet-close .mp-ico {
	width: 18px;
	height: 18px;
}

.mp-timer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 10px;
}

.mp-timer-grid button {
	min-height: 48px;
	padding: 8px 10px;
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 12px;
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	transition: transform 220ms var(--mp-ease), background 220ms var(--mp-ease);
}

.mp-timer-grid button:active {
	transform: scale(.97);
}

.mp-timer-grid button.is-on {
	background: color-mix(in srgb, var(--mp-theme) 78%, transparent);
	border-color: rgba(255, 255, 255, .34);
	font-weight: 600;
}

.mp-sheet-tip {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .62);
}

/* ---------- 曲目列表（常驻可见） ---------- */

.mp-tracks {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	margin-top: 14px;
	padding: 12px 8px 12px 12px;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 16px;
	background: rgba(255, 255, 255, .08);
	backdrop-filter: blur(18px) saturate(140%);
	box-shadow: 0 4px 16px rgba(16, 24, 40, .09);
}

.mp-tracks-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 0 4px 10px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .2px;
}

.mp-tracks-count {
	font-size: 12.5px;
	font-weight: 400;
	color: rgba(255, 255, 255, .62);
}

.mp-list {
	margin: 0;
	padding: 0 4px 0 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.mp-list::-webkit-scrollbar {
	width: 6px;
}

.mp-list::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: rgba(255, 255, 255, .22);
}

.mp-list-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 62px;
	padding: 8px 12px 8px 14px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 12px;
	background: rgba(255, 255, 255, .1);
	cursor: pointer;
	transition: background 220ms var(--mp-ease), border-color 220ms var(--mp-ease), transform 220ms var(--mp-ease);
}

.mp-list-item:hover {
	background: rgba(255, 255, 255, .17);
}

.mp-list-item:active {
	transform: scale(.985);
}

.mp-list-item.is-current {
	background: color-mix(in srgb, var(--mp-theme) 42%, rgba(255, 255, 255, .12));
	border-color: rgba(255, 255, 255, .38);
}

.mp-list-item.is-current::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12px;
	bottom: 12px;
	width: 3px;
	border-radius: 999px;
	background: #fff;
}

.mp-li-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 16px;
	flex-shrink: 0;
}

.mp-li-num {
	font-size: 13px;
	color: rgba(255, 255, 255, .58);
	font-variant-numeric: tabular-nums;
}

.mp-eq {
	display: none;
	align-items: flex-end;
	justify-content: center;
	gap: 2px;
	height: 15px;
}

.mp-eq i {
	width: 3px;
	height: 7px;
	border-radius: 999px;
	background: #fff;
}

.mp-list-item.is-current .mp-li-num {
	display: none;
}

.mp-list-item.is-current .mp-eq {
	display: inline-flex;
}

.mp-app.is-playing .mp-list-item.is-current .mp-eq i {
	animation: mpEq 900ms ease-in-out infinite;
}

.mp-app.is-playing .mp-list-item.is-current .mp-eq i:nth-child(2) {
	animation-delay: 160ms;
}

.mp-app.is-playing .mp-list-item.is-current .mp-eq i:nth-child(3) {
	animation-delay: 320ms;
}

@keyframes mpEq {
	0%, 100% { height: 5px; }
	50%      { height: 15px; }
}

.mp-li-thumb {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: rgba(255, 255, 255, .14);
}

.mp-li-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mp-li-thumb-ph {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(150deg, var(--mp-theme), rgba(255, 255, 255, .1));
}

.mp-li-main {
	flex: 1;
	min-width: 0;
}

.mp-li-title {
	display: block;
	font-size: 15.5px;
	font-weight: 500;
	color: rgba(255, 255, 255, .92);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-li-artist {
	display: block;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .62);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-list-item.is-current .mp-li-title {
	color: #fff;
	font-weight: 600;
}

.mp-list-item.is-current .mp-li-artist,
.mp-list-item.is-current .mp-li-dur {
	color: rgba(255, 255, 255, .82);
}

.mp-li-dur {
	flex-shrink: 0;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .6);
	font-variant-numeric: tabular-nums;
}

.mp-list-item.is-flash {
	animation: mpFlash 900ms var(--mp-ease);
}

@keyframes mpFlash {
	0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
	25%      { box-shadow: 0 0 0 3px rgba(255, 255, 255, .42); }
}

/* ---------- 提示 ---------- */

.mp-toast {
	position: absolute;
	left: 50%;
	bottom: 170px;
	z-index: 6;
	transform: translate(-50%, 8px);
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(18, 24, 31, .88);
	backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, .14);
	font-size: 13px;
	opacity: 0;
	transition: opacity 240ms var(--mp-ease), transform 240ms var(--mp-ease);
	pointer-events: none;
}

.mp-toast.is-open {
	opacity: 1;
	transform: translate(-50%, 0);
}

.mp-empty {
	padding: 16px;
	border: 1px dashed rgba(0, 0, 0, .2);
	border-radius: 12px;
	color: #55606b;
	font-size: 14px;
}

/* ---------- 桌面端 ---------- */

@media (min-width: 768px) {
	.mp-app.mp-mode-embed {
		max-width: 1120px;
		margin: 0 auto;
	}

	.mp-cover {
		width: min(74%, 220px);
	}

	.mp-now-title {
		font-size: 22px;
	}

	.mp-top {
		padding: 4px 8px 0;
	}

	.mp-chip .mp-chip-txt {
		display: inline;
	}
}

/* 宽屏：左侧播放器 + 右侧曲目列表 */
@media (min-width: 860px) {
	.mp-ui {
		display: grid;
		grid-template-columns: minmax(300px, 380px) 1fr;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"top    top"
			"stage  tracks";
		gap: 14px 24px;
	}

	.mp-top {
		grid-area: top;
	}

	.mp-stage {
		grid-area: stage;
		height: 100%;
		justify-content: center;
	}

	.mp-tracks {
		grid-area: tracks;
		margin-top: 0;
	}

	.mp-progress,
	.mp-foot {
		max-width: none;
	}
}

@media (max-width: 420px) {
	.mp-chip .mp-chip-txt {
		display: none;
	}

	.mp-chip {
		padding: 8px 10px;
	}

	.mp-controls {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mp-cover,
	.mp-bg-gradient,
	.mp-slide.is-active {
		animation: none !important;
	}
}
