/* ============================================================
   CB-IA-HOME — Agent A: 首页交互层 (clean-room YT parity)
   搜索焦点蓝边 / 建议下拉 / chip 轨道 / guide 反馈 / 卡片 hover
   宿主 cb-yt.css 用 !important 锁样式,本文件加载在后,冲突处同样 !important。
   ============================================================ */

/* ─── A1: 搜索 pill 焦点蓝边 #065fd4 + 平滑过渡 ─── */
body.page-home header #searchInput,
body.page-home header .search-input,
body.page-home header .search-btn {
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
body.page-home header #searchInput:focus,
body.page-home header .search-input:focus,
body.page-home header .search-box:focus-within .search-btn {
  border-color: #1c62b9 !important;
}
body.page-home header .search-btn {
  background: #f8f8f8 !important;
  color: #0f0f0f !important;
  border: 1px solid #ccc !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  min-width: 64px !important;
  width: 64px !important;
  padding: 0 !important;
  transform: none !important;
}
body.page-home header .search-btn:hover {
  background: #f0f0f0 !important;
  transform: none !important;
}
body.page-home header .search-btn svg,
body.page-home header .search-btn i {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  color: #0f0f0f !important;
  fill: #0f0f0f !important;
}

/* ─── A1b: 搜索建议下拉(独立面板 #cbiaSugPanel) ─── */
/* 宿主自己的 autocomplete pipeline(focus/300ms debounce)会异步把宿主面板
   显示出来,和本面板重叠;这里用 !important 压掉宿主面板(内联 style 无
   !important 时输给 CSS !important),让 #cbiaSugPanel 成为唯一下拉来源 */
body.page-home #searchAutocompletePanel,
body.page-home #searchHistoryPanel {
  display: none !important;
}
body.page-home .search-box .cbia-sug-panel {
  display: none;
  position: absolute !important;
  top: 48px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  max-height: 420px !important;
  overflow-y: auto !important;
  background: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, .1), 0 8px 24px rgba(0, 0, 0, .18) !important;
  padding: 8px 0 !important;
}
body.page-home .cbia-sug-panel .sac-section-label {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 24px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #606060 !important;
}
body.page-home .cbia-sug-panel .sac-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  height: 32px !important;
  padding: 0 24px !important;
  font-size: 16px !important;
  color: #0f0f0f !important;
  cursor: pointer !important;
}
body.page-home .cbia-sug-panel .sac-item:hover {
  background: #f2f2f2 !important;
}
body.page-home .cbia-sug-panel .sac-item:active {
  background: #e5e5e5 !important;
}
body.page-home .cbia-sug-panel .sac-item i {
  width: 16px !important;
  min-width: 16px !important;
  font-size: 14px !important;
  color: #909090 !important;
  text-align: center !important;
}
body.page-home .cbia-sug-panel .sac-item .sac-keyword {
  flex: 1 !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.page-home .cbia-sug-panel .sac-item .sac-rank {
  width: 20px !important;
  min-width: 20px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #606060 !important;
  text-align: center !important;
}
body.page-home .cbia-sug-panel .sac-item .sac-count {
  font-size: 12px !important;
  color: #909090 !important;
}

/* ─── A2: chip 轨道(共享 .yt-ia-chip 提供芯片外观) ─── */
body.page-home .filter-bar .cb-ia-chip-rail {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 1 100% !important;
  margin: 0 !important;
  padding: 4px 0 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
}
/* YT home 只有一条 chip 轨(#sortFilterBar)。#filterContainer 是第二排分类轨,
   再显示就叠成两行。分类聚焦时 host 自己管。 */
body.page-home #filterContainer,
body.page-home .filter-bar {
  display: none !important;
}
body.page-home .filter-bar .cb-ia-chip-rail::-webkit-scrollbar {
  display: none !important;
}
body.page-home .filter-bar .cb-ia-chip-rail .yt-ia-chip {
  flex: 0 0 auto !important;
}

/* ─── A3: guide 侧栏 — hover #f2f2f2 / 当前路径 / 抽屉缓动 ─── */
body.page-home #catSideNav .ph-nav-item,
body.page-home #catSideNav a.ph-nav-item,
body.page-home #userSideNav .ph-nav-item {
  position: relative !important;
  transition: none !important;
}
body.page-home #catSideNav .ph-nav-item:hover,
body.page-home #userSideNav .ph-nav-item:hover {
  background: rgba(0, 0, 0, .05) !important;
  transform: none !important;
}
/* active(宿主管理)与当前路径高亮保持 rgba(.05),盖在 hover 之后 */
body.page-home #catSideNav .ph-nav-item.active,
body.page-home #catSideNav .ph-nav-item.cb-ia-guide-current,
body.page-home #catSideNav #tab-rec.active {
  background: rgba(0, 0, 0, .05) !important;
  font-weight: 500 !important;
}
/* live YT: ≥1312 instant 0ms swap (NOT width tween). 792–1311 overlay: no width tween, scrim 200ms. <792 drawer slides 200ms. */
@media (min-width: 1312px) {
  body.page-home #catSideNav,
  body.page-home #mainContent,
  body.page-home main,
  body.page-home footer {
    transition: none !important;
  }
}
@media (min-width: 792px) and (max-width: 1311px) {
  body.page-home #catSideNav {
    transition: none !important;
  }
  body.page-home #catDrawerBackdrop,
  body.page-home .cat-drawer-backdrop {
    transition: opacity 200ms cubic-bezier(0.05, 0, 0, 1),
                visibility 200ms cubic-bezier(0.05, 0, 0, 1) !important;
  }
}
@media (max-width: 791px) {
  body.page-home #catSideNav {
    transition: transform 200ms cubic-bezier(0.05, 0, 0, 1),
                visibility 200ms cubic-bezier(0.05, 0, 0, 1) !important;
  }
  body.page-home #catDrawerBackdrop,
  body.page-home .cat-drawer-backdrop {
    transition: opacity 200ms cubic-bezier(0.05, 0, 0, 1),
                visibility 200ms cubic-bezier(0.05, 0, 0, 1) !important;
  }
}

/* live YT: no left rail on active — gray pill only */
body.page-home #catSideNav button.feed-tab.active::before {
  content: none !important;
  display: none !important;
}

/* ─── A5: card pointer only — live YT does not blue the title or scale the thumb ─── */
body.page-home .card,
body.page-home .cb-item.video-preview {
  cursor: pointer !important;
}
body.page-home .card:hover,
body.page-home .card:hover .thumb,
body.page-home .card:hover .thumb img,
body.page-home .card:hover .thumb video,
body.page-home .card .thumb img,
body.page-home .card .cb-thumb img {
  transform: none !important;
  filter: none !important;
}
body.page-home .card.cb-ia-preview-zoom,
body.page-home .card.cb-ia-previewing {
  transform: none !important;
  transition: none !important;
}
body.page-home .card.cb-ia-preview-zoom .thumb img,
body.page-home .card.cb-ia-preview-zoom .cb-thumb img {
  transform: none !important;
}

/* ─── A6: thumb hover overlays — live @MrBeast/videos 2026-08-14
   Watch later + Add to queue = 32×32 stacked top-right, only on hover.
   Title does not turn blue. Image does not scale. */
body.page-home .card .thumb .cb-ia-thumb-ov,
body.page-home .card .cb-thumb .cb-ia-thumb-ov,
body.page-home .cb-hist-row .cb-hist-thumb .cb-ia-thumb-ov,
body.page-home .cw-card .cw-card-thumb .cb-ia-thumb-ov {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
body.page-home .card .thumb .cb-ia-ov-btn,
body.page-home .cb-hist-row .cb-ia-ov-btn,
body.page-home .cw-card .cb-ia-ov-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  flex: 0 0 32px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: rgba(0, 0, 0, .3) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  pointer-events: none;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  transition: none !important;
}
body.page-home .card:hover .thumb .cb-ia-ov-btn,
body.page-home .card .thumb:focus-within .cb-ia-ov-btn,
body.page-home .cb-hist-row:hover .cb-ia-ov-btn,
body.page-home .cb-hist-row:focus-within .cb-ia-ov-btn,
body.page-home .cw-card:hover .cb-ia-ov-btn,
body.page-home .cw-card:focus-within .cb-ia-ov-btn {
  opacity: 1 !important;
  pointer-events: auto;
}
body.page-home .card .thumb .cb-ia-ov-btn:hover,
body.page-home .cb-hist-row .cb-ia-ov-btn:hover,
body.page-home .cw-card .cb-ia-ov-btn:hover { background: rgba(0, 0, 0, .5) !important; }
body.page-home .card .thumb .cb-ia-ov-btn svg,
body.page-home .cb-hist-row .cb-ia-ov-btn svg,
body.page-home .cw-card .cb-ia-ov-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

/* ─── A4b: follow 只在 host 设为 block 时显示; [style*="display"] 会把 display:none 也强制亮 ─── */
body.page-home #followContent {
  display: none;
}
body.page-home #followContent[style*="block"] {
  display: block !important;
}

/* Shorts reel — centered 9:16 card, actions glued to the card, not the black void */
body.page-home #randomContent {
  display: none;
}
body.page-home #randomContent[style*="block"] {
  display: block !important;
}
body.page-home.is-feed-random #mainContent,
body.page-home.is-feed-random #homeContent {
  overflow: hidden !important;
}
body.page-home.is-feed-random .intro-section,
body.page-home.is-feed-random footer,
body.page-home.is-feed-random #cwSection,
body.page-home.is-feed-random #trendingTagsBar {
  display: none !important;
}
body.page-home #randomContent {
  position: relative;
}
body.page-home #randomContent .cb-shorts-stage {
  --cb-shorts-h: calc(100vh - 56px);
  --cb-shorts-w: min(603px, calc(var(--cb-shorts-h) * 0.75));
  position: relative;
  height: var(--cb-shorts-h);
  background: #fff;
  overflow: hidden;
}
body.page-home #randomGrid.cb-shorts-reel,
body.page-home #randomGrid {
  display: block !important;
  grid-template-columns: none !important;
  height: var(--cb-shorts-h) !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  scroll-snap-type: none;
  scroll-behavior: auto;
  overscroll-behavior: none;
  scrollbar-width: none;
}
body.page-home #randomGrid.cb-shorts-reel::-webkit-scrollbar,
body.page-home #randomGrid::-webkit-scrollbar {
  display: none;
}
body.page-home #randomGrid.cb-shorts-reel,
body.page-home #randomGrid {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  background: #fff !important;
  row-gap: 0 !important;
  column-gap: 0 !important;
}
body.page-home #commentBox.is-shorts-sheet .comment-meta,
body.page-home #commentBox.is-shorts-sheet .comment-emoji-row {
  display: none;
}
@media (min-width: 901px) {
  body.page-home.is-shorts-comments #randomGrid .cb-shorts-item.is-playing,
  body.page-home.is-shorts-comments #randomGrid .cb-shorts-item.is-comment-host {
    justify-content: flex-start !important;
    padding-left: 80px !important;
    padding-right: 440px !important;
  }
}
body.page-home #randomGrid .cb-shorts-item,
body.page-home #randomGrid .card {
  position: relative !important;
  height: var(--cb-shorts-h) !important;
  min-height: var(--cb-shorts-h) !important;
  width: 100% !important;
  scroll-snap-align: none;
  background: #fff !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 8px 88px 0 24px !important;
  box-sizing: border-box !important;
}
body.page-home #randomGrid .cb-shorts-cluster {
  position: relative;
  width: var(--cb-shorts-w);
  height: calc(var(--cb-shorts-h) - 40px);
  flex: 0 0 var(--cb-shorts-w);
}
body.page-home #randomGrid .cb-shorts-frame,
body.page-home #randomGrid .cb-shorts-item .thumb,
body.page-home #randomGrid .cb-shorts-item .cb-thumb {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 9 / 16 !important;
  border-radius: 12px !important;
  background: #111 !important;
  overflow: hidden !important;
  display: block !important;
  flex: none !important;
}
body.page-home #randomGrid .cb-shorts-poster,
body.page-home #randomGrid .cb-shorts-item img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1;
  background: transparent;
}
body.page-home #randomGrid .cb-shorts-video {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: transparent;
  display: block;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}
body.page-home #randomGrid .cb-shorts-item.is-playing .cb-shorts-video.is-on {
  opacity: 1;
  z-index: 2;
  background: #000;
}
body.page-home #randomGrid .cb-shorts-mute {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #272727;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
body.page-home #randomGrid .cb-shorts-mute svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
body.page-home #randomGrid .cb-shorts-item.is-muted .cb-shorts-ico-vol,
body.page-home #randomGrid .cb-shorts-item:not(.is-muted) .cb-shorts-ico-mute {
  display: none;
}
body.page-home #randomGrid .cb-shorts-pause {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: scale(.82);
  opacity: 0;
  transition: transform .28s cubic-bezier(.05, .7, .1, 1), opacity .18s ease;
}
body.page-home #randomGrid .cb-shorts-item.is-paused .cb-shorts-pause {
  transform: scale(1);
  opacity: 1;
}
body.page-home #randomGrid .cb-shorts-pause svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
  margin-left: 4px;
}
body.page-home #randomGrid .cb-shorts-2x {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
body.page-home #randomGrid .cb-shorts-likeburst {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  color: #fff;
  opacity: 0;
  transform: scale(.4);
  pointer-events: none;
  z-index: 8;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4));
}
body.page-home #randomGrid .cb-shorts-likeburst.is-on {
  opacity: 1;
  transform: scale(1.15);
  transition: transform .28s cubic-bezier(.05, .7, .1, 1), opacity .18s ease;
}
body.page-home #randomGrid .cb-shorts-likeburst svg {
  width: 72px;
  height: 72px;
  fill: currentColor;
}
body.page-home #randomGrid .cb-shorts-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  padding-top: 11px;
  background: transparent;
  z-index: 5;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}
body.page-home #randomGrid .cb-shorts-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, .28);
  pointer-events: none;
}
body.page-home #randomGrid .cb-shorts-bar > i {
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: #f00;
}
body.page-home #randomGrid .cb-shorts-meta {
  position: absolute;
  left: 16px;
  width: calc(100% - 32px);
  bottom: 28px;
  z-index: 4;
  color: #fff;
  pointer-events: none;
}
body.page-home #randomGrid .cb-shorts-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  pointer-events: auto;
}
body.page-home #randomGrid .cb-shorts-avt {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #333 center / cover no-repeat;
  flex: 0 0 36px;
}
body.page-home #randomGrid .cb-shorts-sub {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: #0f0f0f;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 36px;
  cursor: pointer;
  white-space: nowrap;
  font-family: Roboto, Arial, sans-serif;
}
body.page-home #randomGrid .cb-shorts-sub.is-on,
body.page-home #randomGrid .cb-shorts-sub.following {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}
body.page-home #randomGrid .cb-shorts-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff !important;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  text-decoration: none !important;
}
body.page-home #randomGrid .cb-shorts-channel {
  margin-top: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
  pointer-events: auto;
}
body.page-home #randomGrid a.cb-shorts-channel:hover {
  text-decoration: underline;
}
body.page-home #randomGrid .cb-shorts-actions {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: #fff;
  pointer-events: auto;
  flex: 0 0 56px;
  align-self: flex-end;
  margin-bottom: 20px;
}
body.page-home #randomGrid .cb-shorts-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 48px;
  color: #0f0f0f;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
body.page-home #randomGrid .cb-shorts-act svg {
  width: 24px;
  height: 24px;
  fill: #0f0f0f;
  display: block;
  padding: 10px;
  box-sizing: content-box;
  background: #f2f2f2;
  border-radius: 50%;
}
body.page-home #randomGrid .cb-shorts-act.is-on svg,
body.page-home #randomGrid .cb-shorts-act.like-btn.active svg {
  background: #0f0f0f;
  fill: #fff;
}
body.page-home #randomGrid .cb-shorts-act-avt {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #272727 center / cover no-repeat;
  margin-top: 4px;
}
body.page-home #randomGrid .cb-shorts-act-avt svg {
  display: none;
}
body.page-home .cb-shorts-nav-btn.is-prev[hidden] {
  display: none;
}
body.page-home #randomGrid .cb-shorts-act-lbl:empty {
  display: none;
}
body.page-home #randomGrid .cb-shorts-act-lbl {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #0f0f0f;
}
@media (max-width: 720px) {
  body.page-home #randomContent .cb-shorts-stage {
    --cb-shorts-w: 100%;
  }
  body.page-home #randomGrid .cb-shorts-item,
  body.page-home #randomGrid .card {
    padding: 0 !important;
    gap: 0 !important;
  }
  body.page-home #randomGrid .cb-shorts-cluster {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
  }
  body.page-home #randomGrid .cb-shorts-frame,
  body.page-home #randomGrid .cb-shorts-item .thumb,
  body.page-home #randomGrid .cb-shorts-item .cb-thumb {
    border-radius: 0 !important;
  }
  body.page-home #randomGrid .cb-shorts-meta {
    left: 12px;
    width: calc(100% - 84px);
    bottom: 88px;
  }
  body.page-home #randomGrid .cb-shorts-actions {
    position: absolute !important;
    right: 8px !important;
    bottom: 96px !important;
    margin: 0 !important;
  }
  body.page-home .cb-shorts-nav {
    display: none !important;
  }
}
body.page-home #randomGrid .info,
body.page-home #randomGrid .video-info-grid,
body.page-home #randomGrid .cb-ia-thumb-ov,
body.page-home #randomGrid .duration,
body.page-home #randomGrid .card-menu-wrap {
  display: none !important;
}
body.page-home .cb-shorts-nav {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.page-home .cb-shorts-nav-btn {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #0f0f0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
body.page-home .cb-shorts-nav-btn:hover {
  background: #e5e5e5;
}
body.page-home #randomRefreshBtn[hidden] { display: none !important; }

/* History — compact 168×94 rows, not a 16:9 grid */
body.page-home #historyContent {
  display: none;
}
body.page-home #historyContent[style*="block"] {
  display: block !important;
}
body.page-home #vipContent {
  display: none;
}
body.page-home #vipContent[style*="block"] {
  display: block !important;
}
body.page-home .cb-hist-day {
  font-size: 16px;
  font-weight: 500;
  color: #0f0f0f;
  padding: 16px 0 4px;
  font-family: Roboto, Arial, sans-serif;
}
body.page-home .cb-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 64px 8px;
  max-width: 1096px;
}
body.page-home .cb-hist-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f0f0f;
  font-family: Roboto, Arial, sans-serif;
}
body.page-home .cb-hist-clear {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #065fd4;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
body.page-home .cb-hist-clear:hover { background: #def1ff; }
body.page-home #historyGrid.cb-hist-list,
body.page-home #historyGrid {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 16px !important;
  padding: 8px 64px 48px !important;
  max-width: 1096px;
  width: 100% !important;
}
body.page-home .cb-hist-row {
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  min-height: 94px;
  position: relative;
  padding-right: 40px;
}
body.page-home .cb-hist-del {
  position: absolute;
  top: 8px;
  right: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-secondary, #606060);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.page-home .cb-hist-del:hover {
  background: var(--panel-soft, #f2f2f2);
  color: var(--text-primary, #0f0f0f);
}
body.page-home #historyGrid.is-selecting .cb-hist-row {
  padding-left: 28px;
  cursor: pointer;
}
body.page-home .cb-hist-row.is-selecting::before {
  content: "";
  position: absolute;
  left: 0;
  top: 36px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary, #606060);
  box-sizing: border-box;
}
body.page-home .cb-hist-row.is-selected::before {
  background: var(--accent, #065fd4);
  border-color: var(--accent, #065fd4);
  box-shadow: inset 0 0 0 3px var(--card, #fff);
}
body.page-home .cw-card-thumb {
  position: relative;
}
body.page-home .cb-hist-thumb {
  position: relative;
  flex: 0 0 168px;
  width: 168px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e5e5;
}
body.page-home .cb-hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.page-home .cb-hist-thumb .duration {
  position: absolute;
  right: 4px;
  bottom: 6px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  padding: 1px 4px;
  border-radius: 4px;
}
body.page-home .cb-hist-prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: #f00;
  display: block;
}
body.page-home .cb-hist-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}
body.page-home .cb-hist-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  color: #0f0f0f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.page-home .cb-hist-sub {
  font-size: 12px;
  line-height: 18px;
  color: #606060;
}
body.page-home #vipUpsellCard,
body.page-home .vip-upsell-card,
body.page-home .vip-upsell-row {
  display: none !important;
}
body.page-home .cb-shorts-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  pointer-events: none;
}
body.page-home .cb-shorts-loading[style*="block"] {
  display: flex !important;
}
body.page-home #randomEmpty {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f0f0f;
  color: #fff;
}
body.page-home #randomEmpty[style*="block"] {
  display: flex !important;
}

/* ─── E1: Sign in — live YT 1440: 40h / r20 / #065fd4 ─── */
body.page-home header #authBtns .auth-btn[onclick*="login"],
body.page-home header #authBtns .auth-btn:not(.btn-primary),
body.page-home header #authBtns button.auth-btn:not(.btn-primary),
body.page-home #catSideNav .yt-guide-signin-btn {
  height: 40px !important;
  min-height: 40px !important;
  min-width: 0 !important;
  padding: 0 15px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(0, 0, 0, .2) !important;
  background: transparent !important;
  color: #065fd4 !important;
  line-height: 1 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: Roboto, Arial, sans-serif !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  transform: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  transition: background-color .15s ease, border-color .15s ease !important;
}
body.page-home header #authBtns .auth-btn[onclick*="login"]:hover,
body.page-home header #authBtns .auth-btn:not(.btn-primary):hover,
body.page-home header #authBtns button.auth-btn:hover,
body.page-home #catSideNav .yt-guide-signin-btn:hover {
  background: rgb(222, 241, 255) !important;
  border-color: rgba(0, 0, 0, 0) !important;
  transform: none !important;
}
body.page-home header #authBtns .auth-btn .cb-ia-signin-ico,
body.page-home header #authBtns .auth-btn svg,
body.page-home #catSideNav .yt-guide-signin-btn .cb-ia-signin-ico,
body.page-home #catSideNav .yt-guide-signin-btn svg {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  display: block !important;
  fill: currentColor !important;
  color: #065fd4 !important;
}
body.page-home header #authBtns .auth-btn i,
body.page-home #catSideNav .yt-guide-signin-btn i {
  display: none !important;
}
body.page-home header #authBtns .auth-btn [data-tab-label],
body.page-home #catSideNav .yt-guide-signin-btn [data-tab-label] {
  line-height: 1 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

/* ─── E2: card kebab always visible (YT channel/search ⋮ is not hover-only) ─── */
body.page-home .card .info .card-menu-btn,
body.page-home .card .info .card-menu-btn.meta-menu,
body.page-home .card .card-menu-btn.meta-menu {
  opacity: 1 !important;
  background: transparent !important;
  color: #0f0f0f !important;
  width: 40px !important;
  height: 40px !important;
}
body.page-home .card .info .card-menu-btn:hover,
body.page-home .card .info .card-menu-btn.meta-menu:hover {
  background: rgba(0,0,0,.05) !important;
}

/* YT mast: name + standalone logout live inside avatar paper, not the strip */
body.page-home header #userPanel .yt-uname,
body.page-home header #userPanel .yt-logout-btn {
  display: none !important;
}
body.page-home header #notifPanel {
  width: 480px !important;
  max-width: min(480px, calc(100vw - 24px)) !important;
  max-height: min(640px, calc(100vh - 72px)) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 32px rgba(0,0,0,.16) !important;
  background: #fff !important;
}
body.page-home header #notifList { padding: 0 !important; }
body.page-home header .cb-ia-notif-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  background: #fff;
}
body.page-home header .cb-ia-notif-row:hover { background: #f2f2f2; }
body.page-home header .cb-ia-notif-row.is-unread { background: #edf4ff; }
body.page-home header .cb-ia-notif-row.is-unread:hover { background: #e3eeff; }
body.page-home header .cb-ia-notif-avt {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex: 0 0 48px;
  background-color: #e5e5e5;
}
body.page-home header .cb-ia-notif-body { flex: 1; min-width: 0; }
body.page-home header .cb-ia-notif-txt {
  font-size: 14px;
  line-height: 20px;
  color: #0f0f0f;
}
body.page-home header .cb-ia-notif-when {
  font-size: 12px;
  line-height: 18px;
  color: #065fd4;
  margin-top: 2px;
}
body.page-home header .cb-ia-notif-dot {
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 50%;
  background: #065fd4;
  flex: 0 0 6px;
}

body.page-home .cb-ia-continue {
  padding: 16px 0 8px;
}
body.page-home .cb-ia-continue-head {
  font-size: 20px;
  font-weight: 700;
  color: #0f0f0f;
  padding: 0 0 12px;
}
body.page-home .cb-ia-continue-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
body.page-home .cb-ia-continue-rail::-webkit-scrollbar { display: none; }
body.page-home .cb-ia-continue-card {
  flex: 0 0 210px;
  width: 210px;
  color: #0f0f0f;
  text-decoration: none;
}
body.page-home .cb-ia-continue-thumb {
  position: relative;
  display: block;
  width: 210px;
  height: 118px;
  border-radius: 12px;
  background: #f2f2f2 center / cover no-repeat;
  overflow: hidden;
}
body.page-home .cb-ia-continue-title {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  max-height: 40px;
  overflow: hidden;
}

/* Shorts comments: dock next to the 9:16 frame, do not cover the video */
body.page-home #commentBox.is-shorts-sheet {
  display: block !important;
  position: fixed !important;
  inset: 0;
  top: 0;
  height: 100%;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: default;
  pointer-events: none;
  z-index: 2300;
}
body.page-home #commentBox.is-shorts-sheet .comment-box {
  pointer-events: auto;
  position: fixed;
  display: flex;
  flex-direction: column;
  width: 402px;
  max-width: min(402px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  border-radius: 12px;
  border: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  background: #fff;
  color: #0f0f0f;
  overflow: hidden;
}
body.page-home #commentBox.is-shorts-sheet #commentSearch,
body.page-home #commentBox.is-shorts-sheet .comment-toolbar {
  display: none !important;
}
body.page-home #commentBox.is-shorts-sheet .comment-content {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}
body.page-home #commentBox.is-shorts-sheet .comment-input-area {
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  body.page-home #commentBox.is-shorts-sheet {
    pointer-events: auto;
    background: rgba(0, 0, 0, .45);
  }
  body.page-home #commentBox.is-shorts-sheet .comment-box {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: min(72vh, 640px) !important;
    border-radius: 16px 16px 0 0 !important;
  }
}
body.page-home #commentBox.is-shorts-sheet .comment-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}
body.page-home #commentBox.is-shorts-sheet .comment-header h3 {
  margin: 0;
  color: #0f0f0f;
  font-size: 20px;
  font-weight: 700;
  text-transform: none;
}
body.page-home #commentBox.is-shorts-sheet .comment-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #0f0f0f;
  font-size: 24px;
}
body.page-home #commentBox.is-shorts-sheet .comment-close:hover {
  background: rgba(0, 0, 0, .05);
  color: #0f0f0f;
}
body.page-home #commentBox.is-shorts-sheet .comment-toolbar {
  padding: 12px 16px 0 !important;
}
body.page-home #commentBox.is-shorts-sheet .comment-meta,
body.page-home #commentBox.is-shorts-sheet .comment-content,
body.page-home #commentBox.is-shorts-sheet .comment-username,
body.page-home #commentBox.is-shorts-sheet .comment-text {
  color: #0f0f0f;
}
body.page-home #commentBox.is-shorts-sheet .comment-input-area {
  border-top: 1px solid rgba(0, 0, 0, .1);
  background: #fff;
}
body.page-home #commentBox.is-shorts-sheet .comment-input {
  background: #f2f2f2;
  border: 0;
  color: #0f0f0f;
  border-radius: 18px;
  height: 40px;
  min-height: 40px;
  padding: 10px 16px;
}
body.page-home #commentBox.is-shorts-sheet .comment-submit-btn {
  background: #0f0f0f;
  color: #fff;
  border-radius: 18px;
  font-weight: 500;
}
body.page-home #commentBox.is-shorts-sheet .comment-submit-btn:disabled {
  background: #f2f2f2;
  color: #909090;
}

/* ── launch polish: skeleton / card play / motion / tap / overflow ── */
body.page-home {
  overflow-x: hidden;
}
body.page-home .skeleton-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 16px;
  padding: 12px 24px;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 1749px) {
  body.page-home .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1099px) {
  body.page-home .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  body.page-home .skeleton-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 24px 12px;
  }
}
body.page-home .skeleton-card {
  background: transparent !important;
  min-width: 0;
}
body.page-home .skeleton-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--skeleton-base);
  position: relative;
  overflow: hidden;
}
body.page-home .skeleton-line {
  position: relative;
  overflow: hidden;
  height: 14px;
  margin-top: 12px;
  width: 92%;
  border-radius: 6px;
  background: var(--skeleton-base);
}
body.page-home .skeleton-line.short {
  width: 56%;
  height: 12px;
  margin-top: 8px;
}
body.page-home .skeleton-thumb::after,
body.page-home .skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-hl), transparent);
  transform: translateX(-100%);
  animation: cb-skel-shine 1.2s ease-in-out infinite;
}
@keyframes cb-skel-shine {
  100% { transform: translateX(100%); }
}

body.page-home .grid .card,
body.page-home .card.cb-item {
  transition: transform var(--transition-normal, .2s) ease, box-shadow var(--transition-normal, .2s) ease;
}
/* 2026-10-10: 中和卡片 hover 上浮 —— YouTube 卡片本体 hover 完全不动(只出现 ⋮ 菜单)。
   原 translateY(-2px) 与 yt-exact.css 的逐像素复刻冲突。 */
body.page-home .grid .card:hover,
body.page-home .card.cb-item:hover {
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
body.page-home .card:hover .thumb,
body.page-home .card:hover .thumb img,
body.page-home .card:hover .cb-thumb img {
  transform: none !important;
}
body.page-home .card .cb-card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transition: opacity 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.page-home .card .cb-card-play::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent var(--text-primary, #fff);
  margin-left: 3px;
  filter: brightness(10);
}
body.page-home .card:hover .cb-card-play,
body.page-home .card:focus-within .cb-card-play {
  opacity: 1;
}

body.page-home .tab-empty-btn,
body.page-home .tab-empty-btn.primary,
body.page-home .tab-empty-btn.signin {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
}
body.page-home .card-menu-btn,
body.page-home .meta-menu {
  min-width: 44px;
  min-height: 44px;
}
body.page-home .btn-submit,
body.page-home .nav-btn,
body.page-home .oauth-btn,
body.page-home .btn-code {
  min-height: 44px;
}
body.page-home button:active:not(:disabled),
body.page-home .tab-empty-btn:active,
body.page-home .btn-submit:active:not(:disabled),
body.page-home .nav-btn:active {
  transform: none;
}
body.page-home button:disabled,
body.page-home .btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.page-home .auth-modal {
  opacity: 0;
  transition: opacity 200ms ease;
}
body.page-home .auth-modal.is-open {
  opacity: 1;
}
body.page-home .auth-modal .auth-box {
  transform: translateY(10px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}
body.page-home .auth-modal.is-open .auth-box {
  transform: translateY(0);
  opacity: 1;
}
body.page-home #mediaModal,
body.page-home .mini-overlay,
body.page-home .comment-modal {
  transition: opacity 200ms ease;
}

/* ─── Home Shorts shelf (YouTube-style 9:16 rail) ─── */
body.page-home .cb-home-shorts[hidden] {
  display: none !important;
}
body.page-home .cb-home-shorts {
  padding: 12px 0 8px;
  margin: 0 0 8px;
}
body.page-home .cb-home-shorts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 24px 10px;
  color: var(--text-primary);
  text-decoration: none;
}
body.page-home .cb-home-shorts-brand {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}
body.page-home .cb-home-shorts-more {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
body.page-home .cb-home-shorts-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 24px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
body.page-home .cb-home-shorts-rail::-webkit-scrollbar {
  display: none;
  height: 0;
}
body.page-home .cb-home-shorts-card {
  position: relative;
  flex: 0 0 148px;
  width: 148px;
  height: 248px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-soft);
  text-decoration: none;
  color: var(--text-primary);
  scroll-snap-align: start;
}
body.page-home .cb-home-shorts-thumb {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg) center / cover no-repeat;
}
body.page-home .cb-home-shorts-card::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 72%, transparent));
  pointer-events: none;
}
body.page-home .cb-home-shorts-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  max-height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--text-primary);
}
body.page-home .cb-home-shorts-card:hover {
  background: var(--card-hover);
}
body.page-home .cb-home-shorts-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  body.page-home .cb-home-shorts-head,
  body.page-home .cb-home-shorts-rail {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 375px) {
  body.page-home,
  body.page-home .header-inner,
  body.page-home #contentArea {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .skeleton-thumb::after,
  body.page-home .skeleton-line::after,
  body.page-home .grid .card,
  body.page-home .card.cb-item,
  body.page-home .card .cb-card-play,
  body.page-home .auth-modal,
  body.page-home .auth-modal .auth-box,
  body.page-home button {
    animation: none !important;
    transition: none !important;
  }
  body.page-home .grid .card:hover,
  body.page-home .card.cb-item:hover,
  body.page-home button:active:not(:disabled) {
    transform: none !important;
  }
}


/* Shorts: hide guide, full-height reel like YT */
body.page-home.is-feed-random #userSideNav,
body.page-home.is-feed-random .yt-guide,
body.page-home.is-feed-random #guide {
  display: none !important;
}
body.page-home.is-feed-random #mainContent,
body.page-home.is-feed-random .page-manager,
body.page-home.is-feed-random #contentArea {
  margin-left: 0 !important;
  padding-left: 0 !important;
}
body.page-home.is-feed-random #randomContent {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
body.page-home.is-feed-random #randomContent .cb-shorts-stage {
  --cb-shorts-h: calc(100vh - 56px);
  --cb-shorts-w: min(430px, calc(var(--cb-shorts-h) * 9 / 16 + 80px));
  width: 100%;
  display: flex;
  justify-content: center;
  background: #000;
}
body.page-home.is-feed-random #randomGrid {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
}
body.page-home.is-feed-random #randomGrid .cb-shorts-item,
body.page-home.is-feed-random #randomGrid .card {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

body.page-home:not(.is-logged-in) #catSideNav .yt-guide-lib,
body.page-home:not(.is-logged-in) #catSideNav .yt-guide-you-head,
body.page-home:not(.is-logged-in) #catSideNav #tab-later,
body.page-home:not(.is-logged-in) #catSideNav #tab-liked,
body.page-home:not(.is-logged-in) #catSideNav #tab-vip,
body.page-home:not(.is-logged-in) #catSideNav #tab-queue,
body.page-home:not(.is-logged-in) #catSideNav a[href="/vip/"],
body.page-home:not(.is-logged-in) #catSideNav a[href="/later/"],
body.page-home:not(.is-logged-in) #catSideNav a[href="/liked/"],
body.page-home:not(.is-logged-in) #catSideNav a[href="/playlists/"],
body.page-home:not(.is-logged-in) #catSideNav #catSideList,
body.page-home:not(.is-logged-in) #catSideNav .yt-guide-heading:not(:has([data-i18n="exploreSection"])) {
  display: none !important;
}
