/* ============ 图片文字识别 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、empty-state 等）已由 common.css 统一提供 */

/* ---- 容器 + 左右 1:2 布局（与加水印一致） ---- */
#ocr-container {
    margin-bottom: 15px;
}

#ocr-container > .section-row {
    display: flex;
    gap: 15px;
}

#ocr-container > .section-row > .settings-card {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
}

#ocr-container > .section-row > .preview-card {
    flex: 2;
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 上传区（与加水印保持一致） ---- */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ---- 语言选择（复用 .mode-btn） ---- */
.lang-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* ---- 下拉选择 ---- */
.select-input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
    background: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
}

.select-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* ---- 复选框行 ---- */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] { accent-color: #8b5cf6; }

/* ---- 小提示 ---- */
.hint-small {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 22px;
    margin-top: 4px;
}

/* ---- 滑块（带数值，与加水印一致） ---- */
.range-with-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-slider {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.range-label {
    font-size: 12px;
    color: #6b7280;
    min-width: 28px;
    flex-shrink: 0;
}

.range-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    min-width: 48px;
    text-align: right;
}

/* ---- 图片对比 ---- */
.image-compare {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.image-compare:has(.compare-item + .compare-item) {
    grid-template-columns: 1fr 1fr;
}

.compare-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.compare-label {
    font-size: 11px;
    color: #8b5cf6;
    font-weight: 600;
    text-align: center;
    padding: 3px 8px;
    background: #f5f3ff;
    border-radius: 10px;
    width: fit-content;
    margin: 0 auto;
}

.image-wrapper {
    background: #1f2937;
    border-radius: 8px;
    padding: 10px;
    max-height: 360px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 340px;
    display: block;
    border-radius: 4px;
}

/* ---- 进度条 ---- */
.progress-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.progress-bar {
    background: #f3f4f6;
    border-radius: 8px;
    height: 32px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
}

/* ---- 结果编辑区 ---- */
.result-editor {
    width: 100%;
    min-height: 260px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Microsoft YaHei', monospace;
    font-size: 14px;
    line-height: 1.7;
    background: #1e1e1e;
    color: #d4d4d4;
    border: none;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

.result-editor:focus {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
}

/* ---- 结果操作按钮（与加水印预览操作一致） ---- */
.preview-actions {
    margin-top: 14px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-block {
    width: 100%;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #ocr-container > .section-row {
        flex-direction: column;
        gap: 12px;
    }
    .image-compare:has(.compare-item + .compare-item) {
        grid-template-columns: 1fr;
    }
}
