﻿/* ============================================================
   曬馬路直播首頁 — 樣式全數包在 .vl26-page 容器與 CSS 變數內，
   避免影響嵌入母網站既有樣式。命名空間統一使用 vl26- / vl26_ 前綴。
   （原本要求的「26vl_」因不符合 CSS/JS 命名語法規則，改為 vl26_）

   版面概念：電視台節目表（TV Guide）。上方是「星期 Tab」，切到哪一天，
   下方就顯示那一天的完整播出清單，由上到下按時間排序；每部影集一張
   小縮圖、片名、分級、簡介，正在播出的那一部會有紅點閃爍標示。
   全站只有一個「進入直播間」按鈕，貼在節目表最下方。
   ============================================================ */
.vl26-page {
  --vl26-bg: #ffffff;
  --vl26-bg-2: #ede1c5; /* 暖卡其米色，呼應官網「最新推薦」等區塊底色 */
  --vl26-panel: #f7f2e6; /* 暖白卡片底，取代原本偏冷的灰 */
  --vl26-panel1: #faf9f7; /* 暖白卡片底，取代原本偏冷的灰 */
  --vl26-ink: #241a16; /* 暖黑，取代偏冷調的黑 */
  --vl26-ink-dim: rgba(36, 26, 22, 0.62);
  --vl26-line: rgba(36, 26, 22, 0.12);
  --vl26-line-strong: rgba(36, 26, 22, 0.24);
  --vl26-line-soft: rgba(36, 26, 22, 0.07);

  --vl26-brand: #ff5831; /* 緯來品牌橙紅色，呼應官網分類導覽列底色 */
  --vl26-brand-dim: rgba(127, 29, 44, 0.12);

  --vl26-a: #9c2a3a; /* 平日夜場：偏向品牌酒紅的深紅 */
  --vl26-a-dim: rgba(156, 42, 58, 0.16);
  --vl26-b: #b8860a; /* 搶先場：深金黃，呼應官網頁尾的黃色 */
  --vl26-b-dim: rgba(184, 134, 10, 0.16);
  --vl26-c: #6b5642; /* 假日場：深褐，呼應暖卡其色系 */
  --vl26-c-dim: rgba(107, 86, 66, 0.16);

  --vl26-rating-g: #2f8132; /* 普遍級：飽和綠 */
  --vl26-rating-p: #1863b8; /* 保護級：飽和藍 */
  --vl26-rating-x: #c9820a; /* 輔導級：飽和琥珀，跟搶先場的深金黃區隔開 */
  --vl26-rating-r: #c62f2a; /* 限制級：飽和紅，跟平日夜場的深紅區隔開 */

  --vl26-live: #c62f2a; /* 直播中紅點，呼應官網「直播中」標籤顏色 */
  --vl26-radius: 16px;
  --vl26-container: 1280px;

  background: var(--vl26-panel1);
  color: var(--vl26-ink);
  position: relative;
  /*background-image: url("/images/tvschedule/onlineshow.jpg");*/
  /*background-repeat: no-repeat;*/
  /*background-position: center top;*/
  /*background-size: contain;*/
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC",
    "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  isolation: isolate;
  /*border: 3px solid var(--vl26-panel);*/
  margin-bottom: 20px;
  border-radius: 18px;
}
.vl26-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1600 / 600;
  background-image: url("https://japan.videoland.com.tw/images/tvschedule/onlineshow.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: contain;
  border-radius: 18px 18px 0 0;
  z-index: 0; /* 從 -1 改成 0 */
  pointer-events: none;
  aspect-ratio: auto;
  min-height: 420px;
  background-size: cover;
}
.vl26-page * {
  box-sizing: border-box;
}
.vl26-page a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.vl26-page button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.vl26-page img {
  max-width: 100%;
  display: block;
}
.vl26-page .vl26-container {
  position: relative;
  z-index: 1;
  max-width: var(--vl26-container);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  background: url("/images/tvschedule/horce01.png") right top no-repeat;
  background-size: 200px 200px;
}

@keyframes vl26-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes vl26-pulse-ring {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vl26-page * {
    animation: none !important;
    transition: none !important;
  }
}

/* -------------------- 節目表區塊 -------------------- */
.vl26-guide-section {
  padding: 44px 0 66px;
}
.vl26-guide-head {
  text-align: center;
  margin-bottom: 20px;
}
.vl26-guide-head h2 {
  font-size: clamp(1.36rem, 4.4vw, 1.7rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}
.vl26-guide-head p {
  color: var(--vl26-ink-dim);
  font-size: 1.02rem;
  margin: 0;
  text-wrap: pretty;
}

/* -- 本週／下週 切換按鈕 -- */
.vl26-week-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.vl26-week-switch-btn {
  border: 1px solid var(--vl26-line);
  border-radius: 999px;
  background: var(--vl26-panel);
  padding: 7px 20px;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--vl26-ink-dim);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}
.vl26-week-switch-btn:active {
  transform: scale(0.97);
}
@media (hover: hover) {
  .vl26-week-switch-btn:hover {
    border-color: var(--vl26-line-strong);
  }
}
.vl26-week-switch-btn.-active {
  background: var(--vl26-brand);
  border-color: var(--vl26-brand);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(127, 29, 44, 0.28);
}

/* -- 星期 Tab（含日期） -- */
.vl26-day-tabs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.vl26-day-tab {
  position: relative;
  border: 1px solid var(--vl26-line);
  border-radius: 11px;
  background: var(--vl26-panel);
  padding: 8px 2px 7px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--vl26-ink-dim);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}
.vl26-day-tab:active {
  transform: scale(0.96);
}
@media (hover: hover) {
  .vl26-day-tab:hover {
    border-color: var(--vl26-line-strong);
  }
}
.vl26-day-tab-date {
  display: block;
  font-size: 0.72rem;
  margin-top: 2px;
  opacity: 0.7;
  font-weight: 400;
}
.vl26-day-tab.-today {
  color: var(--vl26-a);
}
.vl26-day-tab.-active {
  background: var(--vl26-brand);
  border-color: var(--vl26-brand);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(127, 29, 44, 0.28);
}
.vl26-day-tab.-active .vl26-day-tab-date {
  opacity: 0.85;
}

/* 小螢幕：改成一次顯示 5 個、可左右滑動，今天／選中那天會置中對齊，
     用 scroll-snap 讓手指滑開後自動吸附到整格，不會停在半格中間 */
@media (max-width: 640px) {
  .vl26-day-tabs {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 2px;
  }
  .vl26-day-tabs::-webkit-scrollbar {
    display: none;
  }
  .vl26-day-tab {
    flex: 0 0 calc((100% - 4 * 6px) / 5);
    scroll-snap-align: center;
  }
  .vl26-page .vl26-container {
    padding-top: 70px;
    background: url("/images/tvschedule/horce01.png") right top no-repeat;
    background-size: 100px 100px;
  }
  a.vl26-guide-cta {
    margin: 1% auto 0px auto;
  }
}

@media (max-width: 359px) {
  .vl26-day-tabs {
    gap: 4px;
  }
  .vl26-day-tab {
    flex-basis: calc((100% - 4 * 4px) / 5);
    padding: 7px 1px 6px;
    font-size: 0.8rem;
    border-radius: 9px;
  }
}

/* -- 節目表卡片 -- */
/* 卡片用淡灰色實色底，跟純白頁面背景拉出一層淺淺的層次，
     呼應 Google Store 那種「白底＋淡灰卡片」的乾淨質感 */
.vl26-guide-card {
  border: 1px solid var(--vl26-line);
  border-radius: var(--vl26-radius);
  background: var(--vl26-panel);
  box-shadow:
    0 1px 2px rgba(29, 29, 31, 0.04),
    0 6px 16px rgba(29, 29, 31, 0.05);
  overflow: hidden;
  container-type: inline-size;
  container-name: vl26-card;
}
.vl26-guide-list {
  display: flex;
  flex-direction: column;
}
.vl26-guide-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--vl26-ink-dim);
  font-size: 1.02rem;
}

.vl26-guide-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--vl26-line-soft);
  transition: background 0.3s ease;
}
.vl26-guide-row:last-child {
  border-bottom: none;
}
.vl26-guide-row.-live {
  background: var(--vl26-row-tone-dim, var(--vl26-a-dim));
}
.vl26-guide-row[data-tone="a"] {
  --vl26-row-tone-dim: var(--vl26-a-dim);
  --vl26-row-tone: var(--vl26-a);
}
.vl26-guide-row[data-tone="b"] {
  --vl26-row-tone-dim: var(--vl26-b-dim);
  --vl26-row-tone: var(--vl26-b);
}
.vl26-guide-row[data-tone="c"] {
  --vl26-row-tone-dim: var(--vl26-c-dim);
  --vl26-row-tone: var(--vl26-c);
}

.vl26-guide-time {
  flex: 0 0 auto;
  padding-top: 2px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--vl26-row-tone, var(--vl26-ink));
}

.vl26-guide-thumb {
  position: relative;
  flex: 0 0 140px;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--vl26-row-tone-dim, var(--vl26-bg-2));
}
.vl26-guide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vl26-guide-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--vl26-ink-dim);
  text-align: center;
  line-height: 1.3;
  padding: 3px;
}

.vl26-guide-info {
  flex: 1;
  min-width: 0;
}
.vl26-guide-info-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.vl26-live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
}
.vl26-live-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--vl26-live);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  animation: vl26-blink 1.4s ease-in-out infinite;
}
.vl26-live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.2px solid var(--vl26-live);
  animation: vl26-pulse-ring 1.4s ease-out infinite;
}
.vl26-guide-title {
  font-size: clamp(1rem, 3.1vw, 1.1rem);
  font-weight: 700;
  margin: 0;
}
.vl26-airtype-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.vl26-airtype-chip[data-type="premiere"] {
  background: var(--vl26-row-tone-dim, var(--vl26-a-dim));
  color: var(--vl26-row-tone, var(--vl26-a));
}
.vl26-airtype-chip[data-type="rerun"] {
  background: var(--vl26-bg-2);
  color: var(--vl26-ink-dim);
}
.vl26-episode-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: transparent;
  color: var(--vl26-row-tone, var(--vl26-ink));
  border: 1px solid var(--vl26-row-tone, var(--vl26-line-strong));
}
.vl26-rating-chip {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--vl26-bg-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.vl26-guide-desc {
  font-size: clamp(0.92rem, 2.9vw, 0.96rem);
  color: var(--vl26-ink-dim);
  line-height: 1.6;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

@container vl26-card (max-width: 340px) {
  .vl26-guide-row {
    flex-wrap: wrap;
    padding: 12px 12px;
  }
  .vl26-guide-time {
    flex: 0 0 100%;
    padding-top: 0;
    margin-bottom: 8px;
    font-size: 0.84rem;
  }
  .vl26-guide-thumb {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }
}

/* -- 進入直播間按鈕：全站只有這一個 -- */
/* 選擇器改成 a.vl26-guide-cta（加上元素名稱），優先權才會高過最上面
     .vl26-page a { color: inherit } 那條全站規則，文字顏色才不會被蓋掉 */
a.vl26-guide-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20% auto 0px auto;
  padding: 13px 30px;
  max-width: 320px;
  border-radius: 999px;
  border: 1px solid var(--vl26-brand);
  background: var(--vl26-brand);
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(127, 29, 44, 0.3);
  transition:
    opacity 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.bounce-text {
  /* 動畫時間 0.8s，使用 cubic-bezier 讓彈跳感更逼真 */
  animation: bounceIn 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.vl26-guide-cta:active {
  transform: scale(0.98);
}
@media (hover: hover) {
  .vl26-guide-cta:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(127, 29, 44, 0.38);
  }
}
.vl26-guide-cta svg {
  width: 14px;
  height: 14px;
}

/* 3. 定義 Bounce In 關鍵幀 */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3); /* 一開始透明且縮小至 30% */
  }
  50% {
    opacity: 1;
    transform: scale(1.01); /* 快速放大至 110% (超越原本大小，產生彈跳感) */
  }
  70% {
    transform: scale(0.95); /* 稍微縮小至 95% (回彈效果) */
  }
  100% {
    transform: scale(1); /* 恢復為正常大小 */
  }
}
