<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Text Renderer Simple</title>
    {% if style_list %}
    {% for style in style_list %}
    {{ style | safe }}
    {% endfor %}
    {% endif %}
    <style>
        body {
            margin: 0;
            padding: 2px;
            background-color: #fff;
            display: inline-block;
        }
        .container {
            display: inline-flex;
            flex-direction: column;
            min-width: 50px;
            max-width: 100%;
            padding: 5px;
            font-size: 14px;
            line-height: 1.3;
            color: #333;
            word-break: break-all;
            white-space: pre-wrap;
            background-color: #f9f9f9;
            border: 1px solid #e0e0e0;
            border-radius: 3px;
        }
        .header {
            font-size: 10px;
            color: #888;
            text-align: right;
            border-bottom: 1px solid #eee;
            margin-bottom: 2px;
            padding-bottom: 2px;
        }
        .title {
            font-weight: bold;
            font-size: 14px;
            margin-bottom: 3px;
            padding-bottom: 3px;
            border-bottom: 1px solid #eee;
        }
        .content {
            margin: 0;
        }
        .footer {
            margin-top: 3px;
            padding-top: 2px;
            border-top: 1px solid #eee;
            font-size: 10px;
            color: #888;
            text-align: right;
        }
    </style>
</head>
<body>
    <div class="container">
        {% if header %}
        <div class="header">{{ header }}</div>
        {% endif %}

        {% if title %}
        <div class="title">{{ title }}</div>
        {% endif %}
        
        <div class="content">{{ text }}</div>

        {% if footer %}
        <div class="footer">{{ footer }}</div>
        {% endif %}
    </div>
</body>
</html>
