/* 优化字体显示，减少布局偏移 */
body, h1, h2, h3, h4, h5, h6 {
  font-display: swap !important;
}
/* 固定背景图片样式 - 替代CSS背景优化LCP */
.fixed-background-img {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
  /* 确保在最底层 */
  pointer-events: none;
  /* 不阻挡点击事件 */
}
.bgOpacity {
  background: -webkit-linear-gradient(90deg, #1c1d21 20%, rgba(28, 29, 33, 0.8) 68%);
  max-width: 768px;
  height: 100%;
  position: fixed;
  z-index: -1;
  left: 50%;
  transform: translate(-50%);
}
.fg-series {
  color: rgba(0, 0, 0, 0.95);
  font-weight: 600;
  font-size: 1rem;
}
.bgOpacity {
  background: -webkit-linear-gradient(90deg, #1c1d21 20%, rgba(28, 29, 33, 0.8) 68%);
}
.movie-detail-main {
  padding-top: 0.5rem;
  padding-bottom: 3rem;
  z-index: 10;
  position: relative;
  /* 防止CLS - 隔离布局影响 */
  contain: layout style;
}
.main-content {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 2rem;
}
.main-content > .left {
  flex: 1;
  min-width: 0;
}
.main-content > .right {
  display: flex;
  flex-direction: column;
  width: 400px;
  flex-shrink: 0;
}
article {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
article .movie-type-badge {
  margin-bottom: 0;
}
.player-box {
  display: flex;
  position: relative;
  width: 100%;
  /* padding-top: 56.25%; */
  /* 16:9 宽高比 */
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-right: 1rem;
}
.player-box iframe, .player-box .mov-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
h1 {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.98);
}
h1 .fg-main {
  color: #ffae00;
  text-shadow: 0 0 0.5px rgba(255, 174, 0, 0.3);
}
article h3 {
  font-size: 1.4rem !important;
}
h4 {
  font-size: 1.2rem !important;
}
.company-tag-box {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}
.company-tag {
  font-size: 0.8rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  padding-left: 0.5rem;
  padding-right: 5rem;
  background-color: #ff3ba1;
  opacity: 0.7;
  border-radius: 0.3rem;
  position: relative;
}
.company-tag h4 {
  all: unset !important;
}
.company-tag:hover {
  cursor: pointer;
  opacity: 1;
}
.company-tag-abi {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4rem;
  background-color: #808080;
  display: flex;
  justify-content: center;
  align-content: center;
  border-top-right-radius: 0.3rem;
  border-bottom-right-radius: 0.3rem;
  display: flex;
  flex-direction: column;
}
.keyword-container {
  overflow: hidden;
}
.keyword-item {
  margin-bottom: 0.25rem;
  font-size: 1.3rem !important;
}
.description-text {
  text-indent: 2em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
  cursor: pointer;
  transition: all 0.3s ease;
}
.description-text p {
  margin-bottom: 0.2rem;
}
.description-text:hover {
  opacity: 0.8;
}
.description-text.expanded {
  -webkit-line-clamp: unset;
}
.alike-grid-container {
  margin-top: 1.3rem;
  overflow: hidden;
}
/* 1200px以下隐藏右侧 */
@media(max-width: 1199px) {
  .main-content > .right {
    display: none;
  }
}
@media(max-width:575px) {
  .movie-detail-main {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.1rem;
  }
  h1 {
    font-size: 1.35rem;
  }
  h4 {
    font-size: 1.1rem;
  }
  .keyword-container {
    max-height: 5.5rem;
  }
  .keyword-item {
    font-size: 1.2rem;
  }
  .description-text {
    -webkit-line-clamp: 3;
  }
}
/* 修复小屏幕播放器控制按钮被切掉的问题 */
@media(max-width: 419px) {
  .player-box {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}
/* iPhone SE和极小屏幕专用 - 让播放器突破父容器限制 */
@media(max-width: 375px) {
  .player-box {
    margin: 0 !important;
    width: 100vw !important;
    position: relative;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
  }
  /* 确保父容器不影响播放器 */
  .main-content > .left {
    overflow: visible !important;
  }
  .movie-detail-main {
    overflow-x: hidden !important;
    padding-top: 0.5rem;
    margin-top: 0 !important;
  }
}
.movie-detail-main {
  /* padding-left: 3rem;
        padding-right: 3rem;         */
}
h1 {
  font-size: 1.6rem;
}
.actor-swiper {
  width: calc(100% - 1rem);
  margin: 1rem 0.5rem;
}
.actor-swiper-item {
  width: 10rem !important;
  height: 13rem !important;
  overflow: hidden;
  border-radius: 0.3rem;
}
.movie-swiper {
  width: calc(100% - 1rem);
  margin: 1rem 0.5rem;
  height: 12rem;
  /* 预定义高度防止CLS */
  overflow: hidden;
  /* 隐藏溢出内容 */
}
.movie-swiper .swiper-wrapper {
  height: 12rem;
  /* 确保wrapper有固定高度 */
}
.movie-swiper-item {
  width: auto !important;
  /* 防止图片加载时的布局偏移 */
  height: 12rem;
  overflow: hidden;
  border-radius: 0.3rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.15);
}
.movie-swiper-item img {
  height: 100%;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.movie-swiper-item:hover img {
  transform: scale(1.05);
}
.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
}
.carousel-title {
  padding-left: calc(var(--bs-gutter-x) * .5);
}
.carousel-header {
  padding-left: 0;
  margin-bottom: 1rem;
}
.more-link {
  color: #ccc;
  font-size: 0.9rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.3s ease, transform 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}
.more-link:hover {
  color: #ffae00;
  text-decoration: none;
  transform: translateX(2px);
}
.more-link:hover .arrow-svg {
  transform: translateX(3px);
}
.right-side-movies-horizontal {}
.movies-carousel-container {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* 平滑滚动 */
  padding: 0.5rem 0 1rem 0;
  gap: 0.75rem;
  /* 隐藏滚动条 */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
  /* iOS平滑滚动 */
  -webkit-overflow-scrolling: touch;
  /* 防止垂直滚动 */
  overflow-y: hidden;
  /* 默认移动端：允许滚动 */
  overflow-x: auto;
}
/* 隐藏 WebKit 滚动条 */
.movies-carousel-container::-webkit-scrollbar {
  display: none;
}
/* 保持原有的卡片设计，但调整为横向滑动 */
.movie-carousel-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  width: 160px;
  /* 固定宽度适合滑动 */
  min-width: 160px;
  /* 防止压缩 */
  aspect-ratio: 9/15;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  text-align: left;
  background: var(--bg-minor);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
  /* 防止卡片被压缩 */
}
/* 保持原有的背景图片效果 */
.movie-carousel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  opacity: 1;
  transition: all 0.5s ease;
  z-index: 1;
  filter: brightness(1) contrast(1.2) saturate(1.2);
}
.movie-carousel-card:hover::before {
  opacity: 1;
  transform: scale(1.1);
  filter: brightness(1.1) contrast(1.2) saturate(1.2);
}
/* 保持原有的渐变效果 */
.movie-carousel-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 30%, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.95) 100%);
  z-index: 1;
}
/* 保持原有的标题样式 */
.movie-carousel-card h5 {
  position: relative;
  z-index: 2;
  margin: 0;
  font-size: 1.0rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  width: 100%;
  color: var(--fg-light1);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s, transform 0.3s;
  letter-spacing: 0.5px;
  /* 改为和VerticalListHalfPicture一样的2行显示 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-height: 3rem;
  /* 约2.5行的高度，和VerticalListHalfPicture一致 */
  white-space: normal;
}
.movie-carousel-card:hover h5 {
  color: var(--fg-primary);
  transform: translateY(-2px);
  /* hover时显示完整文本，和VerticalListHalfPicture一致 */
  max-height: 100vh;
  overflow: visible;
}
/* 保持原有的详情样式 */
.movie-carousel-card p {
  position: relative;
  z-index: 2;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  text-align: left;
  width: 100%;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 0;
}
.movie-carousel-card:hover p {
  color: var(--fg-light3);
  transform: translateY(-2px);
}
.movie-carousel-card .movie-title {
  font-size: 0.8rem;
}
.movie-code {
  color: #ffcc00;
  font-weight: 600;
}
.movies-carousel-container {
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 1rem 0.5rem;
}
.movie-carousel-card {
  width: 140px;
  min-width: 140px;
  padding: 0.8rem;
}
.movie-carousel-card h5 {
  font-size: 0.9rem;
}
.movie-carousel-card p {
  font-size: 0.7rem;
}
.javrate-image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(3px);
}
.javrate-image-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: javrate-fadeIn 0.3s ease;
}
.javrate-image-modal-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.javrate-modal-image {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: javrate-zoomIn 0.3s ease;
}
.javrate-image-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}
.javrate-image-modal-close:hover {
  background-color: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}
@keyframes javrate-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes javrate-zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.javrate-image-modal-close {
  top: -40px;
  font-size: 28px;
  width: 40px;
  height: 40px;
}
.javrate-modal-image {
  max-height: 85vh;
  border-radius: 4px;
}