/* ==========================================
   CSS Variables — maccmsbox_119 藍橙主調（仿賞片網風格）
   ========================================== */
:root {
  --bg-base:       #F2F2F3;
  --bg-topbar:     #32414F;
  --bg-card:       #FFFFFF;
  --bg-elevated:   #F7F7F7;

  --accent:        #0094E3;
  --accent-hover:  #0077b8;
  --accent-light:  rgba(0, 148, 227, 0.10);

  --accent-2:      #ff6a1f;
  --accent-2-alt:  #ff7800;

  --text-1:        #333333;
  --text-2:        #666666;
  --text-3:        #999999;

  --border:        #e0e0e0;
  --border-2:      #e6e7e8;

  --score-hi:      #ff6a1f;
  --score-mid:     #0094E3;

  --topbar-h:      60px;
  --radius:        4px;
  --radius-sm:     2px;
  --radius-pill:   3px;
  --shadow-panel:  0 3px 10px rgba(0,0,0,0.10);
  --content-max:   1200px;
}

/* ==========================================
  Base Reset
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-base);
  color: var(--text-2);
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", SimSun, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul { list-style: none; }

iconify-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* ==========================================
   Page Layout — 無 Sidebar，純頂部導覽
   ========================================== */
.page-shell {
  min-height: 100vh;
  background-color: var(--bg-base);
}

.main-area {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
}

/* ==========================================
   Topbar — 半透明深色 60px（rgba(50,65,82,.7) + 對角光澤漸層）
   ========================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: linear-gradient(90deg,
      rgba(17,22,31,0) 0%,
      rgba(255,255,255,0.16) 25%,
      rgba(255,255,255,0.16) 65%,
      rgba(17,22,31,0) 90%),
    rgba(50,65,82,0.88);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.35);
}

.topbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Logo */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo-img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Horizontal nav */
.topbar-nav {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.tn-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  height: 100%;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease-in-out;
}
.tn-item:hover,
.tn-item.is-active {
  background-color: rgba(0,0,0,0.3);
  color: #fff;
}

/* "更多" dropdown — tablet nav overflow */
.tn-more-wrap {
  position: relative;
  display: none;
  flex-shrink: 0;
  height: 100%;
}
.tn-more-btn { gap: 3px; }
.tn-more-caret {
  font-size: 11px;
  transition: transform 0.2s;
}
.tn-more-btn[aria-expanded="true"] .tn-more-caret { transform: rotate(180deg); }
.tn-more-menu {
  display: none;
  position: fixed;  /* fixed 繞開所有上層 overflow 限制 */
  min-width: 120px;
  background: var(--bg-topbar);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  z-index: 9999;
  padding: 4px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tn-more-menu.is-open { display: block; }
.tn-more-menu .tn-item {
  display: flex;
  height: auto;
  padding: 9px 16px;
  width: 100%;
  color: rgba(255,255,255,0.85);
}

/* Right actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 100%;
}

.tb-icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: rgba(255,255,255,0.9);
  font-size: 19px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.tb-icon-btn:hover { color: #fff; background: rgba(0,0,0,0.3); }

/* 常駐搜尋框（仿 .saerch 深色膠囊輸入框） */
.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  width: 220px;
  padding: 0 10px 0 14px;
  margin-right: 6px;
  background: rgba(17,22,31,0.5);
  border: 1px solid #4e4e4e;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.tb-search:focus-within { border-color: var(--accent); }
.tb-search-icon { color: #999; font-size: 15px; flex-shrink: 0; }
.tb-search #searchInputTop {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
}
.tb-search #searchInputTop::placeholder { color: #999; }

/* 文字+圖示按鈕（仿 .header_r a 純文字連結樣式，如「觀看記錄」） */
.tb-text-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 10px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.tb-text-btn iconify-icon { font-size: 18px; }
.tb-text-btn:hover { color: #fff; background: rgba(0,0,0,0.3); }

.tb-login-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s;
  flex-shrink: 0;
}
.tb-login-btn iconify-icon { font-size: 16px; }
.tb-login-btn:hover { background: var(--accent-hover); }

/* ==========================================
   User Dropdown — 已登入用戶選單
   ========================================== */
.user-dd-wrap {
  position: relative;
}
.user-dd-wrap .tb-text-btn .user-dd-label {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dd {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  z-index: 800;
  overflow: hidden;
}
.user-dd.is-open { display: block; }
.user-dd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.ud-avatar-icon { font-size: 22px; color: var(--accent); flex-shrink: 0; }
.ud-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ud-divider { height: 1px; background: var(--border); margin: 0; }
.ud-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ud-item:hover { background: var(--bg-card); color: var(--text-1); }
.ud-item--danger { color: #e05555; }
.ud-item--danger:hover { background: rgba(224,85,85,.08); color: #f07070; }
.ud-item iconify-icon { font-size: 16px; flex-shrink: 0; }


.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(17, 22, 31, 0.92);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-overlay.is-open { display: flex; }

.search-overlay-inner {
  width: 100%;
  max-width: 680px;
  padding: 0 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(17,22,31,0.6);
  border: 1px solid #4e4e4e;
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 18px;
  gap: 8px;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); }

.search-bar-icon {
  color: #999;
  font-size: 20px;
  flex-shrink: 0;
}

#searchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  padding: 10px 0;
  min-width: 0;
}
#searchInput::placeholder { color: #888; }

.search-submit-btn {
  padding: 9px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s;
}
.search-submit-btn:hover { background: var(--accent-hover); }

.search-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #999;
  font-size: 18px;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.search-close-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

.search-hot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 4px 0;
}
.sh-label {
  font-size: 13px;
  color: #888;
  flex-shrink: 0;
  margin-right: 4px;
}
.sh-tag {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid #4e4e4e;
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: #ccc;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.sh-tag:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ==========================================
   Page Content
   ========================================== */
.page-content { flex: 1; }

/* ==========================================
   Hero Banner — 大圖輪播 + 縮圖列（仿 maccmsbox_119 .slide）
   ========================================== */
.hero-banner {
  position: relative;
  max-width: var(--content-max);
  margin: 16px auto 0;
  height: 440px;
  overflow: hidden;
  background: #bed5dd;
  box-shadow: var(--shadow-panel);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

/* 底部漸層，讓文字面板可讀 */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
      rgba(10,12,15,0.85) 0%,
      rgba(10,12,15,0.35) 35%,
      transparent 62%);
}

/* 文字面板：左下角小卡片，不做全幅電影感漸層 */
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 0 36px 28px;
  max-width: 480px;
  z-index: 2;
}

.hero-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hb {
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: var(--radius-sm);
}
.hb--type { background: var(--accent); color: #fff; }
.hb--year { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.9); }

.hero-title {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
}

.hero-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  margin-bottom: 18px;
  max-width: 440px;
}

.hero-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s;
}
.hero-play-btn iconify-icon { font-size: 17px; }
.hero-play-btn:hover { background: var(--accent-hover); }

.hero-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.2s, color 0.2s;
}
.hero-detail-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* Slide transition */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 1;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Arrow navigation */
.hero-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.hero-arrow:hover { background: var(--accent); }
.hero-arrow--prev { left: 14px; }
.hero-arrow--next { right: 14px; }

/* 縮圖列（取代單純圓點指示器，仿 .slide-img 縮圖導覽） */
.hero-dots {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 1px;
  height: 64px;
}
.hero-dot {
  width: 96px;
  height: 100%;
  border: none;
  border-top: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background-color: rgba(10,12,15,0.55);
  background-size: cover;
  background-position: center;
  transition: border-color 0.2s;
}
.hero-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10,12,15,0.45);
  transition: background 0.2s;
}
.hero-dot.is-active { border-top-color: var(--accent); }
.hero-dot.is-active::after { background: rgba(10,12,15,0); }

/* ==========================================
   Quick Nav Bar — 首頁大圖示快速導覽（仿 .menunav）
   ========================================== */
.quick-nav-bar {
  max-width: var(--content-max);
  margin: 16px auto 0;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
  display: flex;
  align-items: stretch;
}
.qnb-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.qnb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-width: 90px;
  padding: 16px 8px;
  font-size: 13px;
  color: var(--text-2);
  border-right: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
}
.qnb-item:last-child { border-right: none; }
.qnb-item iconify-icon { font-size: 26px; color: var(--accent); transition: color 0.2s; }
.qnb-item:hover { background: var(--accent-light); color: var(--accent); }
.qnb-aux {
  display: flex;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
}
.qnb-aux .qnb-item iconify-icon { color: var(--accent-2); }
.qnb-aux .qnb-item:hover { background: rgba(255,106,31,0.08); color: var(--accent-2); }

/* ==========================================
   Content Block — 內容區塊容器（1200px 定寬）
   ========================================== */
.content-block {
  padding: 20px 0 4px;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.section-hd {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

/* 區塊標題：仿 .title h2 素樸樣式 */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-1);
  line-height: 1.3;
}
.section-title-icon {
  color: var(--accent);
  font-size: 20px;
  display: flex;
}

/* 「更多」連結 */
.section-more {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  transition: color 0.2s;
}
.section-more:hover { color: var(--accent); }

/* ==========================================
   兩欄版面（仿 .w920 fn-left + .w260 fn-right）
   ========================================== */
.two-col { display: flex; gap: 20px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; }
.col-side { flex: 0 0 260px; }

/* ==========================================
   VOD Grid
   ========================================== */
.vod-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px 18px;
}

/* ==========================================
   Actor Row (首頁明星推薦)
   ========================================== */
.actor-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
}

/* ==========================================
   VOD Card — 固定圖幅 + 底部漸層字幕（仿 .up-list.list-img）
   ========================================== */
.vod-card { min-width: 0; border-top: 2px solid transparent; }
.vod-card a { display: block; }

.vod-thumb {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 3/4.2;
  background: #eee;
}
.vod-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.vod-card:hover .vod-thumb img { transform: scale(1.06); }

/* 底部漸層字幕列（仿 mask_txtbg_100.png） */
.vod-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 8px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
  z-index: 2;
}
.vod-name {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.vod-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #cacaca;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 整卡覆蓋 hover 遮罩 + 置中播放鍵 */
.vod-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.vod-card:hover .vod-overlay { opacity: 1; }

.vod-play-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
  transition: transform 0.2s;
}
.vod-card:hover .vod-play-icon { transform: scale(1.12); }

/* Badge：左上角小標籤 */
.vod-badge-tl {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 4;
}
.vbadge {
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}
.vbadge--year { background: rgba(0,0,0,0.55); color: #eee; }
.vbadge--type { background: var(--accent); color: #fff; }

/* 右上角集數/狀態徽章（仿 .qx） */
.vod-remarks {
  position: absolute;
  top: 0; right: 0;
  padding: 4px 7px;
  background: rgba(0,0,0,0.45);
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  z-index: 4;
}
.vod-score {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--accent-2);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  z-index: 4;
}
.vod-card:hover .vod-name { color: var(--accent); }

/* ==========================================
   Login Modal — 淺色卡片
   ========================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 600;
  align-items: center;
  justify-content: center;
}
.modal-overlay.is-open { display: flex; }

.modal-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  width: 340px;
  max-width: calc(100vw - 32px);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  color: var(--text-3);
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text-1); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; color: var(--text-1); }
.modal-field { margin-bottom: 16px; }
.modal-label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.modal-input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s;
  margin-top: 6px;
}
.modal-submit:hover { background: var(--accent-hover); }

/* Verify captcha row */
.verify-row { display: flex; align-items: center; gap: 8px; }
.modal-input--verify { flex: 1; }
.verify-img { height: 36px; width: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-2); cursor: pointer; flex-shrink: 0; }
.sms-btn { height: 38px; padding: 0 12px; background: var(--bg-elevated); border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--accent); font-size: 12px; white-space: nowrap; cursor: pointer; transition: background .15s; }
.sms-btn:hover { background: var(--bg-card); }
.sms-btn:disabled { opacity: .55; cursor: not-allowed; }

/* mac-toast — 全站浮动通知 */
.mac-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--bg-elevated);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  white-space: pre-line;
  max-width: calc(100vw - 48px);
  text-align: center;
}
.mac-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.mac-toast--error   { border-color: #e05555; color: #f07070; }
.mac-toast--success { border-color: var(--accent); color: var(--accent); }
.mac-toast--info    { border-color: var(--border-2); color: var(--text-2); }

.modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}
.modal-link { color: var(--text-2); transition: color 0.2s; }
.modal-link:hover { color: var(--accent); }
.modal-link--accent { color: var(--accent); }

.modal-box--confirm { width: 300px; text-align: center; }
.modal-box--confirm .modal-title { margin-bottom: 22px; }
.modal-confirm-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-submit--danger { display: block; background: var(--accent-2); }
.modal-submit--danger:hover { background: var(--accent-2-alt); }
.modal-cancel {
  width: 100%;
  padding: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.modal-cancel:hover { color: var(--text-1); border-color: var(--accent); }

/* ==========================================
   History Modal — 淺色卡片
   ========================================== */
.hm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hm-overlay.is-open { display: flex; }

.hm-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.hm-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.hm-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.hm-clear {
  font-size: 13px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.hm-clear:hover { color: var(--accent); }
.hm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  transition: background 0.15s, color 0.15s;
}
.hm-close:hover { background: var(--border); color: var(--text-1); }
.hm-body {
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}
.hm-body::-webkit-scrollbar { width: 4px; }
.hm-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.hm-card {
  flex: 0 0 calc((100% - 50px) / 6);
  min-width: 0;
  display: block;
  text-decoration: none;
  color: var(--text-1);
  align-self: flex-start;
}
.hm-thumb {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
  contain: strict;
}
.hm-thumb img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.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 0.15s;
}
.hm-empty {
  width: 100%;
  text-align: center;
  padding: 40px 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ==========================================
   Footer — 仿 .mcid-list / .footer-nav
   ========================================== */
.mcid-list {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 0;
}
.mcid-type { width: 25%; padding-right: 12px; }
.mcid-type h2 { margin-bottom: 8px; }
.mcid-type h2 a { font-size: 15px; color: var(--text-3); font-weight: 700; }
.mcid-type h2 a:hover { color: var(--accent); }
.mcid-type ul { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.mcid-type ul li a { font-size: 12px; color: var(--text-3); }
.mcid-type ul li a:hover { color: var(--accent); }
.site-footer {
  padding: 0 0 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.8;
  background: #fff;
  margin-top: 24px;
}
.footer-links {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 20px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.footer-links a { color: var(--text-3); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.site-footer > p {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 6px 20px 0;
}
.footer-bottom-bar {
  margin-top: 14px;
  padding: 12px 20px;
  background: var(--bg-topbar);
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.3px;
}

/* ==========================================
   漂浮功能按鈕 (FAB)
   ========================================== */
.fab-group {
  position: fixed;
  bottom: 30px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 400;
}
.fab-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-panel);
  transition: background 0.2s, transform 0.2s, color 0.2s;
}
.fab-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.fab-btn--top { opacity: 0; pointer-events: none; }
.fab-btn--top.is-visible { opacity: 1; pointer-events: auto; }
.fab-btn--gbook { color: var(--accent-2); }
.fab-btn--gbook:hover { background: var(--accent-2); color: #fff; }
.fab-qr-popup {
  position: fixed;
  bottom: 160px;
  right: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-panel);
  z-index: 401;
  display: none;
}
.fab-qr-popup.is-open { display: block; }
.fab-qr-popup p { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.fab-qr-popup img { width: 130px; height: 130px; border-radius: 4px; background: #fff; display: block; }

/* ==========================================
   Comments（共用 mini 留言元件，仿 .mac_comment 素樸方框）
   ========================================== */
.comment-section { margin-bottom: 32px; }
.gbook-count { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.gbook-list { margin-bottom: 20px; }
.gbook-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.gbook-avatar {
  flex-shrink: 0; width: 36px; height: 36px;
  border-radius: 50%; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 22px;
}
.gbook-body { flex: 1; min-width: 0; }
.gbook-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gbook-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.gbook-time { font-size: 11px; color: var(--text-3); }
.gbook-content { font-size: 13px; color: var(--text-2); line-height: 1.7; word-break: break-all; }
.gbook-reply {
  margin-top: 8px; padding: 8px 12px;
  background: var(--bg-elevated); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: flex-start;
}
.gbook-reply iconify-icon { flex-shrink: 0; color: var(--accent-2); margin-top: 1px; }
.gbook-form { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.gbook-form-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }
.gbook-textarea {
  width: 100%; padding: 10px 12px;
  background: #fff; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text-1); font-size: 13px;
  font-family: inherit; resize: vertical; outline: none; line-height: 1.6;
  transition: border-color 0.2s; display: block; margin-bottom: 10px;
}
.gbook-textarea:focus { border-color: var(--accent); }
.gbook-textarea::placeholder { color: var(--text-3); }
.gbook-form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gbook-chars { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.gbook-chars em { font-style: normal; color: var(--accent); }
.gbook-verify-wrap { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.gbook-captcha-img { height: 36px; border-radius: 4px; cursor: pointer; vertical-align: middle; }
.gbook-input {
  padding: 8px 12px; background: #fff; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text-1); font-size: 13px; outline: none; transition: border-color 0.2s;
}
.gbook-input:focus { border-color: var(--accent); }
.gbook-input::placeholder { color: var(--text-3); }
.gbook-input--verify { width: 88px; }
.gbook-submit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; background: var(--accent-2); color: #fff;
  border: none; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background 0.2s;
}
.gbook-submit-btn:hover { background: var(--accent-2-alt); }

/* ==========================================
   Rank Widgets — 仿 .hot-list（首名大圖 + 其餘文字行）
   ========================================== */
.rank-col {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}
.rank-col-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 2px solid var(--bg-base);
}
.rank-col-title { padding: 10px 12px 0; font-size: 15px; font-weight: 700; color: var(--text-1); }
.rch-badge { font-size: 10px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--accent-light); color: var(--accent); margin-left: 6px; }
.rank-col-more { font-size: 12px; color: var(--text-3); }
.rank-col-more:hover { color: var(--accent); }
.rank-top1 { padding: 10px; }
.rank-top1 a { display: flex; gap: 10px; }
.rt1-thumb {
  position: relative; flex-shrink: 0;
  width: 72px; height: 96px;
  overflow: hidden; background: var(--bg-elevated);
}
.rt1-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rt1-crown {
  position: absolute; bottom: 0; left: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13px;
}
.rt1-info { flex: 1; min-width: 0; }
.rt1-name { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-top1 a:hover .rt1-name { color: var(--accent); }
.rt1-meta { font-size: 12px; color: var(--text-3); margin-bottom: 3px; }
.rt1-status { font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.rt1-hits { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--accent-2); }
.rank-list { list-style: none; padding: 2px 0 8px; }
.rank-li { border-bottom: none; }
.rank-li-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; font-size: 13px; color: var(--text-2); transition: background 0.15s;
}
.rank-li-inner:hover { background: var(--bg-elevated); color: var(--text-1); }
.rl-num {
  flex-shrink: 0; width: 22px; height: 22px;
  border-radius: var(--radius-sm); background: #e9e9e9;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #999;
}
.rl-num--gold,
.rl-num--silver,
.rl-num--bronze { background: var(--accent); color: #fff; }
.rl-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-hits { flex-shrink: 0; font-size: 12px; color: var(--accent); }

/* ==========================================
   Art Card (文章)
   ========================================== */
.art-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.art-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 0;
  overflow: hidden; transition: box-shadow 0.2s; color: var(--text-1);
}
.art-card:hover { box-shadow: var(--shadow-panel); }
.art-card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-elevated); }
.art-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.art-card:hover .art-card-thumb img { transform: scale(1.04); }
.art-card-nopic { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; color: var(--text-3); }
.art-card-cat { position: absolute; top: 8px; left: 8px; padding: 2px 8px; background: var(--accent); color: #fff; font-size: 11px; }
.art-card-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.art-card-title {
  font-size: 14px; font-weight: 400; color: var(--text-1); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; transition: color 0.2s;
}
.art-card:hover .art-card-title { color: var(--accent); }

/* ==========================================
   排行榜首頁
   ========================================== */
.rank-home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ==========================================
   Topic Card
   ========================================== */
.topic-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.topic-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 0;
  overflow: hidden; transition: box-shadow 0.2s; color: var(--text-1);
}
.topic-card:hover { box-shadow: var(--shadow-panel); }
.topic-card-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-elevated); }
.topic-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.topic-card:hover .topic-card-thumb img { transform: scale(1.04); }
.topic-card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: rgba(255,255,255,0.9);
  opacity: 0; transition: opacity 0.2s;
}
.topic-card:hover .topic-card-overlay { opacity: 1; }
.topic-card-count { position: absolute; bottom: 8px; right: 8px; padding: 2px 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; }
.topic-card-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.topic-card-title { font-size: 14px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.topic-card:hover .topic-card-title { color: var(--accent); }
.topic-card-blurb { font-size: 12px; color: var(--text-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================
   Mobile Tabbar
   ========================================== */
.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 56px; background: var(--bg-topbar);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 300; flex-direction: row;
}
.mtb-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; height: 100%;
  color: rgba(255,255,255,0.55); font-size: 10px;
  text-decoration: none; position: relative; transition: color 0.2s;
}
.mtb-item iconify-icon { font-size: 22px; }
.mtb-item.is-active { color: #fff; }
.mtb-item.is-active::before {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--accent);
}

/* ==========================================
   Pagination — 仿 .pagination 方形頁碼
   ========================================== */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0; padding: 25px 0 10px; }
.pg-btn, .pg-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 12px;
  border-radius: 0;
  border: 1px solid var(--border);
  margin-left: -1px;
  background: #fff; color: var(--accent); font-size: 13px; transition: all 0.2s;
}
.pg-btn:hover, .pg-num:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.pg-num.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pg-info { font-size: 12px; color: var(--text-3); margin-left: 12px; }

/* ==========================================
   Desc Expand widget
   ========================================== */
.desc-collapsed { max-height: 80px; overflow: hidden; -webkit-mask-image: linear-gradient(black 40%, transparent); mask-image: linear-gradient(black 40%, transparent); }
.desc-expanded { max-height: none; mask-image: none; -webkit-mask-image: none; }
.desc-expand-btn { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--accent); padding: 6px 0; cursor: pointer; background: none; border: none; }
.desc-expand-btn:hover { text-decoration: underline; }

/* ==========================================
   Ad Slots
   ========================================== */
.vod-ad-slot { margin: 0 0 20px; }
.player-adbar { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #1b1f24; border-bottom: 1px solid #333; font-size: 12px; color: #999; min-height: 36px; }
.player-adbar:empty { display: none; }
.adbar-close { margin-left: auto; flex-shrink: 0; background: none; border: none; color: #999; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 3px; transition: color 0.2s, background 0.2s; }
.adbar-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.site-ad { border: 1px solid var(--border); background: #fff; overflow: hidden; position: relative; }
.site-ad::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--accent-2); }
.site-ad--banner { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 18px; font-size: 12px; color: var(--text-2); flex: 1; }
.site-ad-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.site-ad-icon { font-size: 18px; flex-shrink: 0; color: var(--accent-2); }
.site-ad-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.site-ad-text strong { font-size: 13px; color: var(--text-1); }
.site-ad-text span { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-ad--sidebar { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 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(--accent-2); margin-bottom: 3px; 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: 6px 14px; background: var(--accent-2); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; transition: opacity 0.2s; }
.site-ad-btn:hover { opacity: 0.85; }

/* ==========================================
   MAC.Pop 彈出層覆寫（淺色）
   ========================================== */
.mac_pop_bg { background: rgba(0,0,0,0.5) !important; }
.mac_pop { background: #fff !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: 0 20px 60px rgba(0,0,0,0.3) !important; padding: 0 !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; }
.mac_pop .pop_top { display: flex !important; align-items: center !important; justify-content: space-between !important; height: auto !important; padding: 14px 16px !important; background: var(--bg-elevated) !important; border-bottom: 1px solid var(--border) !important; flex-shrink: 0 !important; }
.mac_pop .pop_top h2 { font-size: 15px !important; font-weight: 600 !important; color: var(--text-1) !important; margin: 0 !important; line-height: 1 !important; float: none !important; }
.mac_pop span.pop_close { float: none !important; width: 28px !important; height: 28px !important; font-size: 16px !important; text-indent: 0 !important; background: none !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; border-radius: 50% !important; color: var(--text-3) !important; cursor: pointer !important; transition: color 0.2s, background 0.2s !important; line-height: 1 !important; }
.mac_pop span.pop_close:hover { color: var(--text-1) !important; background: var(--bg-base) !important; }
.mac_pop .pop_content { flex: 1 !important; overflow-y: auto !important; }
.mac_pop_msg_bg { background: rgba(0,0,0,0.2) !important; }
.mac_pop_msg { background: #fff !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; box-shadow: 0 4px 24px rgba(0,0,0,0.25) !important; padding: 10px 20px !important; }
.mac_pop_msg .pop-msg { color: var(--text-1) !important; font-size: 13px !important; }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1199px) {
  .mobile-tabbar { display: flex; }
  .main-area { padding-bottom: 56px; }

  .fab-group { bottom: 76px; right: 14px; }
  .fab-qr-popup { bottom: 146px; right: 14px; }
  .fab-btn--gbook { display: none; }
  .fab-btn--qr { display: none; }

  /* 平板：定寬容器加回左右留白，避免貼邊 */
  .hero-banner,
  .quick-nav-bar { margin-left: 16px; margin-right: 16px; }
  .content-block { padding-left: 16px; padding-right: 16px; }

  /* 平板／手機：排行榜側欄隱藏，主欄自然填滿整行 */
  .col-side { display: none; }

  /* 平板／手機：快速導覽列改用固定欄數格狀排列，避免 flex+wrap 讓不滿一整排的項目被拉伸、寬高跑掉 */
  .quick-nav-bar { flex-wrap: wrap; }
  .qnb-main {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }
  .qnb-item {
    min-width: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .qnb-item:nth-child(4n) { border-right: none; }
  .qnb-aux {
    flex: 1 1 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 1023px) {
  .rank-home-grid { grid-template-columns: repeat(4, 1fr); }
  .art-grid       { grid-template-columns: repeat(4, 1fr); }
  .topic-grid     { grid-template-columns: repeat(4, 1fr); }
  .site-ad--banner .site-ad-text span { display: none; }
  .hero-dots { display: none; }
}

/* ==========================================
   Hamburger Button (hidden on desktop)
   ========================================== */
.hamburger-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: transparent; border: none;
  color: rgba(255,255,255,0.9); font-size: 22px;
  cursor: pointer; transition: color 0.2s, background 0.2s;
}
.hamburger-btn:hover { color: #fff; background: rgba(0,0,0,0.3); }

/* ==========================================
   Mobile Nav Drawer
   ========================================== */
.mob-nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 499;
}
.mob-nav-overlay.is-open { display: block; }

.mob-nav-drawer {
  position: fixed; top: 0; right: 0;
  width: 240px; height: 100dvh;
  background: var(--bg-topbar);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
.mob-nav-drawer.is-open { transform: translateX(0); }
.mob-nav-drawer::-webkit-scrollbar { display: none; }

.mnd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.mnd-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8); }
.mnd-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none;
  color: rgba(255,255,255,0.8); font-size: 18px; cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.mnd-close:hover { color: #fff; background: rgba(0,0,0,0.3); }

.mnd-nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }

.mnd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  color: rgba(255,255,255,0.75); font-size: 15px;
  text-decoration: none; transition: color 0.2s, background 0.2s;
}
.mnd-item:hover { color: #fff; background: rgba(0,0,0,0.25); }
.mnd-item.is-active { color: var(--accent); }
.mnd-item iconify-icon { font-size: 20px; flex-shrink: 0; }

@media (max-width: 767px) {
  .hero-banner { height: 260px; margin-top: 0; }
  .hero-title { font-size: 20px; }
  .hero-content { padding: 0 16px 20px; }
  .hero-arrow { display: none; }
  .hero-dots { display: none; }
  .brand-name { display: none; }
  .content-block { padding: 14px 12px 4px; }
  .vod-row { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
  .art-grid       { grid-template-columns: repeat(2, 1fr); }
  .topic-grid     { grid-template-columns: repeat(2, 1fr); }
  .rank-home-grid { grid-template-columns: 1fr; }
  .actor-row { grid-template-columns: repeat(4, 1fr); }
  .hm-overlay { padding: 16px; }
  .hm-box { max-height: 85vh; }
  .hm-card { flex: 0 0 calc((100% - 20px) / 3); }
  .mobile-tabbar { display: flex; }
  .main-area { padding-bottom: 56px; }
  .tb-login-btn span { display: none; }
  .topbar-inner { padding: 0 14px; gap: 10px; }

  .topbar-nav { display: none; }
  .hamburger-btn { display: flex; }
  .tb-search { display: none; }
  .tb-icon-btn { display: flex; }
  .tb-text-btn span { display: none; }
}

@media (max-width: 480px) {
  .vod-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .qnb-main { grid-template-columns: repeat(3, 1fr); }
  .qnb-item:nth-child(4n) { border-right: 1px solid var(--border); }
  .qnb-item:nth-child(3n) { border-right: none; }
}

/* ==========================================
   Section Lazy Reveal (Intersection Observer)
   ========================================== */
.content-block.will-observe {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.content-block.is-visible {
  opacity: 1;
  transform: none;
}
