/* public/assets/css/image/img-ocr.css */
.ocr-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #0ea5e9; --p-text: #0f172a; width: 100%; max-width: 900px; margin: 0 auto; background: var(--p-bg); border-radius: 24px; padding: 32px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); border: 1px solid var(--p-border); }
.ocr-header { font-size: 1.5rem; font-weight: 600; color: var(--p-text); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.ocr-badge { background: #e0f2fe; color: #0284c7; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.ocr-subtitle { color: #64748b; font-size: 0.95rem; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; margin-bottom: 24px; }

/* 左右两栏布局 */
.ocr-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 768px) { 
    .ocr-layout { grid-template-columns: 1fr; } 
    .ocr-tool-wrapper { padding: 20px; border-radius: 16px; }
}

/* 左侧容器：Flex 纵向排布 */
.ocr-left-col { display: flex; flex-direction: column; height: 100%; }

/* 上传区：取消 height:100%，改用 flex:1 自动填满剩余空间，不再挤出底部按钮 */
.ocr-upload-area { flex: 1; border: 2px dashed #cbd5e1; border-radius: 16px; padding: 40px 20px; text-align: center; cursor: pointer; transition: 0.2s; background: #f8fafc; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 250px; }
.ocr-upload-area.drag-over { border-color: var(--p-primary); background: #f0f9ff; }

/* 预览区 (支持 Cropper 框选) */
.ocr-preview-box { display: none; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; background: #f1f5f9; position: relative; }
.ocr-img-wrapper { max-height: 350px; width: 100%; display: flex; align-items: center; justify-content: center; background: #e2e8f0; }
.ocr-img-wrapper img { display: block; max-width: 100%; max-height: 350px; }
.ocr-reset-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: white; border: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; z-index: 10; transition: 0.2s; backdrop-filter: blur(4px); }
.ocr-reset-btn:hover { background: rgba(0,0,0,0.8); }

/* 控制区：语言与提取按钮 */
.ocr-controls { margin-top: 16px; flex-shrink: 0; }
.ocr-select { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 10px; margin-bottom: 12px; outline: none; background: #fff; font-size: 0.95rem; }
.ocr-select:focus { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1); }
.ocr-btn { width: 100%; padding: 14px; border-radius: 12px; font-weight: 600; cursor: pointer; border: none; background: var(--p-primary); color: white; transition: 0.2s; font-size: 1.05rem; }
.ocr-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ocr-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3); }

/* 右侧结果区 */
.ocr-result-area { display: flex; flex-direction: column; height: 100%; }
.ocr-textarea { flex: 1; width: 100%; min-height: 250px; padding: 16px; border: 2px solid #cbd5e1; border-radius: 12px; resize: none; outline: none; font-size: 0.95rem; line-height: 1.6; background: #fafafa; margin-bottom: 12px; transition: 0.2s; box-sizing: border-box; }
.ocr-textarea:focus { border-color: var(--p-primary); background: #fff; }
.ocr-actions { display: flex; gap: 12px; }
.ocr-action-btn { flex: 1; padding: 10px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; cursor: pointer; font-weight: 500; color: #334155; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.ocr-action-btn:hover { background: #f1f5f9; color: var(--p-primary); border-color: var(--p-primary); }

.ocr-progress-container { width: 100%; margin-top: 12px; display: none; }
.ocr-status-text { font-size: 0.85rem; color: #64748b; margin-bottom: 6px; font-weight: 500; }
.ocr-progress-bg { width: 100%; height: 8px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.ocr-progress-bar { width: 0%; height: 100%; background: var(--p-primary); transition: width 0.1s linear; }

[data-theme="dark"] .ocr-tool-wrapper { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .ocr-upload-area { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .ocr-select, [data-theme="dark"] .ocr-textarea, [data-theme="dark"] .ocr-action-btn { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .ocr-preview-box { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .ocr-action-btn:hover { background: #334155; }