/* ===================================================================
   推特式沉浸播放器 imv-player.css
   单击时间线视频 → 全屏沉浸播放，上下切换、点赞/评论/转发/分享、返回
   颜色全部走系统主题变量，不硬编码品牌色（点赞红沿用系统 danger 色）
   =================================================================== */

/* 视频封面上的“点击全屏”提示（伪元素，不注入 DOM、不拦截 Plyr 控制条） */
.post-list-item .cl-plyr-video {
	position: relative;
}
.post-list-item .cl-plyr-video::after {
	content: "⛶ 全屏";
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 4;
	padding: 4px 8px;
	font-size: 11px;
	line-height: 1;
	border-radius: 14px;
	color: #fff;
	background: rgba(0, 0, 0, .55);
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s ease;
}
.post-list-item .cl-plyr-video:hover::after {
	opacity: 1;
}
@media (hover: none) {
	.post-list-item .cl-plyr-video::after { opacity: .9; }
}

/* ============ 沉浸层 ============ */
.imv {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	flex-direction: column;
	background: #000;
	-webkit-user-select: none;
	user-select: none;
}
.imv.is-open {
	display: flex;
}

/* 顶部栏：返回 + 计数 */
.imv__top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent);
	color: #fff;
}
.imv__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: #fff;
	background: rgba(255, 255, 255, .12);
}
.imv__back svg { width: 22px; height: 22px; fill: #fff; }
.imv__count {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .5px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* 视频舞台：占满，上下切换区 */
.imv__stage {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
}
.imv__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: transform .28s ease, opacity .28s ease;
	transform: translateY(24px);
}
.imv__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}
.imv__slide.is-prev { transform: translateY(-24px); }
.imv__slide.is-next { transform: translateY(24px); }
.imv__video {
	width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
	background: #000;
}

/* 单击播放/暂停时的中央图标 */
.imv__playicon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .45);
	pointer-events: none;
	opacity: 0;
	transition: opacity .18s ease;
}
.imv__playicon.show { opacity: 1; }
.imv__playicon svg { width: 34px; height: 34px; fill: #fff; margin-left: 3px; }

/* 右侧互动栏 */
.imv__rail {
	position: absolute;
	right: 12px;
	bottom: 118px;
	z-index: 20;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
}
.imv__act {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: #fff;
}
.imv__act .ic {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .42);
	backdrop-filter: blur(4px);
}
.imv__act svg { width: 26px; height: 26px; fill: #fff; }
.imv__act .num {
	font-size: 12px;
	font-weight: 600;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
/* 点赞激活：沿用系统 danger 色（推特红） */
.imv__act[data-act="like"].liked .ic svg { fill: var(--cl-danger-color, #f91880); }
.imv__act[data-act="repost"].reposted .ic svg { fill: var(--cl-success-color, #00ba7c); }

/* 底部信息：头像 名称 时间 文案 */
.imv__meta {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 20;
	padding: 40px 16px calc(env(safe-area-inset-bottom) + 18px);
	background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
	color: #fff;
}
.imv__author {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}
.imv__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	background: #333;
}
.imv__uname {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}
.imv__time {
	font-size: 12px;
	opacity: .75;
	margin-top: 2px;
}
.imv__badge { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; margin-left: 3px; }
.imv__text {
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	max-height: 5.4em;
	overflow: hidden;
}
.imv__text a { color: #fff; text-decoration: underline; }

/* 底部翻页按钮（PC 友好） */
.imv__nav {
	position: absolute;
	left: 12px;
	bottom: 130px;
	z-index: 20;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.imv__nav button {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: #fff;
	background: rgba(0, 0, 0, .42);
	display: flex;
	align-items: center;
	justify-content: center;
}
.imv__nav button:disabled { opacity: .3; }
.imv__nav svg { width: 22px; height: 22px; fill: #fff; }
.imv__swipehint {
	position: absolute;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom) + 4px);
	transform: translateX(-50%);
	z-index: 21;
	font-size: 11px;
	color: rgba(255, 255, 255, .55);
	white-space: nowrap;
}

/* 打开沉浸层时锁背景滚动 */
body.imv-locked { overflow: hidden !important; }

@media (min-width: 768px) {
	.imv__rail { right: 24px; bottom: 130px; }
	.imv__meta { padding-left: 24px; padding-right: 120px; }
	.imv__nav { left: 24px; }
}
