/* General styles for the FAQ page content */
.page-faq {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default text color for light body background */
  background-color: #f9f9f9; /* Light background for the main content area */
}

/* Hero Section */
.page-faq__hero-section {
  position: relative;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
  background-color: #017439; /* Brand primary color for dark section */
  color: #ffffff; /* White text for dark background */
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
}

.page-faq__hero-image-wrapper {
  width: 100%;
  max-height: 500px; /* Limit height for hero image */
  overflow: hidden;
}

.page-faq__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Default cover for desktop */
  aspect-ratio: 16/9; /* Maintain aspect ratio */
}

.page-faq__hero-content {
  max-width: 900px;
  margin-top: 20px;
  padding: 0 20px;
}

.page-faq__main-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive font size */
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #ffffff;
}

.page-faq__description {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-faq__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 500px; /* Limit button group width */
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 0 15px; /* Add padding to prevent overflow */
}

.page-faq__btn-primary,
.page-faq__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 180px;
  text-align: center;
  box-sizing: border-box; /* Crucial for button max-width */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
}

.page-faq__btn-primary {
  background-color: #C30808; /* Custom color for register/login */
  color: #FFFF00; /* Custom color for register/login font */
  border: 2px solid #C30808;
}

.page-faq__btn-primary:hover {
  background-color: #e02020;
  border-color: #e02020;
  color: #ffffff;
}

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

.page-faq__btn-secondary:hover {
  background-color: #ffffff;
  color: #017439;
}

/* Content Sections */
.page-faq__content-section,
.page-faq__faq-list-section {
  padding: 60px 0;
  background-color: #ffffff;
  color: #333333;
}

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

.page-faq__section-title {
  font-size: clamp(2rem, 4vw, 2.8rem); /* Responsive font size */
  font-weight: 700;
  color: #017439; /* Brand primary color */
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.3;
}

.page-faq__article-body {
  max-width: 900px;
  margin: 0 auto 40px;
  line-height: 1.8;
  font-size: 1.05rem;
}

.page-faq__article-body p {
  margin-bottom: 20px;
}

.page-faq__article-body ul,
.page-faq__article-body ol {
  margin-bottom: 20px;
  padding-left: 25px;
}

.page-faq__article-body li {
  margin-bottom: 10px;
}

.page-faq__article-figure {
  width: 100%;
  height: auto;
  display: block;
  margin: 30px auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  min-width: 200px; /* Minimum image size */
  min-height: 200px; /* Minimum image size */
}

/* FAQ Items - Details/Summary Structure */
details.page-faq__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
details.page-faq__faq-item summary.page-faq__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, color 0.3s ease;
  color: #333333;
}
details.page-faq__faq-item summary.page-faq__faq-question::-webkit-details-marker {
  display: none;
}
details.page-faq__faq-item summary.page-faq__faq-question:hover {
  background: #f5f5f5;
  color: #017439;
}
.page-faq__faq-qtext {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
}
.page-faq__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  margin-left: 15px;
  width: 30px;
  text-align: center;
  line-height: 1;
}
details.page-faq__faq-item[open] summary.page-faq__faq-question {
  background-color: #e6f7ed; /* Light green when open */
  color: #017439;
  border-bottom: 1px solid #cce8d6;
}
details.page-faq__faq-item .page-faq__faq-answer {
  padding: 0 25px 25px;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  line-height: 1.7;
  font-size: 1rem;
  color: #555555;
}
.page-faq__faq-answer p:last-child {
  margin-bottom: 0;
}
.page-faq__faq-answer ul, .page-faq__faq-answer ol {
  margin-top: 10px;
  margin-bottom: 10px;
  padding-left: 20px;
}
.page-faq__faq-answer li {
  margin-bottom: 5px;
}

/* Button Container for FAQ answers */
.page-faq__btn-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding: 0 10px;
}
.page-faq__btn-container .page-faq__btn-primary,
.page-faq__btn-container .page-faq__btn-secondary {
  padding: 12px 25px;
  font-size: 0.95rem;
  min-width: 150px;
}
.page-faq__btn-container .page-faq__btn-primary {
  background-color: #017439; /* Brand color for buttons in content */
  border-color: #017439;
  color: #ffffff;
}
.page-faq__btn-container .page-faq__btn-primary:hover {
  background-color: #005f2e;
  border-color: #005f2e;
}
.page-faq__btn-container .page-faq__btn-secondary {
  background-color: transparent;
  color: #017439;
  border-color: #017439;
}
.page-faq__btn-container .page-faq__btn-secondary:hover {
  background-color: #017439;
  color: #ffffff;
}


/* --- Responsive Styles --- */
@media (max-width: 1024px) {
  .page-faq__hero-image {
    max-height: 400px;
  }
  .page-faq__main-title {
    font-size: clamp(2.2rem, 4.5vw, 3rem);
  }
  .page-faq__description {
    font-size: 1.1rem;
  }
  .page-faq__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  }
  .page-faq__article-body {
    font-size: 1rem;
  }
  details.page-faq__faq-item summary.page-faq__faq-question {
    padding: 16px 20px;
  }
  .page-faq__faq-qtext {
    font-size: 1rem;
  }
  .page-faq__faq-toggle {
    font-size: 24px;
    width: 25px;
  }
  details.page-faq__faq-item .page-faq__faq-answer {
    padding: 0 20px 20px;
  }
}

@media (max-width: 768px) {
  /* HERO 主图区域 */
  .page-faq__hero-section {
    padding-top: 10px; /* Small top padding for mobile */
    padding-bottom: 30px;
  }
  .page-faq__hero-image-wrapper {
    max-height: 300px; /* Adjust height for mobile */
  }
  .page-faq__hero-image {
    object-fit: contain !important; /* Prevent cropping on mobile */
    aspect-ratio: unset !important; /* Allow natural aspect ratio */
    width: 100% !important;
    height: auto !important;
  }
  .page-faq__hero-content {
    margin-top: 15px;
    padding: 0 15px;
  }
  .page-faq__main-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem); /* Smaller H1 for mobile */
    margin-bottom: 10px;
  }
  .page-faq__description {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }
  .page-faq__cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 10px;
    padding: 0 15px; /* Ensure padding for container */
    max-width: 100% !important; /* Ensure container takes full width */
    width: 100% !important;
  }
  .page-faq__btn-primary,
  .page-faq__btn-secondary {
    max-width: 100% !important; /* Full width buttons on mobile */
    width: 100% !important;
    padding: 12px 15px;
    font-size: 0.9rem;
    min-width: unset; /* Remove min-width for full flexibility */
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Content Sections */
  .page-faq__content-section,
  .page-faq__faq-list-section {
    padding: 40px 0;
  }
  .page-faq__container {
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-faq__section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 30px;
  }
  .page-faq__article-body {
    font-size: 0.95rem;
    max-width: 100% !important;
    margin: 0 auto 30px;
    padding: 0 5px; /* Slight inner padding for text */
    box-sizing: border-box !important;
  }
  .page-faq__article-body img,
  .page-faq__article-figure {
    max-width: 100% !important; /* Ensure all images are responsive */
    width: 100% !important;
    height: auto !important;
    min-width: 200px;
    min-height: 200px;
    box-sizing: border-box !important;
  }

  /* FAQ Items */
  details.page-faq__faq-item {
    margin-bottom: 10px;
  }
  details.page-faq__faq-item summary.page-faq__faq-question {
    padding: 15px;
  }
  .page-faq__faq-qtext {
    font-size: 0.95rem;
  }
  .page-faq__faq-toggle {
    font-size: 22px;
    width: 25px;
    margin-left: 10px;
  }
  details.page-faq__faq-item .page-faq__faq-answer {
    padding: 0 15px 15px;
    font-size: 0.9rem;
  }
  .page-faq__faq-answer ul, .page-faq__faq-answer ol {
    padding-left: 15px;
  }

  /* Button Container in FAQ answers */
  .page-faq__btn-container {
    flex-direction: column; /* Stack buttons vertically */
    gap: 8px;
    padding: 0;
    max-width: 100% !important;
    width: 100% !important;
  }
  .page-faq__btn-container .page-faq__btn-primary,
  .page-faq__btn-container .page-faq__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}