:root {
  --primary: #3a86ff;
  --secondary: #8ecae6;
  --accent: #ffb703;
  --light: #f8f9fa;
  --dark: #023047;
  --danger: #e63946;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: var(--light);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  padding: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-logo {
  max-width: 200px;
  margin-bottom: 1.5rem;
}

.header-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.header-content p {
  font-size: 1.2rem;
  max-width: 800px;
}

main {
  padding: 3rem 0;
}

.categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.category-btn {
  padding: 0.5rem 1.5rem;
  background-color: white;
  border: 2px solid var(--primary);
  border-radius: 50px;
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn:hover, .category-btn.active {
  background-color: var(--primary);
  color: white;
}

.resources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.resource-card {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-icon {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light);
}

.card-icon svg {
  width: 50px;
  height: 50px;
  color: var(--primary);
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  margin-bottom: 0.5rem;
  color: var(--dark);
  font-size: 1.2rem;
}

.card-content p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.card-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.card-link:hover {
  background-color: #2a75e6;
}

.card-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.75rem;
  background-color: var(--accent);
  color: var(--dark);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: bold;
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

footer {
  background-color: var(--dark);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-logo {
  max-width: 120px;
  margin-bottom: 1.5rem;
}

.footer-content p {
  margin-bottom: 1rem;
}

.footer-links {
  display: flex; /* 使用 Flexbox 排列 */
  flex-wrap: wrap; /* 允許換行 */
  justify-content: center; /* 水平置中 */
  margin-top: 10px;
  gap: 10px; /* 設定連結之間的間距 */
}

.footer-links a {
  color: #adb5bd;
  text-decoration: none;

  white-space: nowrap; 
  transition: color 0.3s ease;
}

.footer-links a:hover {
  text-decoration: underline;
}

.team-logo {
  max-width: 60px;
  border-radius: 50%;
  margin-right: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header-brand h1 {
  margin-bottom: 0;
}

.no-results {
  text-align: center;
  padding: 2rem;
  width: 100%;
  color: var(--dark);
}

@media (max-width: 768px) {
  .header-content h1 {
    font-size: 2rem;
  }
  
  .resources {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .header-brand {
    flex-direction: column;
    text-align: center;
  }
  
  .team-logo {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  .category-btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }
  
  .resources {
    grid-template-columns: 1fr;
  }
}



/* 合作協會 Logo 區 */
.partners {
  text-align: center;
  padding: 2rem 0;
  background-color: var(--light);
}
.partners h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--dark);
}
.partner-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}
.partner-logos img {
  max-width: 120px;
  height: auto;
  object-fit: contain;
  transition: transform .3s;
}
.partner-logos img:hover {
  transform: scale(1.05);
}
/* --- Global Styles (if not already present, good to have) --- */
body {
  font-family: 'Noto Sans TC', sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header Styles (example, adjust as needed) --- */
header {
  background-color: #f8f9fa;
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.team-logo {
  max-height: 60px; /* Adjust as needed */
  width: auto;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  color: #0056b3; /* Example color */
}

header p {
  margin: 0;
  font-size: 1em;
  color: #555;
}


/* --- 合作協會 Section Styles --- */
.partners {
  padding: 40px 0;
  text-align: center;
  background-color: #ffffff; /* Or any other background color */
}

.partners h2 {
  font-size: 1.8em;
  margin-bottom: 30px;
  color: #333;
}

.partner-logos {
  display: flex;
  justify-content: center; /* 水平置中排列 Logo */
  align-items: flex-start; /* 頂部對齊，因為文字高度可能不同 */
  flex-wrap: wrap; /* 當空間不足時，允許換行 */
  gap: 40px; /* Logo 之間的間距 */
}

.partner-logo-link {
  display: flex; /* 讓圖片和文字垂直排列 */
  flex-direction: column; /* 垂直排列 */
  align-items: center; /* 內部元素水平置中 */
  text-decoration: none; /* 移除連結底線 */
  color: #333; /* 設定文字顏色 */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* 平滑的過渡效果 */
  padding: 15px;
  border-radius: 8px; /* 輕微圓角 */
  max-width: 200px; /* 限制每個logo區塊的最大寬度 */
}

.partner-logo-link img {
  max-height: 70px; /* 設定圖片最大高度，讓它們視覺上更一致 */
  width: auto; /* 保持圖片原始寬高比 */
  margin-bottom: 10px; /* 圖片與下方文字的間距 */
  object-fit: contain; /* 確保圖片完整顯示且不變形 */
}

.partner-logo-link:hover {
  transform: translateY(-5px); /* 滑鼠懸停時輕微向上移動 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* 滑鼠懸停時增加陰影 */
}

.partner-link-text {
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
}

/* --- Main Content & Resource Cards (example, adjust as needed) --- */
main {
  padding: 40px 0;
}

.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.resource-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.card-icon svg {
  width: 40px;
  height: 40px;
  color: #007bff; /* Example icon color */
}

.card-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

.card-link {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 8px 15px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9em;
  transition: background-color 0.3s ease;
}

.card-link:hover {
  background-color: #0056b3;
}

/* --- Footer Styles (example, adjust as needed) --- */
footer {
  background-color: #343a40;
  color: #f8f9fa;
  padding: 30px 0;
  text-align: center;
  font-size: 0.9em;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-logo {
  max-height: 50px; /* Adjust as needed */
  margin-bottom: 10px;
}

.footer-links {
  margin-top: 10px;
}

.footer-links a {
  color: #adb5bd;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #007bff;
  color: white;
  padding: 10px;
  border-radius: 50%;
  display: none; /* Initially hidden, shown by JS */
  z-index: 1000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0.8;
}

.back-to-top:hover {
  opacity: 1;
}

.back-to-top svg {
  width: 24px;
  height: 24px;
  display: block;
}
