/* ==========================================
   微短剧页面样式
   ==========================================

   图片尺寸要求：
   1. 微短剧列表卡片封面
      - 比例：16:9 横版（强制）
      - 格式：SVG、WebP、PNG
      - 建议：640x360 或更高分辨率（至少 1280x720）
      - 存储：images/shortdrama/ 目录

   ========================================== */

/* ==========================================
   微短剧页面头部
   ========================================== */

.page-header-drama {
  background: linear-gradient(135deg, #9D8DFF 0%, #7B68EE 50%, #6A5ACD 100%);
  color: white;
}

.page-header-drama .page-title {
  color: white;
}

.page-header-drama .page-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   微短剧筛选器（参照游戏库页面）
   ========================================== */

.drama-filters {
  background: linear-gradient(135deg, var(--bg-light) 0%, #FFF8F0 100%);
  padding: 32px 0;
  margin-bottom: var(--spacing-xxl);
  position: relative;
  overflow: hidden;
}

.drama-filters::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(157, 141, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

.drama-filters .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 筛选器主行 */
.filters-main-row {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, 0.8);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  flex-wrap: wrap;
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.filter-pill {
  padding: 8px 18px;
  border: 2px solid var(--border-light);
  border-radius: 50px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pill:hover {
  border-color: #9D8DFF;
  color: #9D8DFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(157, 141, 255, 0.2);
}

.filter-pill.active {
  border-color: #9D8DFF;
  background: linear-gradient(135deg, #9D8DFF 0%, #7B68EE 100%);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(157, 141, 255, 0.4);
}

.filter-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, transparent, var(--border-light), transparent);
  flex-shrink: 0;
}

/* 搜索区域 */
.search-section {
  flex: 0 0 auto;
  min-width: 250px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 20px;
  border: 2px solid var(--border-light);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
}

.search-box input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-box input:focus {
  border-color: #9D8DFF;
  box-shadow: 0 4px 16px rgba(157, 141, 255, 0.25);
  transform: translateY(-2px);
}

/* 旧的筛选器样式（保留兼容性） */
.drama-filter-section {
  background: var(--bg-white);
  padding: var(--spacing-xl) 0;
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-soft);
}

.drama-filter-container {
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
  justify-content: center;
}

.drama-filter-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.drama-filter-group label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 15px;
}

#dramaFilterButtons {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.drama-filter-btn {
  padding: 8px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-medium);
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drama-filter-btn:hover,
.drama-filter-btn.active {
  border-color: #9D8DFF;
  background: #9D8DFF;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(157, 141, 255, 0.3);
}

/* ==========================================
   微短剧列表区域
   ========================================== */

.drama-section {
  padding: var(--spacing-xxl) 0;
  min-height: 600px;
}

.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xxl);
}

.drama-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  opacity: 0;
}

/* 动画激活状态 */
.drama-card.visible {
  opacity: 1;
}

/* 动画1: 从左侧滑入 */
.drama-card.animate-slide-left {
  animation: slideInLeft 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 动画2: 从右侧滑入 */
.drama-card.animate-slide-right {
  animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 动画3: 从下方滑入 */
.drama-card.animate-slide-up {
  animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画4: 从上方滑入 */
.drama-card.animate-slide-down {
  animation: slideInDown 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画5: 缩放淡入 */
.drama-card.animate-scale {
  animation: scaleIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 动画6: 旋转淡入 */
.drama-card.animate-rotate {
  animation: rotateIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

/* 动画7: 翻转淡入 */
.drama-card.animate-flip {
  animation: flipIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateX(-15deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateX(0);
  }
}

/* 动画8: 弹跳淡入 */
.drama-card.animate-bounce {
  animation: bounceIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 卡片悬停效果 */
.drama-card:hover {
  box-shadow: 0 20px 60px rgba(157, 141, 255, 0.3);
  border-color: rgba(157, 141, 255, 0.4);
}

/* 海报区域 - 统一使用16:9横版比例 */
/* 支持格式：SVG、WebP、PNG */
.drama-poster {
  width: 100%;
  aspect-ratio: 16 / 9;  /* 强制16:9比例 */
  overflow: hidden;
  position: relative;
  background: #FFE4D4;  /* 海报加载前的背景色 */
}

.drama-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* 自动填充，保持比例 */
  object-position: center center;  /* 居中显示 */
}

/* 卡片内容区域 */
.drama-info {
  padding: 24px;
  position: relative;
}

.drama-category {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, #9D8DFF 0%, #7B68EE 100%);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.drama-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.drama-card:hover .drama-category::before {
  left: 100%;
}

.drama-card:hover .drama-category {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(157, 141, 255, 0.4);
}

.drama-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 700;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.drama-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #9D8DFF, #7B68EE);
  transition: width 0.3s ease;
}

.drama-card:hover .drama-title::after {
  width: 100%;
}

.drama-card:hover .drama-title {
  color: #9D8DFF;
}

.drama-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 标签区域 */
.drama-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.drama-tags .game-tag {
  padding: 4px 12px;
  background: rgba(157, 141, 255, 0.1);
  color: #9D8DFF;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid rgba(157, 141, 255, 0.2);
}

.drama-card:hover .drama-tags .game-tag {
  background: rgba(157, 141, 255, 0.15);
  border-color: rgba(157, 141, 255, 0.4);
  transform: translateY(-2px);
}

.drama-card:hover .drama-tags .game-tag:hover {
  background: #9D8DFF;
  color: white;
  transform: translateY(-3px);
}

/* 卡片底部 */
.drama-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(157, 141, 255, 0.1);
}

.drama-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.episodes-badge {
  padding: 6px 12px;
  background: rgba(157, 141, 255, 0.1);
  color: #9D8DFF;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
  border: 1px solid rgba(157, 141, 255, 0.2);
}

.drama-card:hover .episodes-badge {
  background: rgba(157, 141, 255, 0.2);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(157, 141, 255, 0.3);
}

.drama-card:hover .episodes-badge:hover {
  background: #9D8DFF;
  color: white;
}

.drama-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(255, 153, 102, 0.1) 0%, rgba(212, 167, 106, 0.1) 100%);
  color: #FF9966;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 153, 102, 0.2);
}

.drama-card-rating svg {
  fill: #FF9966;
  transition: transform 0.3s ease;
}

.drama-card:hover .drama-card-rating {
  background: linear-gradient(135deg, rgba(255, 153, 102, 0.2) 0%, rgba(212, 167, 106, 0.2) 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 153, 102, 0.3);
}

.drama-card:hover .drama-card-rating svg {
  transform: scale(1.2);
}

/* 旧样式（保留兼容性） */
.drama-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

.drama-card-content {
  padding: var(--spacing-lg);
}

.drama-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  background: #9D8DFF;
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-small);
  box-shadow: 0 4px 12px rgba(157, 141, 255, 0.3);
}

.drama-card-title {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.drama-card-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.drama-card-stats {
  display: flex;
  gap: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-light);
}

.drama-card-stat {
  font-size: 13px;
  color: var(--text-muted);
}

.drama-card-stat strong {
  color: var(--text-secondary);
}

/* ==========================================
   微短剧统计数据
   ========================================== */

.drama-stats {
  background: linear-gradient(135deg, #9D8DFF 0%, #7B68EE 100%);
  padding: var(--spacing-xxl) 0;
  color: white;
}

.drama-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-xl);
}

.drama-stat-item {
  text-align: center;
  padding: var(--spacing-xl);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-xl);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

.drama-stat-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.drama-stat-number {
  font-size: 48px;
  font-weight: bold;
  color: white;
  margin-bottom: var(--spacing-sm);
  font-family: 'Fredoka One', sans-serif;
}

.drama-stat-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   CTA区域
   ========================================== */

.cta-section {
  background: var(--bg-white);
  padding: var(--spacing-xxl) 0;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.cta-title {
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.cta-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn-large {
  padding: 16px 40px;
  font-size: 18px;
}

/* ==========================================
   微短剧模态框
   ========================================== */

#dramaModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

#dramaModal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#dramaModal .game-modal-content {
  border-color: #9D8DFF;
}

#dramaModalBody {
  padding: var(--spacing-xxl);
}

/* ==========================================
   响应式 - 微短剧页面
   ========================================== */

/* 小型桌面 (769px - 1024px) */
@media (max-width: 1024px) {
  .drama-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .drama-card {
    padding: var(--spacing-md);
  }

  /* drama-poster 使用 aspect-ratio 自动保持 16:9 比例，无需响应式高度 */

  .intro-content {
    grid-template-columns: 1fr;
  }
}

/* 平板 (481px - 768px) */
@media (max-width: 768px) {
  .drama-filter-container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .drama-filter-group {
    width: 100%;
  }

  #dramaFilterButtons {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }
  
  .drama-filter-btn {
    font-size: 14px;
    padding: var(--spacing-xs) var(--spacing-md);
  }

  .drama-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .drama-card {
    padding: var(--spacing-md);
  }

  .drama-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .drama-stat-number {
    font-size: 36px;
  }

  .drama-stat-label {
    font-size: 14px;
  }

  /* drama-poster 使用 aspect-ratio 自动保持 16:9 比例，无需响应式高度 */

  .drama-title {
    font-size: 18px;
  }

  .drama-meta {
    font-size: 13px;
  }

  .cta-title {
    font-size: 24px;
  }

  .cta-subtitle {
    font-size: 16px;
  }

  .btn-large {
    padding: 14px 32px;
    font-size: 16px;
  }
  
  .intro-content {
    grid-template-columns: 1fr;
  }
}

/* 手机 (0 - 480px) */
@media (max-width: 480px) {
  .drama-filter-container {
    gap: var(--spacing-sm);
  }
  
  .drama-filter-title {
    font-size: 14px;
  }
  
  .drama-filter-btn {
    font-size: 13px;
    padding: 6px 12px;
  }
  
  .drama-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .drama-card {
    padding: var(--spacing-sm);
  }

  .drama-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .drama-stat-item {
    padding: var(--spacing-sm);
  }

  /* drama-poster 使用 aspect-ratio 自动保持 16:9 比例，无需响应式高度 */

  .drama-title {
    font-size: 16px;
  }
  
  .drama-description {
    font-size: 13px;
    line-height: 1.6;
  }
  
  .drama-meta {
    font-size: 12px;
    gap: var(--spacing-xs);
  }
  
  .drama-rating,
  .drama-episodes,
  .drama-duration {
    font-size: 12px;
  }
  
  .cta-section {
    padding: var(--spacing-lg) 0;
  }
  
  .cta-title {
    font-size: 20px;
  }
  
  .cta-subtitle {
    font-size: 14px;
  }
  
  .btn-large {
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
  }
}

/* ==========================================
   微短剧页面介绍部分
   ========================================== */

.intro-section {
  background: var(--bg-white);
}

.intro-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
}

.intro-description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
}

.feature-list {
  display: grid;
  gap: var(--spacing-md);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-light);
  border-radius: var(--radius-medium);
}

.feature-icon {
  font-size: 32px;
}

.feature-content h4 {
  color: var(--text-primary);
  margin-bottom: 4px;
}

.feature-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.intro-image {
  border-radius: var(--radius-large);
  overflow: hidden;
}

.drama-placeholder {
  background: linear-gradient(135deg, var(--accent-color), #D4C8FF);
}

/* ==========================================
   微短剧详情页样式 - 沉浸式电影设计
   ========================================== */

/* 详情页背景 - 深色电影氛围 */
