/* ===== CSS VARIABLES ===== */
:root {
  --green-dark:  #3d6b35;
  --green-mid:   #4e8a44;
  --green-light: #9cb878;
  --green-pale:  #e8f0e0;
  --gold:        #c8a040;
  --gold-light:  #d4b04a;
  --white:       #ffffff;
  --text-dark:   #2a2a2a;
  --text-muted:  #555;
  --shadow:      0 2px 8px rgba(0,0,0,0.12);
  --font-sans:   'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  --font-serif:  'Noto Serif TC', 'STKaiti', 'KaiTi', serif;
}

/* ===== LANGUAGE TOGGLE ===== */
html[data-lang="sc"] .tc { display: none !important; }
html[data-lang="tc"] .sc { display: none !important; }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: #f5f5f0;
  color: var(--text-dark);
  font-size: 1rem; /* scales with html font-size set by JS */
}

ul { list-style: none; }
img { max-width: 100%; }

/* ===== HEADER ===== */
.site-header {
  background: var(--white);
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--green-dark);
  text-decoration: none;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.school-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.crest-placeholder .crest-label {
  font-size: 10px;
  margin-top: 3px;
  line-height: 1.3;
  text-align: center;
  letter-spacing: 0.5px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 44px; /* px = fixed, won't scale with text-size */
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 6px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  border: 2px solid var(--green-dark);
  border-radius: 4px;
  overflow: hidden;
}

.lang-btn {
  padding: 6px 16px;
  background: var(--white);
  color: var(--green-dark);
  font-family: var(--font-sans);
  font-size: 14px; /* px = fixed */
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 1px;
}

.lang-btn.active {
  background: var(--green-dark);
  color: var(--white);
}

.lang-btn:hover:not(.active) { background: var(--green-pale); }

/* ===== NAVIGATION (fixed for Bootstrap) ===== */
.main-nav {
  background: var(--green-dark);
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 200;
  /* 強制使用 block，避免 Bootstrap 干擾 */
  display: block;
  height: auto;
  min-height: 60px; /* 可依需求調整，確保展開時有高度 */
}

.nav-list {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 0 !important;   /* 覆蓋 Bootstrap 的 margin */
  padding: 0 !important;  /* 覆蓋 Bootstrap 的 padding */
  list-style: none;
  flex-wrap: wrap;        /* 允許換行，避免溢出 */
}

.nav-item {
  position: relative;
  display: flex;          /* 讓子項目可完整填滿高度 */
  align-items: stretch;
}

.nav-link {
  display: flex;          /* 改用 flex 確保內容垂直置中 */
  align-items: center;
  padding: 18px 30px;
  color: rgba(255,255,255,0.92);
  font-size: 17px; /* px = stays fixed */
  font-weight: 500;
  letter-spacing: 1.5px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
  height: 100%;           /* 填滿父層高度 */
}

.nav-link:hover,
.nav-item.active > .nav-link {
  background: var(--green-mid);
  color: var(--white);
}

.nav-item.active > .nav-link {
  border-bottom: 3px solid var(--gold);
}

.nav-link.has-dropdown::after {
  content: ' ▾';
  font-size: 0.75em;
  opacity: 0.75;
}

/* ===== DROPDOWN ===== */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--gold);
  border-top: 3px solid var(--green-dark);
  box-shadow: var(--shadow);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 12px 20px;
    color: var(--green-dark);
    font-size: 15px; /* px = fixed */
    border-bottom: 1px solid var(--green-pale);
    transition: background 0.15s, padding-left 0.15s;
    text-decoration: none;
}

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

.dropdown-link:hover {
  background: var(--green-pale);
  padding-left: 28px;
  font-weight: 600;
}

/* ===== PAGE WRAPPER ===== */
.page-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 48px;
  overflow: hidden; /* 防止 Bootstrap row 負 margin 造成橫向捲動 */
}

/* ===== CONTENT BOX BASE ===== */
.content-box {
  background: var(--green-light);
  border: 2px solid var(--gold);
  border-radius: 4px;
  padding: 24px 28px;
}

/* ===== PINNED CARD ===== */
.pinned-card {
  background: var(--green-light);
  border: 2px solid var(--gold);
  border-left: 6px solid var(--gold);
  border-radius: 4px;
  padding: 24px 28px;
  min-height: 185px;
}

.pin-label {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  letter-spacing: 1.5px;
}

.pinned-card h3 {
  color: var(--green-dark);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.6;
}

.pinned-card p {
  color: #3a3a3a;
  font-size: 0.92rem;
  line-height: 1.8;
  margin-bottom: 14px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.read-more {
  font-size: 0.85rem;
  color: var(--green-dark);
  font-weight: 700;
  border-bottom: 1px solid var(--green-dark);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.read-more:hover { color: var(--gold); border-color: var(--gold); }

/* ===== CAROUSEL ===== */
.carousel-box {
  background: var(--green-light);
  border: 2px solid var(--gold);
  border-radius: 4px;
  overflow: hidden;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  height: 100%; /* 讓它填滿父層 col 的高度 */
}

.carousel-header {
  background: rgba(0,0,0,0.07);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gold);
  flex-shrink: 0;
}

.carousel-title {
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.carousel-nav-btns {
  display: flex;
  gap: 8px;
}

.carousel-btn {
  width: 28px;
  height: 28px;
  background: var(--green-dark);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.carousel-btn:hover { background: var(--green-mid); }

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carousel-slide a.carousel-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.banner-link[href="#"],
.carousel-link[href="#"] {
  cursor: default;
}

.carousel-slide a.carousel-link:hover .school-badge {
  background: var(--green-mid);
}

.school-badge {
  display: inline-block;
  background: var(--green-dark);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 12px;
  align-self: flex-start;
}

.carousel-slide h3 {
  font-size: 1.05rem;
  color: var(--green-dark);
  font-weight: 700;
  line-height: 1.6;
}

.carousel-slide p {
  font-size: 0.9rem;
  color: #3a3a3a;
  line-height: 1.8;
  flex: 1;
}
.carousel-title {
    margin-bottom: 0px;
}
.carousel-description {
    margin-bottom: 0px;
}

.slide-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(200,160,64,0.35);
  flex-shrink: 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(61,107,53,0.28);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.carousel-dot.active { background: var(--green-dark); }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: white;
  padding: 52px 48px;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  letter-spacing: 6px;
  margin-bottom: 8px;
}

.page-hero .subtitle {
  opacity: 0.82;
  font-size: 0.98rem;
  letter-spacing: 1px;
}

/* ===== FOUNDER PAGE ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 32px;
  margin-top: 30px;
}

.article-body h2 {
  font-family: var(--font-serif);
  color: var(--green-dark);
  font-size: 1.35rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  letter-spacing: 2px;
}

.article-body p {
  font-size: 0.97rem;
  line-height: 1.95;
  margin-bottom: 18px;
  color: #333;
  text-align: justify;
}

.article-sidebar .sidebar-box {
  background: var(--green-light);
  border: 2px solid var(--gold);
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-box h4 {
  color: var(--green-dark);
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold);
}

.timeline { position: relative; padding-left: 22px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--gold);
}

.timeline-item {
  position: relative;
  margin-bottom: 18px;
  padding-left: 6px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-dark);
  border: 2px solid var(--gold);
}

.timeline-year {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.85rem;
}

.timeline-desc {
  font-size: 0.88rem;
  color: #444;
  line-height: 1.65;
  margin-top: 2px;
}

/* ===== SCHOOLS PAGE ===== */

.schools-sidebar-heading {
  background: var(--green-dark);
  color: white;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  border-radius: 4px 4px 0 0;
}

.schools-nav {
  border: 1px solid var(--gold);
  border-top: none;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  background: white;
}

.school-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--green-dark);
  border: none;
  border-bottom: 1px solid var(--green-pale);
  background: white;
  cursor: pointer;
  transition: background 0.15s, padding-left 0.15s;
  text-decoration: none;
}

.school-nav-btn:last-child { border-bottom: none; }

.school-nav-btn:hover,
.school-nav-btn.active {
  background: var(--green-pale);
  padding-left: 24px;
  font-weight: 700;
}

.school-nav-btn.active {
  border-left: 4px solid var(--gold);
}

.school-section { display: none; }
.school-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.school-card-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: white;
  padding: 28px 32px;
  border-radius: 4px 4px 0 0;
}

.school-card-header h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.school-card-header .school-en {
  opacity: 0.8;
  font-size: 0.88rem;
  letter-spacing: 1px;
}

.school-card-body {
  border: 1px solid var(--gold);
  border-top: none;
  padding: 28px 32px;
  background: white;
  border-radius: 0 0 4px 4px;
}

.school-card-body p {
  font-size: 0.96rem;
  line-height: 1.9;
  color: #333;
  margin-bottom: 20px;
  text-align: justify;
}

.school-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--green-pale);
}

.info-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--green-mid);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-item p {
  font-size: 0.93rem;
  color: #333;
  line-height: 1.6;
  margin: 0;
}

/* ===== ACTIVITIES PAGE ===== */
.activities-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  margin-bottom: 24px;
}

.activities-toolbar h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--green-dark);
  font-weight: 700;
  letter-spacing: 2px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border: 2px solid var(--green-dark);
  border-radius: 20px;
  background: white;
  color: var(--green-dark);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--green-dark);
  color: white;
}

.activities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.activity-card {
  background: white;
  border-radius: 6px;
  border: 1px solid #dde;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.activity-card-banner {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--green-light), var(--green-mid));
}

.activity-card-body { padding: 18px 20px; }

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.activity-tag {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.activity-date {
  font-size: 0.78rem;
  color: #999;
}

.activity-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  line-height: 1.55;
}

.activity-card-body p {
  font-size: 0.87rem;
  color: #666;
  line-height: 1.7;
}
.activity-card-title {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    color: inherit;
    text-decoration: none;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 28px 48px;
  margin-top: 56px;
  font-size: 0.85rem;
  line-height: 2;
}

.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: white; }

/* ===== COMING SOON ===== */
.coming-soon {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-muted);
}

.coming-soon .cs-icon { font-size: 4rem; margin-bottom: 16px; }

.coming-soon h2 {
  font-size: 1.5rem;
  color: var(--green-dark);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.coming-soon p { font-size: 0.95rem; }

/* ===== TEXT SIZE CONTROL ===== */
.text-size-control {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-right: 14px;
}

.text-size-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 5px 0;
  line-height: 1;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.text-size-btn.active { opacity: 1; }
.text-size-btn:hover  { opacity: 0.8; }

.text-size-btn::after {
  content: '';
  display: block;
  margin-top: 3px;
  height: 2px;
  width: 100%;
  background: var(--green-dark);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}

.text-size-btn.active::after { opacity: 1; }

.text-size-btn[data-size="sm"] { font-size: 13px; }
.text-size-btn[data-size="md"] { font-size: 17px; }
.text-size-btn[data-size="lg"] { font-size: 22px; }

.menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--green-dark);
  color: var(--green-dark);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.menu-toggle:hover {
  background: var(--green-pale);
}

/* ===== BANNER CAROUSEL ===== */
.banner-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.65s ease;
}

.banner-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-slide a.banner-link {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}

.banner-bg {
  display: none;
}

.banner-slide-1 { background: linear-gradient(120deg, #2d5426 0%, #3d6b35 55%, #5a9a4a 100%); }
.banner-slide-2 { background: linear-gradient(120deg, #1c4a30 0%, #2e6b4a 55%, #4a9a6a 100%); }
.banner-slide-3 { background: linear-gradient(120deg, #3d4a22 0%, #5a6b30 55%, #7a9a4a 100%); }

.banner-content {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  color: white;
  padding: 0 80px;
}

.banner-content img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
  z-index: 2;
}

.banner-overlay h2 {
  margin: 0;
  color: white;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.banner-overlay .text {
  padding: 0.1rem 1rem;
  border-radius: 20px;
  background-color: #aaaaaacc;
}

.banner-content > :not(img):not(.banner-overlay) {
  position: relative;
  z-index: 1;
}

.banner-slide[data-mode="resize"] .banner-bg {
  display: block;
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(8px) brightness(1.2);
  transform: scale(1.05);
}

.banner-slide[data-mode="resize"] .banner-content {
  position: relative;
  padding: 0;
  max-width: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-slide[data-mode="resize"] .banner-content img {
  position: relative;
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  display: block;
  z-index: 1;
}

.banner-slide[data-mode="cover"] .banner-bg {
  display: none;
}

.banner-tag {
  display: inline-block;
  background: rgba(200,160,64,0.9);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.banner-content h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.banner-content p {
  font-size: 0.92rem;
  opacity: 0.88;
  letter-spacing: 1px;
  line-height: 1.7;
}

.banner-prev,
.banner-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.banner-prev { left: 18px; }
.banner-next { right: 18px; }
.banner-prev:hover,
.banner-next:hover { background: rgba(255,255,255,0.32); }

.banner-dots-row {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.banner-dot.active { background: white; }
.banner-description {
    font-size: 1rem;
    display: block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  body { font-size: 0.95rem; }
  .site-header {
    flex-wrap: wrap;
    padding: 16px 24px;
    gap: 16px;
  }
  .header-brand { gap: 12px; }
  .school-logo { height: 60px; }
  .site-title { font-size: 2.2rem; letter-spacing: 4px; }
  .header-controls { width: 100%; justify-content: space-between; }
  .lang-toggle { order: 1; }

  .main-nav { padding: 0 24px; }
  .nav-list { flex-wrap: wrap; justify-content: center; }
  .nav-link { padding: 14px 18px; font-size: 15px; }
  .dropdown { position: static; opacity: 1; pointer-events: auto; transform: none; box-shadow: none; border: none; background: transparent; }
  .dropdown-link { padding: 10px 16px; }

  .page-content { padding: 24px 24px; }
  .carousel-box { min-height: auto; }
  .carousel-header { flex-wrap: wrap; gap: 10px; }
  .carousel-nav-btns { justify-content: flex-start; }
  .carousel-slide { padding: 18px 20px; }
  .carousel-viewport { min-height: 320px; }
  .carousel-dots { padding: 10px; }

  .pinned-card { padding: 22px 24px; }
  .card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .read-more { margin-top: 6px; }

  .banner-carousel { height: 240px; }
  .banner-content { padding: 0 40px; }
  .banner-content h2 { font-size: 1.6rem; letter-spacing: 3px; }
  .banner-content p { font-size: 0.9rem; }
  .banner-prev, .banner-next { width: 34px; height: 34px; font-size: 1.1rem; }
}

@media (max-width: 760px) {
  /* 行動版導航修正 */
  .main-nav {
    display: none;          /* 預設隱藏，由 JS 切換 */
    padding: 0 18px;
  }
  .site-header.nav-open + .main-nav {
    display: block;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .site-header {
    padding: 16px 18px;
    justify-content: space-between;
    align-items: center;
  }
  .header-brand {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: auto;
  }
  .site-title { font-size: 1.9rem; letter-spacing: 2px; }
  .header-controls { justify-content: space-between; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-item {
    display: block;
    width: 100%;
  }
  .nav-link {
    width: 100%;
    padding: 14px 16px;
    height: auto;           /* 行動版高度由內容決定 */
    white-space: normal;
    justify-content: space-between;
  }
  .nav-link.has-dropdown::after {
    content: '▾';
    font-size: 0.9em;
    opacity: 0.7;
    margin-left: 8px;
    transition: transform 0.2s ease;
  }
  .nav-item.open > .nav-link.has-dropdown::after {
    transform: rotate(-180deg);
  }

  .dropdown {
    display: none;
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
  }
  .nav-item.open > .dropdown {
    display: block;
  }
  .dropdown-link {
    border: none;
    padding: 12px 16px 12px 34px;
    background: rgba(255,255,255,0.94);
    font-size: 15px;
  }
  .dropdown-link:hover { background: rgba(255,255,255,1); }

  .page-content { padding: 18px 18px; }
  .carousel-header { align-items: flex-start; }
  .carousel-viewport { min-height: 260px; }

  .banner-carousel { height: 220px; }
  .banner-content { padding: 0 24px; }
  .banner-content h2 { font-size: 1.35rem; letter-spacing: 2px; }
  .banner-content p { font-size: 0.88rem; }

  .activities-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-tabs { justify-content: flex-start; }
  .activities-grid { grid-template-columns: 1fr; }

  .school-card-header, .school-card-body { padding: 20px; }
}

/* ===== 無限滾動樣式 ===== */
.infinite-scroll-trigger {
    text-align: center;
    padding: 20px 0;
}

.scroll-sentinel {
    height: 1px; /* 極小高度，僅作為監測點 */
    width: 100%;
    margin-top: -1px; /* 避免額外佔位 */
}

.loading-indicator {
    display: none; /* 預設隱藏，由 JS 控制顯示 */
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

    .loading-indicator.show {
        display: flex;
    }

.end-message {
    padding: 20px 0;
    font-size: 0.9rem;
    display: none;
}