<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Renderer{% endblock %}</title>
    {% if style_list %}
    {% for style in style_list %}
    {{ style | safe }}
    {% endfor %}
    {% endif %}
    <style>
        body {
            margin: 0;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            border: 1px solid #ddd;
            padding: 15px;
            padding-bottom: 0px;
            border-radius: 8px;
            word-break: break-all;
            overflow-wrap: break-word;
        }

        .header {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }

        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin-right: 10px;
            object-fit: cover;
        }

        .avatar-placeholder {
            background-color: #ccc;
            color: #666;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24px;
            font-weight: bold;
        }

        .user-info {
            display: flex;
            flex-direction: column;
        }

        .username {
            font-weight: bold;
        }

        .sub {
            font-size: 0.8em;
            color: gray;
            padding: 2px;
            border-radius: 4px;
            /* margin-top: 4px; */
            display: inline-block;
        }

        .title {
            font-size: 1.5em;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .text {
            white-space: pre-wrap;
            line-height: 1.6;
            margin-bottom: 15px;
        }

        .images {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            margin-bottom: 15px;
        }

        .image-item {
            position: relative;
            aspect-ratio: 1 / 1;
            overflow: hidden;
            border-radius: 4px;
        }

        .image-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .image-placeholder {
            width: 100%;
            height: 100%;
            background-color: #eee;
            color: #999;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 0.8em;
            text-align: center;
        }

        .more-count {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24px;
            font-weight: bold;
        }

        .footer {
            margin-top: 20px;
            color: #999;
            font-size: 0.9em;
            text-align: right;
        }

        .prefix {
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #ddd;
        }

        .suffix {
            padding: 20px 0;
            border-top: 1px solid #ddd;
        }

        /* New styles for posts and comments */
        .item {
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #eee;
        }

        .item:last-child {
            border-bottom: none;
            /* margin-bottom: 0; */
            padding-bottom: 0;
        }

        .comments {
            background-color: #f9f9f9;
            padding: 10px;
            border-radius: 4px;
            margin-top: 10px;
        }

        .comment-item {
            display: flex;
            margin-bottom: 10px;
            font-size: 0.9em;
        }

        .comment-item:last-child {
            margin-bottom: 0;
        }

        .comment-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            margin-right: 8px;
            object-fit: cover;
            flex-shrink: 0;
        }

        .comment-avatar-placeholder {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            margin-right: 8px;
            background-color: #ccc;
            flex-shrink: 0;
        }

        .comment-content {
            flex: 1;
        }

        .comment-user {
            font-weight: bold;
            color: #333;
            margin-right: 5px;
        }

        .comment-text {
            color: #555;
            margin-top: 2px;
            margin-bottom: 2px;
        }

        .id-label {
            font-size: 0.8em;
            color: gray;
            margin-top: 5px;
            display: block;
        }

        .sub-html-item {
            width: 100%;
            border-top: 1px solid #eee;
            margin-top: 10px;
            padding-top: 10px;
        }

        .forum-bar {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
            background-color: #f5f6fa;
            border-radius: 5px;
            width: fit-content;
            padding: 5px 10px;
        }

        .forum-icon {
            width: 20px;
            height: 20px;
            border-radius: 2px;
            object-fit: cover;
        }

        .forum-icon-placeholder {
            width: 20px;
            height: 20px;
            background-color: #ccc;
            border-radius: 3px;
        }
    </style>
</head>

<body>
    <div class="container">
        {% if prefix_html %}
        <div class="prefix">{{ prefix_html | safe }}</div>
        {% endif %}

        {% block content %}{% endblock %}

        {% if suffix_html %}
        <div class="suffix">{{ suffix_html | safe }}</div>
        {% endif %}
    </div>
</body>

</html>