/* ============================================
   For You Tab - 沉浸式全屏 Feed（对标设计稿）
   布局与 Player 页一致
   ============================================ */

#tab-foryou {
  background: #000;
  position: relative;
}

/* ---- Feed 滚动容器 ---- */
.foryou-container {
  height: 100%;
  position: relative;
  overflow: hidden;
}

.foryou-container::-webkit-scrollbar { display: none; }

/* 卡片包裹层：由 JS transform 驱动切换 */
.foryou-feed-inner {
  will-change: transform;
}

/* ---- Feed 卡片 ---- */
.feed-card {
  width: 100%;
  height: 100vh;
  height: 100dvh;           /* 动态视口高度，扣除浏览器底部导航栏 */
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

/* ---- 视频/封面背景 ---- */
.feed-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.feed-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity 0.3s ease;
}

/* 封面图片 */
.feed-cover {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-bg-icon {
  font-size: 64px;
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 底部渐变遮罩 ---- */
.feed-gradient-mask {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 65%;
  background: linear-gradient(to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.7) 35%,
    rgba(0,0,0,0.2) 65%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ---- 左下：剧名 + 简介（直接叠在视频上）---- */
.feed-info-overlay {
  position: absolute;
  left: 16px;
  right: 118px;
  bottom: calc(var(--tabbar-height) + 60px);
  z-index: 5;
  pointer-events: none;
}

.feed-drama-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.feed-synopsis {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

/* ---- 进度条 ---- */
.feed-progress-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-height) + 50px);
  z-index: 6;
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.feed-progress-area.visible {
  opacity: 1;
}

.feed-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.30);
  border-radius: 2px;
  overflow: hidden;
}

.feed-progress-filled {
  height: 100%;
  background: linear-gradient(90deg, #6C7BFF, #fff);
  border-radius: 2px;
  width: 0%;
  transition: width 0.15s linear;
}

/* ---- 底部 EP 信息栏 ---- */
.feed-ep-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--tabbar-height);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: #2B2D3C;
  border-top: 0.5px solid rgba(255,255,255,0.06);
  cursor: pointer;
  color: #fff;
}

.feed-ep-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-ep-left svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.feed-ep-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2px;
}

/* ---- 右侧操作栏 ---- */
.foryou-sidebar {
  position: fixed;
  right: 14px;
  bottom: calc(var(--tabbar-height) + 108px);
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.sidebar-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s;
  background: none;
  border: none;
  padding: 0;
}

.sidebar-action:active {
  transform: scale(0.88);
}

.sidebar-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-fav-img,
.sidebar-speed-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* 收藏激活状态 */
.sidebar-icon.favorited {
  /* 去圈后无需特殊背景 */
}

.sidebar-count {
  font-size: 11px;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* ============================================
   下拉刷新 / 加载更多 指示器
   ============================================ */

.foryou-refresh-indicator {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(28,28,30,0.92);
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.foryou-refresh-indicator.visible {
  opacity: 1;
}

.foryou-refresh-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: foryou-spin 0.7s linear infinite;
}

@keyframes foryou-spin {
  to { transform: rotate(360deg); }
}

.foryou-refresh-text {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.foryou-loadmore-indicator {
  position: absolute;
  bottom: calc(var(--tabbar-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.foryou-loadmore-indicator.visible {
  opacity: 1;
}

/* ---- 已无更多内容提示 ---- */
.foryou-nomore-tip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.foryou-nomore-tip.visible {
  opacity: 1;
}

/* ============================================
   Feed 卡片骨架屏
   ============================================ */

.feed-card--skeleton .feed-bg {
  background: #1a1a1e !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-skeleton-poster {
  width: 30%;
  opacity: 0.35;
}

.feed-skeleton-poster img {
  width: 100%;
  height: auto;
}

.feed-skel-info {
  position: absolute;
  left: 16px;
  right: 118px;
  bottom: calc(var(--tabbar-height) + 110px);
  z-index: 5;
}

.feed-skel-line {
  height: 14px;
  border-radius: 7px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 8px;
}

.feed-skel-line--title {
  width: 55%;
  height: 20px;
  border-radius: 10px;
}

.feed-skel-line--desc {
  width: 80%;
}

.feed-skel-line--short {
  width: 50%;
}

.feed-skel-line--ep {
  width: 100%;
  height: 14px;
  border-radius: 7px;
}

.feed-ep-bar--skeleton {
  background: #1c1c1e;
  border-top: 0.5px solid rgba(255,255,255,0.04);
  padding: 14px 18px;
}
