/* ═══ 全局隐藏滚动条（保留滚动/触摸滑动能力，仅去掉视觉滚动条）═══ */
html, body, * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent;
}

/* ═══════════════════════════════════════════════════════════
   首页 Feed（抖音式全屏沉浸流）
   每张卡占满一屏，上下滑切换（scroll-snap），tab 栏透明浮层
   ═══════════════════════════════════════════════════════════ */
.feed-view {
  /* 脱离 flex 弹性分配（flex:1 的 basis:0 会让百分比高度链塌陷），自带确定视口高度 */
  flex: none;
  padding-bottom: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: #000;
}

.feed-swiper {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.feed-swiper::-webkit-scrollbar { display: none; }

/* ─── 单张卡：满屏 ─── */
.feed-card {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #101018;
  -webkit-tap-highlight-color: transparent;
  /* 按住画面左右滑动控制进度：横向手势归脚本，纵向仍交给 feed 上下滑切换 */
  touch-action: pan-y;
}
.feed-card.feed-scrubbing { cursor: grabbing; }
.feed-card.feed-scrubbing * { user-select: none; -webkit-user-select: none; }

/* 背景：封面图按原比例**贴顶**显示（图文视频只有一张方形封面时，不再居中裁切铺满） */
.feed-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}
.feed-bg img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.feed-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.feed-bg-placeholder {
  font-size: 72px;
  opacity: 0.35;
}
/* 无封面：渐变底 */
.feed-card--nocover .feed-bg {
  background: linear-gradient(160deg, #2a2050 0%, #141428 55%, #1c1030 100%);
}

/* 上下暗渐变遮罩：保证白字可读 */
.feed-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0) 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.24) 26%, rgba(0, 0, 0, 0) 46%);
}

/* 「正在生成视频」标签：浮在视频画面顶部（避开右侧互动栏，不挡底部信息区） */
.feed-gen-badge {
  position: absolute;
  left: 20px;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  z-index: 5;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 3px 12px rgba(0, 0, 0, .38);
  pointer-events: none;
  animation: feedGenPulse 1.6s ease-in-out infinite;
}

@keyframes feedGenPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .62; }
}

@media (prefers-reduced-motion: reduce) {
  .feed-gen-badge { animation: none; }
}

/* ─── 中央播放按钮（暂停时显示） ─── */
.feed-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
}
.feed-bigplay:active { transform: translate(-50%, -50%) scale(0.93); }

/* ─── 字幕：单行浮层，锚在底部信息区（作者+主播+标题+拍同款）上方 ───
   font-size 基准 18px 必须保留：feed.js 的 subUniformFont 以 CSS 默认 18px 为基准
   按实际宽度实测缩放（改基准会破坏比例）。
   注：左右 padding 12px 会占用宽度，subUniformFont 的 usable 已同步减去 24px */
.feed-subtitle {
  position: absolute;
  left: 20px;
  right: 84px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 238px);
  z-index: 3;
  text-align: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
  white-space: nowrap;
  /* 半透明底板 + 模糊：光有 text-shadow 时，字幕压在浅色/花哨封面上看不清，
     看起来像"没有样式"的裸文本 */
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

/* ─── 顶部右侧搜索按钮（Feed 沉浸模式浮层） ─── */
.feed-search-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 14px;
  z-index: 8;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}
.feed-search-btn:active { background: rgba(0, 0, 0, 0.5); }

/* ─── 搜索全屏浮层 ─── */
.pod-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg, #0a0a0f);
  display: flex;
  flex-direction: column;
}
.pod-search-overlay.hidden { display: none; }
.pod-search-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
}
.pod-search-input {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: rgba(128, 128, 128, 0.16);
  color: var(--text);
  font-size: 15px;
  padding: 0 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.pod-search-input::placeholder { color: var(--text-2); }
.pod-search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 14px 30px;
}
.pod-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.12);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pod-search-item:active { background: rgba(128, 128, 128, 0.12); }
.ps-cover {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(128, 128, 128, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ps-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ps-cover-ph { font-size: 24px; opacity: 0.45; }
.ps-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ps-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-meta {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-play {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.35);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.pod-search-loading,
.pod-search-empty {
  text-align: center;
  padding: 46px 0;
  font-size: 14px;
  color: var(--text-2);
}

/* ─── 微信内引导：点右上角「···」在浏览器打开 ─── */
.wx-guide {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 10px 22px;
  -webkit-tap-highlight-color: transparent;
}
.wx-guide.hidden { display: none; }
.wx-guide-arrow {
  font-size: 44px;
  line-height: 1;
  color: #fff;
  transform: rotate(-40deg);
  animation: wxGuidePoint 1.1s ease-in-out infinite;
}
@keyframes wxGuidePoint {
  0%, 100% { transform: rotate(-40deg) translate(0, 0); }
  50% { transform: rotate(-40deg) translate(6px, -6px); }
}
.wx-guide-text {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.8;
  color: #fff;
  text-align: right;
}
/* 复制的下载直链：可长按/选中复制（点它不关闭引导层） */
.wx-guide-link {
  margin-top: 14px;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
  text-align: left;
  -webkit-user-select: text;
  user-select: text;
}
.wx-guide-link:empty { display: none; }
.wx-guide-close {
  margin-top: 16px;
  margin-right: 4px;
  padding: 8px 24px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 20px;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

/* 评论"作者"徽标与回复缩进样式统一在 player.css（两页都加载它），此处不再重复定义 */

/* ─── 底部信息区：作者 + 标题 + 拍同款 ─── */
.feed-info {
  position: absolute;
  left: 16px;
  right: 84px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
  z-index: 3;
  color: #fff;
}
.feed-user {
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  margin-bottom: 5px;
}
/* 主播行：头像 + 名字 */
.feed-hosts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 7px;
}
.feed-host {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 2px 10px 2px 3px;
}
.feed-host-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  font-size: 11px;
}
.feed-host-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.feed-title {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.feed-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.feed-samekind {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.feed-samekind:active { background: rgba(255, 255, 255, 0.18); }

/* ─── 右侧互动栏 ─── */
.feed-rail {
  position: absolute;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.feed-rail-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.feed-rail-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.feed-rail-btn {
  border: none;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
  -webkit-tap-highlight-color: transparent;
}
.feed-rail-btn:active { transform: scale(0.92); }
.feed-rail-ico {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-rail-ico svg {
  width: 32px;
  height: 32px;
}
.feed-rail-num {
  font-size: 12px;
  color: #fff;
  line-height: 1;
}
.feed-rail-btn--on .feed-rail-ico { color: #fe2c55; }
.feed-rail-btn--liked-anim .feed-rail-ico { animation: feedHeartPop 0.35s ease; }
@keyframes feedHeartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* 双击点赞：爆心动画 */
.feed-heart-burst {
  position: absolute;
  z-index: 6;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  color: #fe2c55;
  pointer-events: none;
  animation: feedHeartBurst 0.8s ease forwards;
}
@keyframes feedHeartBurst {
  0% { transform: scale(0.4); opacity: 0; }
  25% { transform: scale(1.15); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3) translateY(-24px); opacity: 0; }
}

/* ─── 底部进度条：贴 tab 浮层上沿 ─── */
.feed-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
  height: 3px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}
.feed-progress-fill {
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

/* ─── 加载哨兵 / 空态 ─── */
.feed-sentinel {
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: feedSpin 0.9s linear infinite;
}
@keyframes feedSpin { to { transform: rotate(360deg); } }

.feed-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-2);
}
.feed-empty-icon { font-size: 52px; opacity: 0.5; }
.feed-empty-text { font-size: 14px; }
.feed-empty-btn {
  padding: 10px 26px;
  border: none;
  border-radius: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* ─── Tab 栏：Feed 沉浸模式透明浮层 ─── */
.tab-bar--overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  border-top: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tab-bar--overlay .tab-item { color: rgba(255, 255, 255, 0.72); }
.tab-bar--overlay .tab-item.active { color: #fff; }

/* PC 端预览：feed 限宽居中（与全局 max-width 习惯一致） */
@media (min-width: 640px) {
  .feed-swiper {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ─── 视频模式三选弹窗：模式说明 ─── */
.video-mode-desc {
  padding: 4px 18px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ─── 下载弹窗（视频文件 / MP3） ─── */
/* 下载弹窗：作者专属操作（编辑 / 删除） */
.dl-owner-actions { display: flex; gap: 10px; margin: 4px 0 8px; }
.dl-owner-btn { flex: 1; padding: 11px 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; cursor: pointer; }
.dl-owner-btn--del { color: #ff6b6b; border-color: rgba(255,107,107,.5); }
.dl-options {
  padding: 6px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dl-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid rgba(128, 128, 128, 0.25);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dl-option:active { background: rgba(128, 128, 128, 0.18); }
.dl-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(128, 128, 128, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: none;
}
.dl-option-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dl-option-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.dl-option-desc {
  font-size: 12px;
  color: var(--text-2);
}
.dl-option--off {
  opacity: 0.45;
  pointer-events: none;
}

/* ─── 作者资料页（抖音式全屏浮层） ─── */
.author-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg, #0a0a0f);
  display: flex;
  flex-direction: column;
}
.author-overlay.hidden { display: none; }
.author-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.18);
}
.author-back {
  border: none;
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.author-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.author-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.author-head-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px 18px;
}
.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.35);
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.author-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.author-works-count {
  font-size: 13px;
  color: var(--text-2);
}
.author-works-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px 14px 30px;
}
.aw-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aw-card:active { opacity: 0.85; }
.aw-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: rgba(128, 128, 128, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}
.aw-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.aw-cover-ph { font-size: 30px; opacity: 0.4; }
.aw-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
}
.aw-title {
  padding: 8px 10px 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.aw-meta {
  padding: 2px 10px 10px;
  font-size: 11px;
  color: var(--text-2);
}
.author-works-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 0;
  font-size: 13px;
  color: var(--text-2);
}
.author-works-empty {
  text-align: center;
  padding: 40px 0 60px;
  font-size: 14px;
  color: var(--text-2);
}
