.hmp-panel {
	--hmp-accent: #f48fb1;
	--hmp-surface: rgba(255, 255, 255, 0.76);
	--hmp-surface-strong: rgba(255, 255, 255, 0.9);
	--hmp-text: #2c3338;
	--hmp-muted: #646970;
	--hmp-line: rgba(44, 51, 56, 0.16);
	position: fixed;
	width: var(--hmp-expanded-width, 320px);
	z-index: 10000;
	overflow: visible;
	color: var(--hmp-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.16));
	isolation: isolate;
}

.hmp-panel.hmp-is-collapsed {
	width: 78px;
	cursor: grab;
}

.hmp-panel.hmp-is-collapsed.hmp-is-dragging {
	cursor: grabbing;
}

.hmp-panel.hmp-is-collapsed .hmp-drag-handle {
	position: absolute;
	top: -6px;
	right: -6px;
	z-index: 6;
	width: 28px;
	min-height: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	cursor: default;
	pointer-events: none;
}

.hmp-panel.hmp-is-collapsed .hmp-identity,
.hmp-panel.hmp-is-collapsed .hmp-volume-button,
.hmp-panel.hmp-is-collapsed .hmp-volume-slider,
.hmp-panel.hmp-is-collapsed .hmp-reset-button {
	display: none;
}

.hmp-panel.hmp-is-collapsed .hmp-header-controls {
	display: block;
	pointer-events: none;
}

.hmp-panel.hmp-is-collapsed .hmp-collapse-button {
	width: 28px;
	height: 28px;
	padding: 6px;
	color: var(--hmp-text);
	background: var(--hmp-surface-strong);
	border-color: var(--hmp-line);
	border-radius: 50%;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
	pointer-events: auto;
}

.hmp-panel.hmp-is-collapsed .hmp-aplayer,
.hmp-panel.hmp-is-collapsed .aplayer,
.hmp-panel.hmp-is-collapsed .aplayer-body {
	width: 78px;
	height: 78px;
	border-radius: 50%;
}

.hmp-panel.hmp-is-collapsed .aplayer {
	overflow: visible;
	background: var(--hmp-surface);
	border: 1px solid var(--hmp-line);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.hmp-panel.hmp-is-collapsed .aplayer-info,
.hmp-panel.hmp-is-collapsed .aplayer-list,
.hmp-panel.hmp-is-collapsed .aplayer-notice {
	display: none !important;
}

.hmp-panel.hmp-is-collapsed .aplayer-pic {
	float: none !important;
	width: 68px;
	height: 68px;
	margin: 4px;
	cursor: grab;
}

.hmp-panel.hmp-is-collapsed.hmp-is-dragging .aplayer-pic {
	cursor: grabbing;
}

.hmp-panel,
.hmp-panel .hmp-aplayer,
.hmp-panel .aplayer,
.hmp-panel .aplayer-pic {
	transition:
		width 180ms ease,
		height 180ms ease,
		margin 180ms ease,
		border-radius 180ms ease;
}

.hmp-panel *,
.hmp-panel *::before,
.hmp-panel *::after {
	box-sizing: border-box;
}

.hmp-drag-handle {
	position: relative;
	z-index: 3;
	min-height: 38px;
	padding: 7px 9px 7px 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--hmp-text);
	background: var(--hmp-surface);
	border: 1px solid var(--hmp-line);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(14px) saturate(115%);
	-webkit-backdrop-filter: blur(14px) saturate(115%);
	cursor: grab;
	user-select: none;
	touch-action: none;
}

.hmp-is-dragging .hmp-drag-handle {
	cursor: grabbing;
}

.hmp-identity,
.hmp-header-controls {
	display: flex;
	align-items: center;
}

.hmp-identity {
	min-width: 0;
	gap: 8px;
}

.hmp-identity strong {
	overflow: hidden;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hmp-identity__icon,
.hmp-control {
	display: grid;
	place-items: center;
}

.hmp-identity__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--hmp-accent);
}

.hmp-panel svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hmp-header-controls {
	flex: 0 0 auto;
	gap: 6px;
}

.hmp-control {
	width: 25px;
	height: 25px;
	margin: 0;
	padding: 5px;
	color: var(--hmp-muted);
	background: rgba(255, 255, 255, 0.28);
	border: 1px solid var(--hmp-line);
	border-radius: 5px;
	box-shadow: none;
	cursor: pointer;
}

.hmp-control:hover,
.hmp-control:focus-visible {
	color: var(--hmp-accent);
	background: var(--hmp-surface-strong);
	border-color: var(--hmp-accent);
	outline: none;
}

.hmp-volume-slider {
	--hmp-volume-percent: 50%;
	width: 58px;
	height: 18px;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	touch-action: auto;
}

.hmp-volume-slider::-webkit-slider-runnable-track {
	height: 3px;
	background: linear-gradient(
		90deg,
		var(--hmp-accent) 0,
		var(--hmp-accent) var(--hmp-volume-percent),
		var(--hmp-line) var(--hmp-volume-percent)
	);
	border-radius: 999px;
}

.hmp-volume-slider::-webkit-slider-thumb {
	width: 12px;
	height: 12px;
	margin-top: -4.5px;
	background: var(--hmp-surface-strong);
	border: 2px solid var(--hmp-accent);
	border-radius: 50%;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.hmp-volume-slider::-moz-range-track {
	height: 3px;
	background: var(--hmp-line);
	border-radius: 999px;
}

.hmp-volume-slider::-moz-range-progress {
	height: 3px;
	background: var(--hmp-accent);
	border-radius: 999px;
}

.hmp-volume-slider::-moz-range-thumb {
	width: 10px;
	height: 10px;
	background: var(--hmp-surface-strong);
	border: 2px solid var(--hmp-accent);
	border-radius: 50%;
	box-shadow: none;
}

.hmp-panel .aplayer {
	margin: 0;
	overflow: visible;
	color: var(--hmp-text);
	background: var(--hmp-surface);
	border: 1px solid var(--hmp-line);
	border-top: 0;
	border-radius: 0 0 10px 10px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
	backdrop-filter: blur(14px) saturate(115%);
	-webkit-backdrop-filter: blur(14px) saturate(115%);
}

.hmp-panel .aplayer-body {
	border-radius: 0 0 10px 10px;
}

.hmp-panel .aplayer-info {
	border-bottom-color: var(--hmp-line);
}

.hmp-panel .aplayer-title {
	color: var(--hmp-text);
	font-weight: 600;
}

.hmp-panel .aplayer-author,
.hmp-panel .aplayer-time,
.hmp-panel .aplayer-list-index,
.hmp-panel .aplayer-list-author {
	color: var(--hmp-muted) !important;
}

.hmp-panel .aplayer-icon {
	color: var(--hmp-muted);
}

.hmp-panel .aplayer-icon path {
	fill: var(--hmp-muted);
}

.hmp-panel .aplayer-icon:hover path {
	fill: var(--hmp-accent) !important;
}

/* 使用插件自己的横向音量控件，避免 APlayer 旧音量弹层失效。 */
.hmp-panel .aplayer-volume-wrap {
	display: none !important;
}

.hmp-panel .aplayer-pic {
	position: relative;
	margin: 9px 0 9px 9px;
	width: 66px;
	height: 66px;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.72);
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--hmp-line);
	transform: none !important;
	animation: none !important;
}

/* APlayer 默认把暂停键放在右下角；播放和暂停都强制固定在封面正中央。 */
.hmp-panel .aplayer-pic .aplayer-button.aplayer-play,
.hmp-panel .aplayer-pic .aplayer-button.aplayer-pause {
	top: 50% !important;
	left: 50% !important;
	right: auto !important;
	bottom: auto !important;
	width: 30px !important;
	height: 30px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, 0.92) !important;
	background: rgba(20, 20, 24, 0.42) !important;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2) !important;
	transform: translate(-50%, -50%) !important;
	animation: none !important;
}

.hmp-panel .aplayer-pic .aplayer-button.aplayer-play svg,
.hmp-panel .aplayer-pic .aplayer-button.aplayer-pause svg {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	width: 18px !important;
	height: 18px !important;
	transform: translate(-50%, -50%) !important;
	animation: none !important;
}

.hmp-panel .aplayer-pic .aplayer-button.aplayer-play svg {
	margin-left: 1px;
}

.hmp-panel.hmp-is-playing .aplayer-pic {
	box-shadow:
		0 0 0 1px var(--hmp-accent),
		0 0 0 4px color-mix(in srgb, var(--hmp-accent) 18%, transparent);
}

.hmp-panel .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {
	background: var(--hmp-line);
}

.hmp-panel .aplayer-loaded {
	background: color-mix(in srgb, var(--hmp-accent) 28%, transparent) !important;
}

.hmp-panel .aplayer-played,
.hmp-panel .aplayer-thumb,
.hmp-panel .aplayer-list-cur {
	background: var(--hmp-accent) !important;
}

.hmp-panel .aplayer-list {
	overflow: hidden;
	color: var(--hmp-text);
	background: var(--hmp-surface-strong);
	border-color: var(--hmp-line);
	border-radius: 0 0 10px 10px;
	backdrop-filter: blur(14px) saturate(115%);
	-webkit-backdrop-filter: blur(14px) saturate(115%);
}

.hmp-panel .aplayer-list ol {
	scrollbar-color: var(--hmp-accent) transparent;
	scrollbar-width: thin;
}

.hmp-panel .aplayer-list li {
	height: 35px;
	line-height: 35px;
	border-top-color: var(--hmp-line);
}

.hmp-panel .aplayer-list li:hover,
.hmp-panel .aplayer-list li.aplayer-list-light {
	background: color-mix(in srgb, var(--hmp-accent) 10%, transparent);
}

.hmp-panel .aplayer-list-title {
	color: var(--hmp-text);
}

.hmp-panel .aplayer-notice {
	color: #fff;
	background: var(--hmp-accent);
}

html.darkmode .hmp-panel {
	--hmp-surface: rgba(24, 24, 30, 0.72);
	--hmp-surface-strong: rgba(24, 24, 30, 0.9);
	--hmp-text: #f0f0f1;
	--hmp-muted: #b8bcc2;
	--hmp-line: rgba(255, 255, 255, 0.16);
	filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34));
}

html.darkmode .hmp-control {
	background: rgba(255, 255, 255, 0.06);
}

@supports not (color: color-mix(in srgb, #000 50%, #fff)) {
	.hmp-panel.hmp-is-playing .aplayer-pic {
		box-shadow: 0 0 0 2px var(--hmp-accent);
	}

	.hmp-panel .aplayer-loaded {
		opacity: 0.3;
		background: var(--hmp-accent) !important;
	}

	.hmp-panel .aplayer-list li:hover,
	.hmp-panel .aplayer-list li.aplayer-list-light {
		background: rgba(127, 127, 127, 0.12);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmp-panel,
	.hmp-panel .hmp-aplayer,
	.hmp-panel .aplayer,
	.hmp-panel .aplayer-pic {
		transition: none;
	}
}

@media (max-width: 768px) {
	.hmp-panel {
		max-width: calc(100vw - 16px);
	}

	.hmp-volume-slider {
		width: 48px;
	}

	.hmp-identity strong {
		max-width: 92px;
	}
}