:root {
  --bg: #2e3a34;
  --gold: #e6c967;
  --red: #e8553d;
  --text-light: #f5f5f5;
}

html, body {
  height: 100%;   /* 讓 body 高度等於視窗 */
  margin: 0;
}

body {
  display: flex;             /* 用 flex 做整體排版 */
  flex-direction: column;
  min-height: 100vh;         /* 即使內容不足也會撐到整個螢幕 */
}
main {
  flex: 1;                   /* 主內容自動撐開 */
}
.footer {
  margin-top: auto;          /* Footer 黏在最下面 */
}

body {
  margin: 0;
  background-color: #472c02;
  background-image: url('paper-texture.jpg');
  background-repeat: repeat;
  background-size: auto;
  background-attachment: scroll;
  background-position: center center;
  font-family: 'FangSong', '仿宋', 'FangSong_GB2312', 'Source Han Serif TC', 'Noto Serif TC', serif;
  color: var(--text-light);
  overflow-x: hidden;
}

#trail-container, #crt-container, .scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 998;
}

.mouse-trail, .crt-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: rgba(230, 201, 103, 0.8);
  box-shadow: 0 0 6px rgba(230, 201, 103, 0.6);
  border-radius: 1px;
  animation: fadeOut 1s ease-out forwards;
}

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index: 997;
}

#walkway {
  position: absolute; /* 從 fixed 改為 absolute */
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('bg4.jpg') center center no-repeat;
  background-size: cover;
  z-index: -2;
  transform-origin: center center;
  transition: opacity 0.5s ease;
}

#walkway-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 100%);
  z-index: -1;
  transition: opacity 0.5s ease;
}

#loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: #1c1c1c;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.loading-logo {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  animation: spin 2s linear infinite;
  z-index: 2;
}

.loading-text {
  color: var(--gold);
  font-size: 24px;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 4px;
  opacity: 0.8;
  z-index: 2;
}

#sand-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.sand-grain {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: var(--gold);
  border-radius: 50%;
  opacity: 0.6;
  animation: sandFall linear forwards;
}

@keyframes sandFall {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) scale(0.5); opacity: 0; }
}

#sand-audio {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 600px;
  padding: 12px 32px;
  background-color: rgba(46, 58, 52, 0.5);
  backdrop-filter: blur(6px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background-color: #473828;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 4px 32px;
}

.logo img { height: 80px; }

/* 🔁 火車轉場容器 */
#train-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('station-bg.png'); /* ✅ 加入背景圖 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: none;
  z-index: 9999;
  overflow: hidden;
}


/* 火車圖片初始位置在畫面右側外面 */
#train-image {
  position: absolute;
  bottom: 0;
  top: 50%;
  left: 0;
/* 新增這兩行來控制縮放比例 */
  width: 80vw;          /* 原來是100%畫面寬，改小一點 */
  max-width: 900px;     /* 可設定最大寬度，視情況微調 */
  height: auto;
  max-height: 100%;
  transform: translate(100vw,-50%); /* 初始狀態：螢幕外 */
  transition: transform 1s ease-in-out;
}

#mist-effect {
  position: absolute;
  top: 45%;
  left: 0;
  width: 500px;
  height: 500px;
  background-image: url('mist.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateX(100vw) translateY(-50%); /* ✅ 初始在右側螢幕外 */
  transition: transform 1s ease-in-out; /* ✅ 要有 transition 才能動畫移動 */
  opacity: 0.9;
  z-index: 2;
  pointer-events: none;
}



@keyframes mist-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1px, -1px) rotate(-0.3deg); }
  50% { transform: translate(-1px, 1px) rotate(0.3deg); }
  75% { transform: translate(1px, 1px) rotate(-0.2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}




.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
}

.menu li a {
  position: relative;
  font-size: 18px;
  padding: 10px 8px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

.menu li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  width: 60%;
  height: 2px;
  background-color: var(--gold);
  transition: transform 0.3s ease;
  opacity: 0.8;
}

.menu li a:hover {
  color: var(--gold);
  transform: scale(1.05);
}

.menu li a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 100px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 90%;
  padding: 0 16px;
  line-height: 1.2;
}

.title-main {
  font-size: 72px;
  color: var(--gold);
  letter-spacing: 10px;
  margin: 0;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 1.4s;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.4);
}

.subtitle {
  color: var(--red);
  font-size: 30px;
  margin-top: 12px;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 1.6s;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.4);
}

.corner-text {
  position: fixed;
  bottom: 20px;
  font-size: 16px;
  color: #fff;
  z-index: 99;
}
.corner-text.left { left: 20px; }
.corner-text.right { right: 20px; }

.spacer {
  height: -10vh;
}

/* ==== 展覽介紹區塊（泡泡區塊） ==== */
.intro-section {
  position: relative;
  height: 100vh;   /* 限制只佔一個視窗高度 */
  overflow: hidden;
  z-index: 0;      /* 確保層級低於後續的 section */
}

#particle-text-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* 左側標題 */
.intro-title {
  position: absolute;
  left: 18%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(28px, 3vw, 44px);
  color: #512203;
  text-shadow: 0 0 12px rgba(249, 227, 137, 0.7);
  z-index: 2;
}

/* 泡泡機 */
.bubble-machine-img {
  position: absolute;
  left: 8%;
  bottom: 28%;
  width: 150px;
  max-width: 18vw;
  z-index: 2;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

/* 泡泡動態區域（限制在 intro-section 範圍內） */
.bubble-area {
  position: absolute;
  inset: 0;             /* 填滿 intro-section，不會蓋到外面 */
  z-index: 0;
  pointer-events: none;
}

/* 泡泡外觀 */
.bubble {
  position: absolute;
  left: 120px;       /* 起始位置：泡泡機出口 */
  bottom: 130px;     /* 起始位置：泡泡機出口 */
  opacity: 1;
  pointer-events: none;
}

.bubble img {
  width: 100%;
  height: auto;
  display: block;
}

/* 泡泡文字 */
.bubble span {
  position: absolute;
  left: 10%;
  top: 10%;
  width: 80%;
  height: 80%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
  word-break: break-word;
  white-space: normal;
  overflow: hidden;
  color: #754c07;
  font-weight: 300;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* 泡泡動畫 */
@keyframes moveRight {
  from { left: 120px; opacity: 1; }
  to   { left: 120vw; opacity: 1; }
}
@keyframes sway {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}

/* === 背景星光 canvas === */
.intro-section #background-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  animation: backgroundDrift 10s ease-in-out infinite alternate;
}
.intro-section #particle-text-canvas {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}
@media (min-width: 768px) {
  .intro-section #particle-text-canvas { display: block; }
}


.transition-door {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  background: url('door.png') center center no-repeat;
  background-size: cover;
  z-index: 9999;
  pointer-events: none;
  transform: translateX(0);
  transition: transform 0.8s ease-in-out;
}

.left-door {
  left: 0;
  transform: translateX(-100%);
}

.right-door {
  right: 0;
  transform: translateX(100%);
}

.transition-door.active {
  transform: translateX(0);
}

.transition-door.open.left-door {
  transform: translateX(-100%);
}

.transition-door.open.right-door {
  transform: translateX(100%);
}

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

@keyframes fadeOut {
  to { opacity: 0; transform: scale(2); }
}

@media screen and (max-width: 768px) {
  .flower-frame-container {
    max-width: 90%;
    background-size: 90% auto;
  }
}

#group-section {
  margin-top: 90vh;
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-image: url('tvbg2.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.group-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;  /* 從 center 改為 flex-start */
  width: 100%;
  height: 100%;
  position: relative;
  padding-top: 40px; /* 新增，往下推 */
}



#group-screen {
  position: relative; /* 絕對定位基準 */
  width: 100%;
  max-width: 1200px;
  height: 600px; /* 調整高度以留空間 */
}

.group-title {
  position: absolute;
  top: 7%;
  left: 52%;
  transform: translateX(-50%);
  font-size: 36px;
  color: #f2d16b;
  text-align: center;
}

.group-title span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}

.group-buttons {
  position: relative;
  width: 100%;
  height: 100%;
}

.group-btn {
  position: absolute;
  width: 110px;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(230, 201, 103, 0.4));
  cursor: pointer;
  animation: float 4s ease-in-out infinite;
}

.group-btn:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(230, 201, 103, 0.8));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ✅ 精準位置（根據橘色點位置大致推估） */
#btn-food {
  top: 20%;
  left: 5%;
}

#btn-clothing {
  top: 67%;
  left: 0%;
}

#btn-housing {
  top: 45%;
  left: 30%;
}

#btn-transport {
  top: 55%;
  left: 60%;
}

#btn-education {
  top: 20%;
  left: 80%;
}

#btn-entertainment {
  top: 75%;
  left: 90%;
}

#category-display {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 150px; /* 新增，往下推開空間 */
}

#back-button {
  position: absolute;
  bottom: -150px; /* 若與字卡仍過近可調小或加大 */
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 0;
}


#back-icon {
  width: 48px;   /* 或依需求調整大小 */
  height: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(230, 201, 103, 0.5));
  position: relative; /* 如果原本是 fixed/absolute 就保持不動 */
  bottom: 40px; /* 數值越大越往上 */
}

#back-button:hover #back-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 10px rgba(230, 201, 103, 0.8));
}

#category-title {
  text-align: center;
  font-size: 24px;
  margin: 10px 0;
  color: #e6c967;
}

.category-icon {
  width: 90px;
  height: auto;
  display: block;
  margin: 0 auto 5px;
  filter: drop-shadow(0 0 8px rgba(248, 243, 206, 0.9)); /* 金色光暈 */
}

#category-display {
  margin-top: 60px; /* 負值往上移，數字可自行調整 */
}


/* 方案A 卡片區完善骨架 */
#groups-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}


.group-card {
  background: rgba(50, 50, 50, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 15px;
  color: #f5f5f5;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 250px;              /* ✅ 卡片寬度統一 */
  height: 250px;             /* ✅ 卡片高度統一 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.group-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.group-card img {
  width: 100%;
  max-width: 100px;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.group-card h3 {
  margin: 10px 0 5px;
  font-size: 16px;
  color: var(--gold);
}

.group-card p {
  font-size: 14px;
  line-height: 1.4;
  color: #ddd;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin-bottom: 8px;
  padding: 0 5px;
}


.group-img {
  width: 100px;
  height: 100px;
  object-fit: contain; /* 或用 cover */
  display: block;
  margin: 0 auto 12px;
}

.card-links {
  margin-top: auto; /* ⬅ 把 icon 推到底部 */
  display: flex;
  justify-content: center;
  gap: 12px;
}

.card-links .icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.card-links .icon:hover {
  transform: scale(1.2);
}

@media (max-width: 1024px) {
  .group-card {
    height: auto; /* 高度自動拉長以適應較小螢幕的文字換行 */
  }
}

@media (max-width: 768px) {
  #groups-container {
    flex-direction: column;
    align-items: center;
  }

  .group-card {
    width: 90%;
    max-width: 350px;
    height: auto;
  }
}


/* 最新消息區塊樣式 */
.news-section {
  clear: both;
  position: relative;
  width: 100%;
  background-image: none;
  padding: 80px 20px;
  color: #f7f1e5;
  z-index: 0;
}

.news-section h2 {
  text-align: center;
  font-size: 36px;
  color: #552d07;
  margin-bottom: 40px;
}

.news-title span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}

.news-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  width: 90%;
}

.news-content {
  display: flex;
  flex-direction: column;
  gap: 60px; /* 上下區塊間距 */
}

/* === 左右區塊通用設定 === */
.news-row {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

/* === 線下活動：左邊聽筒+標題，右邊資訊 === */
.news-row.offline .news-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.news-row.offline .news-right {
  flex: 1;
}

/* === 線上活動：左邊資訊，右邊手機+標題 === */
.news-row.online .news-left {
  flex: 1;
}
.news-row.online .news-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.phone-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;   /* 撐滿版面 */
  height: 100%;
  z-index: 0;    /* 在背景層，不擋住文字 */
  pointer-events: none;
}



/* === 裝飾圖片 === */
.news-left img,
.news-right img {
  width: 250px;
  height: auto;
  margin-bottom: 15px;
}

.news-category {
  font-size: 1.8rem;
  font-weight: bold;
  color: #552d07;
  background-color: rgba(241, 226, 163, 0.5);
  padding: 1px 30px;
  border-radius: 6px;
  text-align: center;
}

/* === 活動卡片 === */
.news-item {
  background-color: rgba(217, 203, 161, 0.25);
  padding: 15px;
  border-radius: 10px;
  max-width: 600px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 20px;
}

.news-item:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.news-text h3 {
  font-size: 1.3rem;
  font-weight: bold;
  color: #7b1a04;
}

/* === 📱 手機版 RWD === */
@media (max-width: 768px) {
  .news-row {
    flex-direction: column;
    align-items: center;
  }

  .news-left, .news-right {
    align-items: center;
    margin-bottom: 20px;
  }

  .news-item {
    max-width: 100%;
  }
}




/* 關於我們區塊整體設定 */
/* 整體區塊 */
.about-title {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: #552d07;
  margin: 40px 0 20px;
}

.about-title span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}

.sub-title {
  text-align: center;
  margin: 60px 0 30px;
}

.sub-title h3 {
  font-size: 24px;
  font-weight: bold;
  color: #552d07;
  font-family: 'Noto Serif TC', serif;
  border-bottom: 2px solid #552d07;
  display: inline-block;
  padding-bottom: 8px;
}

.about-row:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 20px;
}

.about-card:hover .image-box {
  transform: scale(1.03);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}


.about-rows {
  width: 90%;
  margin: auto;
}

.about-row {
  display: flex;
  justify-content: center;
  gap: 80px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

/* 每張卡片：一張照片 + 一組文字 */
.about-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 照片基本樣式 */
.image-box {
  width: 300px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.image-box img {
  width: 100%;
  height: auto;
  display: block;
}

/* === 卡片容器 === */
.flip-card {
  width: 300px;
  height: 80px;
  perspective: 1000px;
  margin: 10px;
}

/* === 內層翻轉機制 === */
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

/* === 前後兩面結構 === */
.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.flip-front img,
.flip-back img {
  width: auto;
  height: 100%;
  object-fit: cover;
}

/* === 反面翻轉 === */
.flip-back {
  transform: rotateY(180deg);
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;   /* 與老師區塊寬度一致 */
  height: 220px;
  transform-origin: center center;
  transform: rotateY(180deg) translate(50%, -50%);
  z-index: 2;
}

.flip-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}


/* 左右傾斜形狀 */
.flip-front.right {
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.flip-front.left {
  clip-path: polygon(0 0, 90% 0, 100% 100%, 10% 100%);
}

/* 文字樣式 */
.description {
  width: 110px;
  max-width: 180px;
  line-height: 1.5;
}

.description p {
  margin: 6px 0;
  font-size: 16px;
  color: #fff;
}


/* 對齊方式 */
.description.left {
  text-align: left;
}

.description.right {
  text-align: right;
}

.description p:first-child {
  color: #552d07;
  font-weight: bold;
  font-size: 16px;
}

.description p:last-child {
  font-size: 17px;
  font-weight: 600;
}



/* Podcast 區塊樣式 */
/* === Podcast 輪播樣式 === */
.about-subtitle {
  text-align: center;
  margin: 60px 0 30px;
}
.about-subtitle h3 {
  font-size: 24px;
  font-weight: bold;
  color: #552d07;
  font-family: 'Noto Serif TC', serif;
  border-bottom: 2px solid #552d07;
  display: inline-block;
  padding-bottom: 8px;
}
.podcast-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 60px auto;
  width: 100%;
  max-width: 1200px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 40px;
  align-items: center;
}

.episode {
  flex-shrink: 0;
  width: 320px;
  opacity: 0.3;
  transform: scale(0.6);
  transition: all 0.5s ease;
  text-align: center;
  pointer-events: none;
}

.episode-image-wrapper {
  position: relative;
  width: 100%;
}

.episode-img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: block;
}

.film-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.episode-info {
  margin-top: 15px;
  color: #fdead6;
}

.episode-info h4 {
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.4;
}

.episode-info p {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.links a {
  color: #fff;
  background-color: #52370f;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.links a:hover {
  background-color: #d3b184;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  padding: 10px;
}

.arrow.left {
  left: 20px;
}

.arrow.right {
  right: 20px;
}

/* 放大縮小邏輯：依照 index 設定樣式 */
.episode.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.episode.prev,
.episode.next {
  opacity: 0.6;
  transform: scale(0.8);
}

.episode.prev2,
.episode.next2 {
  opacity: 0.3;
  transform: scale(0.6);
}

/* 資傳介紹子區塊 */
.com-intro {
  display: flex;              /* 用 flex 控制 */
  flex-direction: column;     /* 垂直排列 (標題 → 圖片 → 扭蛋) */
  align-items: center;        /* 水平置中 */
  margin-top: 60px;
}

.com-intro .sub-title {
  font-size: 24px;
  font-weight: bold;
  color: #552d07;
  font-family: 'Noto Serif TC', serif;
  border-bottom: 2px solid #552d07;
  display: inline-block;
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.gashapon-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  margin-top: 30px;
}

.capsule-side {
  display: flex;
  flex-direction: column;
  gap: 25px;
  align-items: center;
}

.capsule {
  width: 500px;
  opacity: 0;                 /* 初始隱藏 */
  transform: translateY(-50px); /* 從上方掉下來 */
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.3));
}

/* 顯示動畫 */
.capsule.show {
  opacity: 1;
  transform: translateY(0);
  animation: dropIn 0.8s ease forwards;
}

@keyframes dropIn {
  0% {
    opacity: 0;
    transform: translateY(-50px) scale(0.5);
  }
  60% {
    opacity: 1;
    transform: translateY(10px) scale(1.1); /* 彈一下 */
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gashapon-machine {
  position: relative;
  display: inline-block;
}

/* 提示區塊 */
.tap-hint {
  position: absolute;
  bottom: 145px;    /* 跟按鈕水平對齊 */
  left: 60%;      /* 移到按鈕右邊 */
  margin-left: 10px; /* 距離按鈕一點點 */
  display: flex;     /* 使用 flex 讓箭頭和文字對齊 */
  align-items: center; /* 垂直置中 */
  animation: bounceX 1s infinite; /* 左右小幅度動 */
}

.tap-text {
  font-size: 18px;
  font-weight: bold;
  color: #552d07;
  font-family: 'Noto Serif TC', serif;
  background: rgba(255, 255, 255, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* 箭頭朝左 */
.arrow-left {
  width: 0; 
  height: 0; 
  margin-top: 5px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 10px solid #552d07;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

/* 左右晃動動畫 */
@keyframes bounceX {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}



.gashapon-machine .machine-img {
  width: 260px;
  display: block;
}

.gashapon-machine .gashapon-btn {
  position: absolute;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
}

/* 收回動畫 - 左邊 */
.capsule.hide.left {
  animation: retractLeft 0.8s ease forwards;
}

@keyframes retractLeft {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(-20px) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) translateX(0) scale(0.5) rotate(-180deg);
  }
}

/* 收回動畫 - 右邊 */
.capsule.hide.right {
  animation: retractRight 0.8s ease forwards;
}

@keyframes retractRight {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(20px) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) translateX(0) scale(0.5) rotate(180deg);
  }
}



/* 展覽資訊 */
.venue-section {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: #552d07;
  margin: 40px 0 20px;
}

.venue-section span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}

.poster-wrapper {
  max-width: 85%;
  margin: 0 auto;
}

.poster-image {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: opacity 0.4s ease-in-out;
}

.poster-label {
  margin-top: 10px;
  font-size: 16px;
  color: #555;
  font-weight: 500;
}

.flip-icon-wrapper {
  margin-top: 20px;
  text-align: center;
}

.flip-icon {
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.flip-icon:hover {
  transform: rotate(180deg);
}

.poster-image.flipping {
  animation: flipY 0.6s ease-in-out;
}

@keyframes flipY {
  0% {
    transform: perspective(800px) rotateY(0deg);
    opacity: 1;
  }
  50% {
    transform: perspective(800px) rotateY(90deg);
    opacity: 0;
  }
  51% {
    transform: perspective(800px) rotateY(-90deg);
    opacity: 0;
  }
  100% {
    transform: perspective(800px) rotateY(0deg);
    opacity: 1;
  }
}


/* RWD 手機與平板 */
@media (max-width: 768px) {
  .news-item {
    flex-direction: column;
    gap: 15px;
  }

  .news-item:nth-child(even) {
    flex-direction: column;
  }

  .news-item img, .news-text {
    width: 100%;
    min-width: unset;
  }

  .news-category {
    text-align: center;
  }
}




/* === 贊助與合作區塊 === */
.cooperation-section {
  background: none;
  padding: 100px 5vw;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.section-title {
  font-size: 36px;
  color: #552d07;
  margin-bottom: 60px;
  letter-spacing: 2px;
}
.section-title span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}
.cloud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 80px 60px;
  justify-items: center;
  padding: 100px 0;
}
.cloud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
  position: relative;
}
.cloud-shape {
  position: relative;
  width: 280px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cloud-bg {
  position: absolute;
  width: 100%;
  height: auto;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}
.cloud-shape a {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: inline-block;
}
.partner-logo {
  width: 120px;
  height: auto;
  z-index: 1;
  object-fit: contain;
  transition: transform 0.3s ease;
  transform: translateY(-15%);
}
.cloud-item:hover {
  transform: scale(1.1);
}
.partner-name {
  font-size: 1.5rem;
  color: #552d07;
  text-shadow: 2px 2px 0 #e6b687;
  margin-top: 20px;
  line-height: 1.3;
}
.partner-desc {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: #fff8e0;
  text-shadow: 1px 1px 0 #000;
  margin-top: 8px;
  text-align: center;
  line-height: 1.5;
}
.partner-link {
  margin-top: 10px;
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid #593205; /* 復古深藍框 */
  border-radius: 20px;
  color: #593205;
  font-weight: 500;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.partner-link:hover {
  background-color: #68430f;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(56, 64, 79, 0.25);
}
@media (max-width: 768px) {
  .cloud-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 60px 40px;
  }
}


/* ✈️ 紙飛機整體區塊容器 */
.plane-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ✈️ 紙飛機圖像設定 */
.paper-plane {
  width: 150px;
  height: auto;
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  z-index: 10;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.4));
}

/* ✈️ 拖尾線條 SVG 容器 */
.trail-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ✈️ 拖尾虛線樣式 */
.trail-line {
  stroke: #b0e0f8;
  stroke-width: 2;
  stroke-dasharray: 6, 4;
  opacity: 0.7;
  z-index: 1;
}


/* 紙飛機飛行動畫 */
@keyframes fly-plane {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

/* 拖尾線條流動動畫 */
@keyframes dash-flow {
  to {
    stroke-dashoffset: -20;
  }
}

/* ==== 社群媒體區塊 ==== */
.media-section {
  position: relative;
  min-height: 100vh;
  padding: 80px 0 60px;   /* 原本160 → 減少 */
  overflow: hidden;       /* 把超出容器的高度切掉 */
  z-index: 5;        /* 確保比 intro-section 高，避免被泡泡蓋掉 */
}

.title {
  text-align: center;
  font-size: 36px;
  color: #552d07;
  margin-bottom: 60px;
  letter-spacing: 2px;
}
.title span {
  display: block;
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
  color: #ffe0c2;
  margin-top: 8px;
}

/* 風箏初始位置 */
.kite {
  position: absolute;
  bottom: -600px;
  left: 18%;
  width: 450px;
  opacity: 0;
  transition: bottom 1.8s ease-out, opacity 0.8s ease-out;
}
.kite.float {
  bottom:-15%; /* 調整這個數字決定停在哪裡 */
  opacity: 1;
}

/* 社群卡片 */
.social-cards {
  position: relative;     /* 回到文件流 */
  margin-left: auto;      /* 右對齊 */
  margin-right: 15%;      /* 原本的 right 改成外距 */
  margin-top: 30vh;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 兩欄 */
  gap: 1.5rem 2rem; /* 上下間距 1.5rem，左右間距 2rem */
  width: 600px;     /* 控制整體寬度，可以依需要調整 */
}

.info-card {
  background: rgba(255, 255, 255, 0.75);
  padding: 1rem;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  width: 100%;              /* 填滿格子 */
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}
.info-card.show {
  opacity: 1;
  transform: translateY(0);
}

.info-card img {
  width: 100%;
  border-radius: 8px;
}

.info-card h3,
.info-card p,
.info-card a {
  margin: 0;
  line-height: 1.3; /* 預設大約 1.6，改小字距就會緊密 */
}

.info-card h3 {
  color: #2c2c2c;   /* 深色標題 */
  font-weight: bold;
}

.info-card p {
  color: #555;      /* 次要資訊灰色 */
}

.info-card a {
  color: #6b3e96;   /* 按鈕或連結紫色 */
  font-weight: 600;
  text-decoration: none;
}
.info-card a:hover {
  text-decoration: underline;
}


/* 回到頂端按鈕 */
#back-to-top {
  position: fixed;
  bottom: 50px;
  right: 40px;
  z-index: 999;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}


/* 圖片大小可調 */
#back-to-top img {
  width: 40px;
  height: 40px;
}

/* 滑到一定距離後顯示 */
#back-to-top.show {
  opacity: 0.8;
  pointer-events: auto;
}

#back-to-top:hover {
  opacity: 1;
}


/* ==== 頁尾 Footer 區塊 ==== */
/* 色票：深棕 / 奶茶 */
:root{
  --brown:#a16f41;
  --cream:#f1e2a3;
  --cream-2:#f7ecd0;
  --grid:#c9b58a;
  --paper:#e8d9b9;
  --shadow:0 10px 30px rgb(255, 255, 255);
}

.footer{
  position: relative;
  color: var(--cream);
  overflow: clip;
  border-top: 8px solid #3e1f05;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* 背景層：紙張 → 網格 */
.footer-bg{ position:absolute; inset:0; z-index:0; }
.paper-bg{
  position:absolute; inset:0;
  background:
    radial-gradient(1200px 400px at 50% 120%, rgba(0,0,0,.15), transparent 60%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.03) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, var(--paper), #d7c49a);
  transition: opacity .8s ease;
  opacity: 1;
}
.grid-bg{
  position:absolute; inset:0;
  background:
    linear-gradient(transparent 49%, rgba(255,255,255,.08) 50%, transparent 51%) 0 0/16px 16px,
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.08) 50%, transparent 51%) 0 0/16px 16px,
    linear-gradient(180deg, #3b1d07, var(--brown));
  mix-blend-mode: screen;
  opacity: 0; transition: opacity .8s ease .05s;
}

/* 進入視窗時切換背景 */
.footer.in-view .paper-bg{ opacity:0; }
.footer.in-view .grid-bg{ opacity:.9; }

.footer-inner{
  position: relative; 
  z-index:1;
  display:grid; 
  grid-template-columns: 2fr 2fr auto; /* 三欄：左、中、右 */
  gap: 2px;
  padding: 0px clamp(16px, 5vw, 48px); /* 上下留白一樣 */
  background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.35));
  align-items: center;  /* 🔑 新增這行，讓兩欄內容垂直置中 */
}

.footer-venue {
  text-align: right;     /* 靠右對齊 */
  margin-left: -120px; 
}

.footer-venue ul {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.footer-venue li {
  margin: 2px 0;
}

.footer-info {
  display: flex;
  justify-content: space-between;  /* 左右兩邊分開 */
  align-items: flex-start;         /* ⬅ 關鍵：讓兩個 info-block 從頂部對齊 */
  gap: 40px;
  margin-left: -300px;       /* 兩塊之間的距離，可以自己調整 */
}

.footer-info .info-block {
  flex: 1;                         /* 每塊平均分配寬度 */
  text-align: left;                /* 確保內容靠左 */
}

/* 左欄品牌 */
.footer-logo{ width: 120px; height:auto; display:block; filter: drop-shadow(var(--shadow)); margin-bottom:12px; }
.footer-title{ margin:8px 0 4px; font-size: clamp(12px, 2.2vw, 20px); letter-spacing:.5px;}
.footer-tagline{ color: var(--cream-2); opacity:.9; margin-bottom: 16px; font-size:12px;}

/* 右欄資訊 */
.footer-col h4{ font-size: 1rem; margin: 0 0 4px; color: #ffe9b6; letter-spacing:.5px; text-align: left;  }
.footer-col ul{ margin: 0; padding-left: 18px;; list-style: none; text-align: left;}
.footer-col li{ margin: 4px 0; }

.footer-inner a{ color: var(--cream); text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,.35); }
.footer-inner a:hover{ border-bottom-style: solid; }

.footer-col .info-block:nth-child(3) {
  margin-left: 20px; /* 這裡的數值可以依需求調整 */
}

.contact-list {
  display: flex;
  flex-direction: column; /* 改成直排 */
  gap: 12px;              /* 上下行間距，可調整 */
  padding-left: 80px;  /* 讓 icon 不會貼邊 */
  list-style: none;
}
.contact-list li {
  text-align: left;               /* 讓右邊那欄也靠左 */
}

.contact-list a {
  display: inline-block;
  align-items: center;
  justify-content: flex-start; /* icon + 文字靠左 */
  gap: 6px; /* icon 和文字間距 */
  text-decoration: none; /* 移除底線 */
  border-bottom: none;
}

.i{ inline-size:18px; block-size:18px; display:inline-block; }
.i-mail{ background: conic-gradient(from 45deg, currentColor 0 25%, transparent 0) no-repeat,
                    linear-gradient(currentColor,currentColor) center/70% 2px no-repeat;
         mask: polygon(0 25%,50% 55%,100% 25%,100% 100%,0 100%); }
.i-ig{ border:2px solid currentColor; border-radius:5px; position:relative; }
.i-ig::after{ content:""; position:absolute; inset:5px; border:2px solid currentColor; border-radius:50%; }

/* 版權 */
copyright, .copyright{ margin-top: 16px; opacity:.85; font-size: 10px; }

/* 跑馬燈 */
.footer-marquee{ position:relative; z-index:1; background: rgba(0,0,0,.35); overflow:hidden; border-top:1px solid rgba(255,255,255,.15); }
.marquee-track{
  white-space: nowrap; padding: 10px 0; font-size:.95rem; letter-spacing:.4px;
  animation: marquee 22s linear infinite;
}
.footer-marquee:hover .marquee-track{ animation-play-state: paused; }
@keyframes marquee{
  from{ transform: translateX(100%); }
  to{ transform: translateX(-100%); }
}

/* 返回頂端 */
.back-to-top{
  margin-top: 8px; border: 1px solid rgba(255,255,255,.35);
  background: transparent; color: var(--cream); padding: 6px 10px; border-radius: 8px;
  cursor: pointer;
}
.back-to-top:hover{ background: rgba(255,255,255,.08); }

/* 無障礙：減少動作時關閉動畫 */
@media (prefers-reduced-motion: reduce){
  .paper-bg, .grid-bg, .timeline-progress, .marquee-track{ transition: none !important; animation: none !important; }
}

/* RWD */
@media (max-width: 900px){
  .footer-inner{ grid-template-columns: 1fr; gap: 20px; }
  .footer-title{ font-size: 20px; }
}



