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

.page-index__section {
  padding: 20px 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 {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  color: #017439;
}

.tieudevip {
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  margin: 40px auto;
  color: #3477c9; /* Custom color from demo */
  border: 2px solid #3477c9;
  padding: 10px 20px;
  border-radius: 8px;
  max-width: fit-content;
  box-shadow: 0 4px 15px rgba(52, 119, 201, 0.2);
}

/* Module 0: Hero Carousel Section */
.page-index__hero-carousel-section {
  padding-top: 10px; /* Small top spacing as body already has padding-top from shared */
  margin-bottom: 0;
  overflow: hidden;
}

.page-index__hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.page-index__hero-slide {
  display: none;
  width: 100%;
  transition: opacity 0.5s ease-in-out;
  opacity: 0;
}

.page-index__hero-slide.is-active {
  display: block;
  opacity: 1;
}

.page-index__hero-slide img {
  width: 100%;
  height: auto;
  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;
  font-size: 1.5em;
  z-index: 10;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.page-index__hero-slider-prev::before { content: '<'; }
.page-index__hero-slider-next::before { content: '>'; }

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

.page-index__hero-slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
}

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

/* Module 1: Guide Section */
.page-index__guide-section {
  padding-top: 20px;
  padding-bottom: 40px;
}

.page-index__guide-box {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 20px 24px;
  background: #f5e6d3; /* Light beige from demo */
  border-radius: 4px;
  box-sizing: border-box;
}

.page-index__guide-grid {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping on desktop */
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.page-index__guide-card {
  display: block;
  flex: 0 0 calc(20% - 6.4px); /* 20% width minus gap for 5 items */
  max-width: calc(20% - 6.4px);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

/* 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 Section */
.page-index__home-content-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

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

.page-index__home-content-box {
  max-width: 91%; /* Approx 700px width on typical screens, with max-width for responsiveness */
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px;
  border: 5px solid #3477c9; /* Blue border from demo */
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(52, 119, 201, 0.5); /* Blue shadow from demo */
  height: 700px; /* Fixed height for desktop */
  text-align: left;
  box-sizing: border-box;
  background-color: #ffffff;
}

.page-index__home-content-inner {
  height: 100%;
  overflow-y: auto; /* Enable vertical scrolling */
  overflow-x: hidden;
  padding-right: 8px; /* Space for scrollbar */
  color: #333333;
}

.page-index__home-content-title {
  font-size: clamp(2em, 3.5vw, 2.5em); /* Use clamp for H1 font size */
  font-weight: bold;
  color: #017439;
  margin-bottom: 20px;
  text-align: center;
}

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

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

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

.page-index__home-content-box ul,
.page-index__home-content-box ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.page-index__home-content-box ul li,
.page-index__home-content-box ol li {
  margin-bottom: 5px;
}

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

.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-size: 0.9em;
  color: #666666;
  margin-top: 10px;
}

/* Module 3: Latest Blog Posts Section */
.page-index__blog-section {
  padding-top: 40px;
  padding-bottom: 40px;
  background-color: #f9f9f9;
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.page-index__blog-card {
  background-color: #ffffff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.page-index__blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-index__blog-media {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  border-bottom: 1px solid #eee;
}

.page-index__blog-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.page-index__blog-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: #017439;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  font-weight: bold;
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1;
}

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

.page-index__blog-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #017439;
  margin: 15px;
  line-height: 1.4;
}

.page-index__blog-excerpt {
  font-size: 0.9em;
  color: #666666;
  margin: 0 15px 15px;
  flex-grow: 1;
}

/* Module 4: App Download Promo Section */
.page-index__download-app-section {
  padding: 60px 0;
  background-color: #017439; /* Brand primary color */
  color: #ffffff;
  text-align: center;
}

.page-index__download-app-box {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.2); /* Slightly transparent overlay */
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-index__download-app-title {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-index__download-app-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

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

.page-index__btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.2em;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 200px;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-index__btn-primary {
  background-color: #C30808; /* Red from custom colors */
  color: #FFFF00; /* Yellow from custom colors */
  border: 2px solid #C30808;
}

.page-index__btn-primary:hover {
  background-color: #ff3333;
  border-color: #ff3333;
}

.page-index__btn-secondary {
  background-color: #ffffff;
  color: #C30808; /* Red from custom colors */
  border: 2px solid #ffffff;
}

.page-index__btn-secondary:hover {
  background-color: #f0f0f0;
  border-color: #f0f0f0;
}

.page-index__btn-download i {
  margin-right: 10px;
  font-size: 1.4em;
}

.page-index__download-image {
  max-width: 80%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-index__section-title.tieudevip {
    font-size: 2em;
    margin: 30px auto;
  }

  .page-index__guide-card {
    flex: 0 0 calc(20% - 4px);
    max-width: calc(20% - 4px);
  }

  .page-index__blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-index__home-content-box {
    max-width: 95%;
  }
}

@media (max-width: 768px) {
  /* Module 0: Hero Carousel Section */
  .page-index__hero-carousel-section {
    padding-top: 10px !important; /* Ensure small top padding */
  }
  .page-index__hero-slider-prev,
  .page-index__hero-slider-next {
    padding: 8px 12px;
    font-size: 1.2em;
    width: 35px;
    height: 35px;
  }
  .page-index__hero-slider-dots {
    bottom: 5px;
    gap: 5px;
  }
  .page-index__hero-slider-dots button {
    width: 8px;
    height: 8px;
  }

  /* Module 1: Guide Section */
  .page-index__section-title.tieudevip {
    font-size: 1.8em;
    margin: 20px auto;
    padding: 8px 15px;
  }
  .page-index__guide-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 columns for flexibility */
    gap: 8px;
    margin-top: 20px;
  }
  .page-index__guide-card {
    flex: none;
    max-width: none;
    padding-top: 0 !important; /* Reset desktop padding for mobile */
  }
  /* Mobile: Top 2 cards (50% each), Bottom 3 cards (33.33% each) */
  .page-index__guide-card--pos-1,
  .page-index__guide-card--pos-2 { grid-column: span 3; }
  .page-index__guide-card--pos-3,
  .page-index__guide-card--pos-4,
  .page-index__guide-card--pos-5 { grid-column: span 2; }

  /* Module 2: Home Content Section */
  .page-index__home-content-box {
    max-width: 100%;
    height: auto; /* Auto height for mobile */
    padding: 20px 16px;
    border-width: 3px;
    box-shadow: 0 0 15px rgba(52, 119, 201, 0.4);
  }
  .page-index__home-content-inner {
    height: auto; /* Auto height for mobile */
    overflow: visible; /* No scrolling for mobile */
    padding-right: 0;
  }
  .page-index__home-content-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  .page-index__home-content-box h2 {
    font-size: 1.5em;
    margin-top: 25px;
  }
  .page-index__home-content-box h3 {
    font-size: 1.2em;
    margin-top: 20px;
  }

  /* Module 3: Latest Blog Posts Section */
  .page-index__blog-grid {
    grid-template-columns: repeat(1, 1fr); /* Single column for mobile */
  }
  .page-index__blog-card {
    border-radius: 10px;
  }
  .page-index__blog-media img {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }
  .page-index__blog-date {
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    font-size: 0.7em;
  }
  .page-index__blog-title {
    font-size: 1.1em;
    margin: 10px;
  }
  .page-index__blog-excerpt {
    font-size: 0.85em;
    margin: 0 10px 10px;
  }

  /* Module 4: App Download Promo Section */
  .page-index__download-app-box {
    padding: 20px;
  }
  .page-index__download-app-title {
    font-size: 2em;
  }
  .page-index__download-app-description {
    font-size: 1em;
  }
  .page-index__download-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }
  .page-index__btn-download {
    font-size: 1.1em;
    padding: 12px 20px;
    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__download-image {
    max-width: 90%;
  }

  /* Universal image and button adaptation for mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section-content,
  .page-index__guide-box,
  .page-index__home-content-box,
  .page-index__blog-card,
  .page-index__download-app-box,
  .page-index__download-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-index__download-buttons {
    flex-wrap: wrap !important;
    gap: 10px;
  }
}