/* ========================================
   自定义头像旋转 Loading 样式
   ======================================== */

/* 隐藏 inactive 状态 */
.pace.pace-inactive {
	display: none;
}

/* Pace 容器 - 全屏遮罩 */
.pace {
	-webkit-pointer-events: none;
	pointer-events: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;

	z-index: 9999;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);

	display: flex;
	align-items: center;
	justify-content: center;
}

/* 深色模式 */
[data-theme='dark'] .pace {
	background: rgba(20, 20, 20, 0.3);
}

/* 加载容器 */
.pace .pace-progress {
	position: relative;
	width: 200px;
	height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;

	-webkit-transform: translate3d(0, 0, 0) !important;
	-ms-transform: translate3d(0, 0, 0) !important;
	transform: translate3d(0, 0, 0) !important;
}

/* 头像容器 */
.pace .pace-progress::before {
	content: '';
	position: absolute;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: url('/img/avatar.png') center/cover;
	box-shadow: 0 0 60px rgba(102, 126, 234, 0.4);
	z-index: 10;
	animation: avatarPulse 2s ease-in-out infinite;
}

/* 旋转外圈 1 */
.pace .pace-progress::after {
	content: '';
	position: absolute;
	width: 160px;
	height: 160px;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: #667eea;
	border-right-color: #764ba2;
	animation: spin 1.5s linear infinite;
	box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

/* 内圈旋转环 */
.pace .pace-activity {
	position: absolute;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	border: 3px solid transparent;
	border-bottom-color: rgba(102, 126, 234, 0.6);
	border-left-color: rgba(118, 75, 162, 0.6);
	animation: spin 2s linear infinite reverse;
}

/* 外层装饰圈 */
.pace .pace-activity:before {
	content: '';
	position: absolute;
	top: -20px;
	left: -20px;
	right: -20px;
	bottom: -20px;
	border-radius: 50%;
	border: 2px dashed rgba(102, 126, 234, 0.3);
	animation: spin 8s linear infinite;
}

/* 脉冲光晕效果 */
.pace .pace-activity:after {
	content: '';
	position: absolute;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
	animation: pulse 2s ease-in-out infinite;
}

/* 旋转动画 */
@-webkit-keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@-moz-keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@-o-keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* 脉冲动画 */
@-webkit-keyframes pulse {
	0%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.2);
		opacity: 0.8;
	}
}

@-moz-keyframes pulse {
	0%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.2);
		opacity: 0.8;
	}
}

@-o-keyframes pulse {
	0%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.2);
		opacity: 0.8;
	}
}

@keyframes pulse {
	0%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	50% {
		transform: scale(1.2);
		opacity: 0.8;
	}
}

/* 头像脉冲动画 */
@-webkit-keyframes avatarPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 60px rgba(102, 126, 234, 0.4);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 0 80px rgba(102, 126, 234, 0.6);
	}
}

@-moz-keyframes avatarPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 60px rgba(102, 126, 234, 0.4);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 0 80px rgba(102, 126, 234, 0.6);
	}
}

@-o-keyframes avatarPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 60px rgba(102, 126, 234, 0.4);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 0 80px rgba(102, 126, 234, 0.6);
	}
}

@keyframes avatarPulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 0 60px rgba(102, 126, 234, 0.4);
	}
	50% {
		transform: scale(1.05);
		box-shadow: 0 0 80px rgba(102, 126, 234, 0.6);
	}
}

/* 加载文字提示 */
.pace .pace-progress-text {
	position: absolute;
	bottom: -40px;
	left: 50%;
	transform: translateX(-50%);
	color: #667eea;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 2px;
	white-space: nowrap;
	animation: textFade 1.5s ease-in-out infinite;
}

[data-theme='dark'] .pace .pace-progress-text {
	color: #a78bfa;
}

@keyframes textFade {
	0%, 100% {
		opacity: 0.6;
	}
	50% {
		opacity: 1;
	}
}

/* 粒子装饰 */
.pace .loading-particles {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	pointer-events: none;
	overflow: hidden;
}

.pace .loading-particles::before,
.pace .loading-particles::after {
	content: '';
	position: absolute;
	width: 6px;
	height: 6px;
	background: linear-gradient(135deg, #667eea, #764ba2);
	border-radius: 50%;
	animation: orbit 3s linear infinite;
}

.pace .loading-particles::before {
	top: 20%;
	left: 20%;
	animation-delay: 0s;
}

.pace .loading-particles::after {
	top: 20%;
	right: 20%;
	animation-delay: 1.5s;
}

@keyframes orbit {
	0% {
		transform: rotate(0deg) translateX(100px) rotate(0deg);
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	90% {
		opacity: 1;
	}
	100% {
		transform: rotate(360deg) translateX(100px) rotate(-360deg);
		opacity: 0;
	}
}
