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

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

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

/* 左侧控制区 */
.pdf-img2pdf-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; position: sticky; top: 20px; }
.control-section h4 { margin: 0 0 16px 0; font-size: 1rem; color: var(--text-main); border-bottom: 2px solid rgba(99, 102, 241, 0.2); padding-bottom: 8px; display: inline-block; }

.file-drop-area { border: 2px dashed #6366f1; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.3s; background: rgba(99, 102, 241, 0.03); position: relative; overflow: hidden; }
.file-drop-area:hover, .file-drop-area.drag-over { background: rgba(99, 102, 241, 0.08); border-color: #4f46e5; }
.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; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.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: #6366f1; }

.tips-box { background: rgba(99, 102, 241, 0.05); border: 1px solid rgba(99, 102, 241, 0.15); border-radius: 8px; padding: 12px; font-size: 0.85rem; color: #4338ca; line-height: 1.5; }
[data-theme="dark"] .tips-box { color: #818cf8; background: rgba(129, 140, 248, 0.05); }

.pdf-btn-primary { background: #6366f1; 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(99, 102, 241, 0.3); width: 100%; }
.pdf-btn-primary:hover:not(:disabled) { background: #4f46e5; transform: translateY(-2px); }
.pdf-btn-primary:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; opacity: 0.7; }

/* 右侧排版预览区 */
.pdf-img2pdf-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: #6366f1; 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: #6366f1; transition: width 0.2s linear; }

/* 🌟 图片拖拽网格列表 */
.sortable-container { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); min-height: 400px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 60px 0; font-style: italic; font-size: 0.95rem; }

.image-sortable-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px; }
.image-card { position: relative; width: 100%; padding-bottom: 141.4%; /* 完美A4比例占位 (1:1.414) */ background: var(--bg-body); border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden; cursor: grab; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; }
.image-card:hover { transform: translateY(-4px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
.image-card:active { cursor: grabbing; }

/* 拖拽时的幽灵占位符样式 */
.sortable-ghost { opacity: 0.4; border: 2px dashed #6366f1; background: rgba(99, 102, 241, 0.1); transform: none !important; }

/* 缩略图 */
.image-card img.thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* 页码标签 */
.page-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 12px; backdrop-filter: blur(4px); }

/* 删除按钮 */
.btn-del-img { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; background: rgba(239, 68, 68, 0.9); color: #fff; border: none; border-radius: 50%; font-size: 14px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.image-card:hover .btn-del-img { opacity: 1; }
.btn-del-img:hover { background: #dc2626; transform: scale(1.1); }

/* SEO */
.tool-seo-article { width: 100%; }
.pdf-info-card { background: var(--bg-surface); padding: 24px 32px; border-radius: 16px; border: 1px solid var(--border-color); box-sizing: border-box; max-width: 1200px; margin: 0 auto; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.pdf-info-card h3 { margin: 0 0 12px 0; color: var(--text-main); font-size: 1.25rem; }
.pdf-desc-text { color: var(--text-muted); font-size: 0.95rem; }

@media (max-width: 900px) {
    .pdf-img2pdf-workspace { grid-template-columns: 1fr; }
}