/* public/assets/css/pdf/pdf-to-images.css */

.pdf-p2i-wrapper { padding: 32px 16px; position: relative; }
.pdf-p2i-header { text-align: center; margin-bottom: 32px; }
.pdf-p2i-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
.pdf-p2i-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 700px; margin: 0 auto; line-height: 1.6; }

.pdf-p2i-workspace { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }

/* 左侧：控制面板 */
.pdf-p2i-controls { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; gap: 24px; }
.control-section h4 { margin: 0 0 16px 0; font-size: 1rem; color: var(--text-main); border-bottom: 2px solid rgba(245, 158, 11, 0.2); padding-bottom: 8px; display: inline-block; }

.file-drop-area { border: 2px dashed #f59e0b; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.3s; background: rgba(245, 158, 11, 0.03); position: relative; overflow: hidden; }
.file-drop-area:hover, .file-drop-area.drag-over { background: rgba(245, 158, 11, 0.08); border-color: #d97706; }
.drop-text { margin-top: 12px; font-weight: 600; color: var(--text-main); font-size: 0.95rem; word-break: break-all; }
.file-input-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.input-group { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.input-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-body); color: var(--text-main); font-size: 0.95rem; outline: none; transition: 0.2s; box-sizing: border-box; }
.input-group select:focus { border-color: #f59e0b; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tips-box { background: rgba(245, 158, 11, 0.05); border: 1px solid rgba(245, 158, 11, 0.15); border-radius: 8px; padding: 12px; font-size: 0.85rem; color: #b45309; line-height: 1.5; }
[data-theme="dark"] .tips-box { color: #fbbf24; }

.pdf-btn-primary { background: #f59e0b; color: #fff; border: none; padding: 14px 20px; font-size: 1.05rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); width: 100%; }
.pdf-btn-primary:hover:not(:disabled) { background: #d97706; transform: translateY(-2px); }
.pdf-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; opacity: 0.7; }

/* ==========================================
   🌟 升级美化：自定义页码分段控制器与输入区
   ========================================== */
.range-toggle-box { display: flex; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.range-toggle-btn { flex: 1; text-align: center; padding: 10px 0; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background-color 0.2s, color 0.2s; border-right: 1px solid var(--border-color); user-select: none; }
.range-toggle-btn:last-child { border-right: none; }
.range-toggle-btn input[type="radio"] { display: none; }

/* 激活状态的主题色 */
.range-toggle-btn.active { background: rgba(245, 158, 11, 0.1); color: #d97706; }
[data-theme="dark"] .range-toggle-btn.active { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* 平滑折叠动画外壳 */
.custom-range-wrapper { max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; opacity: 0; }
.custom-range-wrapper.show { max-height: 60px; opacity: 1; margin-top: 6px; }

/* 带图标的极客输入框内衬 */
.custom-range-inner { display: flex; align-items: center; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 8px; padding: 0 12px; transition: border-color 0.2s, box-shadow 0.2s; }
.custom-range-inner:focus-within { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1); }
.range-icon { color: #94a3b8; margin-right: 8px; flex-shrink: 0; transition: color 0.2s; }
.custom-range-inner:focus-within .range-icon { color: #f59e0b; }

/* 覆写原有 Input 样式使其无缝融合 */
.custom-range-inner input { border: none !important; padding: 10px 0 !important; background: transparent !important; box-shadow: none !important; width: 100%; border-radius: 0 !important; font-weight: 600; letter-spacing: 0.5px; }
.custom-range-inner input:focus { border-color: transparent !important; }

/* 右侧：状态反馈与预览 */
.pdf-p2i-preview { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.status-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.status-text { font-size: 1.05rem; font-weight: 600; color: var(--text-main); margin-top: 12px; }
.loader-spinner { width: 32px; height: 32px; border: 4px solid var(--border-color); border-top-color: #f59e0b; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon { font-size: 2.5rem; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* 进度条 */
.progress-bar-wrap { width: 100%; max-width: 300px; height: 8px; background: var(--bg-body); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); box-sizing: border-box; }
.progress-bar-fill { width: 0%; height: 100%; background: #f59e0b; transition: width 0.2s linear; }

.image-preview-box { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); text-align: center; }
#imgPreview { max-width: 100%; max-height: 400px; border-radius: 4px; border: 1px solid var(--border-color); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.pdf-info-card { background: var(--bg-surface); padding: 24px; border-radius: 16px; border: 1px solid var(--border-color); box-sizing: border-box; max-width: 1000px; margin: 0 auto; }

/* 📱 响应式 */
@media (max-width: 850px) {
    .pdf-p2i-workspace { grid-template-columns: 1fr; }
}