/* VR PDF Hotspot - FlipBook 仿真翻书与单页高清预览样式 */

/* 根遮罩层 */
.vr-pdf-hotspot {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    background: #14161d;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: border-box;
}

/* 顶部导航栏 */
.vr-pdf-header {
    height: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    background: rgba(22, 25, 34, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
    z-index: 20;
}

.vr-pdf-title-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.vr-pdf-title-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #4096ff;
}

.vr-pdf-title {
    font-size: 15px;
    font-weight: 600;
    color: #f0f2f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vr-pdf-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.vr-pdf-header-badge {
    padding: 2px 8px;
    font-size: 12px;
    color: #8c9ba5;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    white-space: nowrap;
}

.vr-pdf-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d5db;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.vr-pdf-btn-link:hover {
    background: rgba(64, 150, 255, 0.25);
    border-color: rgba(64, 150, 255, 0.4);
    color: #69b1ff;
}

.vr-pdf-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.vr-pdf-btn-icon:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.vr-pdf-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.vr-pdf-close-btn:hover {
    background: rgba(255, 77, 79, 0.35);
    color: #ff7875;
}

/* 主舞台区 */
.vr-pdf-stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
    touch-action: pan-y;
    background: transparent;
}

/* 离线预览 object 容器 */
.vr-pdf-stage object {
    width: 100%;
    height: 100%;
    border: 0;
}

/* 翻书舞台容器 */
.vr-pdf-book-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    background: transparent;
}

.vr-pdf-book {
    position: relative;
    margin: 0 auto;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    background: transparent;
}

/* 覆盖 PageFlip 生成的内联 min-width / min-height，避免移动端溢出并向下偏移 */
.vr-pdf-book.stf__parent {
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 修复 PageFlip CSS typo (.sft__wrapper -> .stf__wrapper)，强制 100% 高度与居中 */
.vr-pdf-book .stf__wrapper {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    background: transparent;
}

.vr-pdf-book .stf__block {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 翻书单个页面容器 */
.vr-pdf-page-item {
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.vr-pdf-page-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
}

/* 双页书脊折痕立体阴影 */
.stf__item.--left .vr-pdf-page-inner::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 36px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.04) 60%, transparent);
    pointer-events: none;
    z-index: 2;
}

.stf__item.--right .vr-pdf-page-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 36px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.04) 60%, transparent);
    pointer-events: none;
    z-index: 2;
}

/* 页面图片 */
.vr-pdf-page-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    background: transparent;
}

/* 页面加载指示器 */
.vr-pdf-page-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1a1e28;
    color: #94a3b8;
    font-size: 13px;
    z-index: 1;
}

/* 全局加载遮罩 */
.vr-pdf-doc-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #14161d;
    z-index: 30;
    color: #cbd5e1;
    font-size: 14px;
}

.vr-pdf-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(64, 150, 255, 0.2);
    border-top-color: #4096ff;
    border-radius: 50%;
    animation: vrPdfSpin 0.8s linear infinite;
}

@keyframes vrPdfSpin {
    to { transform: rotate(360deg); }
}

/* 单页高清预览舞台 - 铺满全屏，缩放时覆盖全屏且可漫游拖拽 */
.vr-pdf-single-stage {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    touch-action: none;
    z-index: 10;
}

.vr-pdf-single-stage.is-zoomed {
    z-index: 24;
}

/* 放大时隐藏左右侧边翻页箭头，避免遮挡和误触，给全屏拖拽提供完整空间 */
.vr-pdf-stage.is-zoomed .vr-pdf-side-arrow {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-50%) scale(0.8) !important;
}

.vr-pdf-single-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    overflow: visible; /* 放大时不裁剪，让图片在全屏幕范围内自由漫游与查看 */
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.vr-pdf-single-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    transform-origin: center center;
    background: transparent;
    cursor: zoom-in;
    border-radius: 4px;
}

.vr-pdf-single-img.is-zoomed {
    cursor: grab;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.vr-pdf-single-img.is-zoomed:active {
    cursor: grabbing;
}

.vr-pdf-single-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #14161d;
    color: #94a3b8;
    font-size: 13px;
    z-index: 2;
}

/* 浮动缩放复原按钮 */
.vr-pdf-zoom-reset-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 20px;
    background: rgba(22, 25, 34, 0.9);
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 25;
    transition: transform 0.15s, background 0.2s;
    white-space: nowrap;
}

.vr-pdf-zoom-reset-btn svg {
    width: 14px;
    height: 14px;
    fill: #4096ff;
}

.vr-pdf-zoom-reset-btn:hover {
    background: rgba(64, 150, 255, 0.85);
}

.vr-pdf-zoom-reset-btn:active {
    transform: translateX(-50%) scale(0.95);
}

/* 左右侧悬浮翻页按钮 (单页与翻书模式均显示，支持移动端和PC端) */
.vr-pdf-side-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(22, 26, 36, 0.75);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 25;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    -webkit-tap-highlight-color: transparent;
}

.vr-pdf-side-arrow:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.85);
    border-color: rgba(147, 197, 253, 0.5);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
    transform: translateY(-50%) scale(1.08);
}

.vr-pdf-side-arrow:active:not(:disabled) {
    transform: translateY(-50%) scale(0.94);
}

.vr-pdf-side-arrow:disabled {
    opacity: 0.18;
    cursor: not-allowed;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.05);
}

.vr-pdf-prev-arrow {
    left: 16px;
}

.vr-pdf-next-arrow {
    right: 16px;
}

.vr-pdf-side-arrow svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* 底部操作工具栏 (悬浮晶透中岛设计) */
.vr-pdf-footer {
    height: 66px;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 13, 20, 0.75) 40%, rgba(7, 9, 15, 0.98) 100%);
    box-sizing: border-box;
    z-index: 20;
    pointer-events: none; /* 外层遮罩不阻挡点击，只有中间控制条接收事件 */
}

/* 悬浮微质感控制岛 - 聚合紧凑、现代高级 */
.vr-pdf-footer-bar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 480px;
    height: 48px;
    padding: 0 8px;
    margin: 0 auto;
    background: rgba(20, 24, 35, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: all 0.25s ease;
}

/* 上一页 / 下一页 精致胶囊微晶按钮 */
.vr-pdf-btn-flip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #f8fafc;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.vr-pdf-btn-flip svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.9;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vr-pdf-btn-flip.vr-pdf-btn-prev:hover:not(:disabled) svg {
    transform: translateX(-2px);
}

.vr-pdf-btn-flip.vr-pdf-btn-next:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.vr-pdf-btn-flip:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.38) 0%, rgba(37, 99, 235, 0.24) 100%);
    border-color: rgba(96, 165, 250, 0.6);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.vr-pdf-btn-flip:active:not(:disabled) {
    transform: translateY(0.5px) scale(0.96);
    background: rgba(37, 99, 235, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.vr-pdf-btn-flip:disabled {
    opacity: 0.24;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
    color: #64748b;
    box-shadow: none;
}

/* 底部中央页码与进度滑块 */
.vr-pdf-nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 110px;
    max-width: 220px;
    flex: 1;
    padding: 0 6px;
}

.vr-pdf-page-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.vr-pdf-cur-page {
    color: #60a5fa;
    font-weight: 600;
}

.vr-pdf-page-divider {
    color: #64748b;
}

.vr-pdf-total-pages {
    color: #94a3b8;
}

.vr-pdf-slider-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    height: 12px;
}

.vr-pdf-slider {
    width: 100%;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 2px 0 0;
    transition: background 0.2s;
}

.vr-pdf-slider:hover {
    background: rgba(255, 255, 255, 0.26);
}

.vr-pdf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 1px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: 2px solid #ffffff;
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.15s;
}

.vr-pdf-slider::-webkit-slider-thumb:hover {
    transform: scale(1.22);
    background: #60a5fa;
}

.vr-pdf-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), 0 1px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: 2px solid #ffffff;
}

/* 移动端特别适配 (针对竖屏手机及小屏幕) */
@media (max-width: 768px) {
    .vr-pdf-header {
        height: 44px;
        min-height: 44px;
        padding: 0 8px;
        gap: 6px;
    }

    .vr-pdf-title {
        font-size: 13px;
    }

    .vr-pdf-header-badge {
        display: none;
    }

    .vr-pdf-btn-link {
        height: 28px;
        padding: 0 8px;
        font-size: 12px;
    }

    .vr-pdf-btn-icon {
        width: 28px;
        height: 28px;
    }

    .vr-pdf-close-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .vr-pdf-stage {
        padding: 6px;
    }

    /* 手机端悬浮箭头精简化，保证单页模式与翻书模式均可轻松轻触 */
    .vr-pdf-side-arrow {
        width: 36px;
        height: 36px;
        background: rgba(18, 22, 32, 0.65);
    }

    .vr-pdf-prev-arrow {
        left: 6px;
    }

    .vr-pdf-next-arrow {
        right: 6px;
    }

    .vr-pdf-side-arrow svg {
        width: 18px;
        height: 18px;
    }

    .vr-pdf-footer {
        height: 60px;
        min-height: 60px;
        padding: 0 10px 6px;
    }

    .vr-pdf-footer-bar {
        height: 44px;
        padding: 0 6px;
        gap: 8px;
        max-width: 100%;
        border-radius: 22px;
    }

    .vr-pdf-btn-flip {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
        gap: 4px;
        border-radius: 16px;
    }

    .vr-pdf-btn-flip svg {
        width: 13px;
        height: 13px;
    }

    .vr-pdf-nav-center {
        min-width: 80px;
        padding: 0 2px;
        gap: 2px;
    }

    .vr-pdf-page-indicator {
        font-size: 11px;
        padding: 0 6px;
    }
}


