/* 基礎重置與字體設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background-color: #f4f6f8;
  color: #333;
  line-height: 1.6;
}

/* ==========================================
   右上角 MENU 按鈕與側邊滑出選單 (Drawer)
   ========================================== */

/* 1. MENU 開啟按鈕 */
.menu-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background-color 0.2s;
}

.menu-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.hamburger-icon {
  font-size: 18px;
}

/* 2. 暗色半透明背景遮罩 */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* 3. 從右側滑出的抽屜容器 */
.side-drawer {
  position: fixed;
  top: 0;
  right: -320px; /* 初始狀態隱藏在螢幕右側外 */
  width: 300px;
  height: 100vh;
  background-color: #ffffff;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* 當有 is-active Class 時，平滑滑入 */
.side-drawer.is-active {
  right: 0;
}

/* 4. 關閉按鈕區塊 */
.drawer-header {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 15px;
  border-bottom: 1px solid #edf2f7;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: bold;
  color: #718096;
  cursor: pointer;
  letter-spacing: 1px;
}

.drawer-close-btn:hover {
  color: #2d3748;
}

/* 5. 側邊選單列表 */
.drawer-nav ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
}

.drawer-nav li {
  border-bottom: 1px solid #f7fafc;
}

.drawer-nav a {
  display: block;
  padding: 14px 10px;
  color: #2d3748;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.2s, background-color 0.2s;
  border-radius: 6px;
}

.drawer-nav a:hover {
  color: #6b52a1;
  background-color: #f7fafc;
}

/* 策略合作學術團體（未連結狀態） */
.drawer-nav a.disabled-link {
  color: #a0aec0;
  cursor: default;
}
.drawer-nav a.disabled-link:hover {
  background-color: transparent;
  color: #a0aec0;
}

/* ==========================================
   側邊選單內部向下展開 (Accordion) 修正版
   ========================================== */

/* 1. 恢復側邊抽屜的上下滾動功能 */
.side-drawer {
  overflow-y: auto !important;
}

.drawer-nav {
  overflow: visible;
}

/* 2. 次選單區塊 */
.has-submenu {
  position: relative;
}

/* 次選單預設隱藏，留在抽屜內部 */
.submenu {
  display: none;
  background-color: #f7fafc;
  padding: 6px 0 6px 15px;
  margin: 6px 0;
  border-left: 3px solid #6b52a1; /* 紫色左邊框線標示層級 */
  border-radius: 4px;
}

/* 3. 次選單內的連結 */
.submenu a {
  display: block;
  font-size: 14px;
  padding: 8px 12px;
  color: #4a5568;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.submenu a:hover {
  color: #6b52a1;
  background-color: #edf2f7;
}

/* 4. 滑鼠懸停時，在抽屜內部往下順暢展開 */
.has-submenu:hover .submenu {
  display: block;
}

/* 1. 讓 Header 浮在畫面的最上方 */
header {
  position: fixed;    /* 關鍵：絕對定位，不佔用下方圖片的空間 */
  top: 10px;             /* 距離頂部 20px */
  left: 0;
  width: 100%;
  z-index: 100;          /* 關鍵：層級設高，確保浮在背景圖與所有內容之上 */
  padding: 0 20px;       /* 左右兩側留些許空間 */
  box-sizing: border-box;
}
/* 2. 打造如同截圖中的「白色膠囊圓角卡片」 */
.header-container {
  max-width: 1250px;
  min-height: 80px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95); /* 95% 半透明純白，質感更好 */
  backdrop-filter: blur(10px);          /* 毛玻璃效果 */
  border-radius: 50px;                   /* 圓角大膠囊形狀 (如截圖效果) */
  padding: 5px 12px;                    /* 容器內部邊距 */
  box-shadow: 0 10px 25px rgba(0,0,0,0.15); /* 懸浮浮雕陰影 */
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* 專門給內頁使用的間距調整 */
.main-container.inner-page {
  padding-top: 90px;
}
/* 左上角標題 Logo */
.logo-area {
  display: flex;
  align-items: center;
  gap: 0px;
  text-decoration: none;
  flex-shrink: 0;        /* 關鍵：保護 Logo 區域不被右側搜尋框推擠壓縮 */
}

.logo-img {
  width: 50px;          /* 將圖示寬度調大 */
  height: 50px;         /* 將圖示高度調大 */
  object-fit: contain;  /* 保持圖片原始比例，不拉伸變形 */
  border-radius: 50%;   /* 若圖片需要呈現圓形可保留此行，若為方形 Logo 可移除 */
}

.site-title {
  font-size: 28px;
  font-weight: bold;
  color: #2c3e50;
  letter-spacing: 1px;
  font-family: "DFKai-SB", "BiauKai", "Kaiti TC", "STKaiti", serif;
  white-space: nowrap;   /* 關鍵：強制文字保持同一橫行，絕不變直排 */
}

/* 手機螢幕優化 (寬度 768px 以下) */
@media (max-width: 768px) {
  /* 1. 膠囊卡片容器邊距調整 */
  .header-container {
    padding: 5px 10px;
  }

  /* 2. Logo 與標題大小優化 */
  .logo-area {
    flex-shrink: 0;        /* 保護左側區域不被壓縮 */
  }

  .logo-img {
    width: 34px;           /* 手機版 Logo 調小 */
    height: 34px;
  }

  .site-title {
    font-size: 16px;       /* 標題字體縮小至 16px */
    letter-spacing: 0px;
    white-space: nowrap;   /* 強制單行，絕不變直排 */
  }

  /* 3. 搜尋框轉為放大鏡圖示模式（圖示居中修正） */
  .search-box {
    width: 35px;
    height: 35px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;        /* 限制為固定圓形圖示 */
    position: relative;    /* 做為內部元件絕對定位的基準 */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f2f5;   /* 給予圓形按鈕輕微底色，視覺更清晰 */
  }

  /* 將內部的放大鏡圖示/按鈕強制置於圓圈正中央 */
  .search-box button,
  .search-box .search-icon,
  .search-box i,
  .search-box svg,
  .search-box img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;  /* 讓點擊透過去，直接觸發搜尋輸入 */
  }

  /* 輸入框改為覆蓋圓圈的透明點擊層 */
  .search-box input {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;            /* 隱藏輸入框，只保留點擊功能 */
    z-index: 2;
    cursor: pointer;
  }

  /* 4. 保護 MENU 按鈕完整顯示 */
  .menu-btn,
  .menu-toggle,
  .nav-menu {
    flex-shrink: 0;        /* 強制 MENU 不被擠出膠囊卡片外 */
  }
}

/* 右上角搜尋與導覽列組合 */
.nav-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.top-tools {
  display: flex;
  align-items: center;
}

/* 搜尋區域定位容器 */
.search-wrapper {
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e0;
  border-radius: 20px;
  padding: 4px 12px;
  background-color: #fff;
  transition: border-color 0.2s;
  margin-left: 10px; /* 👈 讓搜尋框跟左邊的「學會簡介」按鈕保持 20px 間距 */
}

.search-box:focus-within {
  border-color: #6b52a1;
}

.search-box input {
  border: none;
  outline: none;
  padding: 4px;
  font-size: 14px;
  width: 160px;
}

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  color: #718096;
}

/* 搜尋框正下方的即時下拉浮窗 */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
}

.dropdown-item {
  display: block;
  padding: 12px 16px;
  color: #2d3748;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f0f4f8;
  line-height: 1.4;
  transition: background-color 0.2s, color 0.2s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #f7fafc;
  color: #6b52a1;
}

.dropdown-no-result {
  padding: 16px;
  color: #a0aec0;
  font-size: 14px;
  text-align: center;
}

/* 主區域容器 */
.main-container {
  max-width: 1800px;
  margin: 20px auto;
  padding: 0 20px;
}

/* ==========================================
   輪播圖 (Hero Slider) 樣式
   ========================================== */

.hero-slider {
  position: relative;
  width: 100%;             /* 100% 貼滿螢幕左右兩端 */
  height: 100vh;           /* 畫面高度維持與原本滿版相同 (100vh 或可自訂 px) */
  margin: 0 0 40px 0;      /* 移除 margin auto */
  overflow: hidden;
  background-color: #0b132b;
  /* 移除原本的 max-width、border-radius 與 box-shadow */
}

/* 移動軌道 */
.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
}

/* 修正：強制每個 slide 容器與裡面的 a 標籤保持 100% 視窗寬度 */
.slide {
  min-width: 100%;
  width: 100%;
  max-width: 100%;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden; /* 防止超出圖片溢出 */
}

/* 關鍵修正：包在裡面的 a 標籤必須設為區塊元素並撐滿 100% */
.slide a {
  display: block;
  width: 100%;
  height: 100%;
}

/* 強制圖片完美符合容器大小與自動裁切 */
.slide img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;       /* 自動裁切多餘部分，無縫填滿 */
  object-position: center; /* 圖片聚焦中央 */
  display: block;
}

/* 左右箭頭按鈕 */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  border: none;
  font-size: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
  z-index: 10;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-50%) scale(1.08);
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

/* 底部圓點指標 */
.slider-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #ffffff;
  width: 32px;
  border-radius: 10px;
}

/* 響應式：手機版調整高度 */
@media (max-width: 768px) {
  .hero-slider {
    height: 60vh; /* 手機版降為 60vh 避免佔據整頁 */
  }
  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}


.more-btn {
  display: inline-block;
  padding: 6px 20px;
  border: 1px solid #ffffff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s;
}

.more-btn:hover {
  background-color: white;
  color: #2c2a4a;
}

/* 下方最新消息 */
.news-section {
  margin-top: 25px;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.news-header {
  background-color: #1f7a8c;
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.news-list {
  list-style: none;
}

.news-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #edf2f7;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-title {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #2d3748;
  font-size: 15px;
}

.news-item-title:hover {
  color: #1f7a8c;
}

.news-date {
  color: #718096;
  font-size: 14px;
}

/* RWD 響應式調整 */
@media (max-width: 768px) {
  header {
    top: 10px;
    padding: 0 10px;
  }
  .header-container {
    border-radius: 25px;   /* 手機版圓角稍微減小以節省空間 */
    padding: 10px 15px;
  }
  .nav-wrapper {
    align-items: flex-start;
    width: 100%;
  }
  .search-dropdown {
    right: auto;
    left: 0;
    width: 280px;
  }
  .full-width-hero {
    height: 100vh;          /* 手機版適度將高度調小 */
  }
  .news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* ====================================================== */
/* ================= 最新消息區塊 (News) ================= */
/* ====================================================== */
.news-section {
  width: 100%;
  padding: clamp(15px, 1.5vw, 25px) 20px;
  background-color: #f8f9fa; /* 滿版延伸背景 */
  box-sizing: border-box;
}

.news-section .container {
  max-width: 1200px; /* 放寬最大寬度 */
  margin: 0 auto;
}

/* 標題樣式 */
.section-header {
  text-align: center;
  margin-bottom: 35px;
}

.section-title {
  font-size: clamp(24px, 2.2vw, 32px);
  color: #1a365d;
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
}

.section-subtitle {
  font-size: 13px;
  color: #718096;
  margin-top: 5px;
  letter-spacing: 1.5px;
}

/* 消息清單容器 */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 單條消息項目 */
.news-item {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  padding: 18px 20px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid transparent;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-left-color: #1a365d;
}

/* 年月日日期方塊 */
.news-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 55px;
  background-color: #edf2f7;
  border-radius: 6px;
  margin-right: 20px;
  padding: 4px 0;
  flex-shrink: 0;
}

.news-date .year {
  font-size: 11px;
  color: #718096;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.news-date .date-main {
  font-size: 17px;
  font-weight: bold;
  color: #1a365d;
  line-height: 1.2;
}

/* 標題文字區 */
.news-content {
  flex: 1;
}

.news-title {
  font-size: clamp(15px, 1.1vw, 17px);
  color: #2d3748;
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.news-item:hover .news-title {
  color: #1a365d;
}

.news-arrow {
  font-size: 18px;
  color: #cbd5e0;
  margin-left: 15px;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.news-item:hover .news-arrow {
  color: #1a365d;
  transform: translateX(3px);
}

/* 更多按鈕 */
.news-more-wrapper {
  text-align: center;
  margin-top: 35px;
}

.btn-more {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid #1a365d;
  color: #1a365d;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-more:hover {
  background-color: #1a365d;
  color: #ffffff;
}

/* RWD 手機版調整 */
@media (max-width: 600px) {
  .news-item { padding: 12px; }
  .news-date { min-width: 60px; height: 50px; margin-right: 12px; }
  .news-date .year { font-size: 10px; }
  .news-date .date-main { font-size: 14px; }
  .news-title { font-size: 14px; }
  .news-arrow { display: none; }
}


/* ====================================================== */
/* ================= 核心推動領域 (CORE FOCUS AREAS) ============= */
/* ====================================================== */
.missions-section {
  width: 100%;
  padding: clamp(15px, 1.5vw, 25px) 20px;
  background-color: #ffffff; /* 滿版延伸背景 */
  box-sizing: border-box;
}

.missions-section .container {
  max-width: 1300px; /* 放寬最大寬度 */
  margin: 0 auto;
}

/* 卡片網格排版 */
.missions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 35px);
  margin-top: 0px;
}

/* 單張卡片基礎樣式 */
.mission-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* 卡片內文區域容器 */
.mission-card-body {
  padding: 25px 20px 30px;
}

/* 卡片上半部圖片容器 */
.mission-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #f7fafc;
}

.mission-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mission-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(26, 54, 93, 0.08);
  border-color: #2b6cb0;
}

.mission-card:hover .mission-image img {
  transform: scale(1.05);
}

.mission-card *,
.mission-card:hover {
  text-decoration: none;
}

/* 卡片標題 */
.mission-card-title {
  font-size: clamp(18px, 1.4vw, 22px);
  color: #1a365d;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 12px;
}

.mission-card-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 3px;
  background-color: #2b6cb0;
  border-radius: 2px;
}

/* 卡片內文說明 */
.mission-card-desc {
  font-size: 14.5px;
  color: #4a5568;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 900px) {
  .missions-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .mission-image {
    height: 200px;
  }
}


/* ====================================================== */
/* ================= 策略合作區塊 (Partners) ============= */
/* ====================================================== */
.partners-section {
  width: 100%;
  padding: clamp(15px, 1.5vw, 25px) 20px;
  background-color: #f8f9fa; /* 滿版延伸背景 */
  box-sizing: border-box;
}

.partners-section .container {
  max-width: 1300px; /* 放寬最大寬度 */
  margin: 0 auto;
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 2vw, 30px);
  margin-top: 0px;
}

/* 單張合作夥伴卡片 */
.partner-card {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.partner-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(26, 54, 93, 0.08);
  border-color: #2b6cb0;
}

.partner-img-wrapper {
  width: 90px;
  height: 90px;
  min-width: 90px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #edf2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  border: 1px solid #edf2f7;
  flex-shrink: 0;
}

.partner-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.partner-content {
  flex: 1;
}

.partner-title {
  font-size: 18px;
  color: #1a365d;
  font-weight: 700;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.external-icon {
  font-size: 14px;
  color: #a0aec0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.partner-card:hover .external-icon {
  color: #2b6cb0;
  transform: translate(2px, -2px);
}

.partner-desc {
  font-size: 13.5px;
  color: #4a5568;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 850px) {
  .partners-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 500px) {
  .partner-card {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .partner-img-wrapper {
    margin-right: 0;
    margin-bottom: 15px;
  }

  .partner-title {
    justify-content: center;
    gap: 6px;
  }
}


/* ====================================================== */
/* ================= 加入學會區塊 (Join Us) ============== */
/* ====================================================== */
.join-section {
  width: 100%;
  padding: clamp(25px, 2.5vw, 40px) 20px clamp(40px, 4vw, 60px);
  background-color: #f8f9fa; /* 滿版延伸背景 */
  box-sizing: border-box;
}

.join-card {
  max-width: 1300px; /* 對齊上方的容器上限，防止大螢幕過度拉寬或縮太小 */
  margin: 0 auto;
  background: linear-gradient(135deg, #0f2b48 0%, #1a365d 50%, #2b6cb0 100%);
  border-radius: 16px;
  padding: clamp(35px, 4vw, 55px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-shadow: 0 12px 30px rgba(15, 43, 72, 0.18);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.join-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.join-content {
  max-width: 750px;
  position: relative;
  z-index: 1;
}

.join-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #90cdf4;
  margin-bottom: 8px;
}

.join-title {
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #ffffff;
}

.join-desc {
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.7;
  color: #e2e8f0;
  margin: 0;
}

.join-action {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.btn-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background-color: #ffffff;
  color: #1a365d;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-join:hover {
  background-color: #ebf8ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .join-card {
    flex-direction: column;
    text-align: center;
    padding: 40px 24px;
  }

  .join-action {
    width: 100%;
  }

  .btn-join {
    width: 100%;
    max-width: 280px;
  }
}

/* ====================================================== */
/* ======= 超大螢幕 / 低縮放比 全站等比放大與欄位修正 ======= */
/* ====================================================== */

/* 1. 當螢幕寬度超過 1600px (約 2K 螢幕或 75% 縮放) */
@media (min-width: 1600px) {
  .news-section .container,
  .missions-section .container,
  .partners-section .container,
  .join-card {
    max-width: 1500px;
  }

  /* 4 個合作團體在寬螢幕下完美併排為 1 排 4 欄 */
  .partners-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 2. 當螢幕寬度超過 2200px (約 4K 螢幕或 50% 縮放) */
@media (min-width: 2200px) {
  html {
    font-size: 20px; /* 全站整體等比放大 */
  }

  .news-section .container,
  .missions-section .container,
  .partners-section .container,
  .join-card {
    max-width: 1800px;
  }
}

/* 3. 當螢幕寬度超過 3200px (極限縮放 25% 或 8K 螢幕) */
@media (min-width: 3200px) {
  html {
    font-size: 26px; /* 根字級放大帶動全站元件等比擴展 */
  }

  .news-section .container,
  .missions-section .container,
  .partners-section .container,
  .join-card {
    max-width: 2600px;
  }
}



/* ==========================================
   1. 解除頁面限制 & 推開 Header 高度
   ========================================== */

/* 僅有內頁 / 成員頁的主容器才推開 120px */
main.main-container.inner-page,
.main-container,
.members-container {
  width: 94vw !important;
  max-width: none !important;
  margin: 0 auto;
  padding-top: 80px !important; /* 解決內頁/成員頁內容被 Header 遮擋 */
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* 將通用的 .container 獨立出來，頂部間距歸零 */
.container {
  padding-top: 0 !important;
}

/* ==========================================
   2. 紫色分隔線修復（標題與區塊底線）
   ========================================== */
.page-title-section,
.section-title,
.category-title,
.member-section-title {
  width: 100%;
  margin-top: 20px;
  margin-bottom: 25px;
  padding-bottom: 10px;
  border-bottom: 3px solid #6b52a1 !important; /* 強制恢復紫色底線 */
}

/* ==========================================
   3. 卡片整體置中 + 內部文字靠左對齊
   ========================================== */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 320px) !important; /* 卡片欄寬 320px */
  gap: 24px;
  justify-content: start !important; /* ⬅️ 讓卡片在頁面正中央 */
  width: 100%;
  margin-bottom: 45px;
}

.member-card {
  width: 320px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #edf2f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  padding: 24px 20px;
  box-sizing: border-box;
  
  /* 內部排版：文字靠左 */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left !important; /* ⬅️ 卡片內文改回靠左對齊 */
}

/* 人名標題：保持在卡片內上方置中 */
.member-card h3,
.member-info h3 {
  text-align: center !important;
  font-size: 19px;
  color: #2c3e50;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e0;
}

/* 學歷、專長等內文靠左 */
.member-card p,
.member-detail,
.member-info p,
.member-info div {
  text-align: left !important;
  font-size: 14px;
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 6px;
}

/* ==========================================
   4. 修復圖片長寬比例與圓框
   ========================================== */
.member-img-box {
  width: 140px !important;
  height: 140px !important;
  border-radius: 50% !important;
  overflow: hidden;
  margin: 0 auto 16px auto !important; /* 圖片在卡片上方居中 */
  border: 3px solid #e2e8f0;
  flex-shrink: 0;
}

.member-img-box img,
.member-card > img {
  width: 140px !important;
  height: 140px !important;
  border-radius: 50% !important;
  object-fit: cover !important; /* 保持人像比例不拉伸 */
  margin: 0 auto 16px auto !important;
  flex-shrink: 0;
}

/* ==========================================
   5. 名字膠囊區塊（同步置中）
   ========================================== */
.name-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fill, 140px) !important;
  gap: 12px;
  justify-content: start !important;
  width: 100%;
  margin-bottom: 40px;
}

.name-badge {
  width: 140px;
  height: 44px;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #334155;
  box-sizing: border-box;
  white-space: nowrap;
}

/* ==========================================
   理事長的話 專屬樣式 (全圖不裁切左右佈局) (chairman.html)
   ========================================== */

.president-page {
  max-width: 1800px;
  margin: 120px auto 60px auto; /* 避開固定式 Header */
  padding: 0 20px;
  min-height: 60vh;
}

/* 頂部標題 */
.page-title-box {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 15px;
  border-bottom: 2px solid #0056b3;
}

.page-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 8px;
}

.page-subtitle {
  color: #666;
  font-size: 1rem;
}

/* 左右兩欄主容器 */
.president-layout {
  display: grid;
  grid-template-columns: 380px 1fr; /* 左側固定照片寬度，右側自動填滿 */
  gap: 40px;
  align-items: start; /* 頂部對齊 */
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* 左側圖片容器 */
.president-photo-col {
  width: 100%;
  background-color: #f4f7f9; /* 淺色背景，襯托完整圖片 */
  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

.president-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain; /* 關鍵：確保圖片完整顯示不裁切 */
  border-radius: 8px;
}

/* 右側內容區塊 */
.president-text-col {
  display: flex;
  flex-direction: column;
}

/* 職稱區塊樣式 */
.president-header {
  border-bottom: 2px dashed #e8e8e8;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.president-name {
  font-size: 1.8rem;
  color: #111;
  margin-bottom: 6px;
}

.president-title {
  font-size: 1.05rem;
  color: #555;
  font-weight: 500;
  margin: 0;
}

/* 文章內文 */
.president-content {
  line-height: 1.8;
  font-size: 1.02rem;
  color: #333;
}

.president-content p {
  margin-bottom: 8px;
  text-align: justify;
  text-justify: inter-ideograph;
}

/* 右下角落款 */
.president-signature {
  text-align: right;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.signer-name {
  font-size: 1.25rem;
  font-weight: bold;
  color: #222;
  margin-bottom: 4px;
}

.sign-date {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* RWD 響應式佈局 (平板與手機版自動轉為單欄) */
@media (max-width: 850px) {
  .president-layout {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 20px;
  }

  .president-photo-col {
    max-width: 320px;
    margin: 0 auto;
  }

  .president-header {
    text-align: center;
  }
}

/* ==========================================
   學會簡介頁面專用樣式 (about.html)
   ========================================== */

/* 條款項目間距 */
.article-item {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* 任務清單縮排 */
.task-list {
  list-style: none;
  padding-left: 15px;
  margin-top: 8px;
}

.task-list li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* 理事長致辭段落縮排與兩端對齊 */
.president-speech {
  text-indent: 2em;
  text-align: justify;
  line-height: 1.95;
  color: #334155;
  font-size: 15.5px;
}

/* 右下角落款簽名區 */
.president-signature {
  margin-top: 25px;
  text-align: right;
  border-top: 1px dashed #cbd5e0;
  padding-top: 15px;
}

.signature-name {
  font-size: 18px;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 2px;
}

.signature-date {
  font-size: 14px;
  color: #64748b;
}
.about-photos-container {
  display: flex;
  gap: 20px; /* 兩張照片之間的間距 */
  width: 100%;
}

.about-photo-item {
  flex: 1; /* 左右兩邊各佔 50% 寬度 */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
}

.about-photo-item img {
  width: 100%;
  aspect-ratio: 1 / 1.414; /* 強制鎖定為 A4 直式比例 (寬:高 = 1:1.414) */
  object-fit: contain;     /* 完整顯示全圖，不裁切文件文字 */
  display: block;
  background-color: #ffffff;
  transition: transform 0.3s ease;
}

/* 滑鼠懸停微放大效果 */
.about-photo-item img:hover {
  transform: scale(1.02);
}

/* 手機版 RWD 響應式：自動轉為上下堆疊 */
/* 手機版 RWD 響應式：自動轉為上下單欄 */
@media (max-width: 768px) {
  .about-photos-container {
    flex-direction: column;
  }
}
/* ==========================================
   搜尋下拉選單的分類標籤樣式
   ========================================== */
.dropdown-category {
  font-size: 12px;
  color: #6b52a1;
  font-weight: bold;
  background-color: #f0ebf8;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  display: inline-block;
}
/* 搜尋關鍵字高亮樣式 */
mark.search-highlight {
  background-color: #fef08a; /* 醒目的淡黃色背景 */
  color: #9a3412;            /* 深色文字，維持高對比 readability */
  font-weight: bold;
  padding: 0 2px;
  border-radius: 2px;
}
/* ==========================================
   全站頁尾 (Footer) 樣式
   ========================================== */

.site-footer {
  background-color: #1e293b;   /* 深藍灰色背景，高質感沉穩 */
  color: #f1f5f9;              /* 淺色字體 */
  padding: 40px 80px 20px 80px;
  margin-top: 80px;            /* 與上方內容保持距離 */
  border-top: 4px solid #38bdf8;/* 頂部加上學會的主題藍色線條 */
}

.footer-container {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.footer-info h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: #38bdf8;              /* 學會名稱亮藍色強調 */
}

.footer-info p {
  font-size: 16px;
  line-height: 1.8;
  color: #cbd5e1;
  margin: 4px 0;
}

.footer-copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

/* 手機版響應式微調 */
@media (max-width: 768px) {
  .site-footer {
    padding: 30px 15px 15px 15px;
    margin-top: 40px;
  }
}

/* ==========================================
   活動花絮單欄大圖樣式 (BTS.html)
   ========================================== */

/* 1. 全寬單欄容器 (限制最大寬度居中) */
.event-name {
  text-align: center;
  font-size: 27px;
  font-weight: bold;
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 12px;           /* 👈 控制名稱與卡片之間的距離（數字越小越靠近） */
  padding-top: 10px;
}

.event-large-list {
  max-width: 1200px;
  margin: 30px auto 0 auto;
}

.event-item-wrapper {
  margin-bottom: 60px; /* 👈 兩個活動之間的間距 */
}

.event-item-wrapper:last-child {
  margin-bottom: 0;   /* 最後一個活動下方不留空隙 */
}
/* 2. 大圖卡片主體 */
.event-large-card {
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #edf2f7;
  margin-bottom: 0;              /* 重置卡片下邊距 */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-large-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* 3. 上方滿版大圖容器 */
.event-large-img-box {
  width: 100%;
  aspect-ratio: 16 / 9; /* 維持 16:9 黃金大圖比例 */
  max-height: 500px;
  overflow: hidden;
  background-color: #f8fafc;
}

.event-large-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.event-large-card:hover .event-large-img-box img {
  transform: scale(1.02);
}

/* 4. 下方文字詳細區域 */
.event-large-content {
  padding: 28px 32px;
}

.event-large-info {
  list-style: none;
  padding: 0;
  margin: 0;
  padding-top: 0px;
  display: flex;
  flex-direction: column; /* 關鍵：改為垂直三行 */
  gap: 10px;               /* 行與行之間的間距 */
}

.event-large-info li {
  font-size: 22px;
  color: #4a5568;
  line-height: 1.5;
}

.event-large-info strong {
  color: #2d3748;
}

/* 手機版適應調整 */
@media (max-width: 600px) {
  .event-large-content {
    padding: 20px;
  }

  .event-large-title {
    font-size: 20px;
  }

  .event-large-info {
    flex-direction: column; /* 手機版自動垂直排列資訊 */
    gap: 8px;
  }
}

/* 活動花絮燈箱與縮圖牆樣式 (Lightbox Gallery) */

/* 縮圖網格容器 */
.event-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 一排顯示 4 張縮圖 */
  gap: 8px;
  padding: 12px 16px 0 16px;
  background-color: #ffffff;
}

.gallery-thumb-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  cursor: pointer;
}

.gallery-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-thumb-item:hover img {
  transform: scale(1.06);
  opacity: 0.9;
}

/* 隱藏未展示的相片（僅供燈箱輪播使用） */
.hidden-photo {
  display: none;
}

/* 「+N 張」半透明遮罩效果 */
.gallery-thumb-item.more-overlay::after {
  content: attr(data-more); /* 自動讀取 HTML data-more 的數值 (例如 +8) */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65); /* 深色半透明遮罩 */
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gallery-thumb-item.more-overlay:hover::after {
  background: rgba(15, 23, 42, 0.8);
}

/* 響應式：手機版縮圖調整 */
@media (max-width: 600px) {
  .event-gallery-thumbs {
    gap: 6px;
    padding: 8px 12px 0 12px;
  }
  
  .gallery-thumb-item.more-overlay::after {
    font-size: 16px;
  }
}

/* ==========================================
   下載頁面專屬樣式 (Download.html)
   ========================================== */

/* 主要內容容器 */
.download-page {
  max-width: 1500px;
  margin: 100px auto;
  padding: 0 20px;
  min-height: 60vh; /* 確保內容較少時頁尾保持在底部 */
}

/* 標題區塊 */
.page-title-box {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 15px;
  border-bottom: 2px solid #0056b3;
}

.page-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 10px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 最窄 280px，自動填滿剩餘空間 */
  gap: 30px;
}

/* 單一下載卡片 */
.download-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.download-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-top {
  margin-bottom: 10px;
}

/* 檔案類型標籤 */
.file-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: bold;
  border-radius: 6px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

/* 不同檔案類型的背景配色 */
.file-badge.pdf {
  background-color: #ffebee;
  color: #d32f2f;
}

.file-badge.doc {
  background-color: #e3f2fd;
  color: #1976d2;
}

.file-badge.zip {
  background-color: #fff3e0;
  color: #e65100;
}

.doc-title {
  font-size: 1.25rem;
  color: #222;
  margin-bottom: 0;
  line-height: 1.4;
}

/* 下載按鈕 */
.download-btn {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #0056b3;
  color: #ffffff;
  padding: 12px 0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
  margin-top: 20px;
}

.download-btn:hover {
  background-color: #003d82;
}
