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

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

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

/* ========== 顶部浮层 ========== */
.vf-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
  pointer-events: none;
}

.vf-logo {
  pointer-events: auto;
  display: block;
  line-height: 0;
}

.vf-logo img {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.vf-logo-text {
  display: inline-block;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 36px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-menu-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.vf-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* Contact Us：右下角固定 */
.vf-contact-btn {
  pointer-events: auto;
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 80;
  margin: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 40px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

.vf-contact-btn:hover,
.vf-contact-btn:focus {
  background: rgba(255,255,255,0.18);
  outline: none;
}

.vf-contact-btn:active {
  background: rgba(255,255,255,0.28);
}

.vf-drawer-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  color: #fff;
}

.vf-drawer-text {
  margin-top: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.9);
  white-space: normal;
  word-break: break-word;
}

.vf-drawer-empty {
  color: rgba(255,255,255,0.65);
}

/* ========== 侧滑面板（右侧滑入，原站蓝色背景） ========== */
.vf-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.32s ease, visibility 0.32s ease;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

.vf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  width: 60%;
  max-width: 320px;
  min-width: 240px;
  height: 100%;
  height: 100dvh;
  /* 与旧版 .menu .show-menu 一致：用户提供的蓝色背景图 */
  background-color: #004193;
  background-image: url("../images/image.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  color: #fff;
  -webkit-transform: translate3d(105%, 0, 0);
  transform: translate3d(105%, 0, 0);
  -webkit-transition: -webkit-transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  padding-right: calc(20px + env(safe-area-inset-right, 0px));
  box-shadow: -8px 0 24px rgba(0,0,0,0.35);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  text-align: center;
}

.vf-drawer.open {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.vf-drawer-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 40px;
  text-align: center;
  padding: 0;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.vf-drawer-close:active {
  background: rgba(255,255,255,0.28);
}

.vf-drawer-logo {
  margin: 36px 0 20px;
  text-align: center;
}

.vf-drawer-logo img {
  max-height: 48px;
  max-width: 180px;
}

.vf-drawer-logo .vf-logo-text {
  max-width: 100%;
  color: #fff;
}

.vf-drawer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.vf-drawer-nav li {
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.vf-drawer-nav a {
  display: block;
  padding: 14px 8px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}

.vf-drawer-nav a:hover {
  color: #fff;
}

.vf-drawer-contact {
  margin-top: 8px;
  padding-top: 8px;
  font-size: 15px;
  color: rgba(255,255,255,0.92);
  line-height: 1.7;
  text-align: left;
}

.vf-drawer-contact p {
  margin: 0 0 14px;
}

.vf-drawer-contact a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  word-break: break-all;
}

.vf-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-left: 2px;
  border: 1px solid rgba(255,255,255,0.35) !important;
  border-radius: 8px;
  background: rgba(37, 211, 102, 0.22);
  border-bottom: 1px solid rgba(255,255,255,0.35);
  -webkit-tap-highlight-color: transparent;
}

.vf-whatsapp-link:active {
  background: rgba(37, 211, 102, 0.38);
}

.vf-whatsapp-link .fa-whatsapp {
  font-size: 18px;
  color: #25d366;
}

/* 抽屉打开时禁止底层滚动 */
body.vf-drawer-open {
  overflow: hidden;
  touch-action: none;
}

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

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

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

.vf-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
  /* 未 ready 时由 JS 控制透明度，避免黑闪 */
  will-change: opacity;
}

.vf-video.vf-portrait {
  object-fit: contain;
}

.vf-video.vf-landscape {
  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; }
}

/* ========== 静音按钮 ========== */
.vf-unmute {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.3s;
}

.vf-unmute:hover {
  background: rgba(255,255,255,0.25);
}

.vf-unmute.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========== PC 端适配 ========== */
@media (min-width: 768px) {
  .vf-logo img {
    height: 44px;
  }

  .vf-contact-btn {
    right: 24px;
    bottom: 32px;
    height: 44px;
    line-height: 44px;
    padding: 0 18px;
    font-size: 14px;
  }

  /* PC：右侧滑入（保持原样） */
  .vf-drawer {
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
    width: 320px;
    max-width: 360px;
    min-width: 240px;
    height: 100%;
    height: 100dvh;
    -webkit-transform: translate3d(105%, 0, 0);
    transform: translate3d(105%, 0, 0);
    box-shadow: -8px 0 24px rgba(0,0,0,0.35);
  }

  .vf-drawer.open {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

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

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

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

  .vf-unmute {
    bottom: 48px;
  }
}

/* 移动端：Contact Us 自下而上全屏滑入 */
@media (max-width: 767px) {
  .vf-drawer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    height: 100dvh;
    -webkit-transform: translate3d(0, 105%, 0);
    transform: translate3d(0, 105%, 0);
    box-shadow: 0 -12px 28px rgba(0,0,0,0.35);
    padding-left: calc(20px + env(safe-area-inset-left, 0px));
    padding-right: calc(20px + env(safe-area-inset-right, 0px));
  }

  .vf-drawer.open {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .vf-overlay {
    padding: 12px 16px;
  }

  .vf-logo img {
    height: 30px;
    max-width: 110px;
  }

  .vf-logo-text {
    font-size: 14px;
    max-width: 120px;
  }

  .vf-contact-btn {
    right: 12px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    height: 36px;
    line-height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 8px;
  }

  .vf-drawer-title {
    font-size: 18px;
  }

  .vf-drawer-contact {
    font-size: 14px;
  }

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

/* 超宽屏：可选居中窄屏效果（保持全屏铺满，横版视频自然黑边） */
@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-overlay {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }

  .vf-contact-btn {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom));
  }

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

  .vf-unmute {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}
