/* style/index.css */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: #ffffff;
}

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

.page-index__section-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

.page-index__section-title {
  text-align: center;
  font-size: 2.5em;
  margin-bottom: 30px;
  font-weight: bold;
  color: #26A9E0;
}

.tieudevip {
  text-align: center;
  color: #26A9E0;
  border-bottom: 2px solid #26A9E0;
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 2em;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: block;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Module 0: Hero Carousel */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Small top spacing, assuming body has header offset */
  position: relative;
  overflow: hidden;
  width: 100%;
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  height: 351px; /* Fixed height for desktop */
  overflow: hidden;
}

.page-index__hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.page-index__hero-slide.is-active {
  opacity: 1;
  position: relative;
}

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

.page-index__hero-slider-prev,
.page-index__hero-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5em;
  border-radius: 5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.page-index__hero-slider-prev:hover,
.page-index__hero-slider-next:hover {
  opacity: 1;
}

.page-index__hero-slider-prev {
  left: 10px;
}

.page-index__hero-slider-next {
  right: 10px;
}

.page-index__hero-slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
}

.page-index__hero-slider-dots::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.page-index__hero-slider-dots .is-active::before {
  background-color: #ffffff;
}

/* Module 1: Guide Section */
.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #f5e6d3;
  border-radius: 4px;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 calc(20% - 8px); /* Adjust for gap */
  max-width: calc(20% - 8px); /* Adjust for gap */
  text-decoration: none;
  transition: transform 0.3s ease-in-out;
}

.page-index__guide-card:hover {
  transform: translateY(-5px);
}

.page-index__guide-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 250 / 350;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

/* PC错落：中间高、两边平行 */
.page-index__guide-card--pos-1,
.page-index__guide-card--pos-5 {
  padding-top: 50px;
}

.page-index__guide-card--pos-2,
.page-index__guide-card--pos-4 {
  padding-top: 25px;
}

.page-index__guide-card--pos-3 {
  padding-top: 0;
}

/* Module 2: home_content Long Text Area */
.page-index__home-content-section {
  padding: 40px 0;
}

.page-index__home-content-row {
  display: flex;
  justify-content: center;
}

.page-index__home-content-box {
  max-width: 91%;
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid #26A9E0; /* Using brand color for border */
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(38, 169, 224, 0.5); /* Shadow using brand color */
  height: 700px;
  text-align: left;
  box-sizing: border-box;
  background-color: #ffffff;
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px; /* For scrollbar */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: #26A9E0 #f1f1f1; /* Firefox */
}

.page-index__home-content-inner::-webkit-scrollbar {
  width: 8px;
}

.page-index__home-content-inner::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.page-index__home-content-inner::-webkit-scrollbar-thumb {
  background: #26A9E0;
  border-radius: 10px;
}

.page-index__home-content-title {
  font-size: 2.2em;
  font-weight: bold;
  color: #26A9E0;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-index__home-content-section h2 {
  font-size: 1.8em;
  color: #26A9E0;
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-index__home-content-section h3 {
  font-size: 1.4em;
  color: #333333;
  margin-top: 25px;
  margin-bottom: 10px;
}

.page-index__home-content-section p {
  margin-bottom: 15px;
}

.page-index__home-content-section ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 15px;
}

.page-index__home-content-section li {
  margin-bottom: 5px;
}

.page-index__wp-caption {
  text-align: center;
  margin: 20px auto;
  max-width: 800px;
}

.page-index__wp-caption img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.page-index__wp-caption figcaption {
  font-style: italic;
  font-size: 0.9em;
  color: #555555;
  margin-top: 10px;
}

/* Module 3: Latest Blog Posts */
.page-index__blog-section {
  background-color: #f8f8f8;
  padding: 60px 0;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Changed to 3 for better spacing on desktop */
  gap: 20px;
}

.page-index__blog-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.page-index__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.page-index__blog-media {
  position: relative;
  height: 200px; /* Fixed height for blog card images */
  overflow: hidden;
}

.page-index__blog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0; /* Adjusted for card top corners */
}

.page-index__blog-date {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #26A9E0;
  color: #ffffff;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  text-align: center;
  line-height: 1;
}

.page-index__blog-date span:first-child {
  display: block;
  font-weight: bold;
  font-size: 1.2em;
}

.page-index__blog-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #26A9E0;
  padding: 15px;
  margin: 0;
}

.page-index__blog-excerpt {
  font-size: 0.9em;
  color: #555555;
  padding: 0 15px 15px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Module 4: App Download Section */
.page-index__app-download-section {
  text-align: center;
  padding: 60px 0;
  background-color: #eef7fa; /* Light blue background */
}

.page-index__app-description {
  font-size: 1.1em;
  color: #555555;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-index__app-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.page-index__app-button {
  display: inline-block;
  background: #EA7C07; /* Login color for buttons */
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__app-button:hover {
  background-color: #d16b05;
}

.page-index__app-image {
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* General responsive styles for images and containers */
.page-index img {
  max-width: 100%;
  height: auto;
  display: block;
}

.page-index__section-content,
.page-index__guide-box,
.page-index__home-content-box,
.page-index__blog-grid,
.page-index__app-buttons {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* @media (max-width: 768px) for mobile */
@media (max-width: 768px) {
  .page-index {
    font-size: 16px;
    line-height: 1.6;
  }

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

  .page-index__section-title {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .tieudevip {
    font-size: 1.5em;
  }

  /* Module 0: Hero Carousel - Mobile */
  .page-index__hero-carousel-section {
    padding-top: 10px !important;
  }

  .page-index__hero-slider {
    height: 200px; /* Adjust height for mobile */
  }

  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 5px 10px;
    font-size: 1.2em;
  }

  .page-index__hero-slide img {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }

  /* Module 1: Guide Section - Mobile */
  .page-index__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
  }

  .page-index__guide-card {
    flex: none;
    max-width: none;
    padding-top: 0 !important; /* Reset staggered padding */
  }

  /* Upper two cards */
  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 {
    grid-column: span 3;
  }

  /* Lower three cards */
  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 {
    grid-column: span 2;
  }

  .page-index__guide-card img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 250 / 350; /* Maintain aspect ratio */
    object-fit: contain;
  }

  /* Module 2: home_content Long Text Area - Mobile */
  .page-index__home-content-box {
    max-width: 100% !important;
    height: auto !important; /* Allow content to expand */
    padding: 20px 16px;
    border-width: 3px;
    box-shadow: 0 0 10px rgba(38, 169, 224, 0.3);
  }

  .page-index__home-content-inner {
    height: auto !important; /* Allow content to expand */
    overflow: visible !important; /* Disable scroll */
    padding-right: 0;
  }

  .page-index__home-content-title {
    font-size: 1.8em;
  }

  .page-index__home-content-section h2 {
    font-size: 1.5em;
  }

  .page-index__home-content-section h3 {
    font-size: 1.2em;
  }

  .page-index__wp-caption img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Module 3: Latest Blog Posts - Mobile */
  .page-index__blog-section {
    padding: 30px 0;
  }

  .page-index__blog-grid {
    grid-template-columns: repeat(1, 1fr); /* Single column for small mobile */
  }
  
  .page-index__blog-media img {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Module 4: App Download Section - Mobile */
  .page-index__app-download-section {
    padding: 30px 0;
  }

  .page-index__app-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .page-index__app-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__app-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* General image and button overrides for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index a[class*="button"],
  .page-index a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-index__section-content,
  .page-index__card,
  .page-index__container,
  .page-index__app-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets */
  }
}