/* 抖音式首页全屏视频流 */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body.video-feed-page {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
  -webkit-tap-highlight-color: transparent;
}

/* ========== Contact Us 按钮（右下角 · 毛玻璃） ========== */
.vf-contact-btn {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 100;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
  pointer-events: auto;
}

.vf-contact-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.36);
}

.vf-contact-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.22);
}

/* ========== 联系面板 ========== */
.vf-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.vf-drawer-mask.open {
  opacity: 1;
  visibility: visible;
}

.vf-drawer {
  position: fixed;
  z-index: 201;
  background-color: #0a1850;
  background-image: url('../images/contact-gradient.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: #fff;
  overflow-y: auto;
  padding: 20px;
  transition: transform 0.32s ease;
  /* 手机：全屏自底部滑入 */
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  transform: translateY(100%);
}

.vf-drawer.open {
  transform: translateY(0);
}

.vf-drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
  padding: 0;
}

.vf-drawer-title {
  margin: 36px 0 20px;
  padding-right: 40px;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
}

.vf-drawer-body {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.vf-drawer-body p {
  margin: 0 0 12px;
}

.vf-drawer-body strong {
  color: #fff;
  font-weight: 600;
}

.vf-drawer-body a {
  color: #b8dcff;
  text-decoration: underline;
  word-break: break-all;
}

.vf-drawer-body a:hover {
  text-decoration: underline;
}

.vf-drawer-body img {
  max-width: 100%;
  height: auto;
}

/* ========== 视频流容器 ========== */
.vf-feed {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #000;
}

.vf-swiper {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
}

.vf-slide {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-video {
  background: #000;
  display: block;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  /* 元数据加载前兜底：不变形 */
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* X5 / 国产浏览器：减少层叠错位 */
.vf-in-app .vf-slide {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.vf-in-app .vf-video {
  object-position: center center;
}

/* 百度浏览器：等待用户点击后再加载视频 */
.vf-tap-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vf-baidu .vf-tap-overlay.show {
  display: flex;
}

.vf-tap-icon {
  font-size: 56px;
  line-height: 1;
  opacity: 0.92;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.vf-tap-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* 手机端：竖版 cover 铺满，横版宽度 100% */
.vf-video.vf-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-video.vf-landscape {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

/* 视频信息条 */
.vf-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 16px 24px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
  pointer-events: none;
}

.vf-title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* 无视频提示 */
.vf-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  text-align: center;
  padding: 24px;
}

.vf-empty-tip {
  font-size: 13px;
  margin-top: 12px;
  max-width: 320px;
  line-height: 1.6;
}

/* ========== 滑动提示 ========== */
.vf-scroll-hint {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 24px;
  pointer-events: none;
  transition: opacity 0.5s;
}

.vf-scroll-hint.hidden,
.vf-scroll-hint.faded {
  opacity: 0;
  visibility: hidden;
}

.vf-hint-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.vf-hint-item i {
  font-size: 18px;
}

.vf-hint-down {
  animation: vfBounceDown 1.8s ease-in-out infinite;
}

.vf-hint-up {
  animation: vfBounceUp 1.8s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes vfBounceDown {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

@keyframes vfBounceUp {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-6px); opacity: 0.6; }
}

/* ========== PC 端适配 ========== */
@media (min-width: 768px) {
  .vf-contact-btn {
    right: 32px;
    bottom: 32px;
    padding: 14px 26px;
    font-size: 15px;
  }

  .vf-drawer {
    inset: auto;
    top: 0;
    right: 0;
    left: auto;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    transform: translateX(100%);
  }

  .vf-drawer.open {
    transform: translateX(0);
  }

  .vf-info {
    padding-bottom: 32px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .vf-title {
    font-size: 16px;
  }

  .vf-scroll-hint {
    right: 32px;
  }

  /* PC：竖版高度 100% 不拉伸，横版宽度 100% contain */
  .vf-video.vf-portrait {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }

  .vf-video.vf-landscape {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
  }
}

/* 超宽屏：可选居中窄屏效果（保持全屏铺满，横版视频自然黑边） */
@media (min-width: 1200px) {
  .vf-feed {
    display: flex;
    justify-content: center;
    background: #000;
  }

  .vf-swiper {
    max-width: 100%;
  }
}

/* 安全区域（刘海屏） */
@supports (padding: env(safe-area-inset-top)) {
  .vf-contact-btn {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .vf-drawer {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
  }

  .vf-info {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* 毛玻璃不支持时的降级 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .vf-contact-btn {
    background: rgba(30, 30, 30, 0.78);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .vf-drawer-close {
    background: rgba(30, 30, 30, 0.65);
  }
}
