/* =============================================================
 * short.css — PC 短视频全屏竖屏播放器（label/short）
 * 对应 JS: MDassets/web/js/short-player.js
 * ============================================================= */

/* ── el-main 撑满剩余高度，居中 frame ── */
.sv-main {
  padding: 0 !important;
  height: calc(var(--vh, 100vh) - 64px);
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ── 播放器框架：模拟一部手机的物理尺寸 ──
 *
 * 尺寸逻辑（以 iPhone 14 为参考：390 × 844 逻辑像素）：
 *   - height: 最高 820px（接近真实手机高度），同时不超过可用视口高度
 *   - aspect-ratio: 9/16 → 宽度由高度自动推算（≈461px），不超过 460px
 *   - 这样在各种分辨率下始终呈现"一部手机"的视觉大小
 *
 * 视频缩放策略（object-fit: contain）：
 *   - 竖屏视频 (9:16)  → 铺满整个框架，无黑边 ✓
 *   - 横屏视频 (16:9)  → 等比缩放居中，上下留黑边（不裁剪）✓
 *   - 方形视频 (1:1)   → 等比缩放居中，两侧留黑边（不裁剪）✓
 */
.sv-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  height: min(100%, 820px);   /* 不超过一部手机高度 */
  max-height: 820px;
  width: auto;
  max-width: 460px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 12px;        /* 略带圆角，更像手机屏幕 */
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

/* ═══════════════════════════════════════════ 视频滑块（环形三槽） */
.sv-slide {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.sv-slide-prev { transform: translateY(-100%); }
.sv-slide-curr { transform: translateY(0);     }
.sv-slide-next { transform: translateY(100%);  }

.sv-slide video {
  width: 100%;
  height: 100%;
  /*
   * contain：视频等比缩放、居中显示，不裁剪、不变形。
   * 横屏/方形视频在竖屏框架中会出现黑边，这是正常的。
   * 背景色 #000 填充黑边区域。
   */
  object-fit: contain;
  background: #000;
  display: block;
}

/* ═══════════════════════════════════════════ 封面（播放前遮罩） */
.sv-cover {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sv-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sv-cover-icon {
  position: relative;
  z-index: 1;
  font-size: 62px;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s;
}

.sv-cover-icon:hover { transform: scale(1.1); }

/* ═══════════════════════════════════════════ 加载转圈 */
.sv-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.sv-loader.sv-visible { opacity: 1; }

.sv-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sv-spin 0.75s linear infinite;
}

@keyframes sv-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════ 播放/暂停闪现图标 */
.sv-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 25;
  font-size: 68px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.12s ease-out, opacity 0.3s;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.sv-flash.sv-show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ═══════════════════════════════════════════ 视频信息（左下角） */
.sv-info {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 68px;
  padding: 20px 12px 10px;
  z-index: 20;
  /* 渐变遮罩保证文字可读 */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  pointer-events: none;
}

.sv-info-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.45;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sv-info-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 7px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.sv-info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sv-tag {
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 2px 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════ 右侧操作按钮 */
.sv-actions {
  position: absolute;
  right: 8px;
  bottom: 52px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.sv-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 头像 */
.sv-avatar-wrap { position: relative; }

.sv-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  display: block;
  background: #333;
}

.sv-follow {
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fe2c55;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 6px rgba(254, 44, 85, 0.5);
  transition: transform 0.15s;
}

.sv-follow:hover { transform: translateX(-50%) scale(1.15); }
.sv-follow i { font-size: 13px; line-height: 1; }

/* 交互按钮（点赞/收藏/分享） */
.sv-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 21px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s, transform 0.12s;
}

.sv-btn:hover  { background: rgba(255, 255, 255, 0.28); }
.sv-btn:active { transform: scale(0.88); }
.sv-btn i      { line-height: 1; }

.sv-btn.sv-liked    i { color: #fe2c55; }
.sv-btn.sv-collected i { color: #ffd700; }

.sv-btn-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════ 进度条
 * 点击热区高度 24px（方便鼠标点击 & 触摸）
 * 视觉轨道用 ::before 绘制在底部，高度 3px → hover/拖动时 5px
 * 填充条 (.sv-progress-bar) 绝对定位在底部
 */
.sv-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;         /* 加大点击热区 */
  background: transparent;
  z-index: 20;
  cursor: pointer;
  touch-action: none;   /* 防止 pointer 事件被浏览器拦截 */
}

/* 视觉轨道 */
.sv-progress::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  transition: height 0.15s;
  pointer-events: none;
}

.sv-progress:hover::before,
.sv-progress.sv-seeking::before {
  height: 5px;
}

/* 填充条：与轨道同底部对齐 */
.sv-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: #fe2c55;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
  transition: height 0.15s;
}

.sv-progress:hover .sv-progress-bar,
.sv-progress.sv-seeking .sv-progress-bar {
  height: 5px;
}

/* 拖动手柄小圆点 */
.sv-progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 50%;
  transform: translateY(50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fe2c55;
  box-shadow: 0 0 6px rgba(254, 44, 85, 0.7);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sv-progress:hover .sv-progress-bar::after,
.sv-progress.sv-seeking .sv-progress-bar::after {
  transform: translateY(50%) scale(1);
}

/* ═══════════════════════════════════════════ 侧边导航箭头
 * --frame-half-w 由 JS setVh() 根据实际渲染宽度动态注入，
 * 默认值 195px（450/2 = 225，留余量）
 */
.sv-nav {
  position: fixed;
  left: calc(50% + var(--frame-half-w, 225px) + 14px);
  z-index: 9200;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s, transform 0.15s;
  user-select: none;
}

.sv-nav:hover        { background: rgba(255, 255, 255, 0.25); transform: scale(1.08); }
.sv-nav.sv-disabled  { opacity: 0.3; pointer-events: none; }
.sv-nav-prev         { top: calc(50% - 50px); }
.sv-nav-next         { top: calc(50% + 14px); }

/* ═══════════════════════════════════════════ 两侧暗色装饰（自动填充剩余空间）
 * 无需计算固定宽度，flex 布局 + background 已天然填充两侧
 */
.sv-main > .sv-frame { z-index: 2; }
