@import url("./main.css");
@import url("./common.css");
@import "index_mobile.css";

.indexPage {
  width: 100%;
  height: 100vh;
  overflow: auto;
}

/* 主要内容区域 */
.main-content {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* 顶部内容布局 */
.top-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-bottom: 2rem;
}

.banner-slider {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

/* 骨架屏样式 */
.banner-skeleton {
  width: 100%;
  height: 400px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 底部内容布局 */
.bottom-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
}

/* 推荐游戏区域 */
.recommended-games {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
  overflow: auto;
}

/* 最新游戏和热门游戏区域 */
.latest-games,
.hot-games {
  background: white;
  padding: 0 1.5rem;
  border-radius: 12px;
  height: fit-content;
}

.latest-games h3,
.hot-games h3 {
  font-size: 1.25rem;
  color: #2d3748;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #6b46c1;
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 游戏列表项样式 */
.game-list-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  background: white;
}

.game-list-item:hover {
  background: #f5f3ff;
  transform: translateX(4px);
}

.game-list-item img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.game-list-info {
  flex: 1;
  min-width: 0; /* 防止文本溢出 */
}

.game-list-info h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-list-info p {
  font-size: 0.8rem;
  color: #718096;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 加载状态和错误提示 */
.loading,
.error,
.no-games {
  width: 100%;
  padding: 2rem;
  text-align: center;
  border-radius: 8px;
  background: white;
}

.loading {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b46c1;
}

.loading::after {
  content: '';
  width: 30px;
  height: 30px;
  border: 2px solid #6b46c1;
  border-top-color: transparent;
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  color: #e53e3e;
  background-color: #fff5f5;
  border: 1px solid #feb2b2;
}

.no-games {
  color: #718096;
  background-color: #f7fafc;
  border: 1px dashed #e2e8f0;
}

/* 游戏卡片动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 轮播图样式 */
.slider-content {
  height: auto;
  position: relative;
}

.slider-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

.slider-item.active {
  opacity: 1;
}

.slider-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.slider-caption {
  padding: 1.5rem;
  background: white;
}

.slider-caption h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.slider-caption p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #718096;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slider-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
  transition: all 0.3s ease-in-out;
}

/* 游戏卡片样式 */
.game-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: fadeIn 0.3s ease-in-out;
  cursor: pointer;
  position: relative;
}

.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(107, 70, 193, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

.game-card:hover::after {
  opacity: 1;
}

.game-card:active {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(107, 70, 193, 0.3);
}

.game-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.game-card-content {
  padding: 1rem;
  position: relative;
  z-index: 1;
}

.game-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #2d3748;
  transition: color 0.3s ease;
}

.game-card:hover h3 {
  color: #6b46c1;
}

.game-card p {
  font-size: 0.9rem;
  color: #718096;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 游戏网格骨架屏 */
.games-grid-skeleton {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.game-card-skeleton {
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.game-card-skeleton-img {
  width: 100%;
  height: 150px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.game-card-skeleton-content {
  padding: 1rem;
}

.game-card-skeleton-title {
  height: 20px;
  width: 80%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.game-card-skeleton-text {
  height: 16px;
  width: 60%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 显示/隐藏类 */
.is-hidden {
  display: none;
}

.is-visible {
  display: block;
}

.is-flex {
  display: flex;
}

.is-grid {
  display: grid;
}

@media screen and (max-width: 768px) {
  .games-grid-skeleton {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 1rem;
    margin: 0 -1rem;
    padding: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .game-card-skeleton {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
  }
}

/* 网站介绍区域 */
.site-intro {
  background: #f8f9fa;
  padding: 3rem 1rem;
  margin-top: 3rem;
  text-align: center;
}

.site-intro-content {
  max-width: 1200px;
  margin: 0 auto;
  background: #6b46c1;
  border-radius: 16px;
  padding: 3rem 2rem;
  color: white;
  box-shadow: 0 8px 30px rgba(107, 70, 193, 0.2);
}

.site-intro h2 {
  font-size: 2rem;
  color: white;
  margin-bottom: 1.5rem;
}

.site-intro p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
}

.site-intro .highlight {
  color: #ffd700;
  font-weight: 500;
}

.site-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
  text-align: left;
}

.feature-item {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.feature-item h3 {
  font-size: 1.25rem;
  color: white;
  margin-bottom: 1rem;
}

.feature-item p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 0;
}

@media screen and (max-width: 768px) {
  .site-features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .site-intro h2 {
    font-size: 1.5rem;
  }

  .site-intro p {
    font-size: 1rem;
    line-height: 1.6;
  }
}




