/* ============================================================
   學會網站 — 共用樣式表 / Shared stylesheet
   色板 Color tokens: 深空藍 Navy / 紫 Purple / 青 Teal / 薄荷 Mint
   ============================================================ */

:root {
  --navy: #02153D;
  --purple: #4B227A;
  --teal: #0197AF;
  --mint: #00EED0;

  --ink: #0B1324;
  --paper: #F6F7FB;
  --line: rgba(2, 21, 61, 0.12);
  --line-dark: rgba(255, 255, 255, 0.14);

  --font-head-zh: "Noto Serif TC", serif;
  --font-head-en: "Space Grotesk", sans-serif;
  --font-body-zh: "Noto Sans TC", sans-serif;
  --font-body-en: "Inter", sans-serif;

  --radius: 4px;
  --max-width: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body-zh), var(--font-body-en);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5em;
  color: var(--navy);
}

p { margin: 0 0 1em; }

a { color: var(--teal); }
a:hover { color: var(--purple); }

img { max-width: 100%; display: block; }

/* 讓 hidden 屬性永遠生效（img、列表等會被其他 display 規則蓋掉） */
[hidden] { display: none !important; }

/* 語言切換 / Language toggle ------------------------------------ */
/* 預設顯示中文；<html data-lang="en"> 時切換為英文。
   注意：用 data-lang 屬性而非 class，避免跟下方 .lang-zh / .lang-en
   文字用的 class 同名衝突（曾導致 <body> 本身被隱藏、整頁變白屏）。
   行內文字用 <span class="lang-xx">；整段（含 <p>、<ol>）用 <div class="lang-xx">。 */
.lang-en { display: none; }
html[data-lang="en"] .lang-en { display: inline; }
html[data-lang="en"] .lang-zh { display: none; }
html[data-lang="en"] div.lang-en,
html[data-lang="en"] ol.lang-en,
html[data-lang="en"] ul.lang-en,
html[data-lang="en"] p.lang-en { display: block; }

/* 區塊容器 / Section container ----------------------------------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* 頁首 / Header（兩列：標誌＋工具列／主選單）-------------------------- */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line-dark);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-head-zh), var(--font-head-en);
  font-size: 1.05rem;
  font-weight: 700;
  margin-right: auto;
}
.logo:hover { color: #fff; }
.logo img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }

/* 工具列：搜尋、語言、郵件、Facebook */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-search { position: relative; display: flex; align-items: center; }
.site-search input {
  width: 200px;
  height: 34px;
  padding: 0 38px 0 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
}
.site-search input::placeholder { color: rgba(255,255,255,0.6); }
.site-search input:focus { outline: none; border-color: var(--mint); }
.site-search input::-webkit-search-cancel-button { display: none; }
.site-search button {
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
}
.site-search button:hover { color: var(--mint); }
.site-search svg { width: 18px; height: 18px; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.icon-btn:hover { border-color: var(--mint); color: var(--mint); }
.icon-btn svg { width: 18px; height: 18px; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(320px, 90vw);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(2, 21, 61, 0.25);
  z-index: 60;
}
.search-results a {
  display: block;
  padding: 8px 10px;
  color: var(--navy);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.search-results a:hover,
.search-results a:focus { background: var(--paper); color: var(--purple); }
.search-results small { display: block; color: #6b7490; font-size: 0.78rem; }
.search-results .empty { padding: 8px 10px; color: #6b7490; font-size: 0.9rem; }

/* 主選單（第二列，項目之間有分隔線） */
.main-nav { border-top: 1px solid var(--line-dark); }

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
}

.nav-inner > a,
.nav-item {
  flex: 1;
  border-left: 1px solid var(--line-dark);
}
.nav-inner > :last-child { border-right: 1px solid var(--line-dark); }

.nav-inner > a,
.nav-item > a {
  display: block;
  text-align: center;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 11px 12px;
}
.nav-item { position: relative; display: flex; }
.nav-item > a { flex: 1; }

.nav-inner > a:hover,
.nav-item:hover > a,
.nav-item:focus-within > a,
.nav-inner > a[aria-current="page"],
.nav-item > a[aria-current="page"] {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.nav-inner > a[aria-current="page"],
.nav-item > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--mint); }

/* 下拉選單（滑鼠移上去或鍵盤聚焦時展開；手機版直接攤開）*/
.subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--navy);
  border: 1px solid var(--line-dark);
  border-top: 2px solid var(--mint);
  box-shadow: 0 10px 24px rgba(2, 21, 61, 0.35);
  z-index: 55;
}
.nav-item:hover .subnav,
.nav-item:focus-within .subnav { display: block; }
.subnav a {
  display: block;
  padding: 10px 16px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.92rem;
  text-align: left;
}
.subnav a:hover,
.subnav a:focus-visible { background: rgba(255,255,255,0.08); color: var(--mint); }

/* 入會申請按鈕：薄荷綠實心，永遠可見 */
.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  background: var(--mint);
  color: var(--navy);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.join-btn:hover { background: #fff; color: var(--navy); }
.site-header a.join-btn:focus-visible { outline-color: #fff; }

.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; }
  .logo { flex: 1; margin-right: 0; min-width: 0; font-size: 0.98rem; }
  .join-btn { order: 1; padding: 0 12px; font-size: 0.85rem; }
  .nav-toggle { display: block; order: 2; }
  .header-tools { order: 3; width: 100%; }
  .site-search { flex: 1; }
  .site-search input { width: 100%; }
  .search-results { left: 0; right: auto; width: 100%; }

  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .nav-inner { flex-direction: column; padding: 0 24px 8px; }
  .nav-inner > a,
  .nav-item {
    border-left: none;
    border-top: 1px solid var(--line-dark);
  }
  .nav-inner > :last-child { border-right: none; }
  .nav-inner > a,
  .nav-item > a { text-align: left; }
  .nav-item { flex-direction: column; }
  .subnav {
    display: block;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 6px 16px;
  }
  .subnav a { padding: 6px 12px; font-size: 0.88rem; color: rgba(255,255,255,0.7); }
}

/* 圖片佔位 / Image placeholder ------------------------------------
   圖片載入失敗（或還沒放入）時，顯示漸層底色＋文字標籤。 */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--purple), var(--teal) 60%, var(--mint));
  color: rgba(255,255,255,0.92);
}
.ph-label {
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0 12px;
}
.ph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph--card { aspect-ratio: 4 / 3; }
.ph--poster { aspect-ratio: 3 / 4; }
.ph--poster > img { object-fit: contain; background: #fff; }
.ph--group { aspect-ratio: 16 / 6; border-radius: 12px; margin-bottom: 32px; }
@media (max-width: 560px) {
  .ph--group { aspect-ratio: 4 / 3; }
}

/* 首頁輪播 / Carousel ------------------------------------------------ */
.carousel { padding: 32px 0 40px; }

.carousel-stage {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
}
@media (max-width: 760px) {
  .carousel-stage { aspect-ratio: 4 / 3; }
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; }
.slide .ph-label { font-size: clamp(1.6rem, 4vw, 2.6rem); }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(2, 21, 61, 0.55);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.carousel-btn:hover { background: var(--mint); border-color: var(--mint); color: var(--navy); }
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #fff;
  background: transparent;
  cursor: pointer;
}
.carousel-dots button.is-active { background: var(--mint); border-color: var(--mint); }

html:not(.js) .carousel-btn,
html:not(.js) .carousel-dots { display: none; }

.carousel-captions { border-bottom: 1px solid var(--line); padding: 18px 0 20px; }
.cap { display: none; }
.cap.is-active { display: block; }
.cap-title {
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  margin: 0 0 4px;
}
.cap p { margin: 0; color: #45506b; }

/* 英雄區（標誌＋格言）/ Hero ------------------------------------------ */
.hero {
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 72px 0 96px;
}

.hero-wave {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 160px;
  opacity: 0.6;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.hero-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 48px;
  align-items: center;
}
.hero-logo { width: 180px; height: 180px; object-fit: contain; }
@media (max-width: 760px) {
  .hero { padding: 48px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-logo { width: 110px; height: 110px; }
}

.hero .kicker {
  font-family: var(--font-body-en), var(--font-body-zh);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--mint);
  margin: 0 0 8px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  max-width: 14em;
  letter-spacing: -0.01em;
}

.hero p {
  color: rgba(255,255,255,0.78);
  max-width: 42em;
  font-size: 1.05rem;
}

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

.cta {
  display: inline-block;
  margin-top: 12px;
  background: var(--mint);
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius);
}
.cta:hover { background: #fff; color: var(--navy); }
.cta-row .cta { margin-top: 0; }

.cta-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 10px 22px;
}
.cta-outline:hover { background: #fff; color: var(--navy); }

/* 區塊標題 / Section heading ---------------------------------------- */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  border-left: 3px solid var(--teal);
  padding-left: 14px;
}

.section-head h2 { margin: 0; }
.section-head .more-link { font-size: 0.9rem; text-decoration: none; white-space: nowrap; }

/* 小標題（關於我們各段落、活動資訊）*/
.sub-head {
  border-left: 3px solid var(--teal);
  padding-left: 12px;
  margin: 40px 0 14px;
}
.sub-head:first-child { margin-top: 0; }
.sub-head h3 { margin: 0; font-size: 1.2rem; }

.prose ol,
.prose ul { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.55em; }

/* 關於我們：分頁籤 / Tabs --------------------------------------------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  scroll-margin-top: 120px;
}
.tab {
  padding: 10px 22px;
  margin-bottom: -1px;
  color: #45506b;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tab + .tab { box-shadow: inset 1px 0 0 var(--line); }
.tab:hover { color: var(--purple); }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--teal); }

.org-intro { margin-bottom: 8px; }
.group-head { margin: 36px 0 18px; }
.group-head h3 { margin: 0; font-size: 1.15rem; }

/* 成員卡片 / Member grid --------------------------------------------- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.member-card {
  border: 1px solid var(--line);
  padding: 20px;
}

.member-card img {
  width: 100%;
  aspect-ratio: 1 / 1.2;
  object-fit: cover;
  object-position: center top;
  background: #e9ecf3;
  margin-bottom: 14px;
}

.member-card--advisor {
  background: #fff;
  border-color: var(--teal);
  border-top-width: 3px;
  box-shadow: 0 6px 18px rgba(2, 21, 61, 0.08);
}
.member-card--advisor .role { color: var(--teal); }

.member-photo {
  width: 100%;
  aspect-ratio: 1 / 1.2;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  margin-bottom: 14px;
}

.member-card h3 { margin-bottom: 2px; font-size: 1rem; }
.member-card .role { color: var(--purple); font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.member-card .profession { color: #6b7490; font-size: 0.82rem; margin-bottom: 0; }

/* 新聞列表 / News list ------------------------------------------------ */
.news-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.news-item.has-thumb { grid-template-columns: 1fr 200px; }
.news-item:first-child { padding-top: 0; }
@media (max-width: 560px) {
  .news-item.has-thumb { grid-template-columns: 1fr; }
  .news-item .news-thumb { order: -1; }
}

.news-date {
  font-family: var(--font-body-en);
  font-size: 0.82rem;
  color: var(--teal);
  letter-spacing: 0.02em;
}
.news-item h3 { margin: 4px 0 6px; font-size: 1.1rem; }
.news-item p { margin: 0; color: #45506b; font-size: 0.95rem; }

.news-link { text-decoration: none; display: block; }
.news-link h3 { color: var(--navy); }
.news-link:hover h3 { color: var(--purple); }

.news-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* 「回顧」標籤：已結束的活動才會出現，連到該活動頁的相冊 */
.review-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.review-tag svg { width: 13px; height: 13px; }
.review-tag:hover { background: var(--teal); color: #fff; }

/* 「已結束」標籤：活動預告／報名消息在活動日期之後自動出現 */
.ended-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #8a93a8;
  border-radius: 999px;
  color: #6b7490;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.news-thumb {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.news-thumb > img { object-position: center top; }

/* 分頁器 / Pagination ------------------------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.pager > a,
.pager > span {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-family: var(--font-body-en), var(--font-body-zh);
  font-size: 0.9rem;
}
.pager > a:hover { border-color: var(--teal); color: var(--teal); }
.pager > .is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager > .is-disabled { opacity: 0.4; }
.pager > .gap { border-color: transparent; background: transparent; min-width: 20px; padding: 0; }
.pager-info { text-align: center; color: #6b7490; font-size: 0.85rem; margin: 12px 0 0; }

/* 活動詳情頁 / News detail ---------------------------------------------- */
.back-link { margin-bottom: 20px; font-size: 0.92rem; }

.detail-head { text-align: center; margin-bottom: 28px; }
.detail-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: 6px; }
.detail-head .news-date { font-size: 0.9rem; }

.detail-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 760px;
  margin: 0 auto 36px;
}
.detail-media .ph { border: 1px solid var(--line); border-radius: var(--radius); }
@media (max-width: 560px) {
  .detail-media { grid-template-columns: 1fr; }
}

.info-list { list-style: none; padding: 0; margin: 0 0 1em; }
.info-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.info-list li::before { content: "›"; color: var(--teal); font-weight: 700; margin-right: 10px; }
.info-list strong { color: var(--navy); margin-right: 6px; }

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-weight: 700;
  font-size: 0.95rem;
}
.btn:hover { background: var(--purple); color: #fff; }

.detail-review { margin: 10px 0 0; }
.detail-review .review-tag { font-size: 0.85rem; padding: 6px 14px; }

/* 活動相冊與燈箱 / Album & lightbox ------------------------------------- */
#album { scroll-margin-top: 120px; }
.album-note { color: #6b7490; font-size: 0.9rem; margin-bottom: 16px; }

.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.album .ph { border: 1px solid var(--line); border-radius: var(--radius); }
.album .ph > img { transition: transform 0.25s ease; }
.album a:hover > img { transform: scale(1.04); }
a.ph { text-decoration: none; }
a.ph:hover { color: rgba(255,255,255,0.92); }
.album a.img-missing { cursor: default; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 21, 61, 0.94);
}
.lb-figure { margin: 0; text-align: center; max-width: min(92vw, 1100px); }
.lb-figure img {
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius);
}
.lb-count {
  margin-top: 10px;
  color: rgba(255,255,255,0.75);
  font-family: var(--font-body-en), var(--font-body-zh);
  font-size: 0.85rem;
}
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}
.lb-btn:hover { background: var(--mint); border-color: var(--mint); color: var(--navy); }
.lb-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close { top: 20px; right: 20px; transform: none; }
@media (max-width: 560px) {
  .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
}
body.no-scroll { overflow: hidden; }

/* 聯絡頁 / Contact ------------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

.contact-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.contact-logo {
  width: 400px;
  max-width: 100%;
  height: 130px;
  padding: 8px;
  flex-shrink: 1;
  border-radius: var(--radius);
}
.contact-logo img { width: 100%; height: 100%; object-fit: contain; }
.contact-brand strong {
  display: block;
  font-family: var(--font-head-en), var(--font-head-zh);
  font-size: 1.25rem;
  color: var(--navy);
  line-height: 1.2;
}
.contact-brand span { color: #45506b; font-size: 0.95rem; }

.contact-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.contact-row > svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 3px; color: var(--teal); }
.contact-row h3 { font-size: 1rem; margin-bottom: 2px; }
.contact-row p,
.contact-row ul { margin: 0; padding: 0; list-style: none; color: #45506b; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 6px;
  font-weight: 600;
}
.field input,
.field select, 
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.submit-btn {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}
.submit-btn:hover { background: var(--purple); }

.form-note { color: #6b7490; font-size: 0.85rem; margin: 12px 0 0; }
.form-note--ok { color: #1b6b4a; font-weight: 600; }
.form-note--err { color: #b3261e; }

.info-block { border-left: 3px solid var(--mint); padding-left: 16px; }
.info-block h3 { font-size: 1rem; margin-bottom: 4px; }
.info-block p { color: #45506b; font-size: 0.95rem; }

/* 頁尾 / Footer --------------------------------------------------------- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  padding: 32px 0;
  font-size: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,0.75); }
.site-footer a:hover { color: var(--mint); }
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding-bottom: 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-name {
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin: 0 0 8px;
}
.footer-line { margin: 0 0 4px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-content: flex-start; }
.footer-links a { text-decoration: none; }
.footer-copy { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
@media (max-width: 640px) {
  .footer-main { grid-template-columns: 1fr; gap: 20px; }
}

/* 減少動態效果偏好 / Reduced motion -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide { transition: none; }
}

/* 鍵盤可視焦點 / Visible focus ------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.site-header a:focus-visible,
.site-header button:focus-visible,
.hero a:focus-visible,
.carousel-btn:focus-visible {
  outline-color: var(--mint);
}

/* 入會申請 / Membership application ------------------------------------ */
.join-lead { margin-bottom: 28px; max-width: 46em; }

.join-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.join-type {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  padding: 18px 20px 8px;
}
.join-type h4 { margin: 0 0 8px; font-size: 1.05rem; color: var(--navy); }
.join-type p { font-size: 0.92rem; color: #45506b; margin-bottom: 0.5em; }
.join-type ul { padding-left: 1.2em; margin: 0 0 0.8em; font-size: 0.92rem; color: #45506b; }
.join-type li { margin-bottom: 0.3em; }

.join-note {
  color: #45506b;
  font-size: 0.9rem;
  border-left: 3px solid var(--mint);
  padding-left: 14px;
  margin-bottom: 8px;
}

.join-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  counter-reset: step;
}
.join-steps li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 2px 46px;
  font-size: 0.92rem;
  color: #45506b;
  margin: 0;
}
.join-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-body-en), var(--font-body-zh);
  font-weight: 700;
}
.join-steps strong { display: block; color: var(--navy); margin-bottom: 2px; font-size: 1rem; }

.join-form fieldset {
  min-width: 0;
  margin: 0 0 20px;
  padding: 18px 22px 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.join-form legend {
  padding: 0 8px;
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  color: var(--navy);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .join-form fieldset { padding: 16px 16px 4px; }
}
/* 必填欄位在標籤後加紅色星號 */
.join-form .field:has([required]) > label::after { content: " *"; color: #b3261e; }
.join-form select { font: inherit; }

.choice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.choice input { width: auto; margin-top: 0.45em; flex-shrink: 0; accent-color: var(--teal); }

.join-hint {
  margin: 8px 0 0;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--purple);
  background: rgba(75, 34, 122, 0.06);
  border-radius: var(--radius);
}

.join-result {
  margin-top: 28px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  scroll-margin-top: 130px;
}
.join-result:focus { outline: none; }
.join-result h3 { margin-bottom: 8px; }
.join-result textarea {
  width: 100%;
  min-height: 200px;
  margin: 8px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font: 0.85rem/1.7 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans TC", monospace;
  color: var(--ink);
  resize: vertical;
}
.join-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
button.btn { border: none; cursor: pointer; font-family: inherit; }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--navy); padding: 10px 22px; }
button.btn-outline { border: 1px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.join-copied { color: var(--teal); font-weight: 600; font-size: 0.9rem; }

/* 機器人陷阱欄位：移出畫面（不用 display:none，部分機器人會略過隱藏欄位）*/
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.join-form input[type="file"] { padding: 8px; background: #fff; }

/* 入會申請頁：章程、申請方式、申請表下載 ---------------------------------- */
#join-downloads,
#join-form-section { scroll-margin-top: 130px; }

.doc-link { margin: 0 0 8px; }
.doc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  padding: 14px 20px;
  margin: 16px 0 8px;
}
.doc-bar p { margin: 0; color: #45506b; font-size: 0.92rem; }

.join-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.join-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--mint);
  padding: 18px 20px 20px;
}
.join-method h4 { margin: 0 0 8px; font-size: 1.05rem; color: var(--navy); }
.join-method p { font-size: 0.92rem; color: #45506b; margin-bottom: 0.8em; }
.join-method .btn { margin-top: auto; }
.join-address {
  padding: 8px 12px;
  background: var(--paper);
  border-left: 3px solid var(--teal);
  color: var(--ink);
  line-height: 1.6;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.download-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 20px;
}
.download-card h4 { margin: 0 0 10px; font-size: 1rem; color: var(--navy); }
.download-links { display: flex; flex-wrap: wrap; gap: 10px; }
.dl {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}
.dl:hover { background: var(--navy); color: #fff; }

/* 入會申請頁：2026-11 改版新增 -------------------------------------------
   只新增、不改動上面任何既有規則，其他頁（首頁、聯絡頁等）不受影響。
   整段刪掉 → 版面退回舊樣式（join.html 新增的 class 會失去樣式）。 */
#join-types,
#join-documents,
#join-fees,
#join-other { scroll-margin-top: 130px; }

.join-block { margin-top: 56px; }
.join-block:first-child { margin-top: 0; }

/* 頁內小標題（h4）：既有 .join-type / .join-method 內的 h4 有自己的樣式，這個給其餘 h4 用 */
.join-h4 {
  font-family: var(--font-head-zh), var(--font-head-en);
  font-size: 1.05rem;
  color: var(--navy);
  margin: 32px 0 12px;
}

/* 會員卡：入會費 */
.join-type .join-fee { margin: 0 0 4px; color: var(--navy); font-weight: 700; }
.join-type .join-fee b { font-size: 1.2rem; color: var(--purple); }

/* 申請前請準備 */
.join-prep {
  margin-top: 28px;
  padding: 6px 20px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
}
.join-prep .join-h4 { margin-top: 12px; }
.join-prep ul { padding-left: 1.2em; margin: 0 0 0.8em; }
.join-prep li { margin-bottom: 0.3em; }

/* 內文連結：全站的青色 (#0197AF) 在白底只有約 3.5:1，達不到 4.5:1，
   所以入會頁的文字連結改用紫色（約 11:1）。按鈕（.btn、.dl）不受影響。 */
.join a:not(.btn):not(.dl) { color: var(--purple); text-underline-offset: 2px; }
.join a:not(.btn):not(.dl):hover { color: var(--navy); }

/* 表單 ----------------------------------------------------------------- */
.join-form { --edge: #7a849b; }  /* 輸入框邊線：對白底約 3.7:1（--line 太淡，不到 3:1） */
.join-form .field input,
.join-form .field select,
.join-form .field textarea { border-color: var(--edge); }
.join-form ::placeholder { color: #6b7490; opacity: 1; }

.form-note .req { color: #b3261e; font-weight: 700; }
.field .form-note { margin-top: 6px; }

/* 欄位組內的小標題（例如「學歷」「現職及工作經歷」） */
.join-sub { margin: 4px 0 14px; font-weight: 700; color: var(--navy); }
.field + .join-sub,
.form-row + .join-sub { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* 會員類別：橫排選項卡 */
.choice-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.choice-group .choice {
  margin: 0;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.choice-group .choice:has(input:checked) { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: rgba(1, 151, 175, 0.06); }
.choice-group .choice:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }

/* 必填勾選項（聲明）也標星號 */
.join-form .choice:has(> input[type="checkbox"][required]) > span::after { content: " *"; color: #b3261e; }

/* 驗證提示：使用者操作過、且內容不符時才出現（:user-invalid），不影響 JS */
.join-form .field input:user-invalid,
.join-form .field select:user-invalid,
.join-form .field textarea:user-invalid { border-color: #b3261e; }
.join-form .field:has(:user-invalid)::after {
  content: "請檢查此欄位";
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: #b3261e;
}
html[data-lang="en"] .join-form .field:has(:user-invalid)::after { content: "Please check this field"; }

/* 提交按鈕：全寬、有 focus / disabled 狀態（只作用在入會表單，聯絡表單的按鈕維持原樣） */
.join-form .submit-btn { display: block; width: 100%; padding: 14px 22px; font-size: 1.05rem; }
.join-form .submit-btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.join-form .submit-btn:disabled,
.join-form .submit-btn:disabled:hover { background: #8a93a8; cursor: not-allowed; }

/* 費用及會籍規定（可展開） */
.join-details {
  margin-top: 32px;
  padding: 0 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.join-details summary { padding: 14px 0; font-weight: 700; color: var(--navy); cursor: pointer; }
.join-details summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.join-details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.join-details ul { padding-left: 1.2em; margin: 0 0 12px; font-size: 0.92rem; color: #45506b; }
.join-details li { margin-bottom: 0.5em; }

/* 出版刊物 / Publications ------------------------------------------------ */
.pub-lead { max-width: 46em; color: #45506b; margin-bottom: 28px; }
.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 24px;
}
@media (max-width: 560px) {
  .pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
}
.pub-card { display: block; text-decoration: none; color: var(--ink); }
.pub-cover {
  aspect-ratio: 210 / 297;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(2, 21, 61, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pub-card:hover .pub-cover,
.pub-card:focus-visible .pub-cover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(2, 21, 61, 0.18);
}
.pub-info { display: block; margin-top: 12px; }
.pub-issue { display: block; font-weight: 700; color: var(--teal); font-size: 0.85rem; }
.pub-title {
  display: block;
  margin: 2px 0;
  font-family: var(--font-head-zh), var(--font-head-en);
  font-weight: 700;
  line-height: 1.4;
  color: var(--navy);
}
.pub-card:hover .pub-title { color: var(--purple); }
.pub-date { display: block; font-family: var(--font-body-en); font-size: 0.82rem; color: #6b7490; }
.pub-pdf { display: inline-block; margin-top: 4px; font-size: 0.82rem; font-weight: 600; color: var(--teal); }
@media (prefers-reduced-motion: reduce) {
  .pub-cover { transition: none; }
  .pub-card:hover .pub-cover { transform: none; }
}