.exhibitors-grid {
  width: 100%;
  height: 450px; /* 精確計算：15個攤商 × 30px = 450px，與海報區域等高 */
  overflow: hidden;
  position: relative;
}

/* 攤商流動容器 */
.exhibitors-flow-container {
  width: 100%;
  animation: exhibitorsFlow 45s linear infinite; /* 調整動畫時間，讓滑動更流暢 */
}

/* 攤商流動動畫 */
@keyframes exhibitorsFlow {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

/* 攤商列表容器 */
.exhibitors-flow-container {
  width: 100%;
}

/* 攤商條列項目 */
.exhibitor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  width: 100%;
  padding: 0 1rem;
  margin: 0;
  border-bottom: 1px solid black;
  font-size: 0.9rem;
  font-weight: 400;
  transition: background-color 0.2s ease;
  position: relative;
}

/* 攤位類型指示點 */
.exhibitor-item::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #666; /* 預設顏色 */
}

/* 攤商名稱左邊間距 */
.exhibitor-name {
  margin-left: 3px;
}

/* 不同攤位類型的顏色 */
.exhibitor-item.book-booth::before {
  background-color: #392100; /* 藍色 - 書攤 */
}

.exhibitor-item.creative-booth::before {
  background-color: #083154; /* 紅色 - 創作商品攤 */
}

.exhibitor-item.installation-booth::before {
  background-color: #000000; /* 橙色 - 裝置攤 */
}

.exhibitor-item.food-booth::before {
  background-color: #063500; /* 綠色 - 食物酒水攤 */
}

.exhibitor-item.international-booth::before {
  background-color: #50006f; /* 紫色 - 國際攤位 */
}

.exhibitor-item:hover {
  background-color: #f8f9fa;
}

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

/* 讀取中訊息 */
.loading-message {
  text-align: center;
  padding: 2rem;
  color: black;
}

.loading-message p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

/* 攤商名稱（左側） */
.exhibitor-name {
  flex: 1;
  text-align: left;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 攤位編號（右側） */
.exhibitor-booth {
  text-align: right;
  color: black;
  margin-left: 1rem;
  min-width: 60px;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .exhibitors-grid {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .exhibitor-item {
    padding: 0 0.5rem;
    font-size: 0.8rem;
  }

  .exhibitor-booth {
    min-width: 50px;
  }
}

.calender-content {
  max-width: 1200px;
  margin: 0 auto;
  border: none;
  overflow: hidden; /* 隱藏超出容器的內容 */
  position: relative;
}

/* 日曆頂部控制區域 */
.calender-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 0.5rem;
}

/* 箭頭按鈕組 */
.calender-nav-group {
  display: flex;
  gap: 0.5rem;
}

/* 訂閱文字 */
.calender-subscribe {
  font-size: 0.8rem;
  color: green;
  margin: 0;
}

/* 滑動導航按鈕 */
.calender-nav-btn {
  position: static; /* 改為靜態定位 */
  color: black;
  background: ghostwhite;
  border: none;
  width: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 10;
}

.calender-nav-btn.prev {
  left: auto;
}

.calender-nav-btn.next {
  right: auto;
}

/* 日曆滑動容器 */
.calender-scroll-container {
  display: block; /* 改為block佈局 */
  overflow-x: hidden; /* 隱藏水平滾動 */
  overflow-y: auto; /* 允許垂直滾動 */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* iOS 流暢滾動 */
  scrollbar-width: none; /* Firefox 隱藏滾動條 */
  -ms-overflow-style: none; /* IE/Edge 隱藏滾動條 */
  padding: 16px 0;
  height: 100%; /* 填滿父容器高度 */
  width: 100%;
}

/* 隱藏 Webkit 瀏覽器的滾動條 */
.calender-scroll-container::-webkit-scrollbar {
  display: none;
}

/* 事件時間軸樣式 - 垂直佈局 */
.events-timeline {
  display: flex;
  flex-direction: column; /* 改為垂直排列 */
  gap: 0; /* 移除間距，改用分隔線 */
  padding: 0;
  width: 100%; /* 佔滿寬度 */
}

/* 日曆項目容器 */
.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%; /* 佔滿寬度 */
  max-width: none; /* 移除最大寬度限制 */
  padding: 1.5rem;
  border: none; /* 移除邊框 */
  border-bottom: 1px dashed darkslategrey; /* 只保留底部分隔線 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 0; /* 移除圓角 */
  background: transparent; /* 透明背景 */
}

/* 最後一個項目不需要底部分隔線 */
.timeline-item:last-child {
  border-bottom: none;
}

/* 主要內容區域 - 左圖右標題 */
.event-main-content {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 0.5rem;
}

/* 標題和描述區域 */
.event-title-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 事件標題行 - 舊版保留但不使用 */
.event-header {
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  gap: 1rem;
  order: 1; /* 確保標題行在上面 */
}

/* 底部時間區域 */
.event-footer {
  font-family: "IBM Plex Mono", sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
  gap: 1rem;
}

/* 日期時間組合 */
.event-footer .event-date,
.event-footer .event-time {
  flex-shrink: 0;
}

/* 事件日期 */
.event-date {
  font-size: 0.8rem;
  color: black;
}

/* 事件時間 */
.event-time {
  font-size: 0.8rem;
  color: black;
}

/* 舊版時間樣式 - 保留但不使用 */
.timeline-time {
  writing-mode: sideways-rl;
  font-family: "IBM Plex Sans", sans-serif;
  color: #000;
  font-size: 0.8rem;
  text-align: right;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-main {
  flex: 1;
}

/* 事件標題 */
.event-title {
  font-family: "Inclusive Sans", sans-serif;
  font-size: 1.8rem;
  color: #50006f;
  line-height: 1.3;
  word-wrap: break-word; /* 允許長單詞換行 */
  overflow-wrap: break-word; /* 現代瀏覽器的換行屬性 */
  white-space: normal; /* 允許正常換行 */
  text-align: left; /* 標題靠左對齊 */
  flex: 1; /* 佔據剩餘空間 */
  text-transform: uppercase;
  margin: 0;
  margin-bottom: 0.5rem;
}

/* 描述區塊 */
.event-description-section {
  margin: 0;
}

.event-description {
  font-family: "Inclusive Sans", sans-serif;
  font-size: 1rem;
  color: #686868;
  line-height: 1.6;
  text-align: left;
}

/* 報名按鈕 */
.event-signup-btn {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background-color: darkolivegreen;
  color: ghostwhite;
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.8rem;
  transition: background-color 0.3s ease;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.event-signup-btn:hover {
  background-color: #3a0052;
  color: white;
}

/* 在footer中的報名按鈕 */
.event-footer .event-signup-btn {
  margin: 0;
  align-self: center;
}

.event-meta {
  font-size: 0.9rem;
  color: #000;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.event-location {
  color: #000;
  font-weight: 600;
}

.event-thumb {
  flex-shrink: 0;
  width: 100px; /* 較小的圖片寬度 */
  height: 100px; /* 固定高度 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: firebrick;
  color: firebrick;
}

.event-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .calender-content {
    padding: 0 1rem;
  }

  .calender-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 0;
  }

  .calender-nav-group {
    align-self: center;
  }

  .calender-mode-switch {
    align-self: center;
  }

  .calender-subscribe {
    align-self: flex-end;
  }

  .calender-scroll-container {
    padding: 1rem 0;
  }

  .timeline-item {
    width: 100%;
    padding: 1rem;
  }

  .timeline-time {
    min-width: auto;
    text-align: left;
  }

  .timeline-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .event-thumb {
    width: 100%;
    max-width: 200px;
  }

  .event-thumb img {
    width: 100%;
  }

  .event-title {
    font-size: 1.5rem;
  }

  /* 在小螢幕上隱藏導航按鈕，依賴觸控滑動 */
  .calender-nav-btn {
    display: none;
  }

  /* 時間軸模式響應式調整 */
  .timeline-month {
    min-width: 300px; /* 從 250px 增加到 300px，保持比例 */
  }

  .timeline-month-header {
    font-size: 0.6rem;
  }

  .timeline-days {
    height: 35px;
  }

  .timeline-day {
    height: 16px;
    font-size: 0.5rem;
    min-width: 6px;
  }

  .timeline-events-area {
    min-height: 150px;
  }

  .timeline-event-bar {
    height: 25px;
    min-width: 15px;
    padding: 0 0.3rem;
    transform: translateX(-1.5px); /* 平板端的微調 */
  }

  /* 移除 ::before 偽元素，改用 JavaScript 創建的點 */

  .timeline-event-title {
    font-size: 0.6rem;
  }

  .timeline-event-time {
    font-size: 0.5rem;
    min-width: 70px; /* 平板端的時間寬度 */
  }
}

@media (max-width: 480px) {
  .timeline-item {
    width: 100%;
    padding: 1rem;
  }

  .event-title {
    font-size: 1.2rem;
  }

  .event-meta {
    font-size: 0.8rem;
  }

  /* 更小螢幕的時間軸調整 */
  .timeline-month {
    min-width: 240px; /* 從 200px 增加到 240px，保持比例 */
  }

  .timeline-days {
    height: 30px;
  }

  .timeline-day {
    height: 14px;
    font-size: 0.4rem;
    min-width: 5px;
  }

  .timeline-events-area {
    min-height: 120px;
  }

  .timeline-event-bar {
    height: 20px;
    min-width: 12px;
    padding: 0 0.2rem;
    transform: translateX(-1px); /* 手機端的微調 */
  }

  /* 移除 ::before 偽元素，改用 JavaScript 創建的點 */

  .timeline-event-title {
    font-size: 0.5rem;
  }

  .timeline-event-time {
    font-size: 0.4rem;
    min-width: 60px; /* 手機端的時間寬度 */
  }
}

/* 模式切換按鈕 */
.calender-mode-switch {
  display: flex;
  gap: 0.5rem;
}

.mode-btn {
  padding: 0px 5px;
  border: 1px solid #000;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.mode-btn.active {
  background: #000;
  color: #fff;
}

.mode-btn:hover {
  background: #000;
  color: #fff;
}

/* 模式容器 */
.calender-mode-container {
  width: 100%;
  max-width: 100%; /* 確保不超出父容器 */
  height: 65vh; /* 設定固定高度，確保兩個模式一致 */
  transition: all 0.3s ease;
  overflow: hidden; /* 防止內容溢出 */
}

.calender-mode-container.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.calender-mode-container:not(.hidden) {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* 特定模式樣式 */
.calender-mode-container.card-mode {
  display: block;
}

.calender-mode-container.timeline-mode {
  display: block;
}

.calender-mode-container.card-mode.hidden {
  display: none !important;
}

.calender-mode-container.timeline-mode.hidden {
  display: none !important;
}

/* 時間軸日曆樣式 */
.timeline-scroll-container {
  overflow-x: auto;
  overflow-y: hidden; /* 防止垂直滾動 */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  height: 100%; /* 填滿父容器高度 */
  width: 100%; /* 確保不超出父容器 */
}

.timeline-scroll-container::-webkit-scrollbar {
  display: none;
}

.timeline-calendar {
  display: flex;
  width: max-content; /* 改為 width 而不是 min-width */
  max-width: none; /* 允許內容自然寬度 */
  position: relative;
}

.timeline-month {
  /* 移除固定寬度，改由 JavaScript 動態設定 */
  position: relative;
  border-right: 1px dashed darkgreen;
}

.timeline-month:last-child {
  border-right: none;
}

.timeline-month-header {
  font-size: 0.7rem;
  padding-bottom: 5px;
  margin-bottom: 5px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  border-bottom: 1px solid #000000;
  font-family: "IBM Plex Mono", sans-serif;
  background: radial-gradient(circle, ghostwhite, yellow);
}

.timeline-days {
  position: relative;
  height: 20px;
  display: block; /* 改為 block，因為日期點現在是絕對定位 */
  font-family: "IBM Plex Mono", sans-serif;
  /* 移除固定寬度，改由 JavaScript 動態設定 */
}

.timeline-day {
  font-family: "IBM Plex Mono", sans-serif;
  flex: none; /* 移除 flex: 1，使用固定寬度 */
  height: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 1;
  letter-spacing: -1px;
  width: 1.2rem;
  position: absolute; /* 絕對定位 */
  top: 0; /* 垂直居中 */
}

.timeline-day.today {
  background: #000;
  color: #fff;
  font-weight: bold;
}

/* 活動區域 - 甘特圖樣式 */
.timeline-events-area {
  position: relative;
  min-height: 58vh;
  /* padding-left 改由 JavaScript 動態設定 */
  background: aliceblue;
}

/* 活動長條樣式 - 甘特圖樣式 */
.timeline-event-bar {
  position: absolute;
  left: 0; /* 改為 0，因為活動區域已有 padding */
  height: 30px;
  z-index: 2;
  cursor: pointer;
  min-width: 20px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  box-sizing: border-box;
  /* 微調位置，確保與日期點完美對準 */
  transform: translateX(-2px);
}

/* 跨天數活動的特殊樣式 */
.timeline-event-bar.multi-day {
  background: rgba(0, 0, 0, 0.05); /* 淡灰色背景 */
  border-left: 3px solid #000; /* 左邊黑色邊框 */
}

/* 活動內容 */
.timeline-event-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: visible; /* 改為 visible */
  position: relative;
}

/* 移除 ::before 偽元素，改用 JavaScript 創建的點 */

.timeline-event-title {
  font-size: 0.7rem;
  color: #000; /* 改為黑色 */
  font-weight: 600;
  white-space: nowrap;
  overflow: visible; /* 改為 visible */
  text-overflow: clip; /* 移除省略號 */
  line-height: 1.2;
}

.timeline-event-time {
  font-size: 0.6rem;
  color: #000; /* 改為黑色 */
  white-space: nowrap;
  overflow: visible; /* 改為 visible */
  text-overflow: clip; /* 移除省略號 */
  line-height: 1;
  min-width: 80px; /* 確保有足夠空間顯示時間範圍 */
}
