/* PDF 在线编辑器样式 */

.pdf-editor-page {
    height: calc(100vh - 76px);
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.pdf-toolbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pdf-toolbar .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.pdf-toolbar .vr {
    height: 24px;
    align-self: center;
}

.pdf-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 缩略图面板 */
.pdf-thumbnail-panel {
    width: 200px;
    min-width: 200px;
    background: #fff;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 0.5rem;
}

.pdf-thumbnail-panel .panel-header {
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.thumbnail-item {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    text-align: center;
    transition: background 0.2s;
    position: relative;
}

.thumbnail-item:hover {
    background: #e9ecef;
}

.thumbnail-item.active {
    background: #e7e9ff;
    border: 1px solid #4F46E5;
}

.thumbnail-item canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #fff;
}

.thumbnail-item .page-num {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
}

.thumbnail-item .page-actions {
    display: none;
    position: absolute;
    top: 2px;
    right: 2px;
    gap: 2px;
}

.thumbnail-item:hover .page-actions {
    display: flex;
}

.thumbnail-item .page-actions button {
    padding: 0 4px;
    font-size: 10px;
    line-height: 18px;
}

/* 上传区域 */
#upload-container {
    overflow-y: auto;
}

/* 画布区域 */
.pdf-viewer-area {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    position: relative;
}

.pdf-canvas-wrapper {
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #fff;
    margin-bottom: 1rem;
}

#pdf-canvas {
    display: block;
    position: relative;
    z-index: 1;
    background: #fff;
}

#text-layer {
    z-index: 100;
    pointer-events: none;
}

#text-layer span {
    pointer-events: auto;
}

/* 文字替换弹窗 */
.text-replace-panel {
    position: absolute;
    background: #fff;
    border: 1px solid #4F46E5;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 280px;
    display: none;
}

.text-replace-panel.show {
    display: block;
}

/* 上传区域 */
.upload-dropzone {
    border: 2px dashed #4F46E5;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-dropzone:hover {
    background: #eef0ff;
    border-color: #4338ca;
}

.upload-dropzone.dragover {
    background: #e0e4ff;
    border-color: #3730a3;
}

/* 工具按钮激活状态 */
.btn-tool.active {
    background-color: #4F46E5;
    color: #fff;
    border-color: #4F46E5;
}

/* 引导卡片 */
.guide-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    z-index: 100;
}

/* 响应式 */
@media (max-width: 768px) {
    .pdf-thumbnail-panel {
        width: 120px;
        min-width: 120px;
    }
    .pdf-toolbar {
        padding: 0.25rem;
    }
    .pdf-toolbar .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* 加载动画 */
.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 缩放控制 */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

.zoom-control span {
    font-size: 0.875rem;
    min-width: 50px;
    text-align: center;
}
