/* ============================================
 * 小姐姐视频播放器 - xjj-video 插件
 * 架构：原生 scroll-snap 竖屏滚动 + 窗口化 video 池
 * ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%;
    background: #000; overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    color: #fff;
}

body.xjj-fullscreen { overflow: hidden; }

/* ===== 主容器 ===== */
.xjj-app,
.xjj-app * { margin: 0; padding: 0; box-sizing: border-box; }

.xjj-app {
    position: fixed; inset: 0;
    overflow: hidden; background: #000;
    z-index: 1;
    -webkit-user-select: none; -moz-user-select: none; user-select: none;
    -webkit-touch-callout: none;
    --xjj-h: 100vh;
}

/* ===== 背景模糊层（无 video 时兜底） ===== */
.xjj-app #bg {
    position: absolute; inset: -40px;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%) center/cover no-repeat;
    filter: blur(28px) brightness(.45);
    transform: scale(1.1); z-index: 0;
    pointer-events: none;
}

/* ===== 滚动吸附容器 ===== */
.xjj-app #xjj-feed-scroller {
    position: absolute; inset: 0;
    overflow-y: scroll; overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-snap-stop: always;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 1;
}
.xjj-app #xjj-feed-scroller::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ===== 每条视频 ===== */
.xjj-app .xjj-slide {
    position: relative;
    width: 100%;
    height: var(--xjj-h, 100vh);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    contain: strict;
    transform: translateZ(0);
}

.xjj-app .xjj-slide video {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
    -webkit-user-drag: none;
}

.xjj-app .xjj-slide .xjj-title {
    position: absolute;
    left: 14px; right: 90px; bottom: 100px;
    font-size: 14px; line-height: 1.5;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
    pointer-events: none;
    word-break: break-all;
}

/* ===== 顶部品牌 ===== */
.xjj-app #logoWrap {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top));
    left: 14px;
    z-index: 5;
    text-decoration: none; color: #fff;
    line-height: 1.15;
}
.xjj-app #logo {
    font-size: 17px; font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.xjj-app #logo2 {
    font-size: 10px; opacity: .8; margin-top: 2px;
}
.xjj-app #time {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px; z-index: 5;
    color: #fff; font-size: 18px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ===== 右侧按钮列 ===== */
.xjj-app #btns {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex; flex-direction: column; gap: 14px;
}
.xjj-app .btn {
    display: flex; align-items: center; justify-content: center;
    width: 72px; height: 38px;
    border-radius: 19px;
    background: rgba(60,62,72,.65);
    color: #fff; font-size: 14px;
    cursor: pointer; user-select: none; text-decoration: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform .1s, background .2s;
}
.xjj-app .btn:active {
    transform: scale(.94);
    background: rgba(90,92,102,.85);
}

/* ===== 底部状态 ===== */
.xjj-app #status {
    position: absolute;
    left: 8px;
    bottom: calc(6px + env(safe-area-inset-bottom));
    z-index: 5;
    color: rgba(255,255,255,.55);
    font-size: 11px;
    max-width: 70%;
    line-height: 1.3;
    word-break: break-all;
    pointer-events: none;
}

/* ===== Toast 提示 ===== */
.xjj-app #toast {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%,-50%) scale(.9);
    z-index: 20;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(0,0,0,.82);
    color: #fff; font-size: 14px;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
    max-width: 80%; text-align: center; line-height: 1.5;
    word-break: break-all;
}
.xjj-app #toast.show {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
}
.xjj-app #toast a { color: #7fd; text-decoration: underline; }

/* ===== 加载转圈 ===== */
.xjj-app #spin {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%,-50%);
    z-index: 15;
    text-align: center;
    display: none;
}
.xjj-app #spin.show { display: block; }
.xjj-app #spin i {
    display: block;
    width: 30px; height: 30px;
    margin: 0 auto 6px;
    border: 2px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: xjjspin .8s linear infinite;
}
.xjj-app #spin b {
    font-size: 12px; font-weight: 400; color: rgba(255,255,255,.85);
}
@keyframes xjjspin { to { transform: rotate(360deg); } }

/* ===== 自绘弹窗 ===== */
.xjj-app #modal {
    position: absolute; inset: 0;
    z-index: 100;
    background: rgba(0,0,0,.68);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.xjj-app #modal.hidden { display: none; }

.xjj-app #modal .xjj-modal-box {
    width: 86vw; max-width: 400px;
    background: #1a1a22;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.7);
    color: #fff;
    max-height: 80vh;
    overflow: auto;
}
.xjj-app #modal h4 {
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}
.xjj-app #modal .xjj-modal-body {
    font-size: 14px;
    line-height: 1.75;
    color: rgba(255,255,255,.9);
}
.xjj-app #modal .xjj-modal-body hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,.12);
    margin: 10px 0;
}
.xjj-app #modal .xjj-modal-body a {
    color: #ff87a8;
    text-decoration: underline;
}
.xjj-app #modal .xjj-modal-btns {
    display: flex; gap: 10px; margin-top: 18px;
}
.xjj-app #modal .xjj-modal-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 22px;
    text-align: center;
    font-size: 14px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.16);
    cursor: pointer;
}
.xjj-app #modal .xjj-modal-btn.primary {
    background: linear-gradient(135deg, #ff5f8a, #ff8a4c);
    border: 0;
    color: #fff;
    font-weight: 600;
}

/* ===== 移动端 ===== */
@media (max-width: 450px) {
    .xjj-app #btns { right: 8px; gap: 12px; }
    .xjj-app .btn { width: 64px; height: 34px; font-size: 13px; }
    .xjj-app #status {
        bottom: calc(44px + env(safe-area-inset-bottom));
        max-width: 60%;
    }
}

/* ===== 播放器页隐藏站内看板娘（配合 lite.css / pio.css） ===== */
.xjj-fullscreen .lite-container,
.xjj-fullscreen .pio-container { display: none !important; }