:root {
  --primary-color: #1A2E4E;
  --secondary-color: #FFD700;
  --text-color-dark-bg: #ffffff;
  --text-color-light-bg: #333333;
  --bg-color-body: #121212; /* From shared.css */
  --card-bg-dark-mode: rgba(255, 255, 255, 0.08); /* Slightly transparent white for cards on dark background */
  --border-color-dark-mode: rgba(255, 255, 255, 0.15);
}

.page-resources {
  background-color: var(--bg-color-body);
  color: var(--text-color-dark-bg); /* Main text color for the page */
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  padding-top: var(--header-offset, 120px); /* Account for fixed header */
  min-height: 100vh;
}

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

.page-resources__section-title {
  font-size: 36px;
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
  position: relative;
  padding-bottom: 15px;
}

.page-resources__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.page-resources__description {
  text-align: center;
  font-size: 18px;
  margin-bottom: 50px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Section (Module 1: H1 Title + CTA Buttons) */
.page-resources__hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0f1c30 100%);
  padding: 80px 20px;
  text-align: center;
  color: var(--text-color-dark-bg);
  padding-top: var(--header-offset, 120px); /* Ensure space for fixed header */
}

.page-resources__main-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--secondary-color);
  line-height: 1.2;
}

.page-resources__cta-buttons {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

.page-resources__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  white-space: nowrap; /* Prevent text wrapping for single button */
}

.page-resources__btn-primary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--secondary-color);
}

.page-resources__btn-primary:hover {
  background-color: #e6c200;
  border-color: #e6c200;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-resources__btn-secondary {
  background-color: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.page-resources__btn-secondary:hover {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Brand Section (Module 3) */
.page-resources__brand-section {
  background-color: var(--bg-color-body);
  padding: 60px 0;
}

.page-resources__brand-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-resources__brand-item {
  background-color: var(--card-bg-dark-mode); /* Card background on dark body */
  border: 1px solid var(--border-color-dark-mode);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-resources__brand-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-resources__brand-item-title {
  color: var(--secondary-color);
  font-size: 24px;
  margin-bottom: 15px;
  font-weight: bold;
}

.page-resources__brand-item p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin-bottom: 10px;
}

.page-resources__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-resources__list li {
  position: relative;
  padding-left: 25px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.page-resources__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  font-weight: bold;
}

.page-resources__list-highlight {
  color: var(--secondary-color);
}

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

/* Blog Section (Module 4) */
.page-resources__blog-section {
  background-color: #1A2E4E; /* A darker shade for contrast */
  padding: 60px 0;
}

.page-resources__blog-section .page-resources__section-title {
  color: var(--secondary-color);
}

.page-resources__blog-section .page-resources__section-title::after {
  background-color: var(--secondary-color);
}

.page-resources__blog-section .page-resources__description {
  color: rgba(255, 255, 255, 0.8);
}

.page-resources__blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-resources__blog-item {
  background-color: var(--card-bg-dark-mode);
  border: 1px solid var(--border-color-dark-mode);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-resources__blog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-resources__blog-item-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

.page-resources__blog-link {
  padding: 20px;
  display: block;
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
}

.page-resources__blog-item-title {
  font-size: 20px;
  color: var(--secondary-color);
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: bold;
}

.page-resources__blog-item-excerpt {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
}

.page-resources__blog-item-date {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-top: auto; /* Push date to bottom */
  padding: 0 20px 20px; /* Add padding here to align with other content */
}

.page-resources__view-more {
  text-align: center;
  margin-top: 50px;
}


/* FAQ Section (Module 2) */
.page-resources__faq-section {
  background-color: var(--bg-color-body);
  padding: 60px 0;
}

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

/* FAQ容器样式 */
.page-resources__faq-item {
  margin-bottom: 15px;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--card-bg-dark-mode);
  border: 1px solid var(--border-color-dark-mode);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 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 20px;
  opacity: 0;
  color: rgba(255, 255, 255, 0.8);
}

/* FAQ展开状态 - 🚨 使用!important和足够大的max-height确保一定能展开 */
.page-resources__faq-item.active .page-resources__faq-answer {
  max-height: 2000px !important; /* 🚨 使用!important确保优先级，值足够大以容纳任何内容 */
  padding: 20px !important;
  opacity: 1;
  background: rgba(255, 255, 255, 0.05); /* Slightly lighter background for active answer */
  border-top: 1px solid var(--border-color-dark-mode);
}

/* 问题样式 */
.page-resources__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease;
}

.page-resources__faq-question:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* 问题标题样式 */
.page-resources__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-color-dark-bg);
  pointer-events: none; /* 防止h3标签阻止点击事件 */
}

/* 切换图标 */
.page-resources__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  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: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-color);
}

.page-resources__faq-item.active .page-resources__faq-toggle {
  transform: rotate(45deg); /* Rotate to form an 'X' or '−' */
  color: var(--primary-color);
  background-color: var(--secondary-color);
}

/* Global image styles */
.page-resources img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-resources {
    font-size: 16px;
    line-height: 1.6;
    padding-top: var(--header-offset, 120px) !important;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .page-resources__container {
    padding: 30px 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-resources__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .page-resources__description {
    font-size: 16px;
    margin-bottom: 30px;
    padding: 0 10px;
  }

  /* Hero Section */
  .page-resources__hero-section {
    padding: 60px 15px;
    padding-top: var(--header-offset, 120px) !important;
  }

  .page-resources__main-title {
    font-size: 36px;
  }

  .page-resources__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-resources__cta-button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 20px;
    font-size: 16px;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Brand Section */
  .page-resources__brand-section {
    padding: 40px 0;
  }

  .page-resources__brand-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-resources__brand-item {
    padding: 20px;
  }

  .page-resources__brand-item-title {
    font-size: 20px;
  }

  .page-resources__brand-item p {
    font-size: 15px;
  }

  .page-resources__list li {
    font-size: 15px;
    padding-left: 20px;
  }

  .page-resources__list li::before {
    font-size: 16px;
  }

  /* Blog Section */
  .page-resources__blog-section {
    padding: 40px 0;
  }

  .page-resources__blog-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-resources__blog-item-image {
    height: 180px;
  }

  .page-resources__blog-link {
    padding: 15px;
  }

  .page-resources__blog-item-title {
    font-size: 18px;
  }

  .page-resources__blog-item-excerpt {
    font-size: 14px;
  }

  .page-resources__blog-item-date {
    padding: 0 15px 15px;
    font-size: 13px;
  }

  .page-resources__view-more {
    margin-top: 30px;
  }

  /* FAQ Section */
  .page-resources__faq-section {
    padding: 40px 0;
  }

  .page-resources__faq-list {
    margin-top: 30px;
    padding: 0 15px;
  }

  .page-resources__faq-item {
    border-radius: 8px;
  }

  .page-resources__faq-question {
    padding: 15px;
  }

  .page-resources__faq-question h3 {
    font-size: 16px;
  }

  .page-resources__faq-toggle {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }

  .page-resources__faq-item.active .page-resources__faq-answer {
    padding: 15px !important;
  }

  /* Ensure all images are responsive */
  .page-resources img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

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

  .page-resources__blog-item-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; /* Allow height to adjust */
    object-fit: cover;
  }
  
  /* Container overflow prevention */
  .page-resources__hero-section,
  .page-resources__brand-section,
  .page-resources__blog-section,
  .page-resources__faq-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .page-resources__brand-content,
  .page-resources__blog-list,
  .page-resources__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}