/* ========================================
   PC端预览面板样式
   ======================================== */

/* PC端基础预览面板容器 */
.preview-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* PDF查看器容器 */
.pdf-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f9f9f9;
}

/* PDF查看器基础样式 */
#pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 欢迎页面样式 */
.preview-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.preview-welcome .welcome-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #999;
}

.preview-welcome h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.preview-welcome p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* PDF查看器基础样式 */
#pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 确保PDF.js的样式不被覆盖 */
.preview-panel iframe {
    border: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* PC端PDF.js内部布局优化 */
#pdf-viewer #outerContainer {
    height: 100% !important;
    position: relative !important;
}

#pdf-viewer #mainContainer {
    height: calc(100% - 32px) !important;
    position: absolute !important;
    top: 32px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

#pdf-viewer #viewerContainer {
    height: 100% !important;
    overflow: auto !important;
}

#pdf-viewer #toolbar {
    height: 32px !important;
    position: relative !important;
    z-index: 2 !important;
}

/* PC端PDF页面显示优化 */
#pdf-viewer .page {
    margin: 10px auto !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

#pdf-viewer .page canvas {
    display: block !important;
    margin: 0 auto !important;
}

/* ========================================
   移动端预览面板样式
   ======================================== */

@media (max-width: 768px) {
    /* 移动端基础预览面板容器 */
    .preview-panel {
        display: flex;
        flex-direction: column;
        height: 91%;
        background: #f9f9f9;
        border: none;
        border-radius: 0;
        overflow: hidden;
        position: relative;
    }
    
    /* 移动端欢迎页面优化 */
    .preview-welcome {
        padding: 20px 15px;
    }
    
    .preview-welcome .welcome-icon {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .preview-welcome h3 {
        font-size: 16px;
    }
    
    .preview-welcome p {
        font-size: 13px;
    }
    
    /* 移动端PDF查看器工具栏优化 */
    #pdf-viewer #toolbar {
        height: 40px !important;
        font-size: 14px !important;
    }
    
    /* 移动端PDF查看器主容器调整 */
    #pdf-viewer #mainContainer {
        height: calc(100% - 40px) !important;
        top: 40px !important;
    }
    
    /* 移动端PDF页面显示优化 */
    #pdf-viewer .page {
        margin: 5px auto !important;
        max-width: calc(100vw - 20px) !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
    }
    
    /* 移动端PDF查看器容器优化 */
    #pdf-viewer #viewerContainer {
        padding: 0 5px !important;
    }
    
    /* 移动端PDF外层容器调整 */
    #pdf-viewer #outerContainer {
        height: 100% !important;
    }
}