/**
 * 登录/注册成功等轻庆祝提示（全站可复用）
 */
.wb-celebrate {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
		max(28px, env(safe-area-inset-bottom, 12px)) max(20px, env(safe-area-inset-left, 0px));
	box-sizing: border-box;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.wb-celebrate--visible {
	opacity: 1;
}

.wb-celebrate__backdrop {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 85% 65% at 50% 42%, rgba(15, 23, 42, 0.52) 0%, rgba(15, 23, 42, 0.28) 52%, rgba(15, 23, 42, 0.08) 100%);
	pointer-events: none;
}

.wb-celebrate__card {
	position: relative;
	max-width: 300px;
	width: 100%;
	padding: 28px 24px 26px;
	border-radius: 20px;
	background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
	box-shadow:
		0 25px 50px -12px rgba(0, 0, 0, 0.22),
		0 0 0 1px rgba(255, 255, 255, 0.8) inset;
	text-align: center;
	transform: scale(0.88) translateY(12px);
	opacity: 0;
	transition:
		transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1),
		opacity 0.4s ease;
	pointer-events: auto;
}

.wb-celebrate--visible .wb-celebrate__card {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.wb-celebrate__icon-wrap {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: linear-gradient(135deg, #34d399 0%, #10b981 45%, #059669 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 12px 28px rgba(16, 185, 129, 0.45);
	animation: wb-celebrate-icon-pop 0.55s cubic-bezier(0.34, 1.45, 0.64, 1) 0.08s both;
}

.wb-celebrate__icon {
	width: 34px;
	height: 34px;
	color: #fff;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.wb-celebrate__icon path {
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: wb-celebrate-draw 0.5s ease forwards 0.35s;
}

.wb-celebrate__icon-wrap--avatar {
	width: 48px;
	height: 48px;
	background: transparent;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	padding: 0;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.95);
}

.wb-celebrate__avatar {
	display: block;
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 50%;
}

.wb-celebrate__title {
	margin: 0 0 8px;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #0f172a;
	line-height: 1.3;
}

.wb-celebrate__msg {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: #64748b;
}

.wb-celebrate__spark {
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
}

.wb-celebrate__spark--1 {
	top: 18%;
	left: 12%;
	background: #fbbf24;
	animation: wb-celebrate-spark 0.8s ease-out 0.2s both;
}

.wb-celebrate__spark--2 {
	top: 22%;
	right: 14%;
	background: #60a5fa;
	animation: wb-celebrate-spark 0.75s ease-out 0.35s both;
}

.wb-celebrate__spark--3 {
	bottom: 20%;
	left: 18%;
	background: #a78bfa;
	animation: wb-celebrate-spark 0.7s ease-out 0.45s both;
}

@keyframes wb-celebrate-icon-pop {
	from {
		transform: scale(0.6);
		opacity: 0.5;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes wb-celebrate-draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes wb-celebrate-spark {
	0% {
		transform: scale(0);
		opacity: 0;
	}
	40% {
		opacity: 1;
		transform: scale(1);
	}
	100% {
		transform: scale(0.3) translateY(-8px);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wb-celebrate,
	.wb-celebrate__card,
	.wb-celebrate__icon-wrap,
	.wb-celebrate__icon path,
	.wb-celebrate__spark {
		animation: none !important;
		transition: opacity 0.2s ease !important;
	}
	.wb-celebrate--visible .wb-celebrate__card {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
	.wb-celebrate__icon path {
		stroke-dashoffset: 0;
	}
}

/* 手机等小屏：蒙层与卡片对比更强、图标与文案更大，庆祝感更明显（室外屏也能看清） */
@keyframes wb-celebrate-spark-mobile {
	0% {
		transform: translateZ(0) scale(0);
		opacity: 0;
	}
	28% {
		opacity: 1;
		transform: translateZ(0) scale(1.12);
	}
	55% {
		opacity: 1;
		transform: translateZ(0) scale(1) translateY(-6px);
	}
	100% {
		transform: translateZ(0) scale(0.5) translateY(-32px);
		opacity: 0;
	}
}

@media (max-width: 520px) {
	.wb-celebrate__backdrop {
		background:
			radial-gradient(ellipse 100% 75% at 50% 38%, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.45) 48%, rgba(15, 23, 42, 0.2) 100%);
	}

	.wb-celebrate__card {
		max-width: min(340px, calc(100vw - 32px));
		padding: 32px 26px 30px;
		border-radius: 22px;
		box-shadow:
			0 28px 56px -10px rgba(0, 0, 0, 0.38),
			0 0 0 1px rgba(255, 255, 255, 0.72) inset,
			0 0 0 4px rgba(255, 255, 255, 0.12);
	}

	.wb-celebrate__icon-wrap:not(.wb-celebrate__icon-wrap--avatar) {
		width: 82px;
		height: 82px;
		margin-bottom: 18px;
		box-shadow: 0 14px 36px rgba(16, 185, 129, 0.55);
	}

	.wb-celebrate__icon-wrap--avatar {
		width: 60px;
		height: 60px;
		margin-bottom: 18px;
		box-shadow: 0 14px 36px rgba(15, 23, 42, 0.24);
	}

	.wb-celebrate__icon {
		width: 42px;
		height: 42px;
		stroke-width: 2.75;
	}

	.wb-celebrate__avatar {
		width: 60px;
		height: 60px;
	}

	.wb-celebrate__title {
		font-size: clamp(1.25rem, 4.8vw, 1.45rem);
		margin-bottom: 10px;
		color: #020617;
	}

	.wb-celebrate__msg {
		font-size: 16px;
		line-height: 1.55;
		color: #475569;
	}

	.wb-celebrate__spark {
		width: 14px;
		height: 14px;
		transform: translateZ(0);
		-webkit-transform: translateZ(0);
		/* iOS Safari：多层 box-shadow 比 filter:drop-shadow 更明显 */
		filter: none;
		box-shadow:
			0 0 0 2px rgba(255, 255, 255, 0.95),
			0 0 16px 6px rgba(251, 191, 36, 0.85),
			0 0 36px 14px rgba(251, 191, 36, 0.45);
	}

	.wb-celebrate__spark--2 {
		box-shadow:
			0 0 0 2px rgba(255, 255, 255, 0.92),
			0 0 16px 6px rgba(96, 165, 250, 0.92),
			0 0 38px 14px rgba(96, 165, 250, 0.48);
	}

	.wb-celebrate__spark--3 {
		box-shadow:
			0 0 0 2px rgba(255, 255, 255, 0.92),
			0 0 16px 6px rgba(167, 139, 250, 0.92),
			0 0 38px 14px rgba(167, 139, 250, 0.48);
	}

	.wb-celebrate__spark--1 {
		animation: wb-celebrate-spark-mobile 1.35s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
	}

	.wb-celebrate__spark--2 {
		animation: wb-celebrate-spark-mobile 1.32s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
	}

	.wb-celebrate__spark--3 {
		animation: wb-celebrate-spark-mobile 1.28s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
	}
}
