/* style/index.css */
.page-index {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #f0f0f0; /* Light text for dark body background */
  background-color: #0d0d0d; /* Inherited from body */
  padding-top: 120px; /* Adjust for fixed header */
}

.page-index__hero-section {
  position: relative;
  width: 100%;
  padding-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  margin-top: -120px; /* Offset the padding-top from main */
}

.page-index__hero-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.page-index__hero-image {
  width: 100%;
  margin: 0;
}

.page-index__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: cover;
}

.page-index__products-section {
  width: 100%;
  padding: 60px 20px;
  background: #1a1a1a; /* Slightly lighter dark background for contrast */
}

.page-index__products-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 4fr 2fr; /* Desktop: 4 small cards, then 2 large cards */
  gap: 20px;
}

.page-index__products-grid {
  display: grid;
  gap: 20px;
}

.page-index__products-grid--small {
  grid-template-columns: repeat(4, 1fr);
}

.page-index__products-grid--large {
  grid-template-columns: repeat(2, 1fr);
}

.page-index__product-card {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a; /* Darker card background */
  border: 3px solid #ffd700; /* Golden border */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.page-index__product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.page-index__product-card-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.page-index__product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-index__section {
  padding: 80px 0;
  background-color: #0d0d0d; /* Default dark background */
  color: #f0f0f0;
}

.page-index__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.page-index__intro-section {
  background-color: #0d0d0d;
}

.page-index__quick-links-section, .page-index__dark-bg {
  background-color: #003366; /* Main brand dark blue */
  color: #ffffff; /* White text for dark blue background */
}

.page-index__games-section {
  background-color: #0d0d0d;
}

.page-index__promotions-section {
  background-color: #1a1a1a; /* Slightly lighter dark background */
}

.page-index__safety-support-section {
  background-color: #0d0d0d;
}

.page-index__faq-section {
  background-color: #003366; /* Main brand dark blue */
}

.page-index__blog-section {
  background-color: #1a1a1a; /* Slightly lighter dark background */
}

.page-index__title {
  font-size: 36px;
  font-weight: 700;
  color: #ffd700; /* Gold color for titles */
  text-align: center;
  margin-bottom: 40px;
  text-transform: uppercase;
}

.page-index__paragraph {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: justify;
  color: #e0e0e0;
}

.page-index__paragraph a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
}

.page-index__paragraph a:hover {
  text-decoration: underline;
}

.page-index__highlight {
  color: #ffd700;
  font-weight: bold;
}

.page-index__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.page-index__cta-buttons--center {
  justify-content: center;
}

.page-index__btn-primary,
.page-index__btn-secondary,
.page-index__btn-small {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.page-index__btn-primary {
  background-color: #ffd700; /* Gold background */
  color: #003366; /* Dark blue text */
  border-color: #ffd700;
}

.page-index__btn-primary:hover {
  background-color: #ffc400;
  color: #002244;
}

.page-index__btn-secondary {
  background-color: transparent;
  color: #ffd700; /* Gold text */
  border-color: #ffd700;
}

.page-index__btn-secondary:hover {
  background-color: #ffd700;
  color: #003366;
}

.page-index__btn-small {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #ffd700;
  color: #003366;
  border-color: #ffd700;
}

.page-index__btn-small:hover {
  background-color: #ffc400;
  color: #002244;
}

.page-index__link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.page-index__link-card {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 10px;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-index__link-card:hover {
  transform: translateY(-8px);
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.page-index__link-card-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 10px;
}

.page-index__link-card-desc {
  font-size: 16px;
  color: #e0e0e0;
}

.page-index__game-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__game-category-item {
  background-color: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  padding-bottom: 20px;
}

.page-index__game-category-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.page-index__game-category-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
}

.page-index__game-category-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 10px;
}

.page-index__game-category-title a {
  color: #ffd700;
  text-decoration: none;
}

.page-index__game-category-title a:hover {
  text-decoration: underline;
}

.page-index__game-category-desc {
  font-size: 16px;
  color: #e0e0e0;
  padding: 0 15px;
}

.page-index__promotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__promotion-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  padding-bottom: 20px;
}

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

.page-index__promotion-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
}

.page-index__promotion-card-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 10px;
  padding: 0 15px;
}

.page-index__promotion-card-desc {
  font-size: 15px;
  color: #e0e0e0;
  padding: 0 15px;
  margin-bottom: 20px;
}

.page-index__feature-item {
  text-align: center;
  padding: 25px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__feature-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.page-index__feature-item img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
}

.page-index__feature-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 10px;
}

.page-index__feature-desc {
  font-size: 16px;
  color: #e0e0e0;
}

.page-index__features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
}

/* FAQ容器样式 */
.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  overflow: hidden;
}

/* FAQ default state - answer hidden */
.page-index__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.4s ease;
  padding: 0 15px;
  opacity: 0;
}

/* FAQ expanded state - 🚨 Use !important and sufficiently large max-height */
.page-index__faq-item.active .page-index__faq-answer {
  max-height: 2000px !important; /* 🚨 Use !important for priority, large value for content */
  padding: 20px 15px !important;
  opacity: 1;
  background: #1a1a1a; /* Darker background for FAQ answer */
  border-radius: 0 0 5px 5px;
  color: #e0e0e0;
}

/* Question style */
.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #2a2a2a; /* Dark background for question */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-index__faq-question:hover {
  background: #3a3a3a;
  border-color: #ffd700;
}

.page-index__faq-question:active {
  background: #4a4a4a;
}

/* Question title style */
.page-index__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* Prevent h3 from blocking click event */
  color: #ffd700; /* Gold color for FAQ questions */
}

/* Toggle icon */
.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: #ffd700;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click event */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.page-index__faq-item.active .page-index__faq-toggle {
  color: #ffffff;
  transform: rotate(45deg); /* Rotate for 'x' effect */
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index__blog-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

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

.page-index__blog-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
}

.page-index__blog-card-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 10px;
  padding: 0 15px;
}

.page-index__blog-card-title a {
  color: #ffd700;
  text-decoration: none;
}

.page-index__blog-card-title a:hover {
  text-decoration: underline;
}

.page-index__blog-card-excerpt {
  font-size: 15px;
  color: #e0e0e0;
  padding: 0 15px;
  margin-bottom: 15px;
}

.page-index__blog-card-date {
  font-size: 14px;
  color: #aaaaaa;
  padding: 0 15px 20px;
  display: block;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-index__products-container {
    grid-template-columns: 1fr; /* Mobile: two grids stack vertically */
  }
  
  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__products-grid--large {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-index__title {
    font-size: 30px;
  }

  .page-index__paragraph {
    font-size: 16px;
  }

  .page-index__btn-primary, .page-index__btn-secondary {
    font-size: 16px;
    padding: 12px 25px;
  }
}

@media (max-width: 768px) {
  .page-index {
    padding-top: 100px; /* Adjust for fixed header on mobile */
  }

  .page-index__hero-section {
    margin-top: -100px; /* Offset the padding-top from main */
  }

  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-index__section,
  .page-index__container,
  .page-index__product-card,
  .page-index__link-card,
  .page-index__game-category-item,
  .page-index__promotion-card,
  .page-index__feature-item,
  .page-index__blog-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__products-section {
    padding: 40px 15px;
  }
  
  .page-index__products-container {
    grid-template-columns: 1fr; /* Mobile: two grids stack vertically */
    gap: 15px;
  }
  
  /* 🚨 Front 4 images - 4-grid layout (2x2), square */
  .page-index__products-grid--small {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .page-index__products-grid--small .page-index__product-card {
    aspect-ratio: 1 / 1; /* Square */
  }
  
  .page-index__products-grid--small .page-index__product-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; /* Square */
  }
  
  /* 🚨 Back 2 large images - each on a single line, square */
  .page-index__products-grid--large {
    grid-template-columns: 1fr; /* Each card on its own line */
    gap: 15px;
  }
  
  .page-index__products-grid--large .page-index__product-card {
    aspect-ratio: 1 / 1; /* Square */
  }
  
  .page-index__products-grid--large .page-index__product-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1; /* Square */
  }

  .page-index__section {
    padding: 40px 0;
  }

  .page-index__title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .page-index__paragraph {
    font-size: 15px;
  }

  .page-index__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-index__btn-primary, .page-index__btn-secondary {
    width: 100%;
    padding: 12px 20px;
  }

  .page-index__link-grid, .page-index__game-categories, .page-index__promotion-grid, .page-index__features-grid, .page-index__blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-index__link-card, .page-index__game-category-item, .page-index__promotion-card, .page-index__feature-item, .page-index__blog-card {
    padding: 20px 15px;
  }

  .page-index__link-card-title, .page-index__game-category-title, .page-index__promotion-card-title, .page-index__feature-title, .page-index__blog-card-title {
    font-size: 20px;
  }

  .page-index__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .page-index__faq-question h3 {
    font-size: 16px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  
  .page-index__faq-toggle {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }
  
  .page-index__faq-answer {
    padding: 0 15px;
  }
  
  .page-index__faq-item.active .page-index__faq-answer {
    padding: 15px !important;
  }
}