/* =========================================
   Home Page Specific Styles
   ========================================= */

/* ------------------------------------------------
   通用設定
   ------------------------------------------------ */
.section-container {
  padding: 80px 0;
  background-color: transparent;
  background-image: none;
  overflow: hidden;
}

/* 確保區塊無背景 */
.ip-zone,
.news-section,
.store-map-section,
.video-carousel-section {
  background-color: transparent;
  background-image: none;
}

/* ==========================================================
   Home Page Styles
   ========================================================== */

/* ------------------------------------------------
   1. Banner (Carousel) - Navbar 避讓與 RWD 設定
   ------------------------------------------------ */

.home-banner {
  width: 100%;
  position: relative;

  /* ✅ 核心修正：利用 margin-top 避開 Navbar 的高度
     預設為手機版 (Mobile < 768px) 
  */
  margin-top: var(--nav-height-mobile, 45px);
}

/* Tablet (768px ~ 1023px) */
@media (min-width: 768px) {
  .home-banner {
    margin-top: var(--nav-height-tablet, 55px);
  }
}

/* Desktop (≥ 1024px) */
/* @media (min-width: 1024px) {
  .home-banner {
    margin-top: var(--nav-height-desktop, 79px);
  }
} */

/* --- Banner 內部圖片結構 (維持你的自動縮放邏輯) --- */
.home-banner .carousel-item {
  /* ✅ 高度自動，讓圖片撐開容器 */
  height: auto;
  min-height: auto;
  width: 100%;
}

.home-banner .carousel-inner img {
  /* ✅ 寬度 100%，高度自動維持比例 */
  width: 100%;
  height: auto;

  /* 消除圖片下方微小空隙 */
  display: block;
  object-fit: contain;
}

/* --- 指示器 (圓點) --- */
.home-banner .carousel-indicators {
  margin-bottom: -3%; /* 維持你的設定 */
  gap: 10px;
}

.home-banner .carousel-indicators [data-bs-target] {
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary-color, #0d6efd); /* 建議加上 fallback 顏色 */
  background-color: #fff;
  opacity: 1;
  margin: 0;
  transition: all 0.3s ease;
}

.home-banner .carousel-indicators .active {
  background-color: var(--primary-color, #0d6efd);
  transform: scale(1.1);
}

/* --- 左右箭頭 --- */
.home-banner .carousel-control-prev-icon,
.home-banner .carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  /* 這裡保留你的 SVG background-image 設定，在此省略以節省篇幅 */
}

.home-banner .carousel-control-prev:hover,
.home-banner .carousel-control-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
  .ui-carousel-nav {
    bottom: -60px;
  }
}

/* --- RWD 微調 (手機版箭頭縮小) --- */
@media (max-width: 768px) {
  .home-banner .carousel-control-prev-icon,
  .home-banner .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }

  .ui-carousel-nav {
    bottom: -50px;
  }
}

/* ------------------------------------------------
   2. IP Zone (About)
   ------------------------------------------------ */
.ip-zone {
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  width: 100%;
}

.ip-content {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width);
  margin: 0 auto;

  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.ip-text {
  flex: 0 0 45%;
  text-align: left;
}

.ip-text h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: 1.4;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.ip-text p {
  font-size: var(--fs-body-focus);
  font-weight: var(--fw-regular);
  line-height: 1.8;
  color: #555;
  margin-bottom: 2rem;
  text-align: justify;
}

.ip-characters-container {
  flex: 0 0 50%;
  display: flex;
  justify-content: flex-end;
}

.ip-characters-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
}

/* --- RWD: 平板與手機調整 (<= 1024px) --- */
/* 直接寫在這裡，方便管理 */
@media (max-width: 1024px) {
  .ip-content {
    flex-direction: column; /* 改為垂直排列 */
    gap: 2rem;
    align-items: center;
  }

  .ip-text {
    flex: 0 0 100%;
    width: 100%;
    text-align: left !important; /* 強制文字靠左 */
    padding: 0 10px; /* 避免貼邊 */
  }

  .ip-text h2,
  .ip-text p {
    text-align: left !important;
  }

  .ip-characters-container {
    flex: 0 0 100%;
    width: 100%;
    justify-content: center; /* 圖片維持置中 */
  }
}

/* ------------------------------------------------
   3. News Section (活動新訊)
   ------------------------------------------------ */
.news-section {
  padding-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.news-owl-carousel {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width) !important;
  margin: 0 auto !important;

  position: relative;
  z-index: 5;
  overflow: hidden;
  padding: 20px 0;
}

.news-owl-carousel .owl-stage {
  display: flex;
  align-items: center;
}

.news-image {
  display: block;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 15px;
  margin: 0 auto;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-owl-carousel .owl-item .news-image {
  transform: scale(0.8);
  opacity: 0.6;
  filter: grayscale(40%) brightness(0.8);
  box-shadow: none;
}

.news-owl-carousel .owl-item {
  z-index: 1;
  transition: z-index 0.3s;
}

.news-owl-carousel .owl-item.active.center {
  z-index: 20;
}

.news-owl-carousel .owl-item.active.center .news-image {
  transform: scale(1);
  opacity: 1;
  filter: grayscale(0%) brightness(1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 4px solid #fff;
}

.news-owl-carousel .owl-dots {
  margin-top: 20px !important;
  text-align: center;
  position: relative;
  z-index: 30;
}

.news-owl-carousel .owl-dot span {
  width: 12px !important;
  height: 12px !important;
  background: transparent !important;
  border: 2px solid #4fa8d8 !important;
  margin: 5px 6px !important;
  opacity: 0.6;
  transition: all 0.3s;
}

.news-owl-carousel .owl-dot.active span {
  background: #4fa8d8 !important;
  opacity: 1;
  transform: scale(1.2);
}

/* ------------------------------------------------
   3.5 Development Modules: Related Links / Knowledge
   ------------------------------------------------ */
.home-links-section,
.home-knowledge-section {
  width: min(var(--container-fluid-width), calc(100vw - 40px));
  padding-top: 48px;
  padding-bottom: 48px;
}

.home-module-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.home-module-heading--compact {
  margin-bottom: 22px;
}

.home-module-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.home-module-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transform: translateY(2px);
  background-color: var(--color-green);
  -webkit-mask: url("../../img/placeholders/icon/small-title-icon-PC.svg") center / contain no-repeat;
  mask: url("../../img/placeholders/icon/small-title-icon-PC.svg") center / contain no-repeat;
}

.home-module-title-group h2 {
  margin: 0;
  color: var(--color-green);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  white-space: nowrap;
}

.home-module-title-group p {
  margin: 0;
  color: var(--color-light);
  font-size: var(--fs-body-md);
  line-height: 1.6;
}

.home-module-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 18px;
  border: 1px solid rgba(47, 62, 70, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--secondary-color-1);
  text-decoration: none;
  font-size: var(--fs-body-md);
  line-height: 1.4;
  box-shadow: 0 6px 18px rgba(47, 62, 70, 0.08);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.home-module-more:hover {
  color: var(--color-green);
  border-color: rgba(59, 129, 61, 0.35);
  transform: translateY(-2px);
}

.home-module-more .more-text-short {
  display: none;
}

.home-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 128px;
  padding: 18px 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.42)
  );
  color: var(--color-header);
  text-decoration: none;
  text-align: center;
  box-shadow: 0 12px 24px rgba(47, 62, 70, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.home-link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.08)
  );
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
}

.home-link-card:hover {
  color: var(--color-header);
  border-color: var(--primary-color, rgba(255, 255, 255, 0.9));
  box-shadow: 0 18px 36px rgba(47, 62, 70, 0.14);
  transform: translateY(-4px);
}

.home-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(96px, 54%);
  height: 54px;
  flex: 0 0 54px;
  border-radius: 0;
  background: transparent;
  color: var(--color-green);
  font-size: 22px;
  position: relative;
  z-index: 1;
}

.home-link-icon img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: contain;
  display: block;
}

.home-link-card--placeholder {
  justify-content: center;
  text-align: center;
  color: var(--primary-color);
  cursor: default;
}

.home-link-card--placeholder:hover {
  color: var(--primary-color);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 24px rgba(47, 62, 70, 0.08);
  transform: none;
}

.home-link-card--placeholder strong {
  font-size: var(--fs-body-base);
  font-weight: var(--fw-bold);
}

.home-link-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.home-link-body strong,
.home-link-body span,
.home-link-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-link-body strong {
  color: var(--color-header);
  font-size: var(--fs-body-base);
  font-weight: var(--fw-bold);
  max-width: 100%;
}

.home-link-body span {
  color: var(--color-light);
  font-size: var(--fs-body-sm);
  max-width: 100%;
}

.home-link-body small {
  margin-top: 8px;
  color: var(--color-light);
  font-size: var(--fs-body-sm);
}

.home-knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

#knowledge-carousel {
  display: block;
  width: 100%;
}

#knowledge-carousel:not(.owl-loaded) {
  display: grid;
}

#knowledge-carousel .owl-stage {
  display: flex;
}

#knowledge-carousel .owl-item {
  display: flex;
}

#knowledge-carousel .owl-item .item {
  display: flex;
  width: 100%;
}

#knowledge-carousel .owl-dots {
  margin-top: 22px !important;
  text-align: center;
}

#knowledge-carousel .owl-dot span {
  width: 10px;
  height: 10px;
  background: #ccc;
  transition: 0.3s;
}

#knowledge-carousel .owl-dot.active span {
  width: 25px;
  background: #39b3d7;
}

.home-knowledge-card {
  margin: 0;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(47, 62, 70, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(47, 62, 70, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.home-knowledge-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(47, 62, 70, 0.14);
}

.home-knowledge-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.home-knowledge-card img {
  display: block;
  width: 100%;
  /* aspect-ratio: 16 / 7.6; */
  object-fit: cover;
}

.home-knowledge-content {
  padding: 22px 24px 24px;
}

.home-knowledge-content h3 {
  margin: 0 0 10px;
  color: var(--color-header);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: 1.4;
}

.home-knowledge-content p {
  margin: 0 0 18px;
  color: var(--color-light);
  font-size: var(--fs-body-md);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-knowledge-content span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-green);
  font-size: var(--fs-body-md);
  font-weight: var(--fw-bold);
}

.home-knowledge-modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.home-knowledge-modal.is-open {
  display: flex;
  opacity: 1;
}

.home-knowledge-modal .activity-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
}

.home-knowledge-modal .activity-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.home-knowledge-modal.is-open .activity-modal-dialog {
  transform: translateY(0);
}

.home-knowledge-modal .activity-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.home-knowledge-modal .activity-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.home-knowledge-modal .activity-modal-content-wrap {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.home-knowledge-modal .activity-modal-photo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.home-knowledge-modal .activity-modal-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e2e8f0;
  display: block;
}

.home-knowledge-modal .activity-modal-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.home-knowledge-modal .activity-modal-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.home-knowledge-modal .activity-modal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}

.home-knowledge-modal .activity-modal-date {
  font-size: 0.9rem;
  color: #64748b;
  white-space: nowrap;
}

.home-knowledge-modal .activity-modal-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #475569;
}

/* ------------------------------------------------
   4. Map Section
   ------------------------------------------------ */
.store-map-wrapper {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width);
  margin: 0 auto;

  display: flex;
  gap: 20px;
  height: 600px;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.store-map {
  flex: 2;
  border-radius: 12px;
  background-color: #eee;
  overflow: hidden;
}

.store-list-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

.store-list-ul {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  border: 1px solid #eee;
  border-radius: 8px;
}

.store-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-item:hover {
  background-color: #f8f9fa;
}

.store-item .badge {
  background: #333;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ------------------------------------------------
   Bottom & Modal
   ------------------------------------------------ */
.bottom-decoration {
  height: 200px;
  background-position: bottom center;
  background-size: cover;
}

.store-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.store-modal-content {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 650px;
  height: 70vh;
  border-radius: 10px;
  background-color: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.store-modal-top {
  flex: 1;
  background-color: #ccc;
  position: relative;
  overflow: hidden;
}

.store-modal-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-modal-bottom {
  background-color: #fff;
  padding: 1rem 1.5rem;
}

.store-modal-bottom h4 {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.store-modal-bottom p {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.store-modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  z-index: 1;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.store-button-group {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1rem;
}

.store-button-group button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.store-intro-btn,
.store-route-btn {
  background-color: #fff;
  color: #333;
  border: 2px solid #333;
}

.store-intro-btn:hover,
.store-route-btn:hover {
  background-color: #e0e0e0;
}

.store-gps-btn {
  background-color: #333;
  color: white;
  border: none;
}

.store-gps-btn:hover {
  background-color: #000;
}

/* ==================== 影音專區 (Video Section) ==================== */

#video-carousel {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  display: block;
}

/* ==================== 卡片 Flex 排版 ==================== */
.video-card {
  display: flex; /* 關鍵：左右排列 */
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin: 10px;
  min-height: 380px;
}

/* 左側圖片區 (60%) */
.video-card-thumb {
  width: 60%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.video-card-thumb:hover img {
  transform: scale(1.05);
}

/* 播放按鈕 */
.play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(204, 51, 51, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.play-icon-overlay::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 5px;
}

.video-card-thumb:hover .play-icon-overlay {
  transform: scale(1.1);
}

/* 右側文字區 (40%) */
.video-card-content {
  width: 40%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.video-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
}

.video-card-desc {
  font-size: 1rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 2rem;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-date {
  font-size: 0.9rem;
  color: #999;
  text-align: right;
  margin-top: auto;
}

/* ==================== 影片彈窗 (Modal) 樣式 ==================== */

/* 1. 遮罩層 (Overlay) - 全螢幕半透明背景 */
.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75); /* 深色半透明背景 */
  z-index: 9999; /* 確保在最上層 */
  display: flex;
  justify-content: center;
  align-items: center; /* 上下左右置中 */
  padding: 20px; /* 避免手機版邊緣貼死 */
  backdrop-filter: blur(4px); /* 背景模糊效果 (現代瀏覽器支援) */
  /* opacity: 0; */ /* 配合 jQuery fadeIn 的初始狀態 */
  display: none;
}

/* 2. 彈窗本體 (Container) - 白色卡片 */
.video-modal-container {
  background-color: #fff;
  width: 70%; /* 電腦版預設 70% */
  max-width: 1000px; /* 限制最大寬度，避免在超大螢幕太寬 */
  border-radius: 12px; /* 圓角 */
  overflow: hidden; /* 確保內容不超出圓角 */
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.4s ease-out; /* 彈出動畫 */
}

/* 3. 關閉按鈕 (X) */
.video-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: #fff; /* 在影片上方顯示白色 */
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10; /* 確保在影片之上 */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 增加陰影確保在淺色影片背景也能看見 */
  transition: transform 0.2s;
}

.video-modal-close:hover {
  transform: scale(1.1); /* Hover 放大效果 */
}

/* 4. 影片容器 (Video Wrapper) - 保持 16:9 比例 */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background-color: #000;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 5. 資訊文字區 (Info) */
.video-modal-info {
  padding: 25px 30px;
  text-align: left;
}

/* 標題樣式 */
.video-modal-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee; /* 標題下方的分隔線 */
}

/* 日期樣式 (對應 Figma 右下角顯示) */
.video-modal-info p#modal-video-date {
  font-size: 0.9rem;
  color: #999;
  text-align: right; /* 靠右對齊 */
  margin-top: 15px;
  margin-bottom: 0;
}

/* 如果未來有描述文字 (Description) 的樣式預留 */
/* 修改前 (或新增) */
.video-modal-info .modal-desc {
  font-size: var(--fs-body-base);
  color: var(--color-header);
  line-height: 1.6;
  text-align: justify;

  /* 🔥 新增以下 4 行來達成「最多顯示 3 行」的效果 */
  display: -webkit-box; /* 必須設定為 box 才能使用 line-clamp */
  -webkit-line-clamp: 3; /* 限制顯示 3 行 */
  -webkit-box-orient: vertical; /* 設定排列方向為垂直 */
  overflow: hidden; /* 隱藏超出範圍的文字 */
  text-overflow: ellipsis; /* (選填) 標準屬性，輔助截斷效果 */
}

/* ==================== RWD 響應式設定 ==================== */

/* 平板 (Tablet): 寬度 80% */
@media (max-width: 1024px) {
  .video-modal-container {
    width: 80%;
  }
}

/* 手機 (Mobile): 寬度 90% ~ 95% */
@media (max-width: 768px) {
  .video-modal-container {
    width: 95%; /* 手機版讓它寬一點，視覺比較舒適 */
  }

  .video-modal-info {
    padding: 20px;
  }

  .video-modal-info h3 {
    font-size: 1.25rem;
  }
}

/* ==================== 動畫效果 ==================== */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 導航樣式 (箭頭與圓點) ==================== */
#video-carousel .owl-dots {
  margin-top: 25px !important;
  text-align: center;
}

#video-carousel .owl-dot span {
  width: 10px;
  height: 10px;
  background: #ccc;
  transition: 0.3s;
}
#video-carousel .owl-dot.active span {
  background: #39b3d7;
  width: 25px;
}

/* 箭頭位置設定 */
#video-carousel .owl-nav {
  position: absolute;
  bottom: -8px;
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  gap: 100px; /* 箭頭之間的距離 */
}

#video-carousel .owl-nav button.owl-prev,
#video-carousel .owl-nav button.owl-next {
  pointer-events: auto;
  background: none !important;
  color: #39b3d7 !important;
  font-size: 30px !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== RWD 手機版 ==================== */
@media (max-width: 767px) {
  .video-card {
    flex-direction: column; /* 垂直排列 */
    min-height: auto;
  }
  .video-card-thumb {
    width: 100%;
    height: 220px;
  }
  .video-card-content {
    width: 100%;
    padding: 25px;
  }
  #video-carousel .owl-nav {
    display: none; /* 手機版隱藏箭頭 */
  }
}

@media (max-width: 1024px) {
  .home-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-knowledge-grid {
    gap: 18px;
  }
}

@media (max-width: 767px) {
  .home-links-section,
  .home-knowledge-section {
    width: min(var(--container-fluid-width), calc(100vw - 40px));
    padding-top: 36px;
    padding-bottom: 36px;
  }

  .home-module-heading {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
  }

  .home-module-title-group {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 2px;
  }

  .home-module-mark {
    width: 17px;
    height: 17px;
    transform: translateY(3px);
    -webkit-mask-image: url("../../img/placeholders/icon/small-title-icon-Phone.svg");
    mask-image: url("../../img/placeholders/icon/small-title-icon-Phone.svg");
  }

  .home-module-title-group h2 {
    font-size: var(--fs-h3);
  }

  .home-module-title-group p {
    grid-column: 2;
    font-size: var(--fs-body-sm);
  }

  .home-module-more {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--color-green);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-bold);
    transform: none;
  }

  .home-module-more .more-text-full {
    display: none;
  }

  .home-module-more .more-text-short {
    display: inline;
  }

  .home-link-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, calc((100% - 12px) / 2));
    gap: 12px;
    overflow: hidden;
  }

  .home-link-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 132px;
    padding: 18px 10px;
    text-align: center;
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 22px rgba(47, 62, 70, 0.08);
  }

  .home-link-icon {
    width: min(86px, 62%);
    height: 50px;
    flex-basis: 50px;
    font-size: 20px;
  }

  .home-link-body {
    align-items: center;
    width: 100%;
  }

  .home-link-body strong {
    font-size: var(--fs-body-md);
  }

  .home-link-body span {
    max-width: 100%;
    font-size: var(--fs-body-xs);
  }

  .home-link-body small {
    display: none;
  }

  .home-knowledge-grid {
    grid-template-columns: 1fr;
  }

  #knowledge-carousel .home-knowledge-card:nth-child(n + 2) {
    display: block;
  }

  .home-knowledge-card img {
    aspect-ratio: 16 / 7.4;
  }

  .home-knowledge-content {
    padding: 16px 16px 18px;
  }

  .home-knowledge-content h3 {
    font-size: var(--fs-body-base);
    margin-bottom: 8px;
  }

  .home-knowledge-content p {
    margin-bottom: 12px;
    font-size: var(--fs-body-sm);
  }

  .home-knowledge-content span {
    font-size: var(--fs-body-sm);
  }

  .home-knowledge-modal .activity-modal-dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .home-knowledge-modal .activity-modal-content-wrap {
    padding: 15px;
  }

  .home-knowledge-modal .activity-modal-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/*--------------------------------------*/
.module-hidden {
    display: none !important;
}
