/* 自定义样式 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* 轮播图增强样式 */
@keyframes zoomIn {
  from {
    transform: scale(1.2);
  }
  to {
    transform: scale(1.3);
  }
}

.banner-swiper .swiper-slide-active img {
  animation: zoomIn 8s ease forwards;
}

/* 确保图片容器正确显示 */
.banner-swiper .swiper-slide {
  overflow: hidden;
  height: 100%;
}

.banner-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 0.5s ease;
}

/* 响应式布局优化 */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* 视频卡片悬停效果 */
.video-card {
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 搜索框样式增强 */
.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 加载动画 */
.loading-spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 分页样式 */
.pagination a {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  text-decoration: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  transition: all 0.2s;
}

.pagination a:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.pagination a.current,
.pagination span.current {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* 播放器样式 */
.player-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 比例 */
  background: #000;
}

.player-container > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 导航菜单移动端优化 */
@media (max-width: 768px) {
  .mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
  }
  
  .mobile-menu.show {
    display: block;
  }
}

/* 图片懒加载占位 */
.img-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(#f0f0f0 25%, transparent 25%), 
              linear-gradient(90deg, #f0f0f0 75%, transparent 75%), 
              linear-gradient(#f0f0f0 75%, transparent 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 0, 10px 10px, 10px 10px;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Swiper自定义样式 */
.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5);
}

.swiper-pagination-bullet-active {
  background: #fff;
}

.swiper-button-next,
.swiper-button-prev {
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 16px;
}

/* 消息提示样式 */
.message-toast {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* 用户下拉菜单动画 */
.group:hover .group-hover\:opacity-100 {
  transition: opacity 0.3s ease;
}

.group:hover .group-hover\:visible {
  transition: visibility 0.3s ease;
}

/* 卡片悬停效果增强 */
.group:hover .group-hover\:scale-105 {
  transition: transform 0.3s ease;
}

/* 按钮点击效果 */
.button-click {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* 搜索建议样式 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 300px;
  overflow-y: auto;
}

.search-suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-suggestion-item:hover {
  background-color: #f9fafb;
}

/* 评分星星样式 */
.star-rating {
  display: inline-flex;
  align-items: center;
}

.star-rating .star {
  color: #d1d5db;
  transition: color 0.2s ease;
}

.star-rating .star.filled {
  color: #fbbf24;
}

/* 进度条样式 */
.progress-bar {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #ef4444;
  transition: width 0.3s ease;
}

/* 工具提示样式 */
.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 100;
}
