/* 筛选区域样式 */
.filter-section {
  background-color: white;
  border-radius: var(--card-radius);
  padding: 22px 28px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

.filter-title {
  font-weight: 700;
  color: var(--dark-text);
  margin: 0;
  font-size: 1.2rem;
}

.filter-result {
  color: var(--light-text);
  font-size: 0.95rem;
  margin-left: 10px;
}

.filter-toggle {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  background-color: rgba(255, 107, 129, 0.05);
  transition: all 0.3s ease;
}

.filter-toggle:hover {
  color: var(--primary-dark);
  background-color: rgba(255, 107, 129, 0.1);
  text-decoration: none;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-group-title {
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: var(--dark-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group-title i {
  color: var(--primary-color);
  font-size: 0.95rem;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-option {
  padding: 8px 18px;
  background-color: var(--light-bg);
  border-radius: 25px;
  font-size: 0.9rem;
  color: var(--light-text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-option:hover {
  background-color: #e9ecef;
  color: var(--dark-text);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.filter-option.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(255, 107, 129, 0.3);
}

.movie-card {
  margin-bottom: 25px;
  border-radius: 10px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.movie-image-container {
  position: relative;
  overflow: hidden;
  /* 2:3 比例 */
  height: 0;
  padding-top: 150%; /* 2:3 比例 */
  width: 100%;
}

.movie-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.movie-card:hover .movie-image {
  transform: scale(1.05);
}

/* 右上角标签 - 语言/年份格式 */
.top-right-overlay {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  border-bottom-left-radius: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}

.language-year {
  display: flex;
  gap: 5px;
}
.rating-badge {
  position: absolute;
  top: 0;
  left: 0;
  padding: 5px 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--dark-color);
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom-right-radius: 8px;
  color: #fff;
}
.rating-badge .fas {
  margin-right: 5px;
  width: 15px;
}
.bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 30px 10px 10px;
  color: white;
  z-index: 1;
}

.movie-title {
  font-weight: 600;
  font-size: 0.8em;
  color: var(--dark-color);
  text-align: center;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* 限制显示的行数 */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5; /* 设置合适的行高 */
  height: 3em; /* 可选：行高 × 行数 */
}

.episode-badge {
  background-color: var(--accent-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
}

.toggle-filter-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.toggle-filter-btn:hover {
  background-color: #0b5ed7;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .movie-title {
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* 限制显示的行数 */
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5; /* 设置合适的行高 */
    max-height: 3em; /* 可选：行高 × 行数 */
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .filter-options {
    gap: 6px;
  }

  .filter-option {
    padding: 5px 12px;
    font-size: 0.85rem;
  }
}

.filter-content {
  overflow: hidden;
  transition:
    max-height 0.5s ease-out,
    opacity 0.3s ease-out;
  max-height: 500px;
  opacity: 1;
}

.filter-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.reset-filters {
  color: var(--secondary-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.reset-filters:hover {
  color: var(--primary-color);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
}

.active-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background-color: #e7f1ff;
  border-radius: 15px;
  font-size: 0.85rem;
  color: var(--primary-color);
}

.active-filter i {
  cursor: pointer;
  font-size: 0.8rem;
}
/* 针对移动端小屏幕的适配 */
@media screen and (max-width: 480px) {
  /* 假设电影项有类似这样的类名 */
  .movie-item,
  .video-item,
  .list-item {
    width: calc(33.33% - 10px) !important; /* 三列布局，减去间距 */
    margin: 5px !important;
    float: left !important;
    box-sizing: border-box !important;
  }

  /* 清除浮动 */
  .movie-list::after,
  .video-list::after,
  .list-container::after {
    content: "";
    display: table;
    clear: both;
  }

  /* 调整图片大小适应小屏幕 */
  .movie-item img,
  .video-item img,
  .list-item img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* 调整标题文本 */
  .movie-item h3,
  .video-item h3,
  .list-item h3 {
    font-size: 12px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 如果有描述文本，可以隐藏或缩小 */
  .movie-item .desc,
  .video-item .desc,
  .list-item .desc {
    display: none !important;
  }
}

/* 针对超小屏幕的进一步优化 */
@media screen and (max-width: 360px) {
  .movie-item,
  .video-item,
  .list-item {
    width: calc(33.33% - 6px) !important;
    margin: 3px !important;
  }

  .movie-item h3,
  .video-item h3,
  .list-item h3 {
    font-size: 11px !important;
  }
}
