@charset "UTF-8";

/* ==========================================================
   1. 共用設定 (Banner, Layout, Breadcrumb)
   ========================================================== */
.page-banner {
  width: 100%;
  position: relative;
  margin-top: var(--nav-height-mobile, 45px);
  display: block;
}
@media (min-width: 768px) {
  .page-banner {
    margin-top: var(--nav-height-tablet, 55px);
  }
}
@media (min-width: 1024px) {
  .page-banner {
    margin-top: var(--nav-height-desktop, 79px);
  }
}

.page-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ✅ 核心容器：嚴格遵守 variables.css 定義的寬度 */
.x720-container {
  width: var(--container-fluid-width, 90%); /* 讀取變數 */
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px; /* 安全邊距 */
  padding-right: 15px;
}

.section-activity {
  padding-top: 1rem;
  padding-bottom: 5rem;
}

.line-decor {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background-color: #ccc;
  z-index: 1;
}

.content-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #555;
  margin-top: 10px;
}

/* Breadcrumb */
.x720-breadcrumb {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 8px;
  height: 28px;
  margin-bottom: 2rem;
}
.breadcrumb-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-header, #333);
  font-size: var(--fs-body-base, 1rem);
  font-weight: 400;
  padding-bottom: 1px;
  transition: all 0.3s ease;
}
.breadcrumb-link span {
  border-bottom: 1px solid #666;
}
.breadcrumb-link:hover {
  color: #000;
}
.breadcrumb-link img {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}
.breadcrumb-sep {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.breadcrumb-current {
  color: var(--primary-color, #4fa8d8);
  font-size: var(--fs-body-base, 1rem);
  letter-spacing: 0.5px;
}

/* ==========================================================
   3. 集章卡片樣式 (Activity Card) - 橫向佈局
   ========================================================== */
.activity-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: row; /* 預設橫向 */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  width: 100%;
  margin-bottom: 0;
}

.activity-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 左側圖片區 (修改：改為 50%) */
.activity-img {
  width: 50%;
  position: relative;
  background-color: #f5f5f5;
  overflow: hidden;
  /* min-height: 280px; */
}

.activity-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.activity-card:hover .activity-img img {
  transform: scale(1.05);
}

/* 右側內容區 (修改：改為 50%) */
.activity-body {
  width: 50%;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ✅ 新增：日期條 (藍底白字，位於最上方) */
.activity-date-badge {
  background-color: var(--primary-color);
  color: #fff;
  padding: 8px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

/* Header (僅剩狀態標籤) */
.activity-header {
  /* ✅ 修改：增加 padding，因為 body 的 padding 被移除了 */
  padding: 0.5rem 2rem 0 2rem;
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* 狀態標籤 */
.status-badge {
  padding: 4px 16px;
  border-radius: 50px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.status-active {
  background-color: var(--color-green);
}
.status-ended {
  background-color: #ccc;
}

/* 日期樣式 (圖一：藍色背景，白色文字) */
.activity-date {
  font-size: 0.9rem;
  font-family: monospace;
  color: var(--primary-color, #4fa8d8); /* 依您的要求，背景色或文字色 */
  font-weight: 700;
}

/* 標題 */
.activity-title {
  /* ✅ 修改：增加 padding */
  padding: 0 2rem;
  font-family: var(--font-family-base);
  font-size: var(--fs-h3); /* 1.5rem */
  font-weight: var(--fw-bold);
  color: var(--secondary-color-1);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.activity-desc {
  /* ✅ 修改：增加 padding */
  padding: 0 2rem;
  font-family: var(--font-family-base);
  font-size: var(--fs-body-base); /* 1.5rem */
  font-weight: var(--fw-semilight);
  color: var(--color-black);
  line-height: 1.6;
  /* margin-bottom: 1.5rem; */

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 集章進度區 */
.stamp-section {
  margin-top: auto;
  /* ✅ 修改：增加 padding */
  padding: 1rem 2rem 1.5rem 2rem;
  border-top: 1px solid #f0f0f0;
}

/* ✅ 新增：進度資訊容器 (文字 + 進度條) */
.stamp-status-row {
  display: flex;
  align-items: center;
  gap: 15px; /* 文字與進度條的間距 */
  margin-bottom: 12px;
}

.progress-text {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 700;
  /* 移除 margin-bottom，因為現在是左右排列 */
  margin-bottom: 0;
  white-space: nowrap; /* 確保文字不換行 */
}

/* ✅ 新增：進度條軌道 (灰色底) */
.progress-track {
  flex-grow: 1; /* 填滿剩餘空間 */
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

/* ✅ 新增：進度條填充 (藍色) */
.progress-fill {
  height: 100%;
  background-color: var(--primary-color, #4fa8d8);
  border-radius: 10px;
  transition: width 0.5s ease; /* 增加滑動動畫 */
}

/* 印章圓圈容器 */
.stamp-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.stamp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

/* 印章圓圈 */
.stamp-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;

  /* ✅ 新增：讓父元素建立定位基準 */
  position: relative;
  /* ✅ 新增：設定較低的 z-index，確保它作為背景層 */
  z-index: 1;
}

.stamp-item.collected .stamp-circle {
  background-color: #fff;
  border: 2px solid var(--primary-color, #4fa8d8);
}

.stamp-icon {
  width: 60%;
  height: 60%;
  object-fit: contain;
  opacity: 0.3;
  filter: grayscale(100%);

  /* ✅ 新增：為圖片加上定位，使其能受 z-index 控制 */
  position: relative;
  /* ✅ 新增：設定比父元素 (1) 更高的 z-index，確保圖片浮在白底之上 */
  z-index: 10;
}

.stamp-item.collected .stamp-icon {
  opacity: 1;
  filter: grayscale(0%);
}

.stamp-label {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  line-height: 1.35;
}
.stamp-item.collected .stamp-label {
  color: var(--primary-color, #4fa8d8);
  font-weight: 700;
}

.stamp-distance {
  color: var(--primary-color);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 2px;
}

/* ==========================================================
   RWD Settings
   ========================================================== */
@media (max-width: 1024px) {
  /* 標題 */
  .activity-title {
    font-size: var(--fs-h4); /* 1.5rem */
  }
}

@media (max-width: 992px) {
  .activity-card {
    flex-direction: column;
  }
  .activity-img {
    width: 100%;
    height: 500px;
  }
  .activity-body {
    width: 100%;
    padding: 0; /* 維持 0 */
  }

  /* 手機版 padding 縮小 */
  .activity-header,
  .activity-title,
  .activity-desc,
  .stamp-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .activity-date-badge {
    padding: 8px 1.5rem; /* 手機版日期條 padding */
  }

  .stamp-row {
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 5px;
  }
}

@media (max-width: 767px) {
  .activity-img {
    width: 100%;
    height: 270px;
  }

  .stamp-section {
    padding: 0.9rem 1rem 1.25rem;
  }

  .stamp-status-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .progress-text {
    white-space: normal;
    line-height: 1.45;
  }

  .progress-track {
    width: 100%;
  }

  .stamp-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .stamp-item {
    align-items: center;
    background: #f8f8f3;
    border: 1px solid #ececdf;
    border-radius: 12px;
    min-height: 104px;
    padding: 10px 8px;
  }

  .stamp-circle {
    width: 44px;
    height: 44px;
  }

  .stamp-label {
    color: #777;
    display: -webkit-box;
    font-size: 0.74rem;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
  }

  .stamp-distance {
    color: var(--primary-color);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 2px;
  }
}

/* ... 前面樣式保持不變 ... */

/* 分頁器樣式 (確認與圖三一致) */
.pagination {
  gap: 8px; /* 按鈕間距 */
}

.page-item .page-link {
  border: none;
  color: #666; /* 一般文字顏色 */
  background-color: transparent;
  border-radius: 50%; /* 圓形 */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.page-item .page-link:hover {
  background-color: #f0f0f0;
  color: var(--primary-color, #4fa8d8);
}

/* 激活狀態 (藍底白字) */
.page-item.active .page-link {
  background-color: var(--primary-color, #4fa8d8);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 168, 216, 0.3);
}

.page-item.disabled .page-link {
  background-color: transparent;
  color: #ccc;
  cursor: default;
}

/* 箭頭 Icon 大小 */
.page-link i {
  font-size: 1.2rem;
}

/* ==========================================================
   5. 關卡詳情彈窗 (Checkpoint Modal)
   ========================================================== */

/* 標頭樣式 (藍底) */
.checkpoint-header {
  background-color: #5d99c6; /* 圖中的藍色 */
  border-bottom: none;
  padding: 1rem 1.5rem;
}

.checkpoint-header .modal-title {
  font-size: 1.25rem;
  letter-spacing: 1px;
}

/* 地圖區域 */
.checkpoint-map {
  width: 100%;
  height: 250px; /* 固定高度 */
  background-color: #eee;
}

/* 題目文字 */
.checkpoint-question {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  line-height: 1.5;
  text-align: left;
}

/* START 按鈕 */
.btn-checkpoint-start {
  display: block;
  width: 100%;
  background-color: #5d99c6; /* 與標頭同色 */
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 1px;
  transition: background-color 0.3s;
  box-shadow: 0 4px 6px rgba(93, 153, 198, 0.3);
}

.btn-checkpoint-start:hover {
  background-color: #4a82b0;
  color: #fff;
}

/* 警告文字 */
.checkpoint-warning {
  color: #c24848; /* 紅褐色 */
  font-size: 0.95rem;
  font-weight: 500;
}

.checkpoint-warning i {
  font-size: 1.1rem;
  margin-top: -2px;
}

/* RWD 調整 */
@media (max-width: 576px) {
  .checkpoint-map {
    height: 200px;
  }
  .checkpoint-question {
    font-size: 1.1rem;
  }
}

/* 狀態標籤顏色補充 */
.status-badge.status-pending {
  background-color: #6c757d; /* 黃色或橘色 */
  color: #fff;
}

.status-badge.status-ended {
  background-color: #6c757d; /* 灰色 */
  color: #fff;
}

/* ==========================================================
   6. 完成集章行動按鈕 (Activity Actions - 滿版等分設計)
   ========================================================== */
.activity-actions {
  display: flex;
  /* 移除原本的 justify-content: flex-end; 讓它依照預設排列 */
  gap: 12px;
  /* margin-top: 1rem; */
  padding-top: 1rem;
  border-top: 1px dashed #e0e0e0;
  width: 100%; /* 確保容器佔滿可用寬度 */
}

/* 共用按鈕基礎樣式 */
.btn-action {
  flex: 1; /* ✅ 關鍵魔法：不管有幾個按鈕，都會自動平分並佔滿整個寬度 */
  padding: 12px 0; /* 加大上下高度，讓按鈕變大更好按 */
  border-radius: 8px;
  font-size: 1rem; /* 字體稍微加大 */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 主要按鈕 (實心：兌換、抽獎) */
.btn-primary {
  background-color: var(--primary-color, #4fa8d8);
  color: #fff;
  border: 1px solid var(--primary-color, #4fa8d8);
  box-shadow: 0 2px 6px rgba(79, 168, 216, 0.2);
}

.btn-primary:hover {
  /*   background-color: #3a8bb5;
  border-color: #3a8bb5;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 168, 216, 0.3); */
  background-color: var(--secondary-color-2, #eaf4f8);
  transform: translateY(-1px);
  color: var(--primary-color, #4fa8d8);
}

/* 次要按鈕 (外框：獎狀) */
.btn-outline-primary {
  /*   background-color: transparent;
  color: var(--primary-color, #4fa8d8);
  border: 1px solid var(--primary-color, #4fa8d8); */
  background-color: var(--primary-color, #4fa8d8);
  color: #fff;
  border: 1px solid var(--primary-color, #4fa8d8);
  box-shadow: 0 2px 6px rgba(79, 168, 216, 0.2);
}

.btn-outline-primary:hover {
  background-color: var(--secondary-color-2, #eaf4f8);
  transform: translateY(-1px);
  color: var(--primary-color, #4fa8d8);
}

/* === RWD 手機/平板斷點調整 === */
@media (max-width: 992px) {
  .activity-actions {
    gap: 8px; /* 手機版間距稍微縮小一點 */
    border-top: none;
    padding-top: 0.5rem;
  }

  .btn-action {
    padding: 10px 0;
    font-size: 0.95rem;
  }
}

/* 鎖定狀態 (locked) 樣式 */
.btn-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none; /* 讓滑鼠無法點擊與 hover */
}

/* 如果你想讓鎖定的實心按鈕變成灰色，可以加上這段 */
.btn-primary:disabled {
  background-color: #a0a0a0;
  border-color: #a0a0a0;
  box-shadow: none;
}
.btn-outline-primary:disabled {
  color: #a0a0a0;
  border-color: #a0a0a0;
}

.btn-return-activity {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background-color: var(--secondary-color-1, #93a5ab);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 60px;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-return-activity:hover {
  background-color: var(--primary-color, #7a8b91);
  color: #fff;
  transform: translateY(-2px);
}
