<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FastAPI Card Generator</title>
    <style>
        body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
        h1 { color: #333; }
        pre { background: #f5f5f5; padding: 15px; border-radius: 5px; overflow-x: auto; }
        code { font-family: monospace; }
        a { color: #0066cc; text-decoration: none; }
        a:hover { text-decoration: underline; }
    </style>
</head>
<body>
    <h1>FastAPI Card Generator API</h1>
    <p>使用 POST 请求调用 <code>/convert_to_flashcards</code> 接口生成闪卡。</p>
    <p>请求示例：</p>
    <pre><code>curl -X POST -H "Content-Type: application/json" -d '{
  "cards": [
    {
      "front": "问题 1",
      "back": "答案 1"
    },
    {
      "front": "问题 2",
      "back": "答案 2"
    }
  ]
}' http://localhost:5000/convert_to_flashcards</code></pre>
    <p>预览页面：<a href="/preview">/preview</a></p>
    <p>预览听写卡片页面：<a href="/preview?template=listen">/preview</a></p>
    <p>预览默认卡片展示页面：<a href="/preview?template=default">/preview</a></p>
    <p>预览页导出 PDF：
        <a href="/preview_pdf?layout=a4_8">/preview_pdf?layout=a4_8</a>
        ，或单卡每页：
        <a href="/preview_pdf?layout=single">/preview_pdf?layout=single</a>
    </p>
</body>
</html>