/**
 * 唱片卡片播放器组件样式 v3.0 - 简洁版
 * 设计：黑灰半透明圆角矩形卡片 + 唱片 + 音量控制 + 透视视差
 */

/* ====== 整体容器 - 加宽设计 + 透视效果 ====== */
.vinyl-card {
	position: fixed;
	top: 20px;
	left: 20px;
	z-index: 1000;
	width: 190px; /* 加宽以容纳所有控件 */
	background: rgba(30, 30, 30, 0.88);
	backdrop-filter: blur(12px);
	border-radius: 16px;
	padding: 18px; /* 增加内边距 */
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, 0.08);
	transition: all 0.3s ease;
	cursor: default;

	/* 透视视差效果 */
	transform: perspective(25em) rotateY(8deg) scale(0.95);
	transform-origin: left center;

	/* 阴影增强立体感 */
	box-shadow:
		-4px 4px 12px rgba(0, 0, 0, 0.3),
		0 8px 24px rgba(0, 0, 0, 0.2);

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px; /* 唱片和控制区域间距 */
}

.vinyl-card:hover {
	background: rgba(35, 35, 35, 0.93);
	border-color: rgba(255, 255, 255, 0.12);

	/* 悬停时调整透视角度 */
	transform: perspective(25em) rotateY(5deg) scale(0.97);

	box-shadow:
		-2px 2px 8px rgba(0, 0, 0, 0.25),
		0 10px 32px rgba(0, 0, 0, 0.25);
}

/* ====== 唱片区域 - 适配紧凑布局 ====== */
.vinyl-disc-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	margin-bottom: 0; /* 移除底部margin，使用gap控制间距 */
}

.vinyl-disc {
	width: 120px; /* 缩小唱片尺寸 */
	height: 120px;
	border-radius: 50%;
	overflow: hidden;
	position: relative;
	animation: vinyl-spin 8s linear infinite;
	animation-play-state: paused;
	background: transparent; /* 无黑色背景 */
	border: 2px solid rgba(32, 201, 184, 0.5); /* 青色主题色边框 */
	outline: none;
	cursor: pointer; /* 添加指针样式提示可点击 */

	/* 确保可点击 */
	pointer-events: auto !important;
	z-index: 9999 !important; /* 提升到最高层级 */
	user-select: none;
	-webkit-user-select: none;

	/* 悬停效果（调试用） */
	transition: all 0.2s ease;
}

.vinyl-disc:hover {
	border-color: rgba(32, 201, 184, 1); /* 悬停时青色高亮 */
	transform: scale(1.05);
	box-shadow: 0 0 16px rgba(32, 201, 184, 0.4); /* 青色光晕 */
}

/* 播放时旋转 */
.vinyl-card.is-playing .vinyl-disc {
	animation-play-state: running;
}

.vinyl-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

/* 中心圆点 - 适配小唱片 */
.vinyl-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 24px; /* 随唱片缩小 */
	height: 24px;
	background: radial-gradient(circle, #444 0%, #222 70%, #1a1a1a 100%);
	border-radius: 50%;
	z-index: 2;
	border: 2px solid rgba(255, 255, 255, 0.15);
}

/* 播放状态指示器（三个小竖条） */
.play-indicator {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 14px;
	margin-top: 10px;
	opacity: 0.5;
	transition: opacity 0.3s ease;
}

.vinyl-card.is-playing .play-indicator {
	opacity: 1;
}

.play-indicator span {
	width: 3px;
	background: #fff;
	border-radius: 2px;
	animation: sound-wave 0.8s ease-in-out infinite;
}

.play-indicator span:nth-child(1) {
	height: 6px;
	animation-delay: 0s;
}

.play-indicator span:nth-child(2) {
	height: 12px;
	animation-delay: 0.2s;
}

.play-indicator span:nth-child(3) {
	height: 8px;
	animation-delay: 0.4s;
}

@keyframes sound-wave {
	0%, 100% {
		transform: scaleY(1);
	}
	50% {
		transform: scaleY(0.5);
	}
}

/* ====== 信息卡片区域 ====== */
.vinyl-info-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* 歌曲信息 */
.song-info {
	text-align: center;
}

.song-title {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: 0.3px;
}

.song-artist {
	color: #999;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: 0.2px;
}

/* ====== 控制区域 - 确保不裁剪 ====== */
.vinyl-controls {
	display: flex;
	align-items: center;
	justify-content: center; /* 居中对齐 */
	gap: 8px; /* 适当间距 */
	padding: 2px; /* 小内边距防止贴边 */
	margin: 0;
	width: auto; /* 自动宽度，不强制100% */
	box-sizing: border-box;
	/* 移除 overflow: hidden，允许内容自然显示 */
}

/* 静音按钮 - 确保不被裁剪（合并后的唯一定义） */
.btn-mute {
	background: none;
	border: none;
	color: #aaa;
	cursor: pointer;
	padding: 8px; /* 增加padding确保可见 */
	border-radius: 6px;
	transition: all 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0; /* 不压缩 */
	min-width: 32px; /* 最小宽度确保图标完整显示 */
	height: 32px; /* 固定高度 */
}

.btn-mute:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}

.btn-mute svg {
	display: block;
	width: 18px;
	height: 18px;
	transition: all 0.25s ease;
}

.btn-mute.is-muted,
.btn-mute:active {
	color: #ff6b6b;
}

/* 音量滑块 - 线性细条风格 */
.volume-slider {
	flex: 1;
	height: 3px;
	-webkit-appearance: none;
	appearance: none;
	background: rgba(255, 255, 255, 0.12);
	outline: none;
	border-radius: 2px;
	cursor: pointer;
	border: none;
}

.volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 11px;
	height: 11px;
	background: #fff;
	border-radius: 50%;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-thumb:hover {
	background: #20c9b8;
	transform: scale(1.15);
}

.volume-slider::-moz-range-thumb {
	width: 11px;
	height: 11px;
	background: #fff;
	border-radius: 50%;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb:hover {
	background: #20c9b8;
	transform: scale(1.15);
}

.volume-slider::-moz-range-track {
	height: 3px;
	background: rgba(255, 255, 255, 0.12);
	border-radius: 2px;
	border: none;
}

/* ====== 旋转动画 ====== */
@keyframes vinyl-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* ====== 响应式设计 ====== */
@media (max-width: 768px) {
	.vinyl-card {
		top: 10px;
		left: 10px;
		width: 170px;
		padding: 14px;
	}

	.vinyl-disc {
		width: 110px;
		height: 110px;
	}

	.vinyl-center {
		width: 22px;
		height: 22px;
	}

	.song-title {
		font-size: 14px;
	}

	.song-artist {
		font-size: 12px;
	}
}

/* ====== 减少动画模式 ====== */
@media (prefers-reduced-motion: reduce) {
	.vinyl-disc {
		animation: none;
	}

	.play-indicator span {
		animation: none;
	}

	.vinyl-card {
		transition: none;
	}
}