/*!
 * 音乐播放器区块 — 前台 + 编辑器共用样式
 *
 * 约定：
 *  - 所有选择器以 .zm2-player 开头，不向外泄漏，也不吃主题的内容样式。
 *  - 配色固定深色玻璃，不跟随站点明暗：模糊封面只有压在深色蒙版上才好看，
 *    而且能整体避开 ZAXU 那份运行时生成的 zaxu-color-scheme 内联 CSS。
 */

/* ---------------------------------------------------------------
 * 作用域重置
 * ZAXU 的 .entry-content 会命中我们的 p/h3/ol/a/button/img。
 * 其中 img{max-width:100%} 会直接把定尺寸的唱片封面压变形。
 * --------------------------------------------------------------- */
.zm2-player,
.zm2-player *,
.zm2-player *::before,
.zm2-player *::after {
	box-sizing: border-box;
}

.zm2-player p,
.zm2-player h3,
.zm2-player ol,
.zm2-player ul,
.zm2-player li {
	margin: 0;
	padding: 0;
}

.zm2-player ol,
.zm2-player ul {
	list-style: none;
}

.zm2-player a {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.zm2-player button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
}

/* 注意别在这里写 border-radius —— `.zm2-player img` 的特异度是 (0,1,1)，
   会压过 `.zm2-disc__cover` 的 (0,1,0)，把唱片封面的圆形裁切干掉。 */
.zm2-player img {
	display: block;
	max-width: none;
	border: 0;
}

.zm2-player [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------
 * 容器
 * --------------------------------------------------------------- */
.zm2-player {
	--zm2-fg: rgba(255, 255, 255, .94);
	--zm2-dim: rgba(255, 255, 255, .55);
	--zm2-faint: rgba(255, 255, 255, .34);
	--zm2-accent: #ffffff;
	--zm2-line: rgba(255, 255, 255, .16);
	--zm2-panel: rgba(22, 23, 28, .92);
	--zm2-radius: 14px;
	--zm2-disc: 340px;
	--zm2-lrc-h: 340px;
	--zm2-pad: 44px;

	position: relative;
	container-type: inline-size;
	overflow: hidden;
	border-radius: var(--zm2-radius);
	background: #16171c;
	color: var(--zm2-fg);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-align: left;
	isolation: isolate;
}

@media (prefers-color-scheme: light) {
	/* 白底页面上给个投影，免得整块浮着没有着落。 */
	.zm2-player {
		box-shadow: 0 10px 34px rgba(0, 0, 0, .16);
	}
}

/* ---------------------------------------------------------------
 * 封面氛围背景
 * 两层交叉淡入：JS 把新封面写进未激活的那层，下一帧交换 is-active。
 * 用百分比内缩 + scale 而不是负像素内缩，任何尺寸下都不会露出模糊边缘。
 * --------------------------------------------------------------- */
.zm2-player__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	background: #16171c;
}

.zm2-player__bg-layer {
	position: absolute;
	inset: -12%;
	background: 50% 50% / cover no-repeat;
	-webkit-filter: blur(56px) saturate(1.7);
	filter: blur(56px) saturate(1.7);
	-webkit-transform: scale(1.15) translateZ(0);
	transform: scale(1.15) translateZ(0);
	opacity: 0;
	transition: opacity .6s ease;
	will-change: opacity;
}

.zm2-player__bg-layer.is-active {
	opacity: .62;
}

.zm2-player__bg-scrim {
	position: absolute;
	inset: 0;
	/* 参考稿的底色是均匀的一层，梯度拉太大四角会压出很脏的暗角 */
	background: linear-gradient(158deg, rgba(20, 22, 26, .62), rgba(14, 15, 19, .76));
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
}

/* ---------------------------------------------------------------
 * 主体骨架
 * --------------------------------------------------------------- */
.zm2-player__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	/* 参考稿是 1104×748（约 1.48）。放矮了整块就会显得扁。 */
	min-height: 780px;
}

.zm2-player__top {
	display: flex;
	justify-content: flex-end;
	padding: 16px 20px 0;
}

.zm2-stage {
	flex: 1 1 auto;
	display: grid;
	/* 两栏等分，唱片在自己那一栏里居中 —— 参考稿的唱片圆心在整宽的 26% 处，
	   而不是贴着左内边距。 */
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 32px;
	align-items: center;
	padding: 4px var(--zm2-pad) 28px;
}

/* ---------------------------------------------------------------
 * 黑胶唱片 + 唱臂
 * --------------------------------------------------------------- */
.zm2-stage__disc {
	position: relative;
	justify-self: center;
	width: var(--zm2-disc);
	/* 唱臂在上方留白里，比例跟着唱片直径走 */
	padding-top: calc(var(--zm2-disc) * 0.26);
}

.zm2-disc {
	position: relative;
	width: var(--zm2-disc);
	height: var(--zm2-disc);
	border-radius: 50%;
	background:
		repeating-radial-gradient(circle at 50% 50%,
			rgba(255, 255, 255, .05) 0 1px,
			rgba(0, 0, 0, 0) 1px 5px),
		/* 最外圈那道略亮的边是网易云唱片的凸起外沿 */
		radial-gradient(circle at 50% 50%, #1d1d21 0 40%, #0c0c0f 64%, #17171c 93%, #2e2e35 96%, #1a1a1f 100%);
	box-shadow:
		0 22px 48px rgba(0, 0, 0, .55),
		inset 0 0 0 1px rgba(255, 255, 255, .08);
	-webkit-animation: zm2-spin 22s linear infinite;
	animation: zm2-spin 22s linear infinite;
	/* 关键：靠 animation-play-state 暂停，绝不增删动画或承载动画的类。
	   移除动画会让唱片瞬间弹回 0°，看起来就是个 bug。 */
	-webkit-animation-play-state: paused;
	animation-play-state: paused;
}

.zm2-player .zm2-disc__toggle {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 4;
	width: var(--zm2-disc);
	height: var(--zm2-disc);
	border-radius: 50%;
	cursor: pointer;
	touch-action: manipulation;
}

.zm2-player .zm2-disc__toggle:disabled {
	cursor: default;
}

.zm2-player .zm2-disc__toggle:focus-visible {
	outline: 2px solid rgba(255, 255, 255, .72);
	outline-offset: 6px;
}

.zm2-player.is-playing .zm2-disc {
	-webkit-animation-play-state: running;
	animation-play-state: running;
}

@-webkit-keyframes zm2-spin {
	to { -webkit-transform: rotate(360deg); }
}

@keyframes zm2-spin {
	to { transform: rotate(360deg); }
}

.zm2-player .zm2-disc__cover {
	position: absolute;
	inset: 17.5%;
	width: 65%;
	height: 65%;
	border-radius: 50%;
	object-fit: cover;
	background: #24252b;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
}

.zm2-disc::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 9px;
	height: 9px;
	margin: -4.5px 0 0 -4.5px;
	border-radius: 50%;
	background: #0b0b0d;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
	z-index: 2;
}

/*
 * 唱臂几何取自参考稿：转轴在唱片正上方约 0.22 倍直径处、大致对着圆心，
 * 臂向右下 26° 搭到唱片外缘。所有尺寸都用 --zm2-disc 换算，缩放时不会跑位。
 */
.zm2-tonearm {
	position: absolute;
	left: 43.4%;
	top: calc(var(--zm2-disc) * -0.026);
	width: 55%;
	height: auto;
	z-index: 3;
	pointer-events: none;
	fill: none;
	stroke: #ececf1;
	/* 2.7 / 100 × 55% × 唱片直径 ≈ 唱片直径的 1.5%，与参考稿一致 */
	stroke-width: 2.7;
	stroke-linecap: round;
	stroke-linejoin: round; /* 折臂拐点要圆滑，不然是个尖角 */
	/* 暂停时唱头停在唱片外侧；播放后再围绕转轴落到纹路上。 */
	-webkit-transform: rotate(0deg);
	transform: rotate(0deg);
	-webkit-transform-origin: 12% 12%;
	transform-origin: 12% 12%;
	transition: -webkit-transform .55s cubic-bezier(.4, 0, .2, 1);
	transition: transform .55s cubic-bezier(.4, 0, .2, 1);
	filter: drop-shadow(0 5px 10px rgba(0, 0, 0, .5));
}

/* 播放时再顺时针落下 36°：唱头进入外圈纹路，位置与用户标注一致。 */
.zm2-player.is-playing .zm2-tonearm {
	-webkit-transform: rotate(36deg);
	transform: rotate(36deg);
}

.zm2-tonearm__pivot,
.zm2-tonearm__head {
	fill: #e9e9ee;
	stroke: none;
}

/* ---------------------------------------------------------------
 * 右侧信息区
 * --------------------------------------------------------------- */
.zm2-stage__info {
	min-width: 0;
}

.zm2-meta__title {
	font-size: 27px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .01em;
	color: var(--zm2-fg);
	overflow-wrap: anywhere;
}

/* 同样带前缀压过重置里的 `.zm2-player p { margin: 0 }` */
.zm2-player .zm2-meta__sub {
	margin-top: 6px;
	font-size: 14px;
	color: var(--zm2-dim);
	overflow-wrap: anywhere;
}

.zm2-player .zm2-meta__line {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 24px;
	margin-top: 16px;
	font-size: 13.5px;
	color: var(--zm2-dim);
}

.zm2-meta__pair {
	display: inline-flex;
	gap: 5px;
	min-width: 0;
}

.zm2-meta__label {
	color: var(--zm2-faint);
	flex: none;
}

.zm2-meta__pair > span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------------------------------------------------------------
 * 歌词
 * --------------------------------------------------------------- */
.zm2-lrc {
	position: relative;
	height: var(--zm2-lrc-h);
	margin-top: 14px;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
	mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 84%, transparent 100%);
}

/* 桌面嵌入模式让右栏占满舞台高度，歌词窗口自动延伸到底部：
 * 标题位置保持不变，剩余空间全部用于继续显示歌词。 */
@container (min-width: 721px) {
	.zm2-player:not(.is-fullscreen) .zm2-stage__info {
		align-self: stretch;
		display: flex;
		flex-direction: column;
		padding-top: clamp(56px, 6.5cqw, 82px);
	}

	.zm2-player:not(.is-fullscreen) .zm2-lrc {
		flex: 1 1 0;
		min-height: 0;
		height: auto;
	}
}

.zm2-lrc__inner {
	transition: -webkit-transform .45s cubic-bezier(.25, .8, .25, 1);
	transition: transform .45s cubic-bezier(.25, .8, .25, 1);
	will-change: transform;
	padding: 0;
}

/*
 * 这一段的选择器都带 .zm2-player 前缀，是为了压过上面那条作用域重置
 * （`.zm2-player p` 的特异度是 0,1,1，裸的 `.zm2-lrc__line` 只有 0,1,0，
 *  不加前缀 padding 会被重置成 0，行距全塌）。
 */
.zm2-player .zm2-lrc__line {
	/* 参考稿行距约 47px：16.5 × 1.5 + 12 × 2 ≈ 49 */
	padding: 12px 0;
	font-size: 16.5px;
	line-height: 1.5;
	color: var(--zm2-fg);
	opacity: .38;
	transition: opacity .3s ease, color .3s ease;
	overflow-wrap: anywhere;
}

.zm2-player .zm2-lrc__line--timed {
	cursor: pointer;
}

/* 演职员行与正常行同字号，只是更淡 —— 参考稿就是这样 */
.zm2-player .zm2-lrc__line--static {
	opacity: .3;
	cursor: default;
}

/*
 * 当前行放大用 font-size，绝不用 transform:scale()：
 * Windows 上合成层会关掉次像素抗锯齿，中文字会明显发虚。
 * 字号变化不加过渡 —— 布局要立刻落定，JS 随后才能量到正确的行位置。
 */
.zm2-player .zm2-lrc__line.is-active {
	opacity: 1;
	font-size: 19.5px;
	font-weight: 600;
}

.zm2-player .zm2-lrc__empty {
	padding: 24px 0;
	font-size: 14px;
	color: var(--zm2-faint);
}

/* 整首没有时间标签时不做跟随，正常从上往下排 */
.zm2-lrc--unsynced .zm2-lrc__inner {
	transition: none;
}

.zm2-lrc--unsynced {
	overflow-y: auto;
}

/* ---------------------------------------------------------------
 * 进度条
 * --------------------------------------------------------------- */
.zm2-seek {
	position: relative;
	height: 18px;
	margin: 0 0 -6px;
	padding: 7px 0;
	cursor: pointer;
	touch-action: none;
	outline: none;
}

.zm2-seek__track {
	position: relative;
	height: 3px;
	background: rgba(255, 255, 255, .14);
}

.zm2-seek__played {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: var(--zm2-accent);
	transition: width .18s linear;
}

.zm2-seek__thumb {
	position: absolute;
	top: 50%;
	left: 0;
	width: 11px;
	height: 11px;
	margin: -5.5px 0 0 -5.5px;
	border-radius: 50%;
	background: var(--zm2-accent);
	box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
	-webkit-transform: scale(0);
	transform: scale(0);
	transition: -webkit-transform .16s ease, left .18s linear;
	transition: transform .16s ease, left .18s linear;
}

.zm2-seek:hover .zm2-seek__thumb,
.zm2-seek:focus-visible .zm2-seek__thumb,
.zm2-seek.is-dragging .zm2-seek__thumb {
	-webkit-transform: scale(1);
	transform: scale(1);
}

.zm2-seek:focus-visible .zm2-seek__track {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}

/* 拖动中掐掉过渡，否则跟手会有明显延迟 */
.zm2-seek.is-dragging .zm2-seek__played,
.zm2-seek.is-dragging .zm2-seek__thumb {
	transition: none;
}

.zm2-seek__tip {
	position: absolute;
	bottom: 20px;
	transform: translateX(-50%);
	padding: 3px 7px;
	border-radius: 4px;
	background: rgba(0, 0, 0, .82);
	font-size: 11.5px;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	pointer-events: none;
}

/* 音源不支持 Range 请求时（duration 为 Infinity）整条禁用 */
.zm2-player--live .zm2-seek {
	pointer-events: none;
	opacity: .35;
}

.zm2-player--live .zm2-time i,
.zm2-player--live .zm2-time [data-zm2="dur"] {
	display: none;
}

/* ---------------------------------------------------------------
 * 底部控制条
 * --------------------------------------------------------------- */
.zm2-bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	padding: 14px var(--zm2-pad) 18px;
	background: rgba(0, 0, 0, .22);
	border-top: 1px solid rgba(255, 255, 255, .06);
}

.zm2-bar__now {
	min-width: 0;
	line-height: 1.35;
}

.zm2-bar__now strong {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--zm2-fg);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zm2-bar__now span {
	display: block;
	font-size: 12.5px;
	color: var(--zm2-faint);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zm2-bar__transport {
	display: flex;
	align-items: center;
	gap: 14px;
}

.zm2-bar__aside {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	min-width: 0;
}

.zm2-time {
	display: inline-flex;
	gap: 4px;
	font-size: 12.5px;
	color: var(--zm2-faint);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.zm2-time i {
	font-style: normal;
	opacity: .6;
}

/* ---------------------------------------------------------------
 * 按钮与图标
 * --------------------------------------------------------------- */
.zm2-player .zm2-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	color: var(--zm2-dim);
	transition: color .18s ease, background-color .18s ease, transform .12s ease;
}

.zm2-player .zm2-btn:hover {
	color: var(--zm2-fg);
	background: transparent;
}

.zm2-btn:active {
	-webkit-transform: scale(.92);
	transform: scale(.92);
}

.zm2-btn:focus-visible {
	outline: 2px solid rgba(255, 255, 255, .6);
	outline-offset: 2px;
}

.zm2-player .zm2-btn--ghost {
	width: 32px;
	height: 32px;
	color: var(--zm2-faint);
}

.zm2-player .zm2-btn--play {
	width: 44px;
	height: 44px;
	color: rgba(255, 255, 255, .68);
	background: rgba(255, 255, 255, .075);
}

.zm2-player .zm2-btn--play:hover {
	color: rgba(255, 255, 255, .9);
	background: rgba(255, 255, 255, .12);
}

.zm2-bar .zm2-btn .zm2-i {
	width: 26px;
	height: 26px;
}

.zm2-bar .zm2-btn--play .zm2-i {
	width: 27px;
	height: 27px;
}

.zm2-i {
	width: 18px;
	height: 18px;
	fill: currentColor;
	stroke: none;
	pointer-events: none;
}

.zm2-i--stroke {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* on / off 图标切换：默认显示 __on（播放、进入全屏），状态类翻转成 __off */
.zm2-btn__on {
	display: flex;
}

.zm2-btn__off {
	display: none;
}

.zm2-player.is-playing [data-zm2="play"] .zm2-btn__on,
.zm2-player.is-fullscreen [data-zm2="fullscreen"] .zm2-btn__on {
	display: none;
}

.zm2-player.is-playing [data-zm2="play"] .zm2-btn__off,
.zm2-player.is-fullscreen [data-zm2="fullscreen"] .zm2-btn__off {
	display: flex;
}

/* ---------------------------------------------------------------
 * 「⋯」更多菜单
 * --------------------------------------------------------------- */
.zm2-more {
	position: relative;
}

.zm2-more__menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	z-index: 20;
	min-width: 190px;
	padding: 6px;
	border-radius: 10px;
	background: rgba(248, 249, 251, .96);
	border: 1px solid rgba(255, 255, 255, .72);
	box-shadow:
		0 14px 40px rgba(0, 0, 0, .32),
		0 0 0 1px rgba(20, 22, 28, .06);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

.zm2-player .zm2-more__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 7px;
	font-size: 13.5px;
	color: rgba(26, 28, 34, .72);
	transition: background-color .16s ease, color .16s ease;
}

.zm2-player .zm2-more__item:hover,
.zm2-player .zm2-more__item:focus-visible {
	color: #17191f;
	background: rgba(20, 24, 32, .075);
}

.zm2-more__item .zm2-i {
	flex: none;
	width: 16px;
	height: 16px;
	opacity: .85;
}

.zm2-more__item span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------------------------------------------------------------
 * 播放列表面板
 * --------------------------------------------------------------- */
.zm2-playlist {
	position: absolute;
	right: 0;
	top: clamp(18px, 4%, 36px);
	bottom: 88px;
	z-index: 30;
	display: flex;
	width: min(380px, calc(100% - 18px));
	min-height: 0;
	flex-direction: column;
	overflow: hidden;
	overscroll-behavior: contain;
	background: #fff;
	border: 1px solid rgba(35, 51, 74, .1);
	border-right: 0;
	border-radius: 10px 0 0 10px;
	-webkit-backdrop-filter: blur(20px) saturate(.9);
	backdrop-filter: blur(20px) saturate(.9);
	box-shadow: -8px 6px 24px rgba(0, 0, 0, .18);
	-webkit-transform: translate3d(calc(100% + 24px), 0, 0);
	transform: translate3d(calc(100% + 24px), 0, 0);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	will-change: transform, opacity;
	transition:
		-webkit-transform .34s cubic-bezier(.22, .78, .28, 1),
		opacity .2s ease,
		visibility 0s linear .34s;
	transition:
		transform .34s cubic-bezier(.22, .78, .28, 1),
		opacity .2s ease,
		visibility 0s linear .34s;
}

.zm2-playlist.is-open {
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

.zm2-playlist__head {
	flex: none;
	padding: 22px 24px 10px;
}

.zm2-player .zm2-playlist__title {
	display: flex;
	align-items: baseline;
	gap: 5px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.25;
	color: rgba(35, 51, 74, .92);
}

.zm2-player .zm2-playlist__title small {
	font-size: 12px;
	font-weight: 600;
	color: rgba(35, 51, 74, .48);
}

.zm2-playlist__list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 14px 16px !important;
	scrollbar-width: thin;
	scrollbar-color: rgba(35, 51, 74, .22) transparent;
}

.zm2-playlist__list::-webkit-scrollbar {
	width: 6px;
}

.zm2-playlist__list::-webkit-scrollbar-thumb {
	border-radius: 10px;
	background: rgba(35, 51, 74, .22);
}

.zm2-player .zm2-playlist__item {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) 44px;
	align-items: center;
	gap: 12px;
	min-height: 72px;
	padding: 8px 10px;
	border-radius: 4px;
	color: rgba(35, 51, 74, .8);
	cursor: pointer;
	outline: none;
	transition: background-color .16s ease, color .16s ease;
}

.zm2-playlist__item:hover,
.zm2-playlist__item:focus-visible {
	background: rgba(35, 51, 74, .06);
	color: rgba(35, 51, 74, .96);
}

.zm2-playlist__item.is-current {
	color: #e06b3f;
	background: transparent;
}

.zm2-playlist__item.is-current .zm2-playlist__a {
	color: rgba(215, 93, 52, .72);
}

.zm2-playlist__item[aria-disabled="true"] {
	opacity: .4;
	cursor: not-allowed;
}

.zm2-playlist__duration {
	color: rgba(35, 51, 74, .42);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.zm2-playlist__cover {
	width: 48px;
	height: 48px;
	border-radius: 4px;
	object-fit: cover;
}

.zm2-playlist__meta {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 2px;
}

.zm2-player .zm2-playlist__t,
.zm2-player .zm2-playlist__a {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zm2-player .zm2-playlist__t {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;
}

.zm2-player .zm2-playlist__a {
	color: rgba(35, 51, 74, .5);
	font-size: 12.5px;
	line-height: 1.4;
}

/* ---------------------------------------------------------------
 * 原生整屏全屏
 * Fullscreen API 会把播放器提升到浏览器 top layer，不受文章容器限制。
 * --------------------------------------------------------------- */
.zm2-player.is-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 999990;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

.zm2-player.is-fullscreen .zm2-player__body {
	height: 100%;
}

.zm2-player.is-fullscreen {
	/* 网易云全屏骨架：左侧大唱片，右侧信息靠上、歌词独立落在中段。 */
	--zm2-disc: clamp(280px, min(31vw, 52vh), 600px);
	/* 矮屏必须把歌词视窗收短，否则舞台的最小内容高度会把整条控制栏挤出屏幕。 */
	--zm2-lrc-h: clamp(160px, min(calc(40vh - 8px), calc(100dvh - 548px)), 520px);
	--zm2-pad: clamp(48px, 5.25vw, 108px);
}

@media (min-width: 783px) {
	.zm2-player.is-fullscreen .zm2-stage {
		grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
		gap: clamp(40px, 4.25vw, 88px);
		align-items: stretch;
		padding-top: clamp(52px, 7vh, 90px);
		padding-right: var(--zm2-pad);
		padding-bottom: clamp(24px, 3vh, 40px);
		padding-left: var(--zm2-pad);
	}

	.zm2-player.is-fullscreen .zm2-stage__disc {
		align-self: center;
	}

	.zm2-player.is-fullscreen .zm2-stage__info {
		align-self: stretch;
		display: flex;
		min-height: 0;
		flex-direction: column;
	}

	.zm2-player.is-fullscreen .zm2-meta__title {
		font-size: clamp(27px, 1.55vw, 34px);
	}

	.zm2-player.is-fullscreen .zm2-meta__sub {
		font-size: clamp(14px, .85vw, 17px);
	}

	.zm2-player.is-fullscreen .zm2-meta__line {
		font-size: clamp(13.5px, .8vw, 16px);
	}

	.zm2-player.is-fullscreen .zm2-lrc__line {
		font-size: clamp(16.5px, 1vw, 20px);
	}

	.zm2-player.is-fullscreen .zm2-lrc__line.is-active {
		font-size: clamp(19.5px, 1.2vw, 24px);
	}

	.zm2-player.is-fullscreen .zm2-lrc {
		/* 全屏右栏的剩余高度全部交给歌词，避免固定高度在上下留下大块空白。 */
		flex: 1 1 0;
		min-height: 0;
		height: auto;
		margin-top: clamp(32px, 4dvh, 52px);
		/* 渐隐使用稳定的像素范围，避免歌词区变高后 16% 的透明带过宽。 */
		-webkit-mask-image: linear-gradient(
			to bottom,
			transparent 0,
			#000 clamp(32px, 4dvh, 52px),
			#000 calc(100% - clamp(32px, 4dvh, 52px)),
			transparent 100%
		);
		mask-image: linear-gradient(
			to bottom,
			transparent 0,
			#000 clamp(32px, 4dvh, 52px),
			#000 calc(100% - clamp(32px, 4dvh, 52px)),
			transparent 100%
		);
	}
}

/* 主舞台保留较宽的呼吸空间；底栏信息需要更贴近屏幕边缘。 */
.zm2-player.is-fullscreen .zm2-bar {
	padding-right: clamp(20px, 2.5vw, 48px);
	padding-left: clamp(20px, 2.5vw, 48px);
}

.zm2-player.is-fullscreen .zm2-playlist {
	top: clamp(56px, 8dvh, 104px);
	bottom: clamp(92px, 9dvh, 116px);
	width: clamp(360px, 26vw, 520px);
}

.zm2-player::backdrop {
	background: #000;
}

/* ---------------------------------------------------------------
 * 编辑器预览
 * --------------------------------------------------------------- */
.zm2-player--static .zm2-btn,
.zm2-player--static .zm2-seek,
.zm2-player--static .zm2-playlist__item,
.zm2-player--static .zm2-lrc__line {
	pointer-events: none;
}

.zm2-player--static .zm2-btn {
	opacity: .6;
}

.zm2-preview-badge {
	position: absolute;
	left: 14px;
	top: 14px;
	z-index: 20;
	padding: 3px 9px;
	border-radius: 20px;
	background: rgba(0, 0, 0, .5);
	border: 1px solid var(--zm2-line);
	font-size: 11.5px;
	color: var(--zm2-dim);
}

.zm2-player .zm2-preview-warn {
	position: relative;
	z-index: 20;
	margin: 0;
	padding: 10px 16px;
	background: rgba(180, 60, 40, .35);
	border-top: 1px solid rgba(255, 140, 120, .35);
	font-size: 12.5px;
	color: #ffd9d2;
}

.zm2-player .zm2-preview-warn li {
	list-style: disc inside;
}

/* 空区块占位（非 ZAXU 环境下的兜底样式） */
.zm2-block-placeholder-tips {
	padding: 18px;
	border: 1px dashed rgba(127, 127, 127, .5);
	border-radius: 8px;
	text-align: center;
	opacity: .8;
}

.zm2-notice {
	display: block;
	padding: 14px 18px;
	border-radius: 8px;
	background: rgba(127, 127, 127, .12);
}

/* ---------------------------------------------------------------
 * 响应式
 * 容器查询为主，媒体查询兜老 WebView（QQ / UC / 微信内置浏览器）。
 * --------------------------------------------------------------- */
/* 中等宽度（例如插在 840px 正文宽里）：整块等比收一档，别变成竖条 */
@container (max-width: 980px) {
	.zm2-player {
		--zm2-disc: 280px;
		--zm2-lrc-h: 250px;
		--zm2-pad: 32px;
	}

	.zm2-player__body { min-height: 640px; }
	.zm2-player .zm2-lrc__line { padding: 10px 0; font-size: 15.5px; }
	.zm2-player .zm2-lrc__line.is-active { font-size: 18px; }
	.zm2-meta__title { font-size: 24px; }
}

@media (max-width: 1100px) {
	.zm2-player {
		--zm2-disc: 280px;
		--zm2-lrc-h: 250px;
		--zm2-pad: 32px;
	}

	.zm2-player__body { min-height: 640px; }
	.zm2-player .zm2-lrc__line { padding: 10px 0; font-size: 15.5px; }
	.zm2-player .zm2-lrc__line.is-active { font-size: 18px; }
	.zm2-meta__title { font-size: 24px; }
}

@container (max-width: 720px) {
	.zm2-player {
		--zm2-disc: 210px;
		--zm2-lrc-h: 200px;
		--zm2-pad: 20px;
	}

	.zm2-player__body { min-height: 0; }

	.zm2-stage {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		gap: 22px;
		text-align: center;
	}

	.zm2-stage__info { width: 100%; }
	.zm2-meta__title { font-size: 21px; }
	.zm2-player .zm2-lrc__line { padding: 9px 0; font-size: 15px; }
	.zm2-player .zm2-lrc__line.is-active { font-size: 17px; }
	.zm2-meta__line { justify-content: center; }
	.zm2-lrc { text-align: center; }

	.zm2-player__bg-layer {
		-webkit-filter: blur(36px) saturate(1.6);
		filter: blur(36px) saturate(1.6);
	}

	.zm2-bar {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 10px 12px;
		padding-bottom: 14px;
	}

	.zm2-bar__transport {
		grid-column: 1 / -1;
		grid-row: 2;
		justify-content: center;
	}

	.zm2-bar__aside { grid-column: 2; grid-row: 1; }
	.zm2-playlist {
		top: 12px;
		bottom: 88px;
		width: min(360px, calc(100% - 12px));
		border-radius: 12px 0 0 12px;
	}
}

@container (max-width: 480px) {
	.zm2-tonearm { display: none; }
	.zm2-stage__disc { padding-top: 0; }
	.zm2-time { display: none; }
}

@media (max-width: 782px) {
	.zm2-player {
		--zm2-disc: 210px;
		--zm2-lrc-h: 200px;
		--zm2-pad: 20px;
	}

	.zm2-player__body { min-height: 0; }

	.zm2-stage {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		gap: 22px;
		text-align: center;
	}

	.zm2-stage__info { width: 100%; }
	.zm2-meta__title { font-size: 21px; }
	.zm2-player .zm2-lrc__line { padding: 9px 0; font-size: 15px; }
	.zm2-player .zm2-lrc__line.is-active { font-size: 17px; }
	.zm2-meta__line { justify-content: center; }
	.zm2-lrc { text-align: center; }

	.zm2-player__bg-layer {
		-webkit-filter: blur(36px) saturate(1.6);
		filter: blur(36px) saturate(1.6);
	}

	.zm2-bar {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 10px 12px;
	}

	.zm2-bar__transport {
		grid-column: 1 / -1;
		grid-row: 2;
		justify-content: center;
	}

	.zm2-bar__aside { grid-column: 2; grid-row: 1; }
	.zm2-playlist {
		top: 12px;
		bottom: 88px;
		width: min(360px, calc(100% - 12px));
		border-radius: 12px 0 0 12px;
	}
}

@-webkit-keyframes zm2-mobile-disc-in {
	from { opacity: 0; -webkit-transform: translate3d(0, 16px, 0) scale(.94); }
	to { opacity: 1; -webkit-transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes zm2-mobile-disc-in {
	from { opacity: 0; transform: translate3d(0, 16px, 0) scale(.94); }
	to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@-webkit-keyframes zm2-mobile-info-in {
	from { opacity: 0; -webkit-transform: translate3d(0, 10px, 0); }
	to { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}

@keyframes zm2-mobile-info-in {
	from { opacity: 0; transform: translate3d(0, 10px, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 返回唱片时换一个 animation-name，确保同一信息节点也会重新播放入场动画。 */
@-webkit-keyframes zm2-mobile-meta-in {
	from { opacity: 0; -webkit-transform: translate3d(0, 10px, 0); }
	to { opacity: 1; -webkit-transform: translate3d(0, 0, 0); }
}

@keyframes zm2-mobile-meta-in {
	from { opacity: 0; transform: translate3d(0, 10px, 0); }
	to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* 网易云式手机双视图：普通页面和全屏都默认显示唱片，点唱片切到歌词。
 * 非全屏舞台保持稳定高度，避免两个视图切换时推动整篇文章上下跳动。 */
@media (max-width: 782px) {
	.zm2-player {
		--zm2-disc: clamp(210px, min(72vw, 36dvh), 270px);
		--zm2-lrc-h: auto;
	}

	/* 进度条下方只保留一行控制键：播放列表与更多分居两端，
	 * 上一首 / 播放 / 下一首始终以播放器中心为轴，左右严格对称。 */
	.zm2-player .zm2-bar {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 68px;
		gap: 0;
		padding: 10px var(--zm2-pad) 14px;
	}

	.zm2-player .zm2-bar__now,
	.zm2-player .zm2-time {
		display: none;
	}

	.zm2-player .zm2-bar__transport {
		display: flex;
		grid-column: auto;
		grid-row: auto;
		justify-content: center;
		gap: 14px;
	}

	.zm2-player .zm2-bar__transport [data-zm2="list"] {
		position: absolute;
		left: 12px;
		left: clamp(12px, 6cqw, 20px);
		top: 50%;
		-webkit-transform: translateY(-50%);
		transform: translateY(-50%);
	}

	.zm2-player .zm2-bar__transport [data-zm2="list"]:active {
		-webkit-transform: translateY(-50%) scale(.92);
		transform: translateY(-50%) scale(.92);
	}

	.zm2-player .zm2-bar__aside {
		position: absolute;
		right: 12px;
		right: clamp(12px, 6cqw, 20px);
		top: 50%;
		display: flex;
		grid-column: auto;
		grid-row: auto;
		-webkit-transform: translateY(-50%);
		transform: translateY(-50%);
	}

	.zm2-player.is-fullscreen {
		--zm2-disc: clamp(210px, min(76vw, 40dvh), 300px);
	}

	.zm2-player .zm2-stage {
		min-height: 0;
		grid-template-rows: auto auto;
		align-content: center;
		gap: clamp(8px, 1.5dvh, 14px);
		padding: 0 var(--zm2-pad) clamp(8px, 1.5dvh, 14px);
		overflow: hidden;
	}

	.zm2-player:not(.is-fullscreen) .zm2-stage {
		flex: none;
		height: clamp(430px, 68dvh, 520px);
	}

	.zm2-player .zm2-stage__disc {
		display: block;
		width: var(--zm2-disc);
		padding-top: calc(var(--zm2-disc) * .26);
	}

	.zm2-player:not(.is-mobile-lyrics) .zm2-stage__disc {
		-webkit-animation: zm2-mobile-disc-in .42s cubic-bezier(.22, .78, .28, 1) both;
		animation: zm2-mobile-disc-in .42s cubic-bezier(.22, .78, .28, 1) both;
	}

	.zm2-player .zm2-tonearm {
		display: block;
	}

	.zm2-player .zm2-stage__info {
		align-self: auto;
		display: block;
		min-height: 0;
		padding: 0 4px;
	}

	.zm2-player:not(.is-mobile-lyrics) .zm2-lrc {
		display: none;
	}

	.zm2-player:not(.is-mobile-lyrics) .zm2-stage__info {
		margin-top: clamp(22px, 3.2dvh, 26px);
		-webkit-animation: zm2-mobile-meta-in .32s .08s ease-out both;
		animation: zm2-mobile-meta-in .32s .08s ease-out both;
	}

	.zm2-player.is-mobile-lyrics .zm2-stage {
		grid-template-rows: minmax(0, 1fr);
		align-content: stretch;
		cursor: pointer;
		outline: none;
	}

	.zm2-player.is-mobile-lyrics .zm2-stage__disc {
		display: none;
	}

	.zm2-player.is-mobile-lyrics .zm2-stage__info {
		align-self: stretch;
		display: flex;
		height: 100%;
		flex-direction: column;
		-webkit-animation: zm2-mobile-info-in .34s ease-out both;
		animation: zm2-mobile-info-in .34s ease-out both;
	}

	.zm2-player.is-mobile-lyrics .zm2-meta__title {
		font-size: clamp(22px, 6vw, 27px);
	}

	.zm2-player.is-mobile-lyrics .zm2-meta__line {
		margin-top: 10px;
	}

	.zm2-player.is-mobile-lyrics .zm2-lrc {
		display: block;
		flex: 1 1 0;
		min-height: 0;
		height: auto;
		margin-top: clamp(18px, 3dvh, 28px);
		-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
		mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
	}

	.zm2-player.is-mobile-lyrics .zm2-lrc__line {
		padding: 13px 0;
		font-size: clamp(17px, 4.6vw, 20px);
	}

	.zm2-player.is-mobile-lyrics .zm2-lrc__line.is-active {
		font-size: clamp(21px, 5.6vw, 25px);
	}

	/* 手机播放列表改为网易云式底部弹层；遮罩只覆盖当前播放器，
	 * 打开期间提升当前播放器，避免站点固定底栏反过来盖住菜单。 */
	.zm2-player.is-playlist-open {
		z-index: 9990;
	}

	body.zm2-playlist-modal-open
	.site-root-container
	.site-main-container
	.site-content {
		z-index: 990;
	}

	.zm2-player .zm2-player__body::after {
		content: '';
		position: absolute;
		inset: 0;
		z-index: 25;
		background: rgba(0, 0, 0, .58);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity .22s ease, visibility 0s linear .22s;
	}

	.zm2-player.is-playlist-open .zm2-player__body::after {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transition-delay: 0s;
	}

	.zm2-player .zm2-playlist,
	.zm2-player.is-fullscreen .zm2-playlist {
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		width: 100%;
		height: auto;
		max-height: min(72dvh, calc(100% - 56px));
		padding-top: 14px;
		background: rgba(247, 249, 252, .98);
		border: 1px solid rgba(255, 255, 255, .76);
		border-bottom: 0;
		border-radius: 24px 24px 0 0;
		-webkit-backdrop-filter: blur(22px) saturate(.9);
		backdrop-filter: blur(22px) saturate(.9);
		box-shadow: 0 -16px 46px rgba(0, 0, 0, .3);
		-webkit-transform: translate3d(0, calc(100% + 20px), 0);
		transform: translate3d(0, calc(100% + 20px), 0);
	}

	.zm2-player .zm2-playlist::before {
		content: '';
		position: absolute;
		left: 50%;
		top: 9px;
		width: 46px;
		height: 5px;
		border-radius: 999px;
		background: rgba(35, 51, 74, .14);
		-webkit-transform: translateX(-50%);
		transform: translateX(-50%);
	}

	.zm2-player .zm2-playlist.is-open,
	.zm2-player.is-fullscreen .zm2-playlist.is-open {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}

	.zm2-player .zm2-playlist__head {
		padding: 25px 22px 10px;
	}

	.zm2-player .zm2-playlist__list {
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
	}

	.zm2-player.is-fullscreen .zm2-bar {
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 480px) {
	.zm2-tonearm { display: none; }
	.zm2-stage__disc { padding-top: 0; }
	.zm2-time { display: none; }
}

/* ---------------------------------------------------------------
 * 降低动态效果
 * --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.zm2-player .zm2-disc {
		-webkit-animation: none;
		animation: none;
	}

	.zm2-player .zm2-stage__disc,
	.zm2-player .zm2-stage__info {
		-webkit-animation: none;
		animation: none;
	}

	.zm2-player .zm2-player__body::after {
		transition: none;
	}

	.zm2-player .zm2-tonearm,
	.zm2-player .zm2-lrc__inner,
	.zm2-player .zm2-player__bg-layer,
	.zm2-player .zm2-playlist,
	.zm2-player .zm2-seek__played,
	.zm2-player .zm2-seek__thumb {
		transition: none;
	}
}
