@charset "UTF-8";
/*
 * 主題專區 (Theme Zone) 區塊樣式
 *
 * 依規格：h2pes-網站改版/主題專區 Design Specification.md
 *   - section 上下 padding 50px
 *   - section 標題 30px / 600 / letter-spacing 2px
 *   - 海報 200×300 (2:3)，行動裝置縮至 150px
 *   - tab idle/hover/active 三態 + active 底部 2px gold underline
 *   - 切換動效 150ms ease
 *   - 海報 hover：1px gold outline inset (無位移、無投影、無縮放)
 */
.topic-zone {
  padding: var(--tz-section-pad) 0;
  color: var(--tz-fg1);
}

.topic-zone__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.topic-zone__title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
  color: var(--tz-fg1);
}

.topic-zone__subtitle {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--tz-fg3);
}

/* ---- Tabs ---- */
.topic-zone__tabs-wrapper {
  position: relative;
  margin-bottom: 24px;
  /* prev/next 漸層按鈕（carousel mode 才會 .show）— mirror .topic-zone__panel pattern */
}
.topic-zone__tabs-wrapper .prev-btn,
.topic-zone__tabs-wrapper .next-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 28px;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  cursor: pointer;
  transition: opacity 200ms ease-out, background 200ms ease-out;
}
.topic-zone__tabs-wrapper .prev-btn.show,
.topic-zone__tabs-wrapper .next-btn.show {
  pointer-events: visible;
  opacity: 1;
}
.topic-zone__tabs-wrapper .prev-btn .van-icon,
.topic-zone__tabs-wrapper .next-btn .van-icon {
  display: inline-block;
  transition: transform 200ms ease-out;
}
.topic-zone__tabs-wrapper .prev-btn:hover .van-icon,
.topic-zone__tabs-wrapper .next-btn:hover .van-icon {
  transform: scale(1.4);
}
.topic-zone__tabs-wrapper .prev-btn {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}
.topic-zone__tabs-wrapper .prev-btn:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}
.topic-zone__tabs-wrapper .next-btn {
  right: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
}
.topic-zone__tabs-wrapper .next-btn:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 100%);
}

.topic-zone__tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
}

/* carousel fallback：tabs 自然寬度排列、可水平捲動（隱藏 scrollbar）*/
.topic-zone__tabs.is-carousel {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.topic-zone__tabs.is-carousel::-webkit-scrollbar {
  display: none;
}
.topic-zone__tabs.is-carousel .topic-zone__tab {
  flex: 0 0 auto; /* 覆寫 flex: 1 1 0，恢復自然寬度 */
}

.topic-zone__tab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* overlap parent border */
  color: var(--tz-fg2);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  transition: color var(--tz-dur-fast) var(--tz-ease-out), border-color var(--tz-dur-fast) var(--tz-ease-out);
}

.topic-zone__tab:hover {
  color: var(--tz-gold);
}

.topic-zone__tab:focus-visible {
  outline: 2px solid var(--tz-gold);
  outline-offset: 4px;
}

.topic-zone__tab.active {
  color: var(--tz-gold);
  font-weight: 600;
  border-bottom-color: var(--tz-gold);
}

.topic-zone__tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--tz-fg2);
  transition: color var(--tz-dur-fast) var(--tz-ease-out);
}
.topic-zone__tab-icon .van-icon {
  color: inherit;
}

.topic-zone__tab:hover .topic-zone__tab-icon,
.topic-zone__tab.active .topic-zone__tab-icon {
  color: var(--tz-gold);
}

.topic-zone__tab-body {
  display: inline-flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topic-zone__tab-name {
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.topic-zone__tab-badge {
  display: inline-block;
  min-width: 22px;
  height: 20px;
  padding: 0 8px;
  border-radius: 16px;
  background: var(--tz-bg-chip);
  color: var(--tz-fg2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 20px;
  text-align: center;
}

.topic-zone__tab:hover .topic-zone__tab-badge,
.topic-zone__tab.active .topic-zone__tab-badge {
  background: var(--tz-gold-translucent);
  color: var(--tz-gold);
}

.topic-zone__tab-subtitle {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: var(--tz-fg3);
  white-space: nowrap;
  transition: color var(--tz-dur-fast) var(--tz-ease-out);
}

.topic-zone__tab:hover .topic-zone__tab-subtitle,
.topic-zone__tab.active .topic-zone__tab-subtitle {
  color: var(--tz-gold);
}

/* ---- Panel + Carousel ---- */
.topic-zone__panel {
  position: relative; /* anchor for .prev-btn / .next-btn 絕對定位 */
  min-height: 320px;
}

.topic-zone__loading,
.topic-zone__error,
.topic-zone__empty {
  padding: 60px 0;
  text-align: center;
  color: var(--tz-fg3);
  font-size: 14px;
}

.topic-zone__error {
  color: #EB5757;
}

/* prev / next 漸層蒙版按鈕 — mirror index.scss .category-videos-container .prev-btn / .next-btn */
.topic-zone__panel .prev-btn,
.topic-zone__panel .next-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 28px;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  cursor: pointer;
  transition: opacity 200ms ease-out, background 200ms ease-out;
}
.topic-zone__panel .prev-btn.show,
.topic-zone__panel .next-btn.show {
  pointer-events: visible;
  opacity: 1;
}
.topic-zone__panel .prev-btn .van-icon,
.topic-zone__panel .next-btn .van-icon {
  display: inline-block;
  transition: transform 200ms ease-out;
}
.topic-zone__panel .prev-btn:hover .van-icon,
.topic-zone__panel .next-btn:hover .van-icon {
  transform: scale(1.4);
}
.topic-zone__panel .prev-btn {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
}
.topic-zone__panel .prev-btn:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}
.topic-zone__panel .next-btn {
  right: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.65) 100%);
}
.topic-zone__panel .next-btn:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 100%);
}

/* carousel 容器：絕對定位 2×N 卡片 */
.topic-zone__list {
  position: relative;
  height: 620px;
  overflow: hidden;
}

/* mobile infinite-scroll loading indicator（desktop 隱藏；mobile 段下方覆寫顯示）*/
.topic-zone__list-loading {
  display: none;
}

/* ---- Poster 卡片（200×300 絕對定位） ---- */
.topic-zone__poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 300px;
  display: block;
  text-decoration: none;
  color: var(--tz-fg1);
  background-color: #000;
  border-radius: 10px;
  /* 不可加 overflow:hidden — :before 邊框畫在 -1px 外緣會被剪掉 */
}

/* nth-child 迴圈：每 2 個一直欄、向右堆疊（支援 30 卡 = 15 欄 × 2 列） */
.topic-zone__list .topic-zone__poster:nth-child(1) {
  top: 1px;
  left: 1px;
}
.topic-zone__list .topic-zone__poster:nth-child(2) {
  top: 311px;
  left: 1px;
}
.topic-zone__list .topic-zone__poster:nth-child(3) {
  top: 1px;
  left: 211px;
}
.topic-zone__list .topic-zone__poster:nth-child(4) {
  top: 311px;
  left: 211px;
}
.topic-zone__list .topic-zone__poster:nth-child(5) {
  top: 1px;
  left: 421px;
}
.topic-zone__list .topic-zone__poster:nth-child(6) {
  top: 311px;
  left: 421px;
}
.topic-zone__list .topic-zone__poster:nth-child(7) {
  top: 1px;
  left: 631px;
}
.topic-zone__list .topic-zone__poster:nth-child(8) {
  top: 311px;
  left: 631px;
}
.topic-zone__list .topic-zone__poster:nth-child(9) {
  top: 1px;
  left: 841px;
}
.topic-zone__list .topic-zone__poster:nth-child(10) {
  top: 311px;
  left: 841px;
}
.topic-zone__list .topic-zone__poster:nth-child(11) {
  top: 1px;
  left: 1051px;
}
.topic-zone__list .topic-zone__poster:nth-child(12) {
  top: 311px;
  left: 1051px;
}
.topic-zone__list .topic-zone__poster:nth-child(13) {
  top: 1px;
  left: 1261px;
}
.topic-zone__list .topic-zone__poster:nth-child(14) {
  top: 311px;
  left: 1261px;
}
.topic-zone__list .topic-zone__poster:nth-child(15) {
  top: 1px;
  left: 1471px;
}
.topic-zone__list .topic-zone__poster:nth-child(16) {
  top: 311px;
  left: 1471px;
}
.topic-zone__list .topic-zone__poster:nth-child(17) {
  top: 1px;
  left: 1681px;
}
.topic-zone__list .topic-zone__poster:nth-child(18) {
  top: 311px;
  left: 1681px;
}
.topic-zone__list .topic-zone__poster:nth-child(19) {
  top: 1px;
  left: 1891px;
}
.topic-zone__list .topic-zone__poster:nth-child(20) {
  top: 311px;
  left: 1891px;
}
.topic-zone__list .topic-zone__poster:nth-child(21) {
  top: 1px;
  left: 2101px;
}
.topic-zone__list .topic-zone__poster:nth-child(22) {
  top: 311px;
  left: 2101px;
}
.topic-zone__list .topic-zone__poster:nth-child(23) {
  top: 1px;
  left: 2311px;
}
.topic-zone__list .topic-zone__poster:nth-child(24) {
  top: 311px;
  left: 2311px;
}
.topic-zone__list .topic-zone__poster:nth-child(25) {
  top: 1px;
  left: 2521px;
}
.topic-zone__list .topic-zone__poster:nth-child(26) {
  top: 311px;
  left: 2521px;
}
.topic-zone__list .topic-zone__poster:nth-child(27) {
  top: 1px;
  left: 2731px;
}
.topic-zone__list .topic-zone__poster:nth-child(28) {
  top: 311px;
  left: 2731px;
}
.topic-zone__list .topic-zone__poster:nth-child(29) {
  top: 1px;
  left: 2941px;
}
.topic-zone__list .topic-zone__poster:nth-child(30) {
  top: 311px;
  left: 2941px;
}

.topic-zone__poster:before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: -1px;
  left: -1px;
  border: 1px solid #FFF;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0, 0, 0.58, 1);
  z-index: 5;
}

.topic-zone__poster:hover:before {
  opacity: 1;
}

.topic-zone__poster:focus-visible {
  outline: 2px solid var(--tz-gold);
  outline-offset: 2px;
}

.topic-zone__poster-img {
  position: absolute;
  inset: 0;
  background-color: var(--tz-bg-card-hover);
  border-radius: 10px;
  overflow: hidden;
  z-index: 1;
}
.topic-zone__poster-img .van-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 10px;
  overflow: hidden;
}

.topic-zone__poster-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  background: var(--tz-gold-translucent);
  color: var(--tz-gold);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 4;
}

.topic-zone__poster-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0 0 10px 10px;
  padding: 0 0 10px;
  opacity: 0;
  z-index: 10;
  transition: opacity 300ms cubic-bezier(0, 0, 0.58, 1);
}

.topic-zone__poster:hover .topic-zone__poster-info {
  opacity: 1;
}

.topic-zone__poster-title {
  color: #FFF;
  font-size: 16px;
  height: 60px;
  line-height: 1.4em;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  text-align: center;
}

.topic-zone__poster-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 10px;
}
.topic-zone__poster-meta .meta-item {
  color: #FFF;
  font-size: 12px;
  margin: 0 5px;
}
.topic-zone__poster-meta .meta-item:last-of-type {
  margin: 0;
}

.topic-zone__poster-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  overflow: hidden;
  margin: 10px 0 0;
  padding: 0 10px;
  height: 22px;
}
.topic-zone__poster-tags .tag-item {
  color: #FFF;
  font-size: 12px;
  margin: 0 5px;
  border: 1px solid #FFF;
  border-radius: 3px;
  padding: 0 10px;
  height: 20px;
  white-space: nowrap;
  line-height: 20px;
}

.topic-zone__poster-action {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0 0;
  padding: 0 10px;
}
.topic-zone__poster-action .van-button {
  height: 30px;
  margin: 10px 0 0;
}
.topic-zone__poster-action .van-button .van-button__content {
  color: #333;
}
.topic-zone__poster-action .van-button.van-button--plain {
  border: 1px solid #fdbf46;
  background-color: transparent;
}
.topic-zone__poster-action .van-button.van-button--plain .van-button__content {
  color: #fdbf46;
}
.topic-zone__poster-action .van-button.van-button--plain.active {
  background-color: #fdbf46;
}
.topic-zone__poster-action .van-button.van-button--plain.active .van-button__content {
  color: #333;
}
.topic-zone__poster-action .van-button.play-btn {
  width: 100%;
  margin: 0;
}
.topic-zone__poster-action .van-button.favorite-btn, .topic-zone__poster-action .van-button.info-btn {
  width: 30px;
  margin: 10px 0 0 10px;
}

/* ---- 「查看更多」卡 — mirror .category-videos-item.more ---- */
/* 卡片本身沿用 .topic-zone__poster 的 #000 bg，不另外設背景 */
.topic-zone__poster-more {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #000;
  border-radius: 10px;
  opacity: 0.7;
  transition: opacity 300ms cubic-bezier(0, 0, 0.58, 1);
  z-index: 1;
}

.topic-zone__poster.more:hover .topic-zone__poster-more {
  opacity: 1;
}

.topic-zone__poster.more:hover:before {
  opacity: 0;
}

.topic-zone__poster-more-icon {
  width: 40px;
  height: 40px;
  border: 2px solid #FFF;
  border-radius: 50%;
  color: #FFF;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topic-zone__poster-more-text {
  color: #FFF;
  font-size: 14px;
  margin: 10px 0;
}

/* ===========================================================
   行動模式 — 對齊首頁「熱門選擇 / 電影」區塊的 layout：
   section padding 40px、header / tabs / list 左右 20px 縮排、
   list 改為單行橫向 scroll、卡片 150×225 固定、隱藏 hover overlay。

   觸發開關：#container.mobile class。
   class 來源：H2pesHomeCtrler.checkUserIsMobile() SSR 或 navbar.js IIFE
   依 matchMedia('(max-width: 767px)') change 事件動態 toggle。
   採用 .mobile class 而非純 @media 是為了與專案其他模組
   (.content / .category-videos-container) 統一 convention，
   避免 DevTools 切換 viewport 時 @media 與 class toggle 並存 race。
   =========================================================== */
#container.mobile .topic-zone {
  padding: 40px 0;
}
#container.mobile .topic-zone__header {
  padding: 0 20px;
  margin-bottom: 16px;
  gap: 8px;
}
#container.mobile .topic-zone__title {
  font-size: 18px;
  letter-spacing: 1px;
}
#container.mobile .topic-zone__subtitle {
  font-size: 12px;
}
#container.mobile .topic-zone__tabs-wrapper {
  margin-bottom: 16px;
}
#container.mobile .topic-zone__tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 20px 8px; /* 底 8px：chip 與 scrollbar 之間留間距 */
}
#container.mobile .topic-zone__tab {
  flex: 0 0 auto;
  padding: 10px 12px;
}
#container.mobile .topic-zone__panel {
  min-height: 0;
}
#container.mobile .topic-zone__loading,
#container.mobile .topic-zone__error,
#container.mobile .topic-zone__empty {
  padding: 40px 20px;
}
#container.mobile {
  /* prev/next 在行動模式隱藏，依賴 native flex scroll */
}
#container.mobile .topic-zone__panel .prev-btn,
#container.mobile .topic-zone__panel .next-btn {
  display: none;
}
#container.mobile {
  /* List 改為單行 scroll，覆寫 absolute layout；
     高度 240px 與「熱門選擇」一致（item 225 + 底 15px scrollbar 間距）。 */
}
#container.mobile .topic-zone__list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  height: 240px;
  padding: 0 20px;
}
#container.mobile {
  /* mobile infinite-scroll loading indicator 顯示為水平列尾 spinner */
}
#container.mobile .topic-zone__list-loading {
  flex: 0 0 auto;
  width: 80px;
  height: 225px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
}
#container.mobile .topic-zone__list .topic-zone__poster {
  position: relative;
  top: auto !important;
  left: auto !important;
  flex: 0 0 auto;
  width: 150px;
  min-width: 150px;
  height: 225px;
  margin: 0 10px 0 0;
}
#container.mobile {
  /* 觸控裝置無 hover，overlay 與外緣白邊一律隱藏（與熱門選擇行動版一致） */
}
#container.mobile .topic-zone__poster:before {
  display: none;
}
#container.mobile .topic-zone__poster-info {
  display: none;
}
