/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  overscroll-behavior: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}

/* ===== 顶部品牌条 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.brand {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
}
.slogan {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== 视频流：整屏吸附，可一直下滑 ===== */
.feed {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar {
  display: none;
}

.video-card {
  position: relative;
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}
.video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}
/* 视频加载失败时露出封面兜底 */
.video-card.err .video {
  display: none;
}
.poster-fallback {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: none;
}
.video-card.err .poster-fallback {
  display: block;
}

/* ===== 信息层（左下） ===== */
.overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 78px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
}
.info {
  pointer-events: auto;
  max-width: 76%;
}
.v-title {
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.v-cat {
  margin-top: 7px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.v-desc {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 右侧互动栏 ===== */
.actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: auto;
  padding-bottom: 6px;
}
.act {
  background: none;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  transition: transform 0.12s ease;
}
.act:active {
  transform: scale(0.85);
}
.act span {
  display: block;
  font-size: 11px;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.9);
}
.act.on {
  color: #07c160; /* 品牌绿，呼应「云映」主色 */
}
.act.liked {
  color: #ff2d55;
}

/* ===== 静音切换 ===== */
.mute-toggle {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 14px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 18px;
}

/* ===== 加载提示 ===== */
.loader {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
  z-index: 5;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.loader.show {
  opacity: 1;
}

/* ===== 底部 tabbar ===== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  flex: 1;
  background: none;
  border: none;
  color: #888;
  padding: 9px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tab .ic {
  font-size: 21px;
}
.tab .lb {
  font-size: 11px;
}
.tab.active {
  color: #07c160;
}

/* ===== 我的页浮层 ===== */
.mine {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0e0e0e;
  display: flex;
  flex-direction: column;
}
.mine.hidden {
  display: none;
}
.mine-wrap {
  flex: 1;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 16px calc(env(safe-area-inset-bottom, 0px) + 70px);
  -webkit-overflow-scrolling: touch;
}
.mine-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mine-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex: 0 0 auto;
}
.mine-meta {
  flex: 1;
}
.mine-name {
  font-size: 18px;
  font-weight: 700;
}
.mine-sub {
  margin-top: 5px;
  font-size: 12px;
  color: #999;
}
.mine-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  flex: 0 0 auto;
}
.mine-h3 {
  margin: 20px 2px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #ddd;
}
.mine-tip {
  margin-top: 22px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

/* 观看历史卡 */
.history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.h-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1a1a1a;
  border-radius: 12px;
  padding: 10px;
}
.h-cover {
  width: 64px;
  height: 86px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
  flex: 0 0 auto;
}
.h-info {
  flex: 1;
  min-width: 0;
}
.h-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-ep {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}
.h-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.h-bar i {
  display: block;
  height: 100%;
  background: #07c160;
}
.h-go {
  flex: 0 0 auto;
  font-size: 13px;
  color: #07c160;
  padding-right: 4px;
}
.history-empty {
  text-align: center;
  color: #666;
  font-size: 13px;
  padding: 40px 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
}

/* ===== 顶部频道 tab（分类切换） ===== */
.topbar-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.channels {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: none; /* 仅 chip 可点 */
}
.channels::-webkit-scrollbar {
  display: none;
}
.ch {
  pointer-events: auto;
  flex: 0 0 auto;
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s, color 0.15s;
}
.ch.active {
  background: #07c160;
  color: #fff;
  font-weight: 600;
}

/* ===== 卡片底部播放进度条 ===== */
.vp-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 52px);
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 3;
}
.vp-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: #07c160;
  transition: width 0.2s linear;
}

/* ===== 双击点赞心形爆裂 ===== */
.heart-burst {
  position: absolute;
  z-index: 9;
  font-size: 80px;
  line-height: 1;
  color: #ff2d55;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 1;
  transition: transform 0.55s ease, opacity 0.55s ease;
}
.heart-burst.go {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0;
}

/* 我的-三 tab */
.mine-tabs {
  display: flex;
  gap: 12px;
  margin: 4px 0 14px;
}
.mine-tab {
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #cfcfcf;
  font-size: 13px;
}
.mine-tab.active {
  background: #07c160;
  border-color: #07c160;
  color: #04240f;
  font-weight: 600;
}
.h-off {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #9a9a9a;
  font-size: 11px;
}

/* 加载失败 / 空数据占位 */
.feed-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 100vh;
  padding: 0 32px;
  text-align: center;
  color: #d0d0d0;
}
.fe-title { font-size: 15px; line-height: 1.7; }
.fe-retry {
  padding: 10px 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 14px;
}
