/* ============================================================
   tp17_dark_black — main.css
   視覺：黑底橙調，純頂欄導覽（無常駐側欄）＋漢堡抽屜選單，參考 kuaibo8.com 版式重制
   功能架構：同 tp13_dark_black（由其複製而來，見 .claude/CLAUDE.md）
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
  /* 背景層（黑底） */
  --bg-body:        #0B0B0D;
  --bg-page:        #0B0B0D;
  --bg-card:        #17171B;
  --bg-card-hover:  #1F1F24;
  --bg-elevated:    #1C1C21;
  --bg-input:       #1F1F24;
  --bg-overlay:     rgba(0,0,0,.75);

  /* 主調色（橙色，比照參考網站 kuaibo8.com 的品牌色，用在連結/hover/實心按鈕/選中狀態） */
  --accent:         #FF6A00;
  --accent-hover:   #FF8A33;
  --accent-grad:    linear-gradient(135deg, #FF6A00 0%, #FF9640 100%);
  --accent-muted:   rgba(255,106,0,.14);

  /* 實心按鈕／徽章／目前選中狀態一律用 accent 橙色填色（跟 tp13 的「黑色系填色」規則
     不同——tp17 是黑底主題，實心橙色在黑底上對比度已經足夠，不需要另外走黑色系） */
  --fill:           var(--accent);
  --fill-hover:     var(--accent-hover);

  /* 文字（淺色系，黑底） */
  --text-1:         #F2F2F3;
  --text-2:         #A7A7AD;
  --text-3:         #737379;

  /* 邊框（深灰分隔線，用於 input／modal／tag 等結構性元件，不用來框圖片/卡片） */
  --border:         #2A2A30;
  --border-light:   #35353C;

  /* 頂欄專用（比主背景更深一層的暗色 chrome） */
  --topbar-bg:          #0D0D0F;
  --topbar-input-bg:    rgba(255,255,255,.06);
  --sidebar-overlay:    rgba(0,0,0,.6);
  --sidebar-text:       rgba(255,255,255,.85);
  --sidebar-text-muted: rgba(255,255,255,.6);

  /* 尺寸 */
  --topbar-h:       60px;
  /* tp17 是純頂欄導覽，沒有常駐側欄（見 .claude/CLAUDE.md 導覽方式），
     --sidebar-w 固定為 0，只是為了讓沿用自 tp13 的 .main-area{padding-left:var(--sidebar-w)}
     等寫法不用整批刪掉就能自動退化成「不留白」，不要改回非 0 的值。 */
  --sidebar-w:      0px;
  --container-w:    none;
  /* 整站（頂欄＋內容）置中、設寬度上限，比照參考網站在超寬螢幕下左右會留深色空白，
   * 不是無限鋪滿到瀏覽器邊緣——這點跟 tp13/tp10 沿用的「內容區不設上限」剛好相反，
   * tp17 是使用者實測比對參考站後才確認要改回有上限＋置中，見 .claude/CLAUDE.md。
   * 數值是估計值（沒有拿到參考站精確像素），如果實際比對後發現寬窄不對，這裡只要
   * 改一個變數就好，不用到處找。 */
  --page-max-w:     1600px;
  --radius:         4px;
  --radius-sm:      3px;
  --shadow-card:    0 2px 14px rgba(0,0,0,.4);

  --rank-1:         #FFD700;
  --rank-2:         #C0C0C0;
  --rank-3:         #CD7F32;
  --score-mid:      #FF6A00;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-body); color: var(--text-1); min-height: 100%; }
body { font-family: "PingFang SC","Microsoft YaHei",Arial,sans-serif; font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
a:hover { color: var(--accent); transition: .15s ease-in-out; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
iconify-icon { display: inline-flex; align-items: center; vertical-align: middle; }
input, select, textarea { font-family: inherit; }

/* ===== Page Shell =====
   side-nav 是浮在 main-area 上方的半透明疊層（見 §22.1），不佔版面寬度，
   所以這裡用 padding-left（讓 main-area 背景延伸到最左，側欄疊在上面）
   而不是 margin-left（那樣會挖出一塊空白，側欄後面就沒東西可透了）。 */
.page-shell { min-height: 100vh; }
.main-area  {
  min-height: 100vh; display: flex; flex-direction: column; padding-left: var(--sidebar-w);
  max-width: var(--page-max-w); margin: 0 auto;
}
.page-content { flex: 1; padding-top: var(--topbar-h); }

/* ===== Container ===== */
.warp { }
/* margin 不置中（不是 0 auto）：側欄已經把內容往右推過一次，
   若再置中會在側欄與內容之間多出一大塊空白，跟參考網站「內容緊貼側欄右緣」的版型不符。 */
.container { width: 100%; max-width: var(--container-w); margin: 0; padding: 0 16px; }

/* ===== Two-column layout ===== */
.page-body {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 20px 0 40px;
}
.main-inner { flex: 1; min-width: 0; }
.mian-sidebar { width: 300px; flex-shrink: 0; }
.main-inner > *:first-child,
.mian-sidebar > *:first-child { margin-top: 0; }

/* 「資訊」左側子分類導覽（widget/art_left_nav.html），art/detail.html／art/type.html
   共用，放在 main.css（每頁都會載入）而不是任何一個頁面專屬 CSS 檔，見上面的說明。 */
.art-leftnav { background: var(--bg-card); border-radius: var(--radius); padding: 8px; }
.aln-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text-2); transition: .15s;
}
.aln-item iconify-icon { font-size: 16px; flex-shrink: 0; }
.aln-item:hover { color: var(--text-1); background: var(--bg-elevated); }
.aln-item.is-active { color: #fff; background: var(--fill); font-weight: 600; }

/* ============================================================
   TOPBAR — 全寬固定於最上層
   ============================================================ */
/* topbar 是暗色 chrome（跟側欄同色系），跟頁面白底內容區分開，
   固定用 --topbar-bg／--sidebar-text 這類不隨主題變化的 token（見 CLAUDE.md §27）。 */
.dk-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  max-width: var(--page-max-w); margin: 0 auto;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  z-index: 300;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 8px;
}

/* Logo 區塊：純頂欄導覽沒有側欄可對齊寬度，改用內距自然撐開 */
.dk-brand {
  flex-shrink: 0;
  display: flex; align-items: center;
  height: 100%; padding-right: 12px;
}
.dk-brand-img { height: 30px; width: auto; }

/* 頂欄內嵌導覽連結（電影/連續劇/綜藝/動漫/專題/留言），資料來源與 .mob-nav-drawer
   共用同一份分類清單（見 widget/kb_nav_links），純文字、不帶圖示，跟參考網站一致。
   「排行榜」刻意不放進來——只在漢堡抽屜裡，比照參考網站頂欄只有到「留言」為止。 */
.dk-nav-links { display: flex; align-items: center; gap: 28px; flex-shrink: 0; }
.dk-nav-link {
  font-size: 15px; color: var(--text-1); white-space: nowrap; transition: color .15s;
}
.dk-nav-link:hover, .dk-nav-link.is-active { color: var(--accent); }

/* 「全部」漢堡按鈕：tp17 不分桌面/手機斷點，永遠顯示（見 .claude/CLAUDE.md），
   點擊開啟 .mob-nav-drawer（沿用 header.js 既有的 hamburgerBtn 邏輯，不用改 JS）。 */
.dk-hamburger {
  display: flex; align-items: center; gap: 4px;
  height: 34px; padding: 0 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 14px; flex-shrink: 0;
  border: 1px solid var(--border); transition: .15s;
}
.dk-hamburger:hover { color: var(--accent); border-color: var(--accent); }
.dk-hamburger iconify-icon { font-size: 18px; }

/* 搜尋框：左側「視頻」下拉（純視覺，MacCMS 目前只搜影片）＋輸入框＋實心橙色搜尋鈕 */
/* margin-left:auto（不是 flex:1）：比照參考網站，搜尋框＋歷史/會員圖示是黏在一起
   靠右邊的一組，留白應該出現在「導覽連結／全部按鈕」跟「搜尋框」之間，不是出現在
   「搜尋框」跟「圖示」之間。flex:1 會讓搜尋框自己撐到 480px 上限就不動，右側圖示
   再用 margin-left:auto 頂到最右邊，兩個元件中間反而會多出一大段空白，跟參考網站
   的緊湊分組不一致（使用者截圖回報過）。 */
.dk-search {
  display: flex; align-items: center;
  flex: 0 1 480px; height: 36px; margin-left: auto;
  background: var(--topbar-input-bg); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
}
.dk-search-type {
  flex-shrink: 0; height: 100%; padding: 0 10px 0 14px;
  border: none; border-right: 1px solid var(--border); outline: none;
  background: transparent; color: var(--text-2); font-size: 13px;
  -webkit-appearance: none; appearance: none;
}
.dk-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0 6px 0 12px;
  border: none; outline: none; background: transparent;
  color: var(--text-1); font-size: 13px;
}
.dk-search input::placeholder { color: var(--text-3); }
.dk-search-btn {
  flex-shrink: 0; height: 100%; padding: 0 18px;
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  transition: background .15s;
}
.dk-search-btn:hover { background: var(--accent-hover); }

/* 右側動作區：只留歷史／會員頭像兩個圖示按鈕，不帶文字（比照參考網站頂欄的精簡風格，
   「排行榜」的文字/圖示按鈕已移除，改放進漢堡抽屜） */
/* margin-left 用一般間距（不是 auto）：把撐開的工作交給 .dk-search 自己的
   margin-left:auto，這裡只要跟在 search 後面留個正常間距即可，兩者黏成同一組
   靠右對齊，不要各自搶著撐開造成中間空一大段（見 .dk-search 註解）。 */
.dk-actions {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; margin-left: 12px;
}
.dk-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 18px; color: var(--text-2);
  transition: .15s;
}
.dk-action-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.dk-action-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; margin-left: 4px; cursor: pointer;
  color: var(--text-2); font-size: 22px; transition: .15s;
}
.dk-action-avatar:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   SIDE-NAV — 左側常駐圖示側欄（桌面）
   ============================================================ */
/* tp17 是純頂欄導覽（見 .claude/CLAUDE.md 導覽方式），不使用 tp13 那種常駐側欄，
   分類清單一律走 .mob-nav-drawer 這個漢堡抽屜（桌面/手機共用同一份，不分斷點），
   所以 .side-nav 這個 aside 直接關閉，不要只靠 --sidebar-w:0 讓它退化——
   width:0 加上 overflow-y:auto 會被瀏覽器隱性推導出 overflow-x:auto，內容還是可能
   露出一條變形的捲軸，display:none 才是乾淨的做法。 */
.side-nav { display: none; }
.side-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; font-size: 16px; color: var(--sidebar-text-muted);
  border-left: 3px solid transparent;
  transition: .15s;
  white-space: nowrap;
}
.side-nav-item iconify-icon { font-size: 19px; flex-shrink: 0; }
.side-nav-item span { overflow: hidden; text-overflow: ellipsis; }
.side-nav-item:hover { color: var(--sidebar-text); background: rgba(255,255,255,.08); }
.side-nav-item.is-active {
  color: #fff; background: rgba(76,141,255,.35);
  border-left-color: var(--accent); font-weight: 600;
}
.side-nav-divider { height: 1px; background: rgba(255,255,255,.15); margin: 10px 20px; }

/* ===== 「全部」抽屜（沿用 tp13 的 mobile drawer 元件承接導覽內容，tp17 桌面/手機共用
   同一顆按鈕觸發，見 .claude/CLAUDE.md §3） =====
   .mob-nav-overlay 背景改成透明：比照參考網站，抽屜打開時後面的頁面內容維持可見、
   不整片變暗（不是傳統會擋住/變暗頁面的 modal 遮罩），這裡純粹當一個「點外面關閉」
   的透明點擊層，不做視覺遮蔽。抽屜本身（.mob-nav-drawer）維持半透明黑＋blur，
   透過它本身的透明度就能隱約看到後面內容，不需要再疊一層變暗的全頁遮罩。 */
.mob-nav-overlay {
  display: none; position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  background: transparent; z-index: 400;
}
.mob-nav-overlay.is-open { display: block; }
.mob-nav-drawer {
  position: fixed; top: 0; left: -280px; bottom: 0;
  width: 280px; background: var(--sidebar-overlay);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  z-index: 410; transition: left .3s ease;
  overflow-y: auto;
}
.mob-nav-drawer.is-open { left: 0; }
.mnd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.15);
}
/* 抽屜頭部改放 logo（比照 .dk-brand 頂欄品牌區的規則：只放 <img>，不輸出站名文字），
   不再用「菜单」文字當標題 */
.mnd-brand { display: flex; align-items: center; height: 30px; }
.mnd-brand-img { height: 26px; width: auto; }
.mnd-close { font-size: 22px; color: var(--sidebar-text-muted); }
.mnd-nav { padding: 8px 0; }

/* ===== Search Overlay (mobile) ===== */
.search-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--bg-page); z-index: 500;
}
.search-overlay.is-open { display: flex; flex-direction: column; }
.search-overlay-inner { padding: 12px 16px; }
.search-bar-row { display: flex; align-items: center; gap: 10px; }
.search-bar {
  flex: 1; display: flex; align-items: center;
  height: 40px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
}
.search-bar-icon { font-size: 18px; color: var(--text-3); margin: 0 10px; flex-shrink: 0; }
.search-bar input {
  flex: 1; height: 100%; border: none; outline: none;
  background: transparent; color: var(--text-1); font-size: 15px;
}
.search-submit-btn {
  padding: 0 16px; height: 40px;
  background: var(--fill); color: #fff; font-size: 14px; font-weight: 600;
}
.search-close-btn { font-size: 22px; color: var(--text-2); flex-shrink: 0; }
.search-hot { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.sh-label { font-size: 13px; color: var(--text-3); width: 100%; }
.sh-tag {
  padding: 5px 14px; background: var(--bg-card);
  border-radius: 20px; font-size: 13px; color: var(--text-2);
  transition: .15s;
}
.sh-tag:hover { background: var(--fill); color: #fff; }

/* ===== History Modal ===== */
.hm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 600;
  align-items: center; justify-content: center;
}
.hm-overlay.is-open { display: flex; }
.hm-box {
  width: 90%; max-width: 760px; max-height: 80vh;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column;
}
.hm-header {
  display: flex; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.hm-title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; }
.hm-clear { font-size: 13px; color: var(--text-3); }
.hm-clear:hover { color: var(--accent); }
.hm-close { font-size: 20px; color: var(--text-3); }
.hm-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.hm-card { flex: 0 0 calc((100% - 50px) / 6); min-width: 0; display: block; text-decoration: none; color: var(--text-1); }
.hm-thumb { position: relative; aspect-ratio: 2/3; border-radius: 4px; overflow: hidden; background: var(--bg-elevated); }
.hm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.hm-card:hover .hm-thumb img { transform: scale(1.04); }
.hm-card:hover .hm-name { color: var(--accent); }
.hm-name { margin-top: 5px; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.hm-empty { width: 100%; text-align: center; padding: 36px 0; color: var(--text-3); font-size: 13px; }

/* ===== Module: .mod ===== */
.mod {
  padding: 20px; background: var(--bg-card);
  border-radius: var(--radius);
}
.mod + .mod, .mod + .mod-inner, .mod-inner + .mod,
.mod-inner + .mod-inner, .margin-t-20 { margin-top: 20px; }

/* Section header */
.mod-head { display: flex; align-items: center; margin-bottom: 16px; }
.mod-head-title {
  flex: 1; padding-left: 14px; position: relative;
}
.mod-head-title::before {
  content: ""; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--accent); border-radius: 1px;
}
.mod-head-name { font-size: 20px; font-weight: 700; color: var(--text-1); }
.mod-head-more { font-size: 13px; color: var(--text-3); flex-shrink: 0; transition: color .15s; }
.mod-head-more:hover { color: var(--accent); text-decoration: underline; }
.mod-head-today { font-size: 13px; color: var(--text-2); margin-left: auto; margin-right: 12px; flex-shrink: 0; }
.mod-head-today em { color: var(--accent); font-style: normal; font-weight: 700; }

/* Tab list */
.mod-author-list { display: flex; gap: 8px; flex: 1; margin-left: 16px; }
.mod-author-list li {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 12px;
  background: var(--bg-elevated); border-radius: 13px;
  font-size: 13px; cursor: pointer; transition: .15s; color: var(--text-2);
}
.mod-author-list li:hover,
.mod-author-list li.active { color: #fff; background: var(--fill); }

/* .mod-inner */
.mod-inner { background: var(--bg-card); padding: 20px; border-radius: var(--radius); }
.mod-inner-head { display: flex; align-items: center; margin-bottom: 14px; }
.mod-inner-name {
  font-size: 20px; font-weight: 700; color: var(--text-1);
  padding-left: 12px; position: relative;
}
.mod-inner-name::before {
  content: ""; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--accent); border-radius: 1px;
}
.mod-inner-more {
  margin-left: auto; font-size: 13px; color: var(--text-3); font-weight: 600;
  flex-shrink: 0; text-decoration: none; transition: color .15s;
}
.mod-inner-more:hover { color: var(--accent); }
.mod-inner-count { margin-left: auto; font-size: 13px; color: var(--text-3); flex-shrink: 0; }
.mod-inner-count em { color: var(--accent); font-style: normal; font-weight: 700; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 4px; }
/* 麵包屑最後一段（目前頁面名稱）用 <cite> 標籤是為了結構化資料語義（見 CLAUDE.md §24
   point 4），但瀏覽器對 <cite> 有預設的 font-style:italic，要覆寫掉，不然只有最後一段
   會變成斜體、跟前面的連結文字不一致。 */
.breadcrumb cite { font-style: normal; }

/* ===== VOD Grid =====
   卡片維持固定寬度（150px），不用 minmax(...,1fr) 讓卡片跟著容器變寬——
   容器（.container）現在不設 max-width，寬螢幕時應該是「多塞幾欄」而不是
   「卡片被拉得比原本大」，所以欄寬給固定像素，auto-fill 只決定塞得下幾欄，
   欄與欄之間多出的零頭空間留白在最右邊，不強制撐滿最後一欄（見 CLAUDE.md §35）。 */
.video-film-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 150px);
  justify-content: start;
  gap: 16px 12px;
}
/* --6col 重新啟用，但用途跟舊版不同：這個 modifier 專門給「資料筆數固定、不分頁的
   推薦片單」用（vod/detail.html 的猜你喜欢／关联视频／相关推荐、vod/play.html 的
   为你推荐）。
   這類推薦片單常常筆數不多不少（例如關聯影片只有 10 部），固定寬度 auto-fill
   算出來的欄數如果沒有整除，最後一排會塞不滿，右側留下一大塊空白（使用者截圖
   回報過）。改用 repeat(6, minmax(0,1fr))：固定 6 欄，每欄用剩餘寬度平均分配
   （minmax(0,1fr) 而不是單純 1fr，是為了避免內容撐開欄寬——理由跟 flex item 的
   min-width:0 是同一個道理，見 CLAUDE.md §30 的坑），永遠不會有塞不滿的右側空白，
   代價是卡片寬度會跟著可用寬度縮放，不是絕對固定值，這是刻意的取捨。 */
.video-film-list--6col {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-content: normal;
}
@media (max-width: 1024px) { .video-film-list--6col { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .video-film-list--6col { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --fill：給有分頁的清單頁用（vod/type／vod/show，見 CLAUDE.md §35 後續更新）。
   這兩頁原本沿用上面沒有 modifier 的固定寬度版本，使用者截圖回報同一個問題在這裡
   也發生了——螢幕右緣一樣留一大塊沒用到的空白（能塞下第 10 欄的寬度，但固定 150px
   auto-fill 只塞了 9 欄就不動了）。這裡不像 --6col 用固定欄數，是因為這兩頁清單的
   資料量遠大於推薦片單（分頁 24 筆），欄數應該跟著螢幕寬度自然增減，不能寫死成
   某個固定數字。改用 repeat(auto-fit, minmax(150px, 1fr))：auto-fit 和 auto-fill
   的差異在於，算出目前寬度塞得下幾欄之後，auto-fit 會把多餘的零頭空間分給「已經
   存在的那幾欄」（欄位跟著變寬一點，撐滿到右緣），auto-fill 則是把零頭空間晾在
   最右邊當空白（就是這裡要修的問題）。minmax(150px,1fr) 保底 150px、上限用剩餘
   空間平均分配，寬螢幕下頂多把每欄撐寬到接近下一欄的門檻，不會像 --6col 那樣
   把欄數鎖死在一個很小的數字、卡片被拉得特別大。 */
.video-film-list--fill {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  justify-content: normal;
}

/* ===== Hot Featured Block (首頁热点資訊) ===== */
.hot-block { display: flex; gap: 14px; height: 350px; }
.hot-feat-card {
  flex-shrink: 0; width: 220px;
  display: block; position: relative; overflow: hidden;
  border-radius: var(--radius); text-decoration: none;
  background: var(--bg-elevated);
}
.hot-feat-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
  transition: transform .35s ease;
}
.hot-feat-card:hover img { transform: scale(1.05); }
.hot-feat-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.9));
}
.hot-feat-name { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.3; display: block; }
/* 固定寬度 auto-fill（185px，即原本 5 欄在 1280px 容器下的實際寬度，見 CLAUDE.md §35）：
   容器不設 max-width 後不能再用 repeat(5,1fr)，那樣寬螢幕下卡片會被拉得又寬又扁
   （使用者回報過這個問題）。改成固定寬度後欄數會隨可用寬度增加，所以模板那邊把
   {maccms:vod num} 從 11 提高到 31，確保有足夠資料可以多開幾欄；固定列高
   grid-auto-rows + overflow:hidden 讓超過 2 排的多餘項目（資料抓多了、但畫面只有
   350px 高放不下）直接被裁掉，不會撐高 .hot-block，維持原本「精選圖＋2 排縮圖」的版面比例。
   168px = 原本 grid-template-rows:repeat(2,1fr) 在 350px 高、扣掉一條 14px row-gap
   後平分兩排的實際高度（(350-14)/2），不是天真地拿 350/2，避免第二排被 overflow:hidden
   多裁掉幾像素。 */
.hot-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fill, 185px);
  grid-auto-rows: 168px;
  justify-content: start;
  overflow: hidden;
  gap: 14px 12px;
  list-style: none; padding: 0; margin: 0;
}
.hot-grid .video-item { display: flex; flex-direction: column; min-height: 0; }
.hot-grid .video-cover { aspect-ratio: unset; height: 115px; flex: none; }
.hot-grid .video-con { flex-shrink: 0; padding: 4px 0; }
@media (max-width: 767px) {
  .hot-block { height: auto; }
  .hot-feat-card { display: none; }
  .hot-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; gap: 10px 8px; overflow: visible; }
  /* 桌面版把 {maccms:vod num} 從 11 提高到 31 是為了寬螢幕多開幾欄用的（見上面桌面版
     .hot-grid 的註解），手機版沒有裁切機制（grid-template-rows:auto 不會被 overflow:hidden
     裁掉），資料變多會讓手機版多長出好幾排，所以手機版額外用 nth-child 只保留原本的
     前 10 筆（比照改動前 num=11 扣掉 1 筆精選圖之後手機版原本看到的數量），維持原本手機版版面。 */
  .hot-grid .video-item:nth-child(n+11) { display: none; }
  .hot-grid .video-cover { aspect-ratio: 2/3; flex: unset; }
  .hot-grid .video-con { padding: unset; }
}
/* ================================ */
.video-item { position: relative; min-width: 0; }
.video-cover {
  display: block; width: 100%; position: relative; overflow: hidden;
  background: var(--bg-elevated); border-radius: var(--radius);
  aspect-ratio: 2/3;
}
.video-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .35s ease;
}
.video-item:hover .video-cover img { transform: scale(1.07); }
.video-mask {
  position: absolute; bottom: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.85) 100%);
  pointer-events: none; z-index: 1;
}
.video-badge-tl { position: absolute; top: 0; left: 0; display: flex; gap: 4px; z-index: 2; }
.vbadge { padding: 3px 7px; font-size: 10px; font-weight: 700; line-height: 1.5; }
.vbadge--year { background: rgba(0,0,0,.7); color: rgba(255,255,255,.85); border-radius: 0 0 var(--radius-sm) 0; }
.vbadge--type { background: var(--accent); color: #fff; border-radius: 0 0 var(--radius-sm) 0; }
.video-duration {
  position: absolute; right: 6px; bottom: 6px;
  height: 20px; line-height: 20px; padding: 0 6px;
  color: #fff; font-size: 12px; z-index: 2;
}
.video-tips {
  position: absolute; top: 0; right: 0;
  padding: 0 6px; height: 20px; line-height: 20px;
  font-size: 11px; color: #fff;
  border-radius: 0 var(--radius) 0 var(--radius); z-index: 3;
}
.video-tips.red   { background: linear-gradient(to left, #e5424b 0, #ff8a3d 100%); }
.video-tips.blue  { background: linear-gradient(to left, #4C8DFF 0, #7FB1FF 100%); }
.video-tips.green { background: linear-gradient(to left, #2DD671 0, #58E08E 100%); }
.video-cover::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.35); opacity: 0; transition: opacity .22s; z-index: 2;
}
.video-item:hover .video-cover::after { opacity: 1; }
.video-play-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 44px; height: 44px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; z-index: 3;
  opacity: 0; transition: opacity .22s;
  box-shadow: 0 0 0 6px var(--accent-muted);
}
.video-item:hover .video-play-icon { opacity: 1; }
/* 右上角畫質徽章（HD／正片／集數等，取自 vod_remarks），比照參考網站卡片右上角的白底黑字小標籤 */
.video-badge-hd {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  padding: 2px 6px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.92); color: #1A1A1A;
  font-size: 10px; font-weight: 700; line-height: 1.4;
}
.video-con { margin-top: 7px; }
.video-con-tit {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s;
}
.video-item:hover .video-con-tit { color: var(--accent); }
.video-con-subtitle {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px;
}
/* 評分（橙色粗體）＋演員名，同一行顯示，比照參考網站卡片標題下方的資訊列 */
.video-con-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden;
}
.video-con-score { flex-shrink: 0; color: var(--accent); font-weight: 700; }
.video-con-actor { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ===== Mini film list ===== */
.video-mini-film-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px 10px;
}
.video-mini-film-list .video-cover { aspect-ratio: 2/3; border-radius: var(--radius); }

/* ===== Sidebar slide-grid ===== */
.slide-grid { background: var(--bg-card); padding: 16px 14px; border-radius: var(--radius); }
.slide-grid + .slide-grid { margin-top: 16px; }
.slide-grid-title { padding-left: 12px; position: relative; margin-bottom: 10px; }
.slide-grid-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; background: var(--accent); border-radius: 1px;
}
.slide-grid-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.recent-tag-lists { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.recent-tag-lists a {
  display: inline-block; padding: 3px 10px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 2px;
  font-size: 12px; font-weight: 700; color: var(--text-2); transition: .15s;
}
.recent-tag-lists a:hover { color: #fff; background: var(--fill); border-color: var(--fill); }

/* ===== Search result ===== */
.film-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.film-item .img {
  flex-shrink: 0; width: 90px; height: 126px;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-elevated);
}
.film-item .img img { width: 100%; height: 100%; object-fit: cover; }
.film-item .info { flex: 1; min-width: 0; }
.film-item .title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.film-item .title a:hover { color: var(--accent); }
.film-item .des p { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.film-item .des label { color: var(--text-3); }
.film-item .btn {
  display: inline-flex; align-items: center; margin-top: 10px;
  padding: 6px 16px; background: var(--fill); color: #fff;
  border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: .15s;
}
.film-item .btn:hover { background: var(--fill-hover); color: #fff; }

/* ===== VOD Detail ===== */
.detail { background: var(--bg-card); padding: 20px; border-radius: var(--radius); }
.detail-main { display: flex; gap: 20px; }
.detail-main-left { flex-shrink: 0; width: 200px; }
.detail-main-left .cover {
  position: relative; width: 200px; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-elevated);
}
.detail-main-left .cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.detail-main-left label { display: block; margin-top: 8px; text-align: center; font-size: 12px; color: var(--text-3); }
.detail-main-right { flex: 1; min-width: 0; }
.detail-main-right h1 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.intro p { font-size: 13px; color: var(--text-2); line-height: 2; }
.intro label.color-9 { color: var(--text-3); }
.intro-desc { margin-top: 10px; font-size: 13px; color: var(--text-2); line-height: 1.8; }
.detail-main-btn { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-main-btn .btn {
  display: inline-flex; align-items: center;
  padding: 9px 24px; background: var(--fill); color: #fff;
  border-radius: var(--radius); font-size: 14px; font-weight: 700;
  transition: .15s; text-decoration: none; cursor: pointer; border: none;
}
.detail-main-btn .btn:hover { background: var(--fill-hover); color: #fff; }
.detail-main-btn .btn-dl {
  background: var(--accent-muted); color: var(--accent); border: 1px solid var(--accent);
}
.detail-main-btn .btn-dl:hover { background: var(--fill); color: #fff; }
.detail-main-btn .btn-share {
  background: var(--bg-elevated); color: var(--text-2); border: 1px solid var(--border);
}
.detail-main-btn .btn-share:hover { color: var(--accent); border-color: var(--accent); }

/* Episode buttons */
.tv-info-list ul { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tv-info-list li a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 0; width: 72px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text-2); transition: .15s;
}
.tv-info-list li a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }
.tv-info-list li a.cur { color: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ===== Play page ===== */
.tvplay { background: #000; }
.tvplay .inner-main { position: relative; aspect-ratio: 16/9; background: #000; }
.tvplay .inner-main > iframe,
.tvplay .inner-main > div { position: absolute; inset: 0; width: 100%; height: 100%; }
.filmplay-info { padding: 12px 0; }
.filmplay-info-common .title { font-size: 20px; font-weight: 700; }
.filmplay-info-desc { margin-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.7; }

/* ===== Filter / Show page ===== */
.mod-screen { padding: 4px 0 12px; }
.mod-screen-item { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.mod-screen-label { font-size: 13px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.mod-screen-list { display: flex; flex-wrap: wrap; gap: 4px; }
.mod-screen-link {
  padding: 3px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-2); transition: .15s;
}
.mod-screen-link:hover { color: var(--accent); background: var(--accent-muted); }
.mod-screen-link.cur { color: #fff; background: var(--fill); }

/* Sticky filter bar */
.vod-show-sticky {
  position: sticky; top: var(--topbar-h); z-index: 100;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

/* ============================================================
   HERO — 大圖左 + 熱門片單右（參考 miguvideo 頻道頁）
   ============================================================ */
/* .dk-hero 是滿版 banner：.main-area 因側欄浮層而有 padding-left，
   這裡用等量負 margin 把 hero 拉回貼齊螢幕左右邊（見 CLAUDE.md §22.1／§25），
   下面的 .warp/.container 內容維持原本的置中留白版型，不受影響。
   比照參考網站：桌面版完全去邊——不留 padding、.dk-hero-slides 不設 border-radius，
   讓圖片直接貼齊頂欄下緣與螢幕左右兩側，不要有黑邊/縫隙（使用者截圖回報過）；
   高度也從 440px 調高到 460px，比照參考網站量出來的高度。 */
.dk-hero {
  height: 460px; max-height: 460px;
  margin-left: calc(-1 * var(--sidebar-w));
  width: calc(100% + var(--sidebar-w));
}
.dk-hero-slides {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  background: var(--bg-card);
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .5s ease;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
/* vod_pic 退回方案（沒有 vod_pic_slide 橫版banner圖時）：vod_pic 多半是直式海報，
   直接 cover 會裁掉大半張臉/主體，改用「模糊放大鋪滿底 + 原圖 contain 置中」的雙層作法，
   兩層都靠 background-image:inherit 繼承同一個 .hero-bg 的行內背景圖，不用另外複製一份 URL。 */
.hero-bg--fallback::before,
.hero-bg--fallback::after {
  content: ''; position: absolute; inset: 0;
  background-image: inherit; background-repeat: no-repeat; background-position: center;
}
.hero-bg--fallback::before {
  background-size: cover;
  filter: blur(28px) brightness(.55);
  transform: scale(1.15); /* 放大蓋掉模糊造成的邊緣透空 */
}
.hero-bg--fallback::after { background-size: contain; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.7) 0%, rgba(0,0,0,.15) 45%, transparent 75%),
              linear-gradient(to top, rgba(0,0,0,.9) 0%, transparent 55%);
}
/* left 從側欄右緣算起，避免播放/詳情等按鈕被浮在上層的半透明側欄擋住點擊（見 CLAUDE.md §25.2） */
.hero-content {
  position: absolute; bottom: 30px; left: 30px; z-index: 2; max-width: 55%;
}
.hero-badges { display: flex; gap: 6px; margin-bottom: 10px; }
.hb {
  display: inline-block; padding: 2px 8px;
  border-radius: 2px; font-size: 11px; font-weight: 700;
}
.hb--year { background: var(--accent); color: #fff; }
.hb--area { background: rgba(255,255,255,.12); color: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.25); }
.hero-title { font-size: 30px; font-weight: 800; color: #fff; margin-bottom: 8px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.hero-meta { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 14px; line-height: 1.5; }
.hero-btns { display: flex; gap: 10px; }
.hero-play-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 22px; background: var(--accent); color: #fff;
  border-radius: 20px; font-size: 14px; font-weight: 700;
  transition: background .15s;
}
.hero-play-btn:hover { background: var(--accent-hover); color: #fff; }
.hero-detail-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.28); border-radius: 20px;
  font-size: 14px; transition: background .15s;
}
.hero-detail-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Hero controls */
/* 圓點位置比照參考網站放在右下角（不是左下角）——tp17 沒有側欄可扣，也沒有像
   tp13 那樣在旁邊放熱門片單面板，圓點是 hero 唯一的手動切換方式。 */
.hero-dots {
  position: absolute; bottom: 16px; right: 24px; z-index: 3;
  display: flex; gap: 5px;
}
.hero-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4); transition: .2s;
}
.hero-dot.is-active { background: var(--accent); width: 20px; border-radius: 3px; }

/* ===== Hero 熱門片單 — 疊在 hero 圖片右上方，不佔獨立欄位（見 CLAUDE.md §25.2） =====
   跟 .hero-title/.hero-badges 一樣，這塊疊在照片上，配色固定用白色系，
   不跟著全站白底配色走（跟 .side-nav 的道理相同：疊在圖片上的東西配色固定）。 */
/* 背景比照參考網站的 .slide-nav：不是純色色塊，是「上下淡出、中段實色」的漸層
   （上緣/下緣 rgba(0,0,0,0) 全透明，11%～92% 是 rgba(0,0,0,.5)），讓面板跟 hero 圖片
   的交界處是柔化的漸層，不是一條生硬的色塊邊界。 */
/* width/padding/top 比照參考網站 .slide-nav 實測數值：230px 寬、上下 padding 20px、
   跟頂欄下緣固定距離 56px（不是百分比、不是靠 flex 置中算出來的，使用者實測拉伸 RWD
   這個距離都不會變，所以這裡直接寫死 56px，不要改成 % 或其他會隨容器高度變動的算法）。
   right 從 16px 調成 70px：右下角固定的 .fab-group（回頂/選單按鈕，見 §38）
   `right:20px` + 按鈕本身 40px 寬，左緣落在離螢幕右邊 60px 處，panel 貼 16px 會跟
   FAB 按鈕視覺上黏在一起（使用者截圖回報）；70px 這個值不是憑空選的，`main.css` 裡
   `.fab-qr-popup`（FAB 的彈出視窗）本來就是用 `right:70px` 來閃避同一組 FAB 按鈕，
   這裡沿用同一個既有慣例，不要改成其他數字。 */
.dk-hero-panel {
  position: absolute; top: 56px; right: 70px; bottom: 16px;
  width: 230px; z-index: 5;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,.5) 11%,
    rgba(0,0,0,.5) 92%,
    rgba(0,0,0,0) 100%);
  padding: 20px 0;
  border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
}
/* overflow-x:hidden 是關鍵：只設 overflow-y:auto 的話，瀏覽器會把 overflow-x 隱性算成
   auto（CSS 規範規則），.php-item 的 hover/is-active transform:scale(1.06) 又會讓內容
   的可捲動範圍稍微超出容器寬度，兩者疊加就會在面板底部多冒出一條水平捲軸；
   scrollbar-width/::-webkit-scrollbar 則是把「上下捲動」這個功能保留，但不顯示捲軸外觀
   （比照 .rail-track／.actor-hot-scroll 既有的隱藏捲軸寫法），參考網站的原始片單面板
   本來就看不到任何捲軸。 */
.dk-hero-panel-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.dk-hero-panel-list::-webkit-scrollbar { display: none; }
.php-item {
  display: block;
  padding: 8px 16px;
  transition: background .15s, transform .15s;
  transform-origin: left center;
}
.php-item-title {
  display: block; font-size: 13px; color: rgba(255,255,255,.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s, font-size .15s;
}
/* 副標題只在目前播放中／hover 時才顯示（見 CLAUDE.md §34） */
.php-item-sub {
  display: none; font-size: 11px; color: rgba(211,211,211,1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.php-item.is-active,
.php-item:hover {
  transform: scale(1.06);
}
/* 比照參考網站：hover/is-active 的片名字級放大到 20px、顏色用參考站實際的
   #007aff（不是共用的 var(--accent) #4C8DFF，兩者色號不同，這裡指定成參考站的原色，
   不動全站共用的 --accent 變數，避免牽動其他地方）。 */
.php-item.is-active .php-item-title,
.php-item:hover .php-item-title {
  color: #007aff; font-weight: 700; font-size: 20px;
}
.php-item.is-active .php-item-sub,
.php-item:hover .php-item-sub {
  display: block;
}

/* ============================================================
   RAIL — 橫向捲動片單列（見 CLAUDE.md §23）
   ============================================================ */
/* 左右 padding 對齊下方 .mod 區塊的實際內縮（.mod 本身 padding:20px），
   否則 rail 沒有這層 padding 會比下面的卡片區塊「寬」，兩者內容邊界對不齊。 */
.rail { padding: 0 20px; }
/* 跟下一個區塊的間距縮小：.mod 本身有 20px 內距 + margin-top:20px，疊在一起會顯得
   rail 跟下面區塊隔太遠，這裡用相鄰選擇器把間距收窄，不動其餘區塊彼此的間距。 */
.rail + .margin-t-20 { margin-top: 8px; }
.rail-head { display: flex; align-items: center; margin-bottom: 14px; }
.rail-title { font-size: 20px; font-weight: 700; color: var(--text-1); }
.rail-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rail-counter { font-size: 12px; color: var(--text-3); }
.rail-counter .cur { color: var(--text-1); font-weight: 700; }
.rail-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 14px; transition: .15s;
}
.rail-arrow:hover { color: #fff; background: var(--fill); border-color: var(--fill); }
.rail-arrow[disabled] { opacity: .35; pointer-events: none; }
/* ⚠️ overflow-x:auto 會連垂直方向一起裁切（CSS 規範：一軸設裁切值、另一軸沒明講時
   會被隱性算成 auto，見 CLAUDE.md §36 同一個坑），.hover-popout 疊在 .rail-card 上
   放大時如果比卡片本身高，上下露出的部分會被這裡的 overflow-x 直接切掉，
   放大效果看起來像被原卡片的窄小範圍夾住（使用者截圖回報過）。
   解法沿用 tp14_dark_black 的 .video-track 技巧：上下各加 60px 內距，
   再用等量負外距把版面拉回原位——裁切框因此上下各多出 60px 可以露出浮層，
   但 .rail-track 本身的版面佔位（外部看到的高度／跟其他區塊的間距）完全不變，
   兩者互相抵銷。60px 是估計值（.hover-popout 比卡片高出的量沒有精確量過），
   如果之後發現浮層還是被切到一點，或反過來蓋到上面 .kb-cat-head 的篩選列，
   調這裡的數字就好（padding 跟 margin 要維持同步，只改一邊會破壞抵銷）。
   水平方向仍然靠 vod_card.js 的 pop-left/pop-right 把浮層留在
   捲動容器可視範圍內，不是靠加大這個方向的裁切框（那樣做不到，捲動列本來就要裁水平）。 */
.rail-track {
  display: flex; gap: 14px; overflow-x: auto; scroll-behavior: smooth;
  padding: 60px 0 64px; margin: -60px 0 -64px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  /* pointer-events:none 在 .rail-track 本身、auto 在 .rail-card 身上：
     上面加的 60px/64px padding 讓 .rail-track 的實際盒子往上下各多蓋出一截
     （為了讓 .hover-popout 有地方溢出，見前面的說明），這塊透明的 padding 區域
     會往上疊到 .kb-cat-head（分類名稱／「更多」／篩選 pill 那一列）身上，即使
     看不到也照樣會吃掉點擊事件，導致「更多」連結點不到（使用者截圖回報過）。
     讓 .rail-track 本身不接收指標事件，只讓卡片（.rail-card）自己接收，
     這樣空白的 padding 區域點擊會直接穿透到底下/旁邊真正該接的元素。 */
  pointer-events: none;
}
.rail-track .rail-card { pointer-events: auto; }
.rail-track::-webkit-scrollbar { display: none; }
/* min-width:0 是關鍵：flex item 預設 min-width:auto，若卡片內文字用 white-space:nowrap
   （.rail-card-title 就是），瀏覽器會把「文字完整不換行的寬度」當成這個 flex item 的最小寬度，
   標題一長，卡片就會被撐開超過 flex-basis，變成畫面上「某張卡片異常寬大」的爆版。
   加 min-width:0 讓 flex-basis 才是實際寬度，標題的 overflow:hidden/ellipsis 才會生效。 */
/* 桌面版改回容器等分 6 份（不是固定像素）：使用者明確要求「一行固定 6 張，底部跟
   排行榜面板高度沒對齊到就算了」，比起「維持絕對固定的卡片寬度」更優先。用
   calc((100% - 5*14px)/6) 讓 6 張卡片＋5 個 14px 間距剛好等分整個 .rail-track 寬度，
   不管容器多寬都固定顯示 6 欄整，不會有切一半的第 7 張卡片（那是 v9/v10 想解決、
   固定寬度又重新引入的問題，這次換個優先順序，不用兩者兼顧）。
   ⚠️ 這裡是「桌面版專用」的等分算法——手機版（<767px）已經完全改用 CSS Grid
   （repeat(3,1fr)，見下面手機斷點），跟這條 calc() 是兩條独立的路徑，不會互相干擾，
   所以不用擔心等分算法在窄螢幕上出問題（那是 flex-basis 那次事故，現在手機版
   根本不會走到這條規則）。 */
.rail-card { position: relative; flex: 0 0 calc((100% - 5 * 14px) / 6); width: calc((100% - 5 * 14px) / 6); min-width: 0; scroll-snap-align: start; }
/* width:100% 只是「正常情況下」的寫法，.rail-card-link/.rail-card-thumb 不另外加
   max-width 上限了——手機版的「width:100% 算不出正確寬度、退回用 <img> 原始像素
   尺寸當寬度」那個爆版問題已經改用 CSS Grid 徹底繞開（不再經過這條 flex-basis 路徑），
   桌面版本來就沒出過這個問題，不需要為了防一個已經不會發生的情境而限制桌面版
   卡片可以長到的最大寬度（現在卡寬是 calc() 等分算出來的，不是固定值，硬加
   max-width 反而會在螢幕更寬時把卡片截斷成比其他 5 張還窄）。 */
.rail-card-link { display: block; width: 100%; }
.rail-card-thumb {
  position: relative; width: 100%; aspect-ratio: 2/3; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card);
}
.rail-card-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .3s ease;
}
.rail-card:hover .rail-card-thumb img { transform: scale(1.06); }
.rail-card-badge {
  position: absolute; right: 6px; bottom: 6px;
  padding: 2px 7px; font-size: 11px; color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.6); border-radius: 3px;
}
.rail-card-title {
  margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--text-1);
  transition: color .15s;
}
.rail-card:hover .rail-card-title { color: var(--accent); }

/* ============================================================
   卡片 hover 詳情浮層（.hover-popout）—— 參考 tp14_dark_black 的 .video-track
   / widget/vod_card.html / vod_card.js 移植，套用到 tp17 兩種卡片容器：
   `.video-item`（CSS Grid 格狀清單）與 `.rail-card`（.rail-track 橫向捲動列）。
   兩者都已經是 position:relative，直接把 .hover-popout 當絕對定位子層插入即可，
   不需要額外包一層 wrapper。
   進場動畫：scale(0.6667)→1，0.25s cubic-bezier(.25,1,.5,1)，delay 0.15s
   （hover 意圖延遲，滑鼠只是滑過去不會亂彈出來）。
   ============================================================ */
.hover-popout {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  z-index: 60;
  width: 320px; height: auto;
  opacity: 0; visibility: hidden; pointer-events: none;
  background: var(--bg-elevated);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  transform: translate(-50%, -50%) scale(.6667);
  transform-origin: center center;
}
.hover-popout.pop-left  { left: 0; transform: translate(0, -50%) scale(.6667); transform-origin: left center; }
.hover-popout.pop-right { left: auto; right: 0; transform: translate(0, -50%) scale(.6667); transform-origin: right center; }

.video-item:hover .hover-popout,
.rail-card:hover .hover-popout {
  display: block; visibility: visible; pointer-events: auto;
  animation: popoutIn .25s cubic-bezier(.25,1,.5,1) forwards;
  animation-delay: .15s;
}
.video-item:hover .hover-popout.pop-left,  .rail-card:hover .hover-popout.pop-left  { animation-name: popoutInLeft; }
.video-item:hover .hover-popout.pop-right, .rail-card:hover .hover-popout.pop-right { animation-name: popoutInRight; }

@keyframes popoutIn      { from { opacity: 0; transform: translate(-50%,-50%) scale(.6667); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes popoutInLeft  { from { opacity: 0; transform: translate(0,-50%) scale(.6667); }     to { opacity: 1; transform: translate(0,-50%) scale(1); } }
@keyframes popoutInRight { from { opacity: 0; transform: translate(0,-50%) scale(.6667); }     to { opacity: 1; transform: translate(0,-50%) scale(1); } }

.popout-inner { width: 100%; display: flex; flex-direction: column; background: var(--bg-elevated); border-radius: 10px; overflow: hidden; position: relative; }

.popout-cover { position: relative; display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card); }
.popout-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popout-cover-shadow { position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; background: linear-gradient(rgba(0,0,0,0), var(--bg-elevated)); }

.popout-title-wrap { position: relative; padding: 0 16px; margin-top: -32px; }
.popout-title {
  font-size: 16px; font-weight: 700; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.popout-mix { padding: 12px 16px 0; }
.popout-tags { display: flex; flex-wrap: nowrap; gap: 6px; overflow: hidden; }
.popout-tag { height: 20px; padding: 0 6px; border-radius: var(--radius-sm); font-size: 11px; line-height: 20px; white-space: nowrap; }
.popout-tag--main  { color: var(--accent); background: var(--accent-muted); }
.popout-tag--grey  { color: rgba(255,255,255,.85); background: rgba(255,255,255,.1); }
.popout-tag--plain { color: var(--text-3); background: none; overflow: hidden; text-overflow: ellipsis; }
/* 年份：跟其他 plain 標籤不同，年份要「一定完整顯示」，不能被旁邊的類型標籤擠到
   靠 ellipsis 截斷——所以另外給實色底（不是 background:none）＋flex-shrink:0
   （.popout-tags 是 nowrap+overflow:hidden，預設 flex-shrink:1 遇到空間不夠時
   還是會被壓縮甚至整個被容器裁掉，這裡鎖住不讓它縮）。 */
/* 年份改用網站主色橘色實色底（--accent，不是 --accent-muted 那種淡橘色調——
   .popout-tag--main 的地區標籤已經在用 --accent-muted，年份用實色 --accent 才會
   跟地區標籤明顯區分開，不是兩個看起來很像的淡色塊）。 */
.popout-tag--year  { color: #fff; background: var(--accent); font-weight: 700; flex-shrink: 0; }

/* 演員／簡介各自獨立一行（不是合併成一段文字），比照參考網站：
   演員固定 1 行，超出寬度用省略號；簡介固定 2 行，超出用省略號。
   前面各自加「演员：」「简介：」label，用比內容淺一階的顏色跟內容區分開。 */
.popout-label { color: var(--text-3); }
.popout-actor {
  margin-top: 10px; font-size: 12px; line-height: 1.6; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.popout-desc {
  margin-top: 4px; font-size: 12px; line-height: 1.7; color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.popout-score { display: flex; align-items: center; gap: 5px; padding: 10px 16px 0; font-size: 12px; color: var(--text-1); }
.popout-score iconify-icon { font-size: 13px; color: #F0B429; }
.popout-score .score-num { font-size: 13px; font-weight: 700; color: #F0B429; }

.popout-bottom { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 16px; }
.popout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: var(--text-1); font-size: 16px;
  transition: background .15s, color .15s;
}
.popout-btn:hover { background: var(--accent); color: #fff; }
.popout-btn:first-child { background: var(--accent); color: #fff; }
.popout-btn:first-child:hover { background: var(--accent-hover); }

/* 平板／手機關掉浮層：觸控裝置沒有「滑鼠停留」這個狀態，瀏覽器會在點擊時合成一次
   :hover 並黏著，結果變成想點進詳情頁卻先跳出浮層擋住畫面。卡片本身仍是連結，
   點擊照樣進詳情頁，功能沒有消失，只是不做這層滑鼠專屬的預覽互動。 */
@media (max-width: 1024px) { .hover-popout { display: none !important; } }
@media (hover: none), (pointer: coarse) { .hover-popout { display: none !important; } }

/* ============================================================
   KB-CAT — 首頁「分类内容+该分类排行榜」區塊（比照 kuaibo8.com 首頁版式）
   每個頂層分類一個區塊：抬頭（圖示/名稱/更多/類型篩選 pill/頁碼)，
   下方左側沿用 .rail 橫向片單、右側固定寬度排行榜面板。
   ============================================================ */
.kb-cat { padding: 20px; background: var(--bg-card); border-radius: var(--radius); }
.kb-cat + .kb-cat, .kb-cat + .mod, .mod + .kb-cat { margin-top: 20px; }
.kb-cat-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.kb-cat-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 20px; font-weight: 700; color: var(--text-1); flex-shrink: 0;
}
.kb-cat-title iconify-icon { color: var(--accent); }
.kb-cat-title a { color: inherit; }
.kb-cat-more {
  font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; transition: color .15s;
}
.kb-cat-more:hover { color: var(--accent); }
/* .kb-cat-pills-wrap 取代舊的 .kb-cat-pills 直接放在 .kb-cat-head 裡的寫法——分類多的
   時候 flex-wrap:wrap 會擠成兩行甚至更多，把整個 head 撐高、跟旁邊的「更多」/翻頁
   計數器對不齊（使用者截圖回報過）。改成單行 + 左右箭頭捲動，視覺上比照
   vod/show.html 篩選列「按鈕點擊翻頁」的呈現方式，箭頭沿用 .rail-arrow 的圓形樣式
   （純視覺共用 class，JS 行為不共用——見下方 kb-pills.js 的獨立實作，不能跟
   rail.js 用同一組 .rail-arrow--prev/--next，否則同一個 .kb-cat-head 裡會有兩組
   同名 class，rail.js 的 section.querySelector 只抓得到第一組，會把翻頁箭頭跟
   影片 rail 的箭頭綁在一起，點擊會同時捲動兩條軌道）。 */
.kb-cat-pills-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.kb-cat-pills {
  display: flex; flex-wrap: nowrap; gap: 8px; min-width: 0;
  overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none;
}
.kb-cat-pills::-webkit-scrollbar { display: none; }
.kb-pills-arrow { width: 24px; height: 24px; font-size: 12px; flex-shrink: 0; }
.kb-pill {
  padding: 5px 14px; border-radius: 16px; font-size: 13px;
  background: var(--bg-elevated); color: var(--text-2); white-space: nowrap;
  transition: .15s;
}
.kb-pill:hover, .kb-pill.is-active { color: #fff; background: var(--accent); }
.kb-cat-nav { margin-left: auto; flex-shrink: 0; }

.kb-cat-body { display: flex; gap: 20px; align-items: flex-start; }
/* 加在 .rail-track 本身上（不是外面另包一層 div）：rail.js 用 track.closest('.rail')
   找外層 section，只要 .kb-cat 這個外層本身也帶 .rail class（見 index/index.html），
   counter/arrows 放在 .kb-cat-head 裡一樣找得到，不需要額外的 wrapper。 */
.kb-cat-rail { flex: 1; min-width: 0; }
.kb-rank-panel {
  flex-shrink: 0; width: 260px;
  background: var(--bg-elevated); border-radius: var(--radius);
  padding: 14px 0;
}
.kb-rank-head {
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700; color: var(--text-1);
}
.kb-rank-head iconify-icon { color: var(--accent); }
@media (max-width: 1024px) {
  .kb-cat-body { flex-direction: column; }
  .kb-rank-panel { width: 100%; }
}
@media (max-width: 767px) {
  .kb-cat { padding: 14px; }
  .kb-cat-pills-wrap { display: none; }
  /* 手機版空間有限，每個分類旁邊的小排行榜面板直接不顯示（完整榜單走首頁下方的
     「排行榜」大區塊／label/rank.html，不是拿掉功能，只是這個縮小版面板在手機
     上不划算）。 */
  .kb-rank-panel { display: none; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-page); border-top: 1px solid var(--border);
  padding: 24px 0; text-align: center;
  color: var(--text-3); font-size: 13px;
}
.site-footer p { margin: 4px 0; line-height: 1.8; }
.site-footer a { color: var(--text-3); transition: color .15s; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 10px 0; }

/* ===== FAB ===== */
.fab-group {
  position: fixed; right: 20px; bottom: 80px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.fab-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.fab-btn:hover { background: var(--fill); border-color: var(--fill); color: #fff; }
.fab-qr-popup {
  display: none; position: fixed; right: 70px; bottom: 120px; z-index: 101;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
  font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-card);
}
.fab-qr-popup img { width: 100px; height: 100px; margin: 8px auto 0; }

/* ===== Mobile tabbar ===== */
.mobile-tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: var(--bg-card);
  border-top: 1px solid var(--border); z-index: 350;
  justify-content: space-around; align-items: center;
}
.mtb-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  font-size: 11px; color: var(--text-3); padding: 6px 0;
  transition: color .15s;
}
.mtb-item iconify-icon { font-size: 22px; }
.mtb-item:hover, .mtb-item.is-active { color: var(--accent); }

/* ===== Auth page (user/login, user/reg — 獨立頁面版本，重用 login-modal-box 樣式) ===== */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--topbar-h)); padding: 40px 16px;
}
.auth-page .login-modal-box { width: 380px; max-width: 100%; }
.auth-page .jump-error { padding: 10px 20px 0; font-size: 13px; color: var(--accent); }

/* ===== Login / Logout Modal ===== */
.login-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 700;
  align-items: center; justify-content: center;
}
.login-modal-overlay.is-open { display: flex; }
.login-modal-box {
  width: 360px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; position: relative;
}
.login-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.login-modal-title { font-size: 16px; font-weight: 700; }
.modal-close-btn { font-size: 20px; color: var(--text-3); }
.login-modal-body { padding: 24px 20px; }
.login-form-group { margin-bottom: 14px; }
.login-form-group label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-form-group input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-1); font-size: 14px; outline: none;
}
.login-form-group input:focus { border-color: var(--accent); }
.login-submit {
  width: 100%; height: 42px;
  background: var(--fill); color: #fff;
  border-radius: var(--radius); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s; border: none;
}
.login-submit:hover { background: var(--fill-hover); }
.login-footer-links { margin-top: 12px; display: flex; justify-content: space-between; font-size: 13px; }
.login-footer-links a { color: var(--text-3); }
.login-footer-links a:hover { color: var(--accent); }

/* ===== Rank Widget ===== */
.rank-home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rank-col { }
.rank-col-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--text-1);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.rank-top-item {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 10px;
}
.rank-top-cover {
  flex-shrink: 0; width: 72px; border-radius: var(--radius);
  overflow: hidden; position: relative; aspect-ratio: 2/3;
  background: var(--bg-elevated);
}
.rank-top-cover img { width: 100%; height: 100%; object-fit: cover; }
.rank-top-crown { position: absolute; top: 4px; left: 4px; font-size: 15px; color: #F0B429; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.rank-top-info { flex: 1; min-width: 0; }
.rank-top-num {
  font-size: 22px; font-weight: 900; line-height: 1;
  color: var(--rank-1); margin-bottom: 4px;
}
.rank-top-name {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-top-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.rank-top-status { font-size: 11px; color: var(--score-mid, #85c13a); margin-top: 2px; }
.rank-top-hits { font-size: 12px; color: var(--accent); margin-top: 5px; display: flex; align-items: center; gap: 3px; }
.rank-list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.rank-list-item:last-child { border-bottom: none; }
.rank-num {
  width: 20px; text-align: center; font-size: 13px; font-weight: 700;
  flex-shrink: 0; color: var(--text-3);
}
.rank-num.is-1 { color: var(--rank-1); }
.rank-num.is-2 { color: var(--rank-2); }
.rank-num.is-3 { color: var(--rank-3); }
.rank-name {
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-name:hover { color: var(--accent); }
.rank-hits { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.rank-more { display: block; text-align: center; font-size: 13px; color: var(--text-3); margin-top: 8px; transition: color .15s; }
.rank-more:hover { color: var(--accent); text-decoration: underline; }
/* sidebar rank — vod/play, vod/detail */
.rank-col-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.rank-col-more { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: auto; transition: color .15s; }
.rank-col-more:hover { color: var(--accent); text-decoration: underline; }
.rank-top1 { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; text-decoration: none; }
.rt1-thumb { flex-shrink: 0; width: 90px; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 2/3; background: var(--bg-elevated); }
.rt1-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt1-crown { position: absolute; top: 4px; left: 4px; font-size: 15px; color: #F0B429; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.rt1-info { flex: 1; min-width: 0; }
.rt1-name { font-size: 13px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 4px; display: block; }
.rt1-meta { font-size: 11px; color: var(--text-3); margin: 0 0 2px; }
.rt1-status { font-size: 11px; color: var(--score-mid, #85c13a); margin: 0 0 4px; }
.rt1-hits { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 3px; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-li { border-bottom: 1px solid var(--border); }
.rank-li:last-child { border-bottom: none; }
.rank-li-inner { display: flex; align-items: center; gap: 8px; padding: 6px 0; text-decoration: none; }
.rl-num { width: 20px; text-align: center; font-size: 13px; font-weight: 700; flex-shrink: 0; color: var(--text-3); }
.rl-num--gold { color: var(--rank-1, #f5a623); }
.rl-num--silver { color: var(--rank-2, #9e9e9e); }
.rl-num--bronze { color: var(--rank-3, #cd7f32); }
.rl-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.rank-li-inner:hover .rl-name { color: var(--accent); }
.rl-hits { font-size: 12px; color: var(--text-3); flex-shrink: 0; }

/* ===== Art card ===== */
.art-home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
.art-card { display: flex; gap: 10px; align-items: flex-start; }
.art-card-cover { flex-shrink: 0; width: 80px; height: 54px; border-radius: var(--radius); overflow: hidden; background: var(--bg-elevated); }
.art-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.art-card-info { flex: 1; min-width: 0; }
.art-card-title {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.art-card-title:hover { color: var(--accent); }
.art-card-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ===== Topic card ===== */
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.topic-card { display: block; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--bg-card); transition: transform .2s; }
.topic-card:hover { transform: translateY(-2px); }
.topic-card-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.topic-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.topic-card:hover .topic-card-thumb img { transform: scale(1.05); }
.topic-card-name {
  padding: 8px 10px 0;
  font-size: 13px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s;
}
.topic-card:hover .topic-card-name { color: var(--accent); }
/* 縮圖左上角常駐播放圖示（不是 hover 才出現），比照參考網站 kuaibo8.com 首頁專題卡片 */
/* 演員縮圖堆疊：topic/detail.html 的 hero 資訊列＋topic/index.html／首頁專題卡片
   縮圖裡的迷你版都共用這組 base class（放 main.css 而不是 topic_detail.css，
   因為不是每個用到它的頁面都有載入 topic_detail.css）。 */
.td-cast-stack { display: flex; align-items: center; }
.td-cast-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-elevated); border: 2px solid var(--bg-body);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 15px; margin-left: -8px;
}
.td-cast-avatar:first-child { margin-left: 0; }

.topic-card-play {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.topic-card-meta { padding: 4px 10px 10px; font-size: 12px; color: var(--text-3); }
.sidebar-topic-grid { display: flex; flex-direction: column; gap: 10px; }
.topic-card-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .2s; font-size: 24px; color: #fff; }
.topic-card:hover .topic-card-overlay { opacity: 1; }
.topic-card-count { position: absolute; bottom: 6px; right: 6px; font-size: 11px; color: #fff; background: rgba(0,0,0,.65); padding: 2px 6px; border-radius: 3px; }
.topic-card-body { padding: 6px 10px; }
.topic-card-title { font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; transition: color .15s; }
.topic-card:hover .topic-card-title { color: var(--accent); }

/* ===== Actor card ===== */
.actor-card { text-align: center; }
.actor-card-cover {
  border-radius: 50%; overflow: hidden; aspect-ratio: 1/1;
  background: var(--bg-elevated); margin-bottom: 6px;
}
.actor-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.actor-card-name { font-size: 13px; color: var(--text-1); }

/* ===== Comment ===== */
.comment-form { margin-bottom: 20px; }
.comment-form textarea {
  width: 100%; height: 80px; padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-1); font-size: 14px;
  resize: vertical; outline: none;
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-submit {
  margin-top: 8px; padding: 8px 24px;
  background: var(--fill); color: #fff; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.comment-submit:hover { background: var(--fill-hover); }
.comment-list { }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.comment-text { font-size: 14px; color: var(--text-2); line-height: 1.7; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; color: var(--text-2); transition: .15s;
}
.page-btn:hover { color: var(--accent); border-color: var(--accent); }
.page-btn.cur { background: var(--fill); border-color: var(--fill); color: #fff; font-weight: 700; }

/* ===== Content-block animate ===== */
.content-block.will-observe { opacity: 0; transform: translateY(16px); transition: opacity .4s ease, transform .4s ease; }
.content-block.will-observe.is-visible { opacity: 1; transform: none; }

/* ===== Utility ===== */
.ellipsis-1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.clearfix::after { content: ""; display: table; clear: both; }
.shadow { box-shadow: var(--shadow-card); }
.color-9 { color: var(--text-3); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ===== Responsive =====
   tp17 沒有側欄（--sidebar-w 固定 0px，見 :root），這裡不用再像 tp13 那樣在斷點裡
   覆寫 --sidebar-w／關 .side-nav。 */
@media (max-width: 1024px) {
  :root { --container-w: 100%; }
  .dk-nav-links { display: none; }
  .rank-home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  :root { --topbar-h: 54px; }
  .dk-search { display: none; }
  .dk-actions .dk-action-btn { display: none; }
  #searchToggle { display: flex !important; }
  /* .dk-search 是 display:none 之後就不在版面裡了，原本頂著它的 margin-left:auto
     也跟著消失，.dk-actions（現在只剩放大鏡）會貼著「全部」按鈕，不會貼到最右邊。
     這裡直接把 margin-left:auto 補回 .dk-actions 身上，讓放大鏡自己頂到右側。 */
  .dk-actions { margin-left: auto; }
  .dk-hero { flex-direction: column; height: auto; padding: 10px 12px 0; }
  .dk-hero-slides { height: 210px; flex: none; border-radius: 8px; }
  .dk-hero-panel { display: none; }
  /* 手機版 banner 只留圖，文字/按鈕都藏起來，整張圖點擊直接跳轉（heroTap，見 §28） */
  .hero-badges, .hero-title, .hero-meta, .hero-btns { display: none; }
  .hero-slide { cursor: pointer; }
  .mobile-tabbar { display: flex; }
  .page-content { padding-bottom: 56px; }
  .video-film-list { grid-template-columns: repeat(3, 1fr); gap: 10px 8px; }
  .rank-home-grid { grid-template-columns: repeat(2, 1fr); }
  .art-home-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { flex-direction: column; }
  .mian-sidebar { width: 100%; }
  .main-inner { max-width: calc(100vw - 32px); }
  .detail-main { flex-direction: column; }
  .detail-main-left { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .detail-main-left .cover { width: 160px; }
  .detail-main-right { width: 100%; }
  /* 手機版放棄橫向捲動＋flex-basis 那一套算法，改用跟 .video-film-list 完全一樣、
     全站已經驗證過穩定的 CSS Grid 三欄寫法（見 tp13_dark_black 同一個 class 的手機版
     斷點，數值都是照抄）。連續兩次用 flex:0 0 calc()／再疊 width 明寫都沒有解決
     「一行變 1 張」的問題（使用者截圖回報過兩次），與其繼續在 flex-basis 這條路上猜，
     不如直接换成已經反覆證明可靠的 Grid 版型——Grid 的欄寬是由 grid-template-columns
     直接决定，不像 flex-basis 需要看容器怎麼分配剩餘空間，這裡沒有「算不出正確寬度」
     這一步。橫向翻頁箭頭在手機版本來就不好用（觸控滑動比按小箭頭直覺），改成滿版換行
     也同時解決了那個 UX 問題，不是純粹繞過 bug。 */
  .rail-track {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px;
    overflow-x: visible; overflow-y: visible;
    padding: 0; margin: 0;
  }
  .rail-card { position: relative; flex: none; width: auto; scroll-snap-align: none; }
  /* 橫向翻頁計數/箭頭在網格版型下沒有意義（已經不是橫向捲動），跟著隱藏；
     rail.js 找不到 .rail-arrow 也不會報錯（都已經是 if(btn) 防呆寫法）。 */
  .kb-cat-nav { display: none; }
}
@media (max-width: 480px) {
  .video-film-list { grid-template-columns: repeat(3, 1fr); }
  .art-home-grid, .topic-grid { grid-template-columns: 1fr; }
  .rank-home-grid { grid-template-columns: 1fr; }
  .rank-top-cover { width: 110px; }
  .rank-top-name { font-size: 14px; }
  .hm-card { flex: 0 0 calc((100% - 20px) / 3); }
}

/* ===== 資訊列表 art/type ===== */
.art-list { display: flex; flex-direction: column; }
.art-list-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.art-list-item:last-child { border-bottom: none; }
.ali-thumb { flex-shrink: 0; width: 140px; }
.ali-thumb a { display: block; }
.ali-thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.ali-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ali-title { font-size: 15px; font-weight: 700; color: var(--text-1); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ali-title:hover { color: var(--accent); }
.ali-desc { font-size: 13px; color: var(--text-2); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.ali-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); }
.ali-meta iconify-icon { font-size: 13px; vertical-align: -2px; }
@media (max-width: 480px) {
  .ali-thumb { width: 100px; }
  .ali-title { font-size: 13px; }
}

/* ===== 廣告區塊 ===== */
.site-ad {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.site-ad::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--fill);
}
.site-ad--sidebar { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 18px; text-align: left; }
.site-ad--sidebar .site-ad-body { flex: 1; min-width: 0; }
.site-ad-label { display: inline-block; font-size: 9px; color: var(--fill); margin-bottom: 2px; letter-spacing: 1px; text-transform: uppercase; }
.site-ad-title { font-size: 13px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.site-ad-desc { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.site-ad-btn { display: inline-flex; align-items: center; flex-shrink: 0; padding: 5px 12px; background: var(--fill); color: #fff; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap; transition: .18s; text-decoration: none; }
.site-ad-btn:hover { opacity: 0.85; color: #fff; }
