﻿:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "Noto Sans TC", system-ui, sans-serif;
  background: #0b0b0b;
  color: #eee;
  /* 公告列目前的實際高度，由 JS 量測後寫入；沒開公告列時是 0px，
     app-shell 與 side-menu 的位移算式才不用另外判斷「有沒有公告列」。 */
  --announcement-h: 0px;
  /* 首頁資訊卡最小寬度：admin 後台總覽可設「放大比例」1x~4x（見 app.js
     applyHomeCardScale()），220px 是原本沒有這個設定時的預設值。卡片變大時
     .work-grid 同一列能塞的欄數變少，連帶讓 estimateInitialWorkCount() 算出的
     首頁初次抓取筆數變少，降低 R2 封面讀取次數。 */
  --work-card-min-width: 220px;
  /* 卡片放大時，下面標題／meta 文字也跟著放大一點（不是等比例，避免 4x 時
     文字大到跟縮圖不成比例），三個都是原本固定值的預設，見 applyHomeCardScale()。 */
  --work-title-size: 16px;
  --work-meta-size: 13px;
  --work-submeta-size: 12px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #0b0b0b; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: 52px;
  /* 要比選單遮罩（1099）高，不然選單開著時遮罩會蓋住漢堡鈕，
     沒辦法直接再點一次收回選單，只能點遮罩空白處關掉。 */
  z-index: 1101;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: rgba(20,20,20,.97);
  border-bottom: 1px solid #282828;
  backdrop-filter: blur(10px);
}
.hamburger-btn { flex: 0 0 auto; padding: 9px; }
.hamburger-icon, .hamburger-icon::before, .hamburger-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: #eee;
}
.hamburger-icon { position: relative; }
.hamburger-icon::before, .hamburger-icon::after { content: ""; position: absolute; left: 0; }
.hamburger-icon::before { top: -6px; }
.hamburger-icon::after { top: 6px; }
.brand {
  display: flex;
  flex: 0 0 auto;
  height: 38px;
  align-items: center;
  text-decoration: none;
}
.brand img { display: block; width: auto; max-width: 156px; max-height: 38px; object-fit: contain; }
.brand:hover img { filter: brightness(1.12); }
.search-form { flex: 1; max-width: 430px; }
.search-form input {
  width: 100%;
  border: 1px solid #383838;
  border-radius: 18px;
  padding: 7px 13px;
  color: #eee;
  background: #0f0f0f;
  outline: none;
}
.search-form input:focus { border-color: #6cf; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.top-button, .action-button, .dialog button, .comment-form button {
  border: 1px solid #444;
  border-radius: 18px;
  padding: 7px 13px;
  color: #eee;
  background: #242424;
}
.top-button:hover, .action-button:hover, .dialog button:hover, .comment-form button:hover {
  background: #333;
}

/* 左側抽屜選單：收藏／繼續觀看／觀看紀錄／訂閱以前擠在頂欄，現在收進漢堡選單裡。
   遮罩只負責「點外面關掉」，不用把畫面變暗——透明就好。 */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1099;
  background: transparent;
}
.side-menu {
  position: fixed;
  top: calc(52px + var(--announcement-h, 0px));
  left: 0;
  z-index: 1100;
  width: 240px;
  max-width: 80vw;
  height: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #161616;
  border-right: 1px solid #282828;
  border-bottom: 1px solid #282828;
  border-bottom-right-radius: 10px;
  box-shadow: 4px 6px 18px rgba(0,0,0,.4);
  transform: translateX(-100%);
  transition: transform .2s ease;
}
.side-menu.is-open { transform: translateX(0); }

/* 公告列：介紹網站用，固定在頂欄下方；收起時走「收入選單」而不是永久關掉——
   狀態存在 localStorage，之後可從 side-menu 的「顯示公告」按鈕再打開。
   高度會因文字換行而變動，所以用 --announcement-h（JS 量測寫入）而不是寫死數字，
   app-shell 的內距與 side-menu 的 top 都用同一個變數，兩邊才不會跟公告列重疊。 */
.announcement-bar {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 1080;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 16px 12px;
  background: linear-gradient(90deg, #142a3f 0%, #1c3c58 55%, #16324c 100%);
  border-bottom: 1px solid #2c5378;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
/* .announcement-bar 自己訂了 display:flex，跟瀏覽器內建的 [hidden]{display:none}
   規則同層級時，作者樣式會贏，所以沒有這條的話 hidden 屬性會被蓋掉、公告列關不掉。 */
.announcement-bar[hidden] { display: none; }

.announcement-text { flex: 1 1 auto; min-width: 0; }

.announcement-headline {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #eef6ff;
  letter-spacing: .1px;
}
.announcement-headline strong { color: #86d1ff; font-weight: 800; letter-spacing: .3px; }
.announcement-headline em { font-style: normal; color: #a9d4f2; font-weight: 500; }

.announcement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.announcement-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 3.5px 10px;
  border-radius: 999px;
  background: rgba(134, 209, 255, .1);
  border: 1px solid rgba(134, 209, 255, .32);
  color: #cfe9ff;
  white-space: nowrap;
  letter-spacing: .15px;
}
.announcement-tag .announcement-tag-dot { color: #7ec8ff; font-size: 9px; }

.announcement-hide-btn {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 4px 9px;
  border-radius: 999px;
  opacity: .75;
  transition: opacity .15s ease, background-color .15s ease;
}
.announcement-hide-btn:hover { opacity: 1; background: rgba(255, 255, 255, .08); }

@media (max-width: 520px) {
  .announcement-headline { font-size: 13px; }
  .announcement-tag { font-size: 11px; padding: 3px 8px; }
}

/* 進站幾秒後才彈出的加到主畫面提示：固定在底部，不擋內容，可關閉。
   z-index 比 side-menu(1100) 低但比一般內容高，避免被選單蓋住時互相搶焦點。 */
.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1090;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 12px;
  background: #161616;
  border: 1px solid #282828;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  transform: translateY(120%);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
}
.install-banner.is-open { transform: translateY(0); opacity: 1; }
.install-banner-icon { width: 36px; height: 36px; border-radius: 9px; flex: 0 0 auto; }
.install-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.install-banner-text strong { font-size: 14px; }
.install-banner-text span { font-size: 12.5px; color: #999; }
/* 「不再提示」：永久拒絕，刻意做成不搶眼的文字連結，主要動作還是「安裝」／✕。 */
.install-banner-never { align-self: flex-start; margin-top: 2px; padding: 0; border: 0; background: none;
  color: #777; font-size: 12px; text-decoration: underline; cursor: pointer; }
.install-banner-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.install-banner-actions .action-button { padding: 6px 12px; }
.install-banner-actions .icon-only { padding: 6px 9px; }
.side-menu-item {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  text-align: left;
  color: #eee;
  background: none;
  font-size: 15px;
}
.side-menu-item:hover { background: #262626; }

.app-shell { max-width: 1180px; margin: 0 auto; padding: calc(76px + var(--announcement-h, 0px)) 18px 36px; }
.loading, .empty, .error-panel { padding: 48px 0; color: #aaa; text-align: center; }
.page-title { margin: 0 0 18px; font-size: clamp(22px, 4vw, 32px); }
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--work-card-min-width, 220px), 1fr));
  gap: 22px 16px;
}
.work-card { min-width: 0; }
/* 未公開／封存：縮圖不再加外框（之前只有未公開會有黃框、其他沒有，看起來很怪），
   一律只靠縮圖下面 .work-flag 文字標示，見下面 .work-flag.unlisted / .work-flag.archived。 */
.work-card.is-archived .cover-wrap { outline: 1px solid #4d4d4d; outline-offset: -4px; }
.work-flag {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px;
  font-size: 11px; line-height: 17px; vertical-align: 1px;
}
.work-flag.unlisted { color: #d8b040; border: 1px solid #8a7220; }
.work-flag.archived { color: #bbb; border: 1px solid #4d4d4d; }
.work-link { display: block; color: inherit; text-decoration: none; }
.cover-wrap { aspect-ratio: 16/9; overflow: hidden; border-radius: 9px; background: #171717; }
.work-cover { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.work-link:hover .work-cover { transform: scale(1.025); }
/* 「資訊卡也套用濾鏡效果」開關（admin 後台總覽，跟 image_filter_mode 同一組設定）。
   --vp-img-filter 這個變數在 player.css 依目前濾鏡模式設在 <html> 上，這裡開關打開
   （<html data-img-filter-cards>）才會讓作品卡封面也吃同一個濾鏡；沒開就是原圖，
   跟以前一樣。見 app.js applyImageFilterSettings()。 */
html[data-img-filter-cards] .work-cover { filter: var(--vp-img-filter, none); }
/* 縮圖鉤子（migrations/0055）：2026-10-02 使用者要求改成直接疊在封面圖上——貼齊封面
   底部，底下墊一層由透明到黑的漸層讓白字在任何圖上都看得清楚；右側留空給時長徽章，
   最多兩行。不吃滑鼠事件，點擊照樣落到整張卡的連結。 */
.work-hook { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0;
  /* 2026-10-21：底部留白改用透明 border——overflow:hidden 只裁到 padding 外緣，
     原本 padding-bottom 讓被 clamp 掉的下一行露出半截；border 外面就會被裁掉。 */
  padding: 28px 56px 0 10px; border-bottom: 9px solid transparent; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.78)) border-box;
  /* 2026-10-02 使用者要求：字大一點、換顏色；不額外下載字型，只用各平台內建的粗黑體
     （Windows 微軟正黑體、Mac/iOS 蘋方、Android 思源黑體）。顏色用暖金色＋黑色描邊，
     在任何封面上都跳得出來；要換色只改 --work-hook-color。 */
  color: var(--work-hook-color, #ffd54a);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans CJK TC", "Noto Sans TC", "Heiti TC", sans-serif;
  font-weight: 900; font-size: var(--work-hook-size, 17px); line-height: 1.3; letter-spacing: .5px;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 6px rgba(0,0,0,.9);
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }
.work-hook[hidden] { display: none; }
.work-duration, .work-progress, .work-adult-badge, .work-status-badge { z-index: 2; }
/* 2026-10-25：卡片標題調暗一點（241）、觀看次數那列灰字改 133，降低對比。 */
.work-title { margin: 9px 0 4px; font-size: var(--work-title-size, 16px); line-height: 1.4; color: rgb(241, 241, 241); }
.work-meta { margin: 0; color: #929292; font-size: var(--work-meta-size, 13px); }
.work-submeta { margin: 2px 0 0; color: rgb(133, 133, 133); font-size: var(--work-submeta-size, 12px); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-slug { color: rgb(133, 133, 133); }
/* 縮圖右下角時長徽章 + 底部紅色觀看進度條，跟 player_server 的卡片一致。 */
.cover-wrap { position: relative; }
.work-duration {
  position: absolute; right: 6px; bottom: 6px; padding: 0 5px; border-radius: 4px;
  background: rgba(0, 0, 0, .78); color: #fff; font-size: 12px; line-height: 18px;
}
/* 18+ 作品縮圖左上角角標，只是分級提醒；播放頁不重複顯示。 */
.work-adult-badge {
  position: absolute; left: 6px; top: 6px; padding: 0 5px; border-radius: 4px;
  background: rgba(227, 51, 51, .9); color: #fff; font-size: 12px; line-height: 18px;
  font-weight: 600;
}
.work-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255, 255, 255, .25);
}
/* 首頁「訂閱／繼續觀看」混合列表：縮圖右上角標一個小角標，區分這部作品是
   訂閱頻道／系列的更新，還是使用者看到一半的紀錄。 */
.work-status-badge {
  position: absolute; right: 6px; top: 6px; padding: 0 5px; border-radius: 4px;
  background: rgba(30, 30, 30, .82); color: #6cf; font-size: 12px; line-height: 18px;
  font-weight: 600;
}
.work-progress > span { display: block; height: 100%; background: #e33; }

.home-carousel .section-title { margin-top: 0; }
.home-carousel + .home-carousel .section-title { margin-top: 26px; }
.carousel-wrap { position: relative; }
.carousel-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.carousel-row::-webkit-scrollbar { display: none; }
.carousel-row .work-card { width: 220px; flex: 0 0 220px; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  line-height: 34px;
  padding: 0;
  background: rgba(11, 11, 11, .55);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.carousel-wrap:hover .carousel-arrow { opacity: 1; pointer-events: auto; }
.carousel-arrow-left { left: 6px; }
.carousel-arrow-right { right: 6px; }

.player-page { display: grid; grid-template-columns: minmax(0, 680px) minmax(240px, 1fr); gap: 26px; align-items: start; }
.player-column { min-width: 0; }
/* 劇院模式：影片撐滿瀏覽器寬度，留言搬到下面——跟窄螢幕自動改成單欄是同一招
   （見下面 860px 那個 media query），這裡直接沿用同一組屬性，差別只是觸發條件
   從「螢幕夠窄」換成「使用者自己按了劇院模式」。app-shell 平常的 1180px 上限
   在劇院模式下也要拿掉，不然影片撐不滿瀏覽器寬度。 */
.app-shell.theater-active { max-width: none; }
.app-shell.theater-active .player-page { display: block; }
.app-shell.theater-active .side-panel { margin-top: 28px; padding-left: 0; border-left: 0; border-top: 1px solid #242424; padding-top: 20px; }
#player_dock { width: 100%; }
.work-heading { margin: 16px 0 7px; font-size: 24px; }
.work-description { color: #bbb; line-height: 1.7; white-space: pre-wrap; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.action-button.active { border-color: #6cf; color: #6cf; background: #203243; }
.donate-button {
  display: inline-block;
  text-decoration: none;
  border-color: #e6a23c;
  color: #ffcf8a;
}
.donate-button:hover { background: #3a2c12; }
.side-panel { border-left: 1px solid #242424; padding-left: 22px; }
.side-panel h3 { margin-top: 0; }
.comments-heading { display: flex; align-items: baseline; gap: 10px; }

.comment-form { display: flex; gap: 8px; margin-bottom: 14px; }
/* .comment-form 自己訂了 display:flex，跟 [hidden] 的 UA 樣式 specificity 打平時
   author 樣式會贏，不補這條的話 hidden=true 的表單（例如討論串「留言」按鈕
   展開前）還是會被畫出來——跟上面 .announcement-bar[hidden] 是同一個問題。 */
.comment-form[hidden] { display: none; }
.comment-form textarea {
  flex: 1;
  min-height: 46px;
  resize: vertical;
  border: 1px solid #3b3b3b;
  border-radius: 7px;
  padding: 9px;
  color: #eee;
  background: #101010;
}
.comments-toggle-hidden { background: none; border: 0; padding: 0; color: #888; font-size: 12px; }
.comments-toggle-hidden:hover { color: #bbb; text-decoration: underline; }
.comment { padding: 11px 0; border-bottom: 1px solid #222; }
.comment-is-hidden { opacity: .55; }
.comment-head { display: flex; gap: 8px; align-items: center; color: #888; font-size: 12px; }
.comment-name { color: #ddd; font-weight: 700; }
.comment-hidden-tag { color: #d99; border: 1px solid #533; border-radius: 3px; padding: 1px 5px; font-size: 11px; }
.comment-text { margin: 5px 0 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { margin-left: auto; display: flex; gap: 6px; }
.comment-hide, .comment-delete { border: 0; color: #aaa; background: transparent; }
.comment-timestamp { color: #4ea8ff; text-decoration: none; font-variant-numeric: tabular-nums; }
.comment-timestamp:hover { text-decoration: underline; }
.comment-reply-tag { color: #6cf; border: 1px solid #234; border-radius: 3px; padding: 1px 5px; font-size: 11px; }
.comment-reply-toggle { background: none; border: 0; padding: 0; margin-top: 4px; color: #888; font-size: 12px; cursor: pointer; }
.comment-reply-toggle:hover { color: #bbb; text-decoration: underline; }
.comment-reply-form { margin: 8px 0 0 20px; }

/* 討論區：跟單一作品留言共用 .comment-form/.comment-head/.comment-text 等樣式，
   這裡只補分類標籤、列表、串頁跟巢狀展開/收合需要的額外樣式。 */
.discussion-type-tag {
  display: inline-block;
  border: 1px solid #3b3b3b;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  color: #bbb;
  margin-right: 8px;
}
.discussion-type-discussion { border-color: #2d5a8c; color: #7ec2ff; }
.discussion-type-chat { border-color: #4a7a4a; color: #9fdf9f; }
.discussion-type-bug { border-color: #8c3d2d; color: #ff9a7e; }
.discussion-type-suggestion { border-color: #8c7a2d; color: #ffdd7e; }
.discussion-type-review { border-color: #6a2d8c; color: #d99aff; }

.discussion-new-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; margin: 12px 0 20px; }
.discussion-new-form[hidden] { display: none; }
.discussion-new-form select {
  align-self: flex-start;
  border: 1px solid #3b3b3b;
  border-radius: 6px;
  padding: 6px 9px;
  color: #eee;
  background: #101010;
}
.discussion-new-form input,
.discussion-new-form textarea {
  border: 1px solid #3b3b3b;
  border-radius: 7px;
  padding: 9px;
  color: #eee;
  background: #101010;
}
.discussion-new-form textarea { min-height: 90px; resize: vertical; }

.discussion-type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.discussion-type-tab {
  display: inline-block;
  border: 1px solid #3b3b3b;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 13px;
  color: #bbb;
  text-decoration: none;
}
.discussion-type-tab:hover { color: #eee; border-color: #555; }
.discussion-type-tab.active { color: #eee; border-color: #6cf; background: #16222c; }

.discussion-list { display: flex; flex-direction: column; max-width: 760px; }
.discussion-post { padding: 16px 0; }
.discussion-post .comment-text { margin-top: 8px; }

.discussion-back { display: inline-block; margin-bottom: 14px; }
.discussion-reply-root {
  border-left: 2px solid #3b3b3b;
  padding-left: 14px;
  margin-bottom: 6px;
}

.discussion-reply { padding: 11px 0; border-bottom: 1px solid #222; }
.discussion-expand-toggle {
  background: none;
  border: 0;
  padding: 0;
  margin: 2px 0 8px;
  color: #6cf;
  font-size: 12px;
  cursor: pointer;
  display: block;
}
.discussion-expand-toggle:hover { text-decoration: underline; }
.discussion-reply-children { border-left: 1px solid #242424; padding-left: 12px; }

.dialog {
  width: min(430px, calc(100vw - 32px));
  border: 1px solid #444;
  border-radius: 12px;
  padding: 22px;
  color: #eee;
  background: #191919;
}
.dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog h2 { margin: 0 0 16px; }
.dialog label { display: block; margin: 11px 0; color: #bbb; font-size: 13px; }
.dialog input { display: block; width: 100%; margin-top: 5px; border: 1px solid #444; border-radius: 6px; padding: 9px; color: #eee; background: #101010; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 16px; }
/* 內容分級四個選項：直排、等寬，目前選的那個加框。 */
.age-dialog-actions { flex-direction: column; align-items: stretch; }
.age-dialog-actions button { text-align: left; }
.age-dialog-actions button.is-current { outline: 2px solid #6cf; outline-offset: -2px; }
.icon-button { border: 0 !important; font-size: 24px; background: transparent !important; }
.form-error { min-height: 20px; color: #f77; font-size: 13px; }

@media (max-width: 860px) {
  .player-page { display: block; }
  .side-panel { margin-top: 28px; padding-left: 0; border-left: 0; border-top: 1px solid #242424; padding-top: 20px; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { height: 32px; }
  .brand img { max-width: 112px; max-height: 32px; }
  #favorites_btn { display: none; }
  .top-button { padding-inline: 9px; }
  .app-shell { padding-inline: 12px; }
  /* 2026-10-23：手機改 1 欄。2 欄時每張卡只剩 ~178px 寬，疊在封面上的縮圖鉤子
     （17px、最多 3 行＋上方漸層）幾乎蓋滿整張縮圖；estimateInitialWorkCount 在這個
     寬度本來就是算 1 欄。 */
  .work-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* ---------------------------------------------- 頻道 / 系列 / 個人資料 */
.entity-header { margin-bottom: 22px; }
.entity-banner {
  height: clamp(110px, 20vw, 210px);
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  margin-bottom: 14px;
}
.entity-bar { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.entity-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: #1c1c1c;
  flex: none;
}
.entity-info { min-width: 0; flex: 1; }
.entity-info .page-title { margin: 0 0 6px; }
.entity-meta { margin: 0 0 4px; color: #999; font-size: 14px; }
.entity-desc { margin: 8px 0 0; color: #bbb; white-space: pre-wrap; }
.entity-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.subscribe-button.active { border-color: #6cf; color: #6cf; }

.section-title { margin: 26px 0 10px; font-size: 16px; color: #ddd; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  border: 1px solid #383838;
  border-radius: 16px;
  padding: 5px 13px;
  color: #ccc;
  text-decoration: none;
  font-size: 13.5px;
  background: #161616;
}
a.chip:hover { border-color: #6cf; color: #6cf; }

.meta-link { color: #9cf; text-decoration: none; }
.meta-link:hover { text-decoration: underline; }

.profile-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #141414;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
/* 頭像 + 旁邊「變更」按鈕：可以點按鈕選檔，也可以直接把圖片拖進頭像換掉。 */
.avatar-edit-wrap {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 50%;
}
.avatar-edit-wrap.drag-over .entity-avatar { outline: 2px dashed #6cf; outline-offset: 3px; }
.avatar-change-btn {
  border: 1px solid #383838;
  border-radius: 16px;
  padding: 5px 13px;
  color: #ccc;
  background: #161616;
  font-size: 13px;
  cursor: pointer;
}
.avatar-change-btn:hover { border-color: #6cf; color: #6cf; }

/* 頻道編輯表單裡頭像／橫幅那兩列：縮圖（沒設定就不顯示）＋選檔案＋刪除鈕。 */
.image-edit-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px; border-radius: 8px; }
.image-edit-field.drag-over { outline: 2px dashed #6cf; outline-offset: 3px; }
.image-edit-preview { background: #1c1c1c; object-fit: cover; flex: none; }
.image-edit-preview.is-avatar { width: 56px; height: 56px; border-radius: 50%; }
.image-edit-preview.is-banner { width: 128px; height: 40px; border-radius: 6px; }
.image-edit-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.image-remove-btn {
  border: 1px solid #383838;
  border-radius: 16px;
  padding: 5px 13px;
  color: #f77;
  background: #161616;
  font-size: 13px;
  cursor: pointer;
}
.image-remove-btn:hover { border-color: #f77; }

.inline-editor {
  display: grid;
  gap: 12px;
  max-width: 520px;
  background: #141414;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.inline-editor .field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #999; }
.inline-editor .checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #eee;
}
.inline-editor .checkbox-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: #6cf; }
.inline-editor input[type="text"], .inline-editor input:not([type]), .inline-editor textarea,
.inline-editor select {
  border: 1px solid #383838;
  border-radius: 8px;
  padding: 7px 11px;
  background: #0f0f0f;
  color: #eee;
  outline: none;
  font: inherit;
}
.inline-editor textarea { min-height: 84px; resize: vertical; }
.inline-editor input:focus, .inline-editor textarea:focus, .inline-editor select:focus { border-color: #6cf; }
.inline-editor button { justify-self: start; }
.voice-file-list { display: grid; gap: 10px; }
.voice-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}
.voice-drop-zone {
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px dashed #505050;
  border-radius: 10px;
  padding: 11px 13px;
  background: #111;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.voice-drop-zone:hover { border-color: #777; background: #151515; }
.voice-drop-zone:focus,
.voice-drop-zone:focus-within {
  outline: none;
  border-color: #6cf;
  box-shadow: 0 0 0 3px rgba(102, 204, 255, .16);
}
.voice-drop-zone.is-dragging {
  border-color: #6cf;
  background: rgba(102, 204, 255, .1);
}
.voice-drop-title { color: #eee; font-size: 14px; }
.voice-drop-detail {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #999;
  font-size: 12px;
}
.voice-drop-detail.pending { color: #8ddcff; }
.voice-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.voice-file-state { color: #888; font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) {
  .voice-file-row { grid-template-columns: 1fr auto; }
  .voice-drop-zone { grid-column: 1 / -1; }
}

/* ---------------------------------------------- 帳號頭像選單 */
.notif-wrap { position: relative; }
.top-button.icon-only { position: relative; padding: 7px 10px; font-size: 16px; line-height: 1; }
.notif-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  min-width: 280px;
  max-width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: #191919;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 8px;
  z-index: 20;
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: #e33;
  color: #fff;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
}
.notif-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: #eee;
  font: inherit;
}
.notif-item:hover { background: #242424; }
.notif-item.unread { background: #1c2733; }
.notif-item.unread:hover { background: #223244; }
.notif-item strong { font-size: 13px; }
.notif-body { color: #999; font-size: 12.5px; }
.notif-time { color: #666; font-size: 11px; }
.notif-mark-all {
  display: block;
  width: 100%;
  margin-top: 4px;
  background: transparent;
  border: none;
  color: #9cf;
  font-size: 12px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: center;
}
.notif-mark-all:hover { text-decoration: underline; }

.account-menu-wrap { position: relative; }
.avatar-button {
  border: 1px solid #444;
  background: transparent;
  border-radius: 50%;
  padding: 2px;
  line-height: 0;
}
.avatar-button:hover, .avatar-button[aria-expanded="true"] { border-color: #6cf; }
.avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
  display: block;
}
.avatar-img.lg { width: 46px; height: 46px; }

.account-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 286px;
  background: #191919;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,.6);
  z-index: 1200;
  overflow: hidden;
}
.account-menu-head {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid #2a2a2a;
}
.account-menu-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-menu-id strong { color: #fff; font-size: 14px; }
.account-menu-id span {
  color: #999;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-tag {
  align-self: flex-start;
  border: 1px solid #3a3a3a;
  border-radius: 9px;
  padding: 0 7px;
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}
.role-tag.admin { border-color: #f6a; color: #f6a; }
.role-tag.moderator { border-color: #6cf; color: #6cf; }

.account-menu-others:not(:empty) { border-bottom: 1px solid #2a2a2a; padding: 6px 0; }
.account-menu-label { color: #777; font-size: 11.5px; padding: 4px 14px 6px; }
.account-row { display: flex; align-items: center; }
.account-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  border: none;
  color: #ddd;
  padding: 7px 14px;
  text-align: left;
}
.account-pick:hover { background: #242424; }
.account-pick-text { min-width: 0; display: flex; flex-direction: column; }
.account-pick-text strong { font-size: 13px; color: #eee; }
.account-pick-text span {
  font-size: 11.5px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-remove {
  border: none;
  background: transparent;
  color: #777;
  font-size: 17px;
  padding: 0 12px;
  align-self: stretch;
}
.account-remove:hover { color: #f88; background: #241a1a; }

.account-menu-list { padding: 6px 0; display: flex; flex-direction: column; }
.menu-item {
  border: none;
  background: transparent;
  color: #ddd;
  text-align: left;
  padding: 9px 14px;
  font-size: 13.5px;
  text-decoration: none;
  display: block;
}
.menu-item:hover { background: #242424; }
/* .menu-item 的 display:block 跟 [hidden] 的 UA 樣式 specificity 打平時，author
   樣式一律贏過 UA 樣式，所以單靠 hidden attribute 蓋不掉這條規則，要另外補上。 */
.menu-item[hidden] { display: none; }
.menu-badge { color: #e33; font-size: 9px; margin-left: 6px; vertical-align: middle; }
.menu-item.danger { color: #f99; }
.menu-item.danger:hover { background: #2a1c1c; }

.auth-hint {
  margin: 0 0 4px;
  color: #9cf;
  font-size: 12.5px;
}
.form-error.ok { color: #7d9; }
.auth-divider { text-align: center; color: #777; font-size: 12px; margin: 14px 0 8px; }
/* 按鈕本體是 Google 在 iframe 裡畫的白底黑字（theme: outline），那塊白色是要的。
   問題在 GIS 會在按鈕外面再包一層自帶白底的 wrapper（class 名是會變動的
   hash，例如 .S9gUrf-YoZ4jf），而且底色是行內樣式，一般選擇器壓不過去——
   所以這裡對 container 底下所有非按鈕的層級一律 !important 壓成透明。
   真正的按鈕帶 role="button"（.nsm7Bb-HzV7m-LgbsSe），排除掉不要動到。 */
.google-signin-container {
  display: flex;
  justify-content: center;
  background: transparent !important;
}
.google-signin-container div:not([role="button"]),
.google-signin-container > div,
.google-signin-container iframe {
  background: transparent !important;
  box-shadow: none !important;
}

/* 播放頁的本次傳輸量／R2 請求數（只有 admin 看得到），不是按鈕，不要有按鈕外框。 */
.traffic-meter {
  color: #888;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 首頁 SEO 內容區（index.html #seo_footer）：真的顯示給使用者看的頁尾介紹＋FAQ，
   同時也是搜尋引擎唯一抓得到的首頁文字（#app 是 client-side render，爬蟲只看到
   「載入中…」）。不可以改成 display:none 之類的隱藏做法——那會變成 cloaking，
   Google 會判定為隱藏文字。要不顯示就整段拿掉，別留著藏起來。
   顯示與否由 app.js renderRoute() 依路由 toggle [hidden]（只在首頁顯示）。 */
.seo-footer {
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 28px 18px 48px;
  border-top: 1px solid #242424;
  color: #9a9a9a;
  font-size: 14px;
  line-height: 1.8;
}
.seo-footer[hidden] { display: none; }
.seo-block { margin-bottom: 22px; }
.seo-block h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #d6d6d6;
}
.seo-block p { margin: 0; }
.seo-block ul { margin: 0; padding-left: 20px; }
.seo-block li { margin-bottom: 4px; }
.seo-block strong { color: #cfcfcf; }
.seo-faq { margin: 0; }
.seo-faq dt { margin-top: 10px; font-weight: 600; color: #cfcfcf; }
.seo-faq dd { margin: 2px 0 0; }
.seo-tagline { margin: 24px 0 0; color: #6f6f6f; font-size: 13px; }
@media (max-width: 720px) {
  .seo-footer { padding-inline: 12px; }
}

/* 2026-10-25 member_only：會員限定作品的說明面板 */
.members-only-panel p { margin: 0 0 16px; font-size: 16px; color: #ddd; }

/* 2026-10-25 手機版頂端列：➕作品 只留 ➕、拿掉 banner，頭像不會被擠出畫面。 */
.add-work-btn { white-space: nowrap; }
.top-actions { flex: none; align-items: center; }
.search-form { min-width: 0; }
@media (max-width: 600px) {
  .brand { display: none; }
  .add-work-label { display: none; }
  .top-actions { gap: 6px; }
}

/* 2026-10-25 手機版登入視窗：Google 登入移到最上面、整體縮小、不超出畫面寬度。
   input 字級 16px，iOS 才不會在點輸入框時自動放大整個畫面（放大後就會超出寬度）。 */
@media (max-width: 600px) {
  #auth_dialog {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px 16px;
    overflow-y: auto;
  }
  #auth_form { display: flex; flex-direction: column; }
  #auth_form > * { order: 3; }
  #auth_form > .dialog-head { order: 0; }
  #auth_form > #google_signin_container { order: 1; }
  #auth_form > .auth-divider { order: 2; margin: 8px 0 0; }
  #auth_dialog h2 { margin: 0 0 8px; font-size: 18px; }
  #auth_dialog label { margin: 7px 0; }
  #auth_dialog input { font-size: 16px; padding: 7px 9px; }
  #auth_dialog .dialog-actions { margin-top: 8px; }
  #auth_dialog .auth-terms { margin: 8px 0 0; font-size: 12px; }
  .google-signin-container { max-width: 100%; overflow: hidden; }
}

/* 2026-10-25：安裝提示不超出手機寬度（文字太長時縮排、不把 ✕ 推出畫面）。 */
.install-banner { box-sizing: border-box; max-width: min(420px, calc(100vw - 24px)); overflow: hidden; }
.install-banner-text span { overflow-wrap: anywhere; }
@media (max-width: 380px) {
  .install-banner { gap: 8px; padding-inline: 10px; }
  .install-banner-icon { width: 30px; height: 30px; }
  .install-banner-actions .action-button { padding: 6px 9px; }
}

/* 2026-10-25：頻道／系列頁「有作品沒列出來」的說明 */
.hidden-works-hint { margin: 0 0 14px; color: rgb(133, 133, 133); font-size: 13px; }

.seo-title { margin: 0 0 18px; font-size: 20px; font-weight: 700; color: #e6e6e6; }

/* 2026-10-28 work_i18n：側邊選單「作品語言」 */
.side-menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: default; }
.side-menu-lang select { background: #222; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 3px 6px; font-size: 13px; }

/* Five-language labels and native language menus remain usable on narrow screens. */
.side-menu { box-sizing: border-box; max-height: calc(100vh - 64px - var(--announcement-h, 0px)); max-height: calc(100dvh - 64px - var(--announcement-h, 0px)); overflow-y: auto; }
.side-menu-lang { flex-direction: column; align-items: stretch; gap: 6px; }
.side-menu-lang select { min-width: 0; width: 100%; max-width: 100%; }
.admin-body .topbar { overflow-x: auto; scrollbar-width: thin; }
.admin-body .topbar > * { flex-shrink: 0; }
.admin-body .top-actions [data-ui-locale] { width: 8.5rem; min-width: 5rem; max-width: 26vw; }
