/*=======categories.html=========*/
.categories-page {
  border-radius: 10px;
  background-color: #EDE7F0;
  margin: 10px;
}

.page-header {
  text-align: center;
}

.page-header h1 {
  background-color: #ddd;
  border-radius: 10px 10px 0 0;
  font-size: 24px;
  color: #333;
  font-weight: 700;
  line-height: 48px;
}

.page-header p {
  color: #888;
  font-size: 16px;
}

.total-categories {
  color: #f57c00;
  font-size: 20px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 0 10px 10px 10px;
}

.category-card {
  background: linear-gradient(145deg, #97b2d3, #375569);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
  position: relative;
}

.category-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 15px 30px rgba(65, 57, 70, 0.4);
  border-color: rgba(95, 86, 100, 0.6);
}

.category-icon {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 29, 58, 0.7);
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

.category-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(125, 3, 186, 0.2) 0%, transparent 70%);
  z-index: 0;
}

.category-icon i {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 15px rgba(125, 3, 186, 0.7);
}

.category-content {
  text-align: center;
}

.category-name {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.games-count {
  display: inline-block;
  background: rgba(168, 167, 168, 0.2);
  color: #afafaf;
  padding: 5px 15px;
  border-radius: 15px;
}

.view-btn {
  display: inline-block;
  background: linear-gradient(180deg, #f0bb8a, #f17108);
  color: white;
  padding: 8px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  margin-top: 10px;
  margin-bottom: 10px;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.view-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(125, 3, 186, 0.5);
}

@media (max-width: 992px) {
  .categories-grid {
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 20px;
  }
  
  .page-header h1 {
      font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .categories-grid {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 18px;
  }
  
  .page-header h1 {
      font-size: 1rem;
  }
  
  .category-icon {
      height: 100px;
      font-size: 3rem;
  }
}

@media (max-width: 576px) {
  .categories-grid {
      grid-template-columns: 1fr;
      max-width: 400px;
      margin: 0 auto;
  }
  
  .page-header h1 {
      font-size: 1rem;
  }
  
  body {
      padding: 15px;
  }
}

.loader {
  text-align: center;
  padding: 40px;
  grid-column: 1 / -1;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(125, 3, 186, 0.3);
  border-top: 5px solid #7d03ba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.error-message {
  text-align: center;
  padding: 30px;
  background: rgba(255, 0, 0, 0.1);
  border-radius: 10px;
  max-width: 500px;
  margin: 40px auto;
  border: 1px solid rgba(255, 0, 0, 0.3);
  grid-column: 1 / -1;
}

.error-message h3 {
  color: #333;
  margin-bottom: 15px;
}

/*=============genre.html/tag-games.html============*/
.tags-page {
  border-radius: 10px;
  background-color: #EDE7F0;
  margin: 10px;
}

/* 游戏网格布局 */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 0 10px 0 10px;
}

.game-item {
  position: relative;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.game-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.game-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 宽高比 */
  overflow: hidden;
}

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

.game-item:hover .game-image {
  transform: scale(1.05);
}

.game-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.game-title {
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: #333;
  font-weight: 600;
}

.game-field {
  margin: 0;
  font-size: 0.9rem;
  color: #7f8c8d;
  line-height: 1.4;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;  
}

.game-field-label {
  font-weight: 600;
  color: #3498db;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.game-tag {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* 标签类型特定样式 */
.tag-gender-female { background: #ffd1e0; color: #c2185b; }
.tag-gender-male { background: #cae1ff; color: #1976d2; }
.tag-agegroup-kids { background: #e8f5e9; color: #388e3c; }
.tag-agegroup-teens { background: #fff8e1; color: #f57c00; }
.tag-agegroup-adults { background: #fbe9e7; color: #d84315; }
.tag-exclusive { background: #fff9c4; color: #f9a825; border: 1px dashed #f9a825; }
.tag-genre { background: #e0f7fa; color: #006064; }
.tag-tag { background: #f3e5f5; color: #6a1b9a; }

.game-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}



/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top:30px;
  padding-bottom: 30px;
}

.page-item {
  padding: 8px 16px;
  border: none;
  background: #f1f1f1;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.page-item:hover {
  background: #e0e0e0;
}

.page-item.active {
  background: #3498db;
  color: white;
  font-weight: bold;
}

.ellipsis {
  padding: 0 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .games-grid {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 10px;
  }
  
  .page-item {
      padding: 6px 12px;
      font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .games-grid {
      grid-template-columns: repeat(1, 1fr);
  }
  
  .pagination {
      gap: 5px;
  }
  
  .page-item {
      padding: 5px 8px;
      font-size: 0.8rem;
  }
}