<form method="post" action="{% url 'add_comment' artwork.slug %}" enctype="multipart/form-data" class="mb-8">
    {% csrf_token %}

    <div class="bg-gray-900 border border-gray-800 rounded-lg p-6">
        <h3 class="text-lg font-medium text-white mb-4">发表评论</h3>

        <!-- 文本输入 -->
        <div class="mb-4">
            {{ comment_form.text }}
            {% if comment_form.text.errors %}
                <div class="mt-2 text-red-400 text-sm">{{ comment_form.text.errors }}</div>
            {% endif %}
        </div>

        <!-- 图片上传 -->
        <div class="mb-4">
            <label class="block text-gray-400 text-sm mb-2">上传图片（可选）</label>
            {{ comment_form.image }}
            <p class="text-gray-500 text-xs mt-2">支持 JPG、PNG、GIF、WEBP 格式，最大 5MB</p>
            {% if comment_form.image.errors %}
                <div class="mt-2 text-red-400 text-sm">{{ comment_form.image.errors }}</div>
            {% endif %}
        </div>

        <!-- 表单错误 -->
        {% if comment_form.non_field_errors %}
            <div class="mb-4 p-3 bg-red-900/30 border border-red-800 rounded-lg">
                {% for error in comment_form.non_field_errors %}
                    <p class="text-red-400 text-sm">{{ error }}</p>
                {% endfor %}
            </div>
        {% endif %}

        <!-- 提交按钮 -->
        <div class="flex justify-end">
            <button type="submit"
                    class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition duration-200">
                发布评论
            </button>
        </div>
    </div>
</form>