/* Mizuki 迷你播放器：结构对齐 hxwys（整块展开，歌词贴在盒子正上方）。 */

.mz-player {
	--mz-player-accent: var(--primary);
	--mz-player-text: var(--deep-text);
	--mz-player-muted: var(--content-meta);
	--mz-player-surface: var(--card-bg, #fff);
	--mz-player-line: var(--line-color, rgba(0, 0, 0, .1));
	--mz-player-ease: cubic-bezier(0.33, 0, 0.67, 1);
	position: fixed;
	right: 16px;
	bottom: 6.5rem;
	left: auto;
	top: auto;
	z-index: 10050;
	width: 320px;
	max-width: calc(100vw - 24px);
	padding: 0;
	margin: 0;
	border: 1px solid var(--mz-player-line);
	border-radius: 1rem;
	background: var(--mz-player-surface);
	box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, .16));
	backdrop-filter: blur(24px) saturate(1.2);
	-webkit-backdrop-filter: blur(24px) saturate(1.2);
	overflow: visible;
	opacity: 0;
	pointer-events: none;
	user-select: none;
	font-family: inherit;
	color: var(--mz-player-text);
	touch-action: none;
	/* 用 right/bottom 锚定，展开时向左上长，避免贴边卡墙。 */
	transition: width 250ms var(--mz-player-ease), height 250ms var(--mz-player-ease), opacity 167ms var(--mz-player-ease), box-shadow 167ms var(--mz-player-ease);
}

.mz-player.show {
	opacity: 1;
	pointer-events: auto;
}

.mz-player.collapsed {
	width: 48px;
	height: 48px;
	border-radius: 1rem;
	box-shadow: var(--shadow-button, 0 2px 8px rgba(0, 0, 0, .12));
}

.mz-player.collapsed .mz-player-inner {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	overflow: hidden;
}

.mz-player.collapsed .mz-player-fab {
	opacity: 1;
	pointer-events: auto;
	cursor: grab;
}

.mz-player-fab {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 1rem;
	background: var(--mz-player-accent);
	opacity: 0;
	pointer-events: none;
	cursor: grab;
	color: #fff;
}

.mz-player.dragging,
.mz-player.dragging.collapsed {
	width: 48px;
	height: 48px;
	transition: none;
}

.mz-player.dragging .mz-player-inner {
	opacity: 0 !important;
	pointer-events: none !important;
}

.mz-player.dragging .mz-player-fab {
	opacity: 1 !important;
	pointer-events: auto !important;
	cursor: grabbing;
}

.mz-player-fab-icon {
	font-size: 18px;
	line-height: 1;
	color: #fff;
	pointer-events: none;
}

.mz-player-inner {
	position: relative;
	z-index: 2;
	padding: 12px 36px 10px 12px;
}

.mz-player-drag {
	position: absolute;
	top: 0;
	left: 0;
	right: 36px;
	height: 28px;
	z-index: 4;
	cursor: grab;
}

.mz-player-lyric {
	position: absolute;
	z-index: 4;
	right: 0;
	left: auto;
	top: auto;
	bottom: calc(100% + 8px);
	width: max-content;
	max-width: min(280px, calc(100vw - 40px));
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 5px 10px;
	font-size: 13px;
	line-height: 18px;
	color: var(--mz-player-accent);
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	pointer-events: none;
	background: color-mix(in oklab, var(--mz-player-surface) 88%, transparent);
	border: 1px solid var(--mz-player-line);
	border-radius: 12px;
	box-shadow: 0 4px 14px color-mix(in oklab, var(--mz-player-accent) 16%, transparent);
}

.mz-player[data-h="left"] .mz-player-lyric {
	left: 0;
	right: auto;
	text-align: left;
}

.mz-player.lyric-off .mz-player-lyric,
body.lyric-off .mz-player-lyric {
	display: none !important;
}

.mz-player-lyric.empty {
	color: var(--mz-player-muted);
	background: color-mix(in oklab, var(--mz-player-surface) 78%, transparent);
	border-color: color-mix(in oklab, var(--mz-player-line) 70%, transparent);
	box-shadow: none;
	padding: 4px 8px;
}

.mz-player-lyric-line {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(6px);
	filter: blur(2px);
	transition:
		opacity 167ms var(--mz-player-ease),
		transform 167ms var(--mz-player-ease),
		filter 167ms var(--mz-player-ease);
}

.mz-player-lyric-line:empty {
	display: none;
}

.mz-player-lyric-line.prev {
	opacity: .35;
	transform: translateY(-4px);
	filter: blur(1px);
	font-size: 11px;
}

.mz-player-lyric-line.cur {
	opacity: 1;
	transform: translateY(0);
	filter: blur(0);
	font-weight: 600;
}

.mz-player-lyric-line.next {
	opacity: .35;
	transform: translateY(4px);
	filter: blur(1px);
	font-size: 11px;
}

.mz-player-lyric.empty .mz-player-lyric-line.cur {
	opacity: .65;
	font-weight: 400;
}

.mz-player-lyric.credits .mz-player-lyric-line {
	opacity: .72;
	font-weight: 500;
	font-size: 12px;
	filter: blur(0);
}

.mz-player-lyric.credits .mz-player-lyric-line.cur {
	opacity: 1;
	font-weight: 600;
	font-size: 13px;
}

.mz-player-lyric.credits .mz-player-lyric-line.prev,
.mz-player-lyric.credits .mz-player-lyric-line.next {
	opacity: .55;
}

.mz-player-lyric-toggle {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 16px;
	background: color-mix(in oklab, var(--mz-player-accent) 14%, transparent);
	color: var(--mz-player-accent);
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: none;
	line-height: 1;
	transition: background 167ms var(--mz-player-ease), color 167ms var(--mz-player-ease);
}

.mz-player-lyric-toggle:hover {
	background: color-mix(in oklab, var(--mz-player-accent) 22%, transparent);
}

.mz-player.lyric-off .mz-player-lyric-toggle {
	background: color-mix(in oklab, var(--mz-player-muted) 16%, transparent);
	color: var(--mz-player-muted);
}

.mz-player.empty .mz-player-btn {
	opacity: .45;
	cursor: not-allowed;
}

.mz-player-top {
	display: flex;
	align-items: center;
	gap: 12px;
}

.mz-player-art {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border-radius: 0.75rem;
	background: var(--btn-regular-bg, #eee) center / cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.mz-player-art::after {
	content: '♪';
	color: var(--mz-player-accent);
	font-size: 16px;
	z-index: 1;
}

.mz-player-art.has-cover::after {
	display: none;
}

.mz-player-info {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.mz-player-now {
	font-size: 11px;
	font-weight: 500;
	color: var(--mz-player-accent);
	margin-bottom: 2px;
}

.mz-player-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--mz-player-text);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mz-player-title .mz-player-scroll {
	display: inline-block;
	padding-right: 28px;
}

.mz-player-title.marquee .mz-player-scroll {
	animation: mzPlayerMarquee 9s linear infinite;
}

@keyframes mzPlayerMarquee {
	0%, 15% { transform: translateX(0); }
	85%, 100% { transform: translateX(calc(-100% + 140px)); }
}

.mz-player-meta {
	margin-top: 2px;
	font-size: 12px;
	color: var(--mz-player-muted);
	font-weight: 400;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}

.mz-player-meta:hover {
	color: var(--mz-player-accent);
}

.mz-player-progress {
	margin-top: 8px;
	height: 3px;
	border-radius: 1.5px;
	background: color-mix(in oklab, var(--mz-player-accent) 22%, transparent);
	overflow: hidden;
	pointer-events: none;
}

.mz-player-progress-bar {
	height: 100%;
	width: 28%;
	border-radius: inherit;
	background: var(--mz-player-accent);
	position: relative;
	animation: mzPlayerBarSlide 2.4s ease-in-out infinite;
	animation-play-state: paused;
}

@keyframes mzPlayerBarSlide {
	0% { left: 0; }
	50% { left: 72%; }
	100% { left: 0; }
}

.mz-player-time {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 11px;
	color: var(--mz-player-muted);
	font-variant-numeric: tabular-nums;
}

.mz-player-ctrl {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 6px;
}

.mz-player-btn {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 0.75rem;
	background: var(--btn-regular-bg, rgba(0, 0, 0, .06));
	color: var(--btn-content, inherit);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	box-shadow: none;
}

.mz-player-btn:hover {
	background: var(--btn-regular-bg-hover, rgba(0, 0, 0, .1));
}

.mz-player-btn.play {
	width: 40px;
	height: 40px;
	background: var(--mz-player-accent);
	color: #fff;
}

.mz-player-btn svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	display: block;
}

.mz-player-btn.play svg {
	width: 18px;
	height: 18px;
}

.mz-player-hint,
.mz-player-legal {
	margin: 8px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: var(--mz-player-muted);
	text-align: left;
}

.mz-player:not(.empty) .mz-player-hint {
	display: none;
}

.mz-player.empty .mz-player-legal {
	display: none;
}

/* 官方外链必须保留真实尺寸才能出声；贴在视口内左下角全透明，避免屏幕外被挂起。 */
.mz-player-netease {
	position: fixed !important;
	left: 0 !important;
	bottom: 0 !important;
	width: 330px !important;
	height: 86px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	border: 0 !important;
	margin: 0 !important;
	z-index: 0 !important;
}

.mz-player-netease-frame {
	width: 330px !important;
	height: 86px !important;
	border: 0;
	background: transparent !important;
}

@media (prefers-reduced-motion: reduce) {
	.mz-player-inner,
	.mz-player-title.marquee .mz-player-scroll {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 768px) {
	.mz-player {
		right: 12px;
		bottom: 5.75rem;
	}

	.mz-player:not(.collapsed) {
		width: min(300px, calc(100vw - 20px));
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}
}
