/* ==========================================================
 * hm-loading.css — Heel Miss 统一加载动效（黑金主题）
 * 用法：
 *   <div class="hm-loading" v-if="loading">
 *     <div class="hm-spinner"><span></span><span></span></div>
 *     <div class="hm-loading-text">加载中…</div>
 *   </div>
 * 注意：父容器必须 position:relative（遮罩按 inset:0 铺满）
 * ========================================================== */

.hm-loading {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	background: rgba(0, 0, 0, 0.35);
	pointer-events: none; /* 纯装饰层，不拦截手势 */
}

/* 深色场景（黑底视频区）用更实的底 */
.hm-loading--dark {
	background: rgba(0, 0, 0, 0.55);
}

.hm-spinner {
	position: relative;
	width: 1rem;
	height: 1rem;
}

.hm-spinner span {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 0.06rem solid transparent;
}

/* 外环：金色实弧，顺时针 */
.hm-spinner span:first-child {
	border-top-color: #f4aa2a;
	border-right-color: #f4aa2a;
	animation: hmSpin 0.9s linear infinite;
}

/* 内环：半透金弧，逆时针 */
.hm-spinner span:last-child {
	inset: 0.14rem;
	border-bottom-color: rgba(244, 170, 42, 0.45);
	animation: hmSpin 1.4s linear infinite reverse;
}

/* 小尺寸（集锦 cell 等小面积场景） */
.hm-spinner--sm {
	width: 0.72rem;
	height: 0.72rem;
}

.hm-spinner--sm span:last-child {
	inset: 0.1rem;
}

@keyframes hmSpin {
	to { transform: rotate(360deg); }
}

.hm-loading-text {
	font-size: 0.26rem;
	color: #f4aa2a;
	letter-spacing: 0.04rem;
	font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================
 * 骨架屏：首页列表加载占位（YouTube 式 shimmer 流光）
 * ========================================================== */
.hm-skel-card {
	pointer-events: none;
	user-select: none;
}
.hm-skel-cover {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 5.6rem;
	background: #1d1d1f;
	border-radius: 0.1rem;
}
.hm-skel-meta {
	padding: 0.14rem 0.02rem 0;
}
.hm-skel-line {
	position: relative;
	overflow: hidden;
	height: 0.16rem;
	margin-top: 0.14rem;
	background: #1d1d1f;
	border-radius: 0.08rem;
}
/* 流光扫过动画（占位块共用 ::after 叠加层） */
.hm-skel-cover::after,
.hm-skel-line::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.055) 50%, rgba(255, 255, 255, 0) 65%);
	background-size: 200% 100%;
	background-position: 200% 0;
	animation: hmShimmer 1.4s linear infinite;
}
@keyframes hmShimmer {
	from { background-position: 200% 0; }
	to { background-position: -200% 0; }
}

/* ==========================================================
 * 首页列表封面渐进淡入（图加载完成才显形，深色底防白闪）
 * ========================================================== */
.cell-cover {
	display: block;
	background: #1d1d1f;
}
.cell-cover img {
	opacity: 0;
	/* transform 参与 transition：点击瞬间封面随 .video-cell:active 缩放，松开回弹（按压反馈） */
	transition: opacity 0.5s ease, transform 0.15s ease;
}
.cell-cover img.is-loaded {
	opacity: 1;
}

/* 图片独立加载占位（与文字/列表动效解耦）：真卡片渲染后、图片尚未 onload 期间，
   图片区域不再裸黑——深灰底 + 微光扫过（复用骨架屏 hmShimmer 语言），
   onload/error 加 is-loaded 后此背景随 opacity 淡入一起退出 */
.cell-cover img:not(.is-loaded) {
	background-color: #1d1d1f;
	background-image: linear-gradient(100deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.055) 50%, rgba(255, 255, 255, 0) 65%);
	background-size: 200% 100%;
	background-position: 200% 0;
	animation: hmShimmer 1.4s linear infinite;
}

/* 按压反馈：按住卡片时封面轻微缩放，松开回弹——让用户明确感知「点上了」
 * 注意：播放中的集锦视频不加按压缩放——第二下点击即跳详情页，
 * 按下瞬间画面缩 4% 会被完整看到，像 glitch（2026-11-06 用户实报） */
.video-room .videos-space .video-cell:active .cell-cover img {
	transform: scale(0.96);
}

/* ==========================================================
 * 首页卡片 stagger 上浮入场（数据回来逐条渐显）
 * ========================================================== */
@keyframes hmFadeUp {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}
.video-box.hm-fade-up {
	animation: hmFadeUp 0.45s ease-out both;
}
