/* style/index.css */

/* General styles for the page content */
.page-index {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #f0f0f0; /* Default text color for dark body background */
  background-color: var(--secondary-color); /* Assuming body background is handled by shared.css */
}

/* Module 0: Hero Banner */
.page-index__hero-section {
  padding-top: 10px; /* Small top padding as per rules, assuming body padding-top is handled by shared.css */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-index__hero-banner {
  width: 100%;
  overflow: hidden;
}

.page-index__hero-banner img {
  width: 100%;
  height: auto;
  display: block;
  min-height: 200px; /* Minimum size requirement */
  object-fit: cover;
}

/* Module 1: Intro Section */
.page-index__intro-section {
  background: #252b38;
  padding: 60px 20px;
  color: #ffffff;
}

.page-index__intro-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.page-index__section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 30px;
  color: #ed9107; /* Accent color */
}

.page-index__section-title--center span {
  padding: 0 20px;
  font-size: clamp(2rem, 5vw, 3rem); /* H1 font size with clamp */
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.2;
}

.page-index__section-title--center b {
  flex-grow: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, #ed9107, transparent);
  max-width: 150px;
}

.page-index__section-title--normal {
  justify-content: flex-start;
  margin-left: 0;
  margin-right: 0;
}

.page-index__section-title--normal span {
  padding: 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.5rem); /* H2 font size with clamp */
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.2;
}

.page-index__section-title--normal b {
  flex-grow: 0;
  height: 2px;
  background: #ed9107;
  width: 50px;
  margin-right: 15px;
}

.page-index__intro-quote {
  font-size: 1.15rem;
  line-height: 1.8;
  max-width: 800px;
  margin: 30px auto 40px;
  color: #cccccc;
}

.page-index__intro-quote p {
  margin: 0;
  padding: 0;
}

.page-index__intro-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.page-index__intro-links li {
  margin: 0;
}

.page-index__btn-primary,
.page-index__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 150px;
  text-align: center;
  max-width: 100%; /* Button responsive */
  box-sizing: border-box; /* Button responsive */
  white-space: normal; /* Button responsive */
  word-wrap: break-word; /* Button responsive */
}

.page-index__btn-primary {
  background: #EA7C07; /* Login color */
  color: #ffffff;
  border: 2px solid #EA7C07;
}

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

.page-index__btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid #26A9E0;
}

.page-index__btn-secondary:hover {
  background: #26A9E0;
  color: #ffffff;
}

/* Module 2: FAQ Section */
.page-index__faq-section {
  background: #181b1f; /* Blog card background for contrast */
  padding: 60px 20px;
  color: #ffffff;
}

.page-index__faq-container {
  max-width: 1000px;
  margin: 0 auto;
}

.page-index__faq-section .page-index__section-title {
  justify-content: center;
  margin-bottom: 40px;
}

.page-index__faq-section .page-index__section-title span {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #ed9107;
}

.page-index__faq-section .page-index__section-title b {
  background: linear-gradient(to right, transparent, #ed9107, transparent);
}

details.page-index__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

details.page-index__faq-item[open] {
  background: rgba(255, 255, 255, 0.1);
  border-color: #26A9E0;
}

details.page-index__faq-item summary.page-index__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

details.page-index__faq-item summary.page-index__faq-question::-webkit-details-marker {
  display: none;
}

details.page-index__faq-item summary.page-index__faq-question:hover {
  background: rgba(255, 255, 255, 0.1);
}

.page-index__faq-qtext {
  flex: 1;
  line-height: 1.5;
  text-align: left;
}

.page-index__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: #ed9107;
  flex-shrink: 0;
  margin-left: 15px;
  width: 30px;
  text-align: center;
  line-height: 1;
  transition: transform 0.3s ease;
}

details.page-index__faq-item[open] .page-index__faq-toggle {
  transform: rotate(45deg); /* Change + to X or similar */
  color: #26A9E0;
}

details.page-index__faq-item .page-index__faq-answer {
  padding: 0 25px 25px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 8px 8px;
  color: #cccccc;
}

.page-index__faq-answer p {
  margin: 0;
}

/* Module 3: Blog Section */
.page-index__blog-section {
  background: #252b38;
  padding: 60px 20px;
  color: #ffffff;
}

.page-index__blog-section .page-index__section-title {
  justify-content: center;
  margin-bottom: 40px;
}

.page-index__blog-section .page-index__section-title span {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #ed9107;
}

.page-index__blog-section .page-index__section-title b {
  background: linear-gradient(to right, transparent, #ed9107, transparent);
}

.page-index__blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-index__blog-card {
  background: #181b1f;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-index__blog-media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.page-index__blog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 200px; /* Minimum size requirement */
}

.page-index__blog-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ed9107;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

.page-index__blog-day {
  display: block;
  font-size: 1.2em;
}

.page-index__blog-month {
  display: block;
  font-size: 0.8em;
  text-transform: uppercase;
}

.page-index__blog-body {
  padding: 20px;
}

.page-index__blog-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 10px;
  color: #ffffff;
  line-height: 1.4;
  height: 3.2em; /* Limit to 2 lines for consistency */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-index__blog-excerpt {
  font-size: 0.95rem;
  color: #cccccc;
  line-height: 1.6;
  height: 3.2em; /* Limit to 2 lines for consistency */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Responsive styles */
@media (max-width: 1024px) {
  .page-index__section-title--center b {
    max-width: 100px;
  }
}

@media (max-width: 849px) {
  /* HERO 主图区域 */
  .page-index__hero-section {
    padding-top: 10px !important; /* Ensure small top padding */
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .page-index__hero-banner img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* 深色导语区 */
  .page-index__intro-section {
    padding: 40px 15px;
  }
  .page-index__section-title--center span {
    font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  }
  .page-index__intro-quote {
    font-size: 1rem;
    margin: 20px auto 30px;
  }
  .page-index__intro-links {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }
  .page-index__intro-links li {
    width: 100%;
  }
  .page-index__btn-primary,
  .page-index__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 0.95rem;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* FAQ 与其他模块 */
  .page-index__faq-section {
    padding: 40px 15px;
  }
  .page-index__faq-section .page-index__section-title span {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }
  details.page-index__faq-item summary.page-index__faq-question {
    padding: 15px 20px;
    font-size: 1rem;
  }
  .page-index__faq-toggle {
    font-size: 24px;
    width: 24px;
    margin-left: 10px;
  }
  details.page-index__faq-item .page-index__faq-answer {
    padding: 0 20px 20px;
    font-size: 0.95rem;
  }

  /* 博客网格 */
  .page-index__blog-section {
    padding: 40px 15px;
  }
  .page-index__blog-section .page-index__section-title span {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }
  .page-index__blog-grid {
    grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
    gap: 20px;
  }
  .page-index__blog-card-link {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .page-index__blog-media img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__blog-title {
    font-size: 1.1rem;
  }
  .page-index__blog-excerpt {
    font-size: 0.9rem;
  }

  /* 通用图片与容器 */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-index__section,
  .page-index__container,
  .page-index__card,
  .page-index__intro-inner,
  .page-index__faq-container,
  .page-index__blog-grid {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* padding-left and padding-right are handled by parent sections */
  }
}

@media (max-width: 549px) {
  .page-index__section-title--center span {
    font-size: clamp(1.1rem, 4.5vw, 1.75rem); /* Mobile H1 clamp */
  }
  .page-index__section-title--center b {
    max-width: 50px;
  }
  .page-index__section-title--normal span {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }
  .page-index__intro-quote {
    font-size: 0.95rem;
  }
  .page-index__blog-grid {
    grid-template-columns: 1fr; /* Mobile: 1 column */
  }
  .page-index__blog-title {
    font-size: 1rem;
  }
  .page-index__blog-excerpt {
    font-size: 0.85rem;
  }
  details.page-index__faq-item summary.page-index__faq-question {
    padding: 12px 15px;
    font-size: 0.95rem;
  }
  details.page-index__faq-item .page-index__faq-answer {
    padding: 0 15px 15px;
  }
  .page-index__faq-toggle {
    font-size: 20px;
    width: 20px;
  }
}