/* 批量修复 UI 重构样式 (Sidebar Layout) */

/* --- 左侧侧边栏 (.batch-sidebar-panel) --- */
.batch-sidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* overflow: hidden; Handled by flex children */
    padding-bottom: 20px;
}

.panel-header-batch {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-header-batch h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
}

.panel-header-batch p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.batch-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 侧边栏上传区域 */
.batch-upload-area-sidebar {
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.batch-upload-area-sidebar:hover {
    border-color: #6366f1;
    background: #f5f5ff;
}

.batch-upload-area-sidebar .upload-icon-sm {
    font-size: 28px;
    color: #9ca3af;
}

.batch-upload-area-sidebar .upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.batch-upload-area-sidebar strong {
    font-size: 0.95rem;
    color: #374151;
}

.batch-upload-area-sidebar span {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* 侧边栏进度条 */
.batch-progress-container {
    background: #fff;
    border-radius: 8px;
    padding: 0;
}

.batch-progress-text {
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
}

.progress-bar {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
}

/* 侧边栏选项组 */
.batch-options-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prompt-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.batch-input,
.batch-input-area {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    background: #fff;
    color: #111;
    transition: all 0.2s;
}

.batch-input:focus,
.batch-input-area:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.batch-input-area {
    min-height: 80px;
    resize: vertical;
}

.batch-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.batch-btn.primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.batch-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.batch-btn.success {
    background: #10b981;
    color: white;
}

.batch-btn.success:hover {
    background: #059669;
}


/* --- 右侧画布视图 (#batch-canvas-view) --- */
.batch-canvas-view {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    /* Lighter bg for canvas */
    position: relative;
    padding: 20px;
    gap: 20px;
}

/* 画布顶栏 */
.batch-canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.batch-status-bar p {
    margin: 0;
    font-size: 1rem;
    color: #4b5563;
    font-weight: 500;
}

.batch-toolbar .tool-btn-sm {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #374151;
    transition: all 0.2s;
}

.batch-toolbar .tool-btn-sm:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* 预览网格 (Grid) */
.batch-preview-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    /* Adaptive columns */
    gap: 20px;
    padding: 4px;
    /* Space for shadow */
    align-content: start;
}

/* 预览卡片 (Reusing existing batch-page-card styles but refined) */
.batch-page-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    /* PPT default typically */
    transition: all 0.2s;
    border: 2px solid transparent;
    cursor: pointer;
}

.batch-page-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.batch-page-card.selected {
    border-color: #6366f1;
}

.batch-page-card.error {
    border-color: #ef4444;
}

.batch-page-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 卡片遮罩/状态 */
.page-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.batch-page-card:hover .page-overlay,
.batch-page-card.selected .page-overlay {
    opacity: 1;
}

/* 选中状态下，遮罩可以淡一点，或者只显示勾选框 */
.batch-page-card.selected .page-overlay {
    background: rgba(99, 102, 241, 0.1);
    /* Light purple tint */
}

/* Checkbox overlay */
.page-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    border: 2px solid #ddd;
    font-size: 14px;
    z-index: 2;
    transition: all 0.2s;
}

.batch-page-card.selected .page-checkbox {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

/* Page Number */
.page-number {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Zoom Button */
.batch-zoom-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.batch-zoom-btn:hover {
    background: #fff;
    transform: scale(1.1);
    color: #6366f1;
}

/* Status Icon (Success/Error) */
.page-status-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 3;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 空白状态 */
.batch-empty-state {
    grid-column: 1 / -1;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: 16px;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
}

.batch-empty-state .empty-icon {
    font-size: 48px;
    color: #d1d5db;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Hidden Utility */
.hidden {
    display: none !important;
}
/* --- Hybrid Batch Widget Styles (Embedded in Sidebar) --- */
.hybrid-batch-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.batch-upload-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-upload-compact:hover {
    background: #eff6ff;
    border-color: #6366f1;
}

.upload-icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-icon-emoji {
    font-size: 24px;
}

.upload-text-col {
    display: flex;
    flex-direction: column;
}

.upload-title {
    font-size: 0.9rem;
    color: #1f2937;
    font-weight: 600;
}

.upload-sub {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Mini Progress Bar */
.hybrid-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px;
}

.progress-bar-xs {
    flex: 1;
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}

.progress-Label-xs {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 48px;
    text-align: right;
}

/* Compact Textarea Mode for NotebookLM Repair */
.input-container-framed.compact-textarea textarea#prompt-input {
    min-height: 60px !important; /* Reduce from 120px */
    height: 80px;
}

.input-container-framed.compact-textarea {
    padding: 8px 12px;
margin-bottom: 4px;
}
