* {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

[v-cloak] { display: none !important; }

/* iOS Safari / 内嵌 WebView 的 100vh 按「工具栏收起后的最大视口」计算，
   实际可见区域更矮，页面最底行（播放器控件栏）会被底部工具栏/圆角遮住。
   dvh 跟随可见视口动态变化；老 WebKit 不认 dvh 时退回 -webkit-fill-available。 */
body.h-screen {
    height: 100vh;
    height: -webkit-fill-available;
}
@supports (height: 100dvh) {
    body.h-screen { height: 100dvh; }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }
.poster-fallback {
    background: linear-gradient(135deg, #27272a 0%, #18181b 100%);
}

/* 推荐墙货架：只展示整 2 行。列数随断点变（3/4/5/6/8），
   每架 20 张整除不了会留半行，这里按断点把超出 列数×2 的卡片裁掉，
   剩余的收进「查看更多」详情页。断点与模板里的 grid-cols 保持一致。 */
.tvb-shelf-grid > *:nth-child(n+7) { display: none; }                       /* <640px：3 列 ×2 行 */
@media (min-width: 640px) {                                                 /* sm：4 列 */
    .tvb-shelf-grid > *:nth-child(-n+8) { display: block; }
    .tvb-shelf-grid > *:nth-child(n+9) { display: none; }
}
@media (min-width: 768px) {                                                 /* md：5 列 */
    .tvb-shelf-grid > *:nth-child(-n+10) { display: block; }
    .tvb-shelf-grid > *:nth-child(n+11) { display: none; }
}
@media (min-width: 1024px) {                                                /* lg：6 列 */
    .tvb-shelf-grid > *:nth-child(-n+12) { display: block; }
    .tvb-shelf-grid > *:nth-child(n+13) { display: none; }
}
@media (min-width: 1280px) {                                                /* xl：8 列 */
    .tvb-shelf-grid > *:nth-child(-n+16) { display: block; }
    .tvb-shelf-grid > *:nth-child(n+17) { display: none; }
}

/* 今日 TOP 10：单行不换行、横向滚动（滚轮/触屏原生，鼠标由 dragScroll 接管）。
   隐藏滚动条；拖拽时禁掉图片原生 drag 与文字选中，避免拖到一半变成拖图。 */
.tvb-top10-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    /* overflow-x:auto 会连带裁掉纵向溢出：留 0.5rem 顶部内边距给 hover 上移
       （-translate-y-1），再用负 margin 抵消，避免行间距变大 */
    padding-top: 0.5rem;
    margin-top: -0.5rem;
    cursor: grab;
    user-select: none;
    scrollbar-width: none;              /* Firefox */
}
.tvb-top10-scroll::-webkit-scrollbar { display: none; }
.tvb-top10-scroll:active { cursor: grabbing; }
.tvb-top10-scroll img { -webkit-user-drag: none; }

/* 无滚动条的横向滚动区（演员阵容等）：滚轮/触屏原生可滑，鼠标由 dragScroll 接管 */
.tvb-scroll-nobar { scrollbar-width: none; cursor: grab; user-select: none; }
.tvb-scroll-nobar::-webkit-scrollbar { display: none; }
.tvb-scroll-nobar:active { cursor: grabbing; }
.tvb-scroll-nobar img { -webkit-user-drag: none; }

/* 下拉刷新松手回弹：快出缓收的类弹簧曲线，回位干脆不发飘 */
.tvb-pull-snap { transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }

/* 轻量 toast（utils.toast）：顶部居中、浮入淡出，不阻塞交互 */
#tvb-toast-box {
    position: fixed;
    top: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}
.tvb-toast {
    max-width: min(90vw, 28rem);
    padding: 0.55rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    color: #e4e4e7;
    background: rgba(24, 24, 27, 0.92);
    border: 1px solid rgba(63, 63, 70, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tvb-toast-show { opacity: 1; transform: translateY(0); }
.tvb-toast-error { border-color: rgba(244, 63, 94, 0.45); color: #fda4af; }

/* 移动端：聚焦输入框时禁止自动放大页面。
   iOS Safari 自 iOS 10 起忽略 maximum-scale / user-scalable，
   唯一可靠的做法是让控件字号 >= 16px（Android 同理）。
   仅对粗指针（触屏）生效，桌面端保持原有 text-xs / text-sm 视觉。 */
@media (pointer: coarse) {
    input,
    input[type="text"],
    input[type="search"],
    input[type="url"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
        /* 抵消 16px 带来的行高增长，保持原有紧凑高度 */
        line-height: 1.25;
    }
}
