:root {
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

.ocr-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.ocr-header h1 {
    font-size: 24px;
    margin: 0 0 6px;
}
.subtitle { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card h2 { font-size: 16px; margin: 0 0 8px; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* 模型模式选择 */
.model-select { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.model-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.model-opt input { cursor: pointer; }
.model-opt input:disabled { cursor: not-allowed; }

.btn {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: #f3f4f6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-group { display: flex; gap: 8px; }

.status {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-size: 13px;
    color: #1e40af;
}

/* 拖拽上传区 */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, background .2s;
    margin-top: 4px;
}
.dropzone.dragover { border-color: var(--primary); background: #eff6ff; }
.dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    cursor: pointer;
    text-align: center;
    gap: 6px;
}
.dropzone-icon { font-size: 34px; }
.muted { color: var(--muted); font-size: 12px; }

.preview-wrap { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.preview-img { max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--border); }

/* 结果 */
.result-tabs { display: flex; gap: 4px; margin: 14px 0 10px; }
.tab { border: none; background: transparent; padding: 6px 14px; border-radius: 6px 6px 0 0; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.result-text {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 14px;
    margin: 0;
    max-height: 480px;
    overflow: auto;
}
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table th, .result-table td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.result-table th { color: var(--muted); font-weight: 600; background: #f9fafb; }
.text-cell { word-break: break-all; }

/* Blazor 错误页 */
#blazor-error-ui {
    background: #fff1f2; color: #991b1b; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: 12px 1rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
