/* 图片OCR工具样式 */
.ocr-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ocr-main {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--box-shadow);
}

.ocr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 30px;
}

.upload-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #0070d9;
    background-color: rgba(45, 152, 218, 0.05);
}

.upload-area.highlight {
    border-color: #0070d9;
    background-color: rgba(45, 152, 218, 0.1);
}

.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-text {
    position: relative;
    z-index: 1;
}

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

.upload-text p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* 预览区域样式 */
.preview-section {
    margin-top: 20px;
    display: none;
}

.preview-section h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.image-preview {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: var(--bg-light);
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 图片预处理区域样式 */
.image-processing-section {
    margin-bottom: 30px;
}

.image-processing-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.processing-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.processing-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-light);
    transition: all 0.2s ease;
}

.processing-option:hover {
    background: var(--bg-hover);
}

.processing-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.processing-option span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 控制区域样式 */
.controls-section {
    margin-bottom: 30px;
}

.controls-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.setting-item select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-item select:hover {
    border-color: #0070d9;
}

.setting-item select:focus {
    outline: none;
    border-color: #0070d9;
    box-shadow: 0 0 0 2px rgba(45, 152, 218, 0.1);
}

/* 按钮样式 */
.btn-primary {
    background: #0070d9;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-primary:hover {
    background: #1e90ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 152, 218, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--bg-light);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: #0070d9;
    color: #0070d9;
}

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

.progress-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0070d9, #4a90e2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 5px;
}

.progress-detail {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
}

/* 结果区域样式 */
.result-section {
    margin-bottom: 30px;
}

.result-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.result-content {
    margin-bottom: 20px;
}

.result-content textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
}

.result-content textarea:hover {
    border-color: #0070d9;
}

.result-content textarea:focus {
    outline: none;
    border-color: #0070d9;
    box-shadow: 0 0 0 2px rgba(45, 152, 218, 0.1);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.recognition-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 6px;
    border-left: 4px solid #0070d9;
}

.recognition-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.recognition-info span {
    color: #0070d9;
    font-weight: 600;
}

/* 侧边栏样式 */
.tool-info,
.usage-tips,
.troubleshooting,
.network-tips {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.tool-info h3,
.usage-tips h3,
.troubleshooting h3,
.network-tips h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.tool-info p,
.usage-tips p,
.troubleshooting p,
.network-tips p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.usage-tips ul,
.troubleshooting ul,
.network-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usage-tips li,
.troubleshooting li,
.network-tips li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.usage-tips li::before,
.troubleshooting li::before,
.network-tips li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #0070d9;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ocr-container {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .processing-options {
        flex-direction: column;
    }
    
    .recognition-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

/* 加载动画 */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.progress-text.loading {
    animation: pulse 1.5s infinite;
}

/* 错误提示样式 */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c62828;
}

/* 成功提示样式 */
.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #2e7d32;
}

/* 调整字体大小 */
@media (max-width: 480px) {
    .ocr-main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .tool-info,
    .usage-tips,
    .troubleshooting,
    .network-tips {
        padding: 15px;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .ocr-main,
    .tool-info,
    .usage-tips,
    .troubleshooting,
    .network-tips {
        background: #1a1a1a;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .image-preview,
    .setting-item select,
    .result-content textarea,
    .recognition-info {
        background: #2d2d2d;
    }
    
    .processing-option {
        background: #2d2d2d;
    }
    
    .processing-option:hover {
        background: #3a3a3a;
    }
    
    .btn-secondary {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .btn-secondary:hover {
        border-color: #0070d9;
    }
}