/* 抖音视频弹窗样式 */
html {
  scrollbar-gutter: stable;
}

body {
  scrollbar-gutter: stable;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  overflow: hidden;
}

.modal::-webkit-scrollbar {
  display: none !important;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-content {
  position: relative;
  width: min(71%, 340px);
  max-width: calc((100vh - 100px) * 9 / 17.5);
  height: auto;
  aspect-ratio: 9 / 17.5;
  max-height: calc(100vh - 100px);
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .modal-content {
    width: min(81%, 320px);
    height: auto;
    aspect-ratio: 9 / 17.5;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: min(94%, 300px);
    max-width: calc((100vh - 80px) * 9 / 17.5);
    height: auto;
    aspect-ratio: 9 / 17.5;
    max-height: calc(100vh - 80px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .close-btn {
    top: env(safe-area-inset-top, 0px);
    right: 5px;
  }
}

.modal-content iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: none;
}

.close-btn {
  position: absolute;
  top: 0;
  right: 10px;
  left: auto;
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  z-index: 10000;
  width: 40px;
  height: 40px;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-radius: 50%;
}

.close-btn:hover {
  color: #e74c3c;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  width: 50px;
  height: 50px;
  text-align: center;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  line-height: 50px;
  user-select: none;
}

.nav-btn:hover {
  background: rgba(0,0,0,0.2);
}

.prev-btn {
  left: 0;
}

.next-btn {
  right: 15px;
}

@media (max-width: 768px) {
  .modal-content {
    width: calc(100% - 60px);
    max-width: calc((100vh - 100px) * 9 / 17.5);
    margin: 0 auto;
    box-sizing: border-box;
  }
  .prev-btn {
    left: 0;
  }
  .next-btn {
    right: 5px;
  }
}

@media (max-width: 480px) {
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 30px;
    line-height: 40px;
  }
  .prev-btn {
    left: 0;
  }
  .next-btn {
    right: 5px;
  }
}
