/* 语音评论：按住说话面板 + 气泡播放 */

.b2-voice-bubble {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 96px;
	max-width: 220px;
	margin: 4px 0 6px;
	padding: 8px 12px;
	border: 0;
	border-radius: 18px;
	background: linear-gradient(135deg, #f3e6d8 0%, #e8d2bc 100%);
	color: #3b2a1c;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	box-shadow: inset 0 0 0 1px rgba(90, 60, 30, 0.08);
}

.b2-voice-bubble.is-playing {
	background: linear-gradient(135deg, #e8c9a8 0%, #d9b48f 100%);
}

.b2-voice-bubble__ico {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: #5c3d28;
	position: relative;
}

.b2-voice-bubble__ico::before {
	content: "";
	position: absolute;
	left: 6px;
	top: 4px;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent #fff7ee;
}

.b2-voice-bubble.is-playing .b2-voice-bubble__ico::before {
	left: 5px;
	top: 4px;
	width: 3px;
	height: 10px;
	border: 0;
	background: #fff7ee;
	box-shadow: 5px 0 0 #fff7ee;
}

.b2-voice-bubble__wave {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 14px;
	flex: 1 1 auto;
}

.b2-voice-bubble__wave i {
	display: block;
	width: 2px;
	height: 6px;
	border-radius: 1px;
	background: rgba(92, 61, 40, 0.55);
}

.b2-voice-bubble__wave i:nth-child(1) { height: 6px; }
.b2-voice-bubble__wave i:nth-child(2) { height: 11px; }
.b2-voice-bubble__wave i:nth-child(3) { height: 8px; }
.b2-voice-bubble__wave i:nth-child(4) { height: 13px; }

.b2-voice-bubble.is-playing .b2-voice-bubble__wave i {
	animation: b2-voice-wave 0.7s ease-in-out infinite;
}
.b2-voice-bubble.is-playing .b2-voice-bubble__wave i:nth-child(2) { animation-delay: 0.1s; }
.b2-voice-bubble.is-playing .b2-voice-bubble__wave i:nth-child(3) { animation-delay: 0.2s; }
.b2-voice-bubble.is-playing .b2-voice-bubble__wave i:nth-child(4) { animation-delay: 0.3s; }

@keyframes b2-voice-wave {
	0%, 100% { transform: scaleY(0.55); }
	50% { transform: scaleY(1); }
}

.b2-voice-bubble__dur {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

/* 按住说话入口（评论抽屉 / 底栏） */
.b2-voice-hold-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 14px;
	border: 0;
	border-radius: 20px;
	background: #5c3d28;
	color: #fff8f0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	touch-action: none;
}

.b2-voice-hold-btn:active,
.b2-voice-hold-btn.is-holding {
	background: #3f291b;
}

.b2-m-comment-bar__voice {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin-right: 6px;
	border: 0;
	border-radius: 50%;
	background: #5c3d28;
	color: #fff8f0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
}

.b2-m-comment-bar__voice::before {
	content: "";
	width: 14px;
	height: 18px;
	border: 2px solid currentColor;
	border-radius: 8px;
	box-sizing: border-box;
	box-shadow: 0 6px 0 -4px currentColor, 0 8px 0 -5px currentColor;
	position: relative;
}

.b2-voice-compose-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px 12px;
}

.b2-voice-compose-row .b2-voice-hold-btn {
	flex: 1 1 auto;
	width: 100%;
}

/* 全屏录音层 */
.b2-voice-overlay {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(20, 12, 8, 0.45);
	padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
}

.b2-voice-overlay[hidden] {
	display: none !important;
}

.b2-voice-overlay__panel {
	width: min(420px, 100%);
	padding: 22px 18px 20px;
	border-radius: 20px 20px 16px 16px;
	background: #fff8f1;
	text-align: center;
	box-shadow: 0 -8px 32px rgba(40, 20, 10, 0.18);
}

.b2-voice-overlay__hint {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 600;
	color: #3b2a1c;
}

.b2-voice-overlay__timer {
	margin: 0 0 16px;
	font-size: 28px;
	font-variant-numeric: tabular-nums;
	color: #5c3d28;
	letter-spacing: 0.04em;
}

.b2-voice-overlay__pad {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #7a5238, #5c3d28 70%);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	box-shadow: 0 10px 24px rgba(60, 35, 20, 0.28);
}

.b2-voice-overlay.is-recording .b2-voice-overlay__pad {
	animation: b2-voice-pulse 1.1s ease-in-out infinite;
}

.b2-voice-overlay.is-cancel .b2-voice-overlay__pad {
	background: radial-gradient(circle at 35% 30%, #c45a4a, #8b3a2f 70%);
	animation: none;
}

@keyframes b2-voice-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 10px 24px rgba(60, 35, 20, 0.28); }
	50% { transform: scale(1.06); box-shadow: 0 12px 28px rgba(60, 35, 20, 0.38); }
}

.b2-voice-overlay__tip {
	margin: 0;
	font-size: 12px;
	color: rgba(59, 42, 28, 0.65);
}

.b2-voice-overlay.is-cancel .b2-voice-overlay__hint,
.b2-voice-overlay.is-cancel .b2-voice-overlay__tip {
	color: #8b3a2f;
}

/* 声场 Vue 气泡 */
.topic-comment-text .b2-voice-bubble,
.comment-content-text .b2-voice-bubble {
	vertical-align: middle;
}

/* Shorts 侧栏语音入口 */
.shorts-meta__voice {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	padding: 8px 10px;
	margin-bottom: 10px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 248, 240, 0.92);
	color: #3b2a1c;
	font-size: 12px;
	font-weight: 700;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

@media (min-width: 769px) {
	.b2-m-comment-bar__voice {
		display: none;
	}
}
