:root {
  --primary-color: #017439; /* Main brand green */
  --secondary-color: #FFFFFF; /* Auxiliary white */
  --register-button-bg: #C30808; /* Red for register/login buttons */
  --text-dark: #333333; /* Dark text for light backgrounds */
  --text-light: #ffffff; /* Light text for dark backgrounds */
  --border-light: #e0e0e0;
  --bg-light-gray: #f9f9f9;
}

.page-resources {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for the page, assuming light body background */
  background-color: var(--secondary-color); /* Matches shared.css body background */
}

/* --- Hero Section --- */
.page-resources__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: var(--header-offset, 120px); /* Ensures content is not hidden by fixed header */
  background: linear-gradient(135deg, var(--primary-color) 0%, #018C46 30%, var(--secondary-color) 100%); /* Green to White gradient */
}

.page-resources__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%; /* Ensure container takes full width for responsive */
}

.page-resources__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-resources__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.page-resources__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  color: var(--text-light); /* Light text on gradient background */
}

.page-resources__hero-title {
  font-size: 3em;
  margin-bottom: 15px;
  color: var(--text-light);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-resources__hero-description {
  font-size: 1.2em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-light);
}

.page-resources__hero-cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%; /* Ensure button container is responsive */
}

.page-resources__btn-register,
.page-resources__btn-login {
  display: inline-block;
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 100%; /* Ensure button is responsive */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__btn-register {
  background: var(--register-button-bg); /* Custom red */
  color: var(--text-light); /* Forced white text for contrast */
  border: 2px solid var(--text-light);
}

.page-resources__btn-register:hover {
  background: #A60707; /* Darker red on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-resources__btn-login {
  background: var(--primary-color); /* Brand green */
  color: var(--text-light); /* White text */
  border: 2px solid var(--text-light);
}

.page-resources__btn-login:hover {
  background: #016331; /* Darker green on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* --- General Content Sections --- */
.page-resources__content-section {
  padding: 80px 20px;
  text-align: center;
}

.page-resources__dark-bg {
  background-color: var(--primary-color); /* Dark green background */
  color: var(--text-light); /* Light text */
}

.page-resources__light-bg {
  background-color: var(--secondary-color); /* White background */
  color: var(--text-dark); /* Dark text */
}

.page-resources__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%; /* Ensure container takes full width for responsive */
  box-sizing: border-box;
}

.page-resources__section-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--primary-color); /* Brand green for titles on light background */
}

.page-resources__section-title--light {
  color: var(--text-light); /* White for titles on dark background */
}

.page-resources__section-description {
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__section-description--light {
  color: rgba(255, 255, 255, 0.9); /* Slightly transparent white on dark background */
}

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

.page-resources__card {
  background: var(--secondary-color);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* Ensure cards have equal height */
  display: flex;
  flex-direction: column;
  color: var(--text-dark); /* Dark text on white card background */
}

.page-resources__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-resources__card img {
  width: 100%;
  height: 200px; /* Fixed height for card images */
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-light);
}

.page-resources__card-title {
  font-size: 1.4em;
  padding: 15px 20px 10px;
  margin: 0;
}

.page-resources__card-title a {
  text-decoration: none;
  color: var(--primary-color); /* Brand green for card titles */
  transition: color 0.3s ease;
}

.page-resources__card-title a:hover {
  color: #016331;
}

.page-resources__card-text {
  padding: 0 20px 15px;
  font-size: 0.95em;
  flex-grow: 1; /* Make text content grow to push read more to bottom */
}

.page-resources__read-more {
  display: inline-block;
  padding: 10px 20px;
  margin: 0 20px 20px;
  background: var(--primary-color);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-resources__read-more:hover {
  background: #016331;
}

/* --- FAQ Section --- */
.page-resources__faq-section {
  padding: 80px 20px;
  text-align: center;
}

.page-resources__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

/* FAQ默认状态 - 答案隐藏 */
.page-resources__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展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px 15px !important;
  opacity: 1;
  background: var(--bg-light-gray);
  border-radius: 0 0 5px 5px;
  color: var(--text-dark); /* Dark text on light background */
}

/* 问题样式 */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--secondary-color);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  color: var(--text-dark); /* Dark text on white question background */
}

.page-resources__faq-question:hover {
  background: var(--bg-light-gray);
  border-color: #C7C7C7;
}

.page-resources__faq-question:active {
  background: #EBEBEB;
}

/* 问题标题样式 */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none; /* 防止h3标签阻止点击事件 */
  color: var(--primary-color); /* Brand green for FAQ questions */
}

/* 切换图标 */
.page-resources__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #666;
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* 防止图标阻止点击事件 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  color: var(--primary-color); /* Brand green when active */
  transform: rotate(45deg); /* Optional: rotate for 'X' effect */
}

/* --- CTA Banner --- */
.page-resources__cta-banner {
  padding: 80px 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%); /* White to Green gradient */
  color: var(--text-dark); /* Dark text on initial white background */
}

.page-resources__cta-title {
  font-size: 2.8em;
  margin-bottom: 20px;
  color: var(--primary-color); /* Brand green for CTA title */
}

.page-resources__cta-text {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-resources__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%; /* Responsive button container */
}

.page-resources__btn-download {
  display: inline-block;
  padding: 15px 40px;
  background: var(--primary-color);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 100%; /* Responsive button */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-resources__btn-download:hover {
  background: #016331;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-resources__hero-title {
    font-size: 2.5em;
  }
  .page-resources__section-title {
    font-size: 2em;
  }
  .page-resources__cta-title {
    font-size: 2.2em;
  }
}

@media (max-width: 768px) {
  .page-resources {
    font-size: 16px;
    line-height: 1.6;
  }

  /* 🚨 Mobile Hero Section */
  .page-resources__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific padding top */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-resources__hero-title {
    font-size: 2em;
  }
  .page-resources__hero-description {
    font-size: 1em;
  }
  .page-resources__hero-image img {
    border-radius: 4px;
  }
  .page-resources__hero-cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px; /* Add padding to container */
  }
  .page-resources__btn-register,
  .page-resources__btn-login,
  .page-resources__btn-download {
    padding: 12px 25px;
    font-size: 16px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* 🚨 Mobile Content Sections */
  .page-resources__content-section,
  .page-resources__faq-section,
  .page-resources__cta-banner {
    padding: 40px 15px; /* Adjust padding for mobile */
  }

  .page-resources__section-title {
    font-size: 1.8em;
  }
  .page-resources__section-description {
    font-size: 1em;
  }

  /* 🚨 Mobile Image Adaption */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-resources__card img {
     /* Adjust card image height for mobile */
  }
  .page-resources__container,
  .page-resources__card,
  .page-resources__hero-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
  }
  .page-resources__resource-grid {
    gap: 20px;
  }
  .page-resources__card-title {
    font-size: 1.2em;
  }
  .page-resources__card-text {
    font-size: 0.9em;
  }

  /* 🚨 Mobile FAQ */
  .page-resources__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  .page-resources__faq-question h3 {
    font-size: 15px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  .page-resources__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  .page-resources__faq-answer {
    padding: 0 15px;
  }
  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }

  /* 🚨 Mobile CTA Banner */
  .page-resources__cta-title {
    font-size: 2em;
  }
  .page-resources__cta-text {
    font-size: 1em;
  }
  .page-resources__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }
}