<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>通用OCR结果展示</title>
    <style>
        html, body {
            width: 100%;
            padding: 0;
            margin: 0;
        }

        .img-line {
            width: 100%;
            box-sizing: border-box;
            padding: 0 100px;
            display: flex;
            justify-content: space-between;
            margin-top: 50px;
        }

        .img-box {
            margin: 0 20px;
        }

        img {
            width: 500px;
            height: auto;
            box-sizing: border-box;
            padding: 5px;
            border: 1px solid #000;
        }

        .data-table {
            width: 100%;
            justify-content: center;
            box-sizing: border-box;
            margin: 50px 0;
            padding: 0 20px;
        }

        table {
            border: none;
            background-color: aqua;
        }

        .col1 {
            width: 60%;
        }

        .col2 {
            width: 15%;
        }

        .col3 {
            width: 25%;
        }

        td, th {
            background-color: white;
        }

        .center {
            text-align: center;
        }
    </style>
</head>
<body>
<h1>识别结果展示页面</h1>
<div class="img-line">
    <div class="img-box">
        <h1>原图</h1>
        <a target="_blank" href="/{{ raw }}"><img src="/{{ raw }}" alt="raw"></a>
    </div>
    <div class="img-box">
        <h1>结果</h1>
        <a target="_blank" href="/{{ rec }}"><img src="/{{ rec }}" alt="rec"></a>
    </div>
</div>
<div class="data-table">
    <table>
        <thead>
        <tr>
            <th class="col1">内容</th>
            <th class="col2">概率</th>
            <th class="col3">位置</th>
        </tr>
        </thead>
        <tbody>
        {% for item in data %}
            <tr>
                <td>{{ item.word }}</td>
                <td class="center">{{ item.rate }}</td>
                <td>{{ item.pos }}</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
</body>
</html>