/* 与 Boboji Next 项目 globals.css 一致：补充预编译 tailwind.css 未覆盖的动画与滚动条 */

html {
    scroll-behavior: smooth;
}

body {
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
a,
select,
input[type="checkbox"],
input[type="radio"],
input[type="submit"],
input[type="button"],
label[for] {
    cursor: pointer;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

.bj-poster-fallback {
    z-index: 0;
}

/* JS 动态插入的卡片占位 logo（构建时见 tailwind.config.js content） */
.bj-poster-fallback img[data-bj-poster-fallback-logo],
[data-bj-poster-fallback-logo] {
    width: 6rem;
    height: 6rem;
    opacity: 0.3;
    object-fit: contain;
}

[data-bj-history-list] [data-bj-poster-fallback-logo] {
    width: 2.5rem;
    height: 2.5rem;
}

[data-bj-poster-wrap]:not(.absolute) {
    position: relative;
}

img[data-bj-poster-failed="1"] {
    display: none;
}

/* 全局隐藏滚动条，保留滚动能力 */
html,
body,
* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse-slow {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-shimmer {
    animation: shimmer 2s infinite linear;
}

.pt-safe-area-inset-top {
    padding-top: env(safe-area-inset-top, 0px);
}

.pb-safe-area-inset-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@supports not (height: 100dvh) {
    .h-\[100dvh\] {
        height: 100vh;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 热度榜序号（top 页），不依赖模板 add 函数 */
.boboji-rank-grid {
    counter-reset: boboji-rank;
}

.boboji-rank-card {
    position: relative;
}

/* 播放器层叠：避免滚动时盖住固定顶栏（z-[100]） */
[data-bj-player] {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

[data-bj-player] .artplayer-app {
    z-index: 1 !important;
}

[data-bj-player] .art-dplayer {
    z-index: 1 !important;
}

/* 选集区：默认折叠为两行高度，超出可在此区域内滚动定位当前集 */
[data-bj-episodes-list].bj-episodes-list--collapsed {
    max-height: calc(2 * (1.875rem + 2px) + 0.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

[data-bj-episodes-list].bj-episodes-list--collapsed::-webkit-scrollbar {
    display: none;
}

[data-bj-episodes-toggle].bj-episodes-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    margin-top: 0;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    color: #9ca3af;
    background: transparent;
    border: 0;
    border-top: 1px solid rgb(39 39 42 / 0.85);
    border-radius: 0;
    box-shadow: none;
    transition: color 0.2s ease;
}

[data-bj-episodes-toggle].bj-episodes-toggle:hover {
    color: #f87171;
}

[data-bj-episodes-toggle][data-expanded="1"] [data-bj-episodes-chevron] {
    transform: rotate(180deg);
}

.boboji-rank-card::before {
    counter-increment: boboji-rank;
    content: counter(boboji-rank);
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 20;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: #f59e0b;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
