{% extends "base.html" %}

{% block title %}购买积分 - AI 视界{% endblock %}

{% block content %}
<div class="w-full h-full overflow-y-auto p-8 lg:p-12 custom-scrollbar">
    <div class="max-w-4xl mx-auto space-y-12">
        <div class="flex items-center gap-4">
            <div class="w-12 h-12 bg-amber-500 text-white rounded-2xl flex items-center justify-center shadow-lg shadow-amber-200">
                <i data-lucide="shopping-cart" class="w-7 h-7"></i>
            </div>
            <div>
                <h1 class="text-3xl font-black text-slate-900 tracking-tight">充值积分</h1>
                <p class="text-slate-400 text-sm">选择适合您的积分套餐，开启无限创作空间</p>
            </div>
        </div>

        {% if success %}
        <div class="bg-emerald-50 border border-emerald-100 rounded-3xl p-6 flex items-center gap-4 animate-in fade-in slide-in-from-top-4 duration-500">
            <div class="w-12 h-12 bg-emerald-500 text-white rounded-2xl flex items-center justify-center shadow-lg shadow-emerald-100">
                <i data-lucide="check" class="w-7 h-7"></i>
            </div>
            <div>
                <h3 class="text-emerald-900 font-black">支付成功！</h3>
                <p class="text-emerald-600 text-xs font-bold">您的订单 #{{ order.out_trade_no if order else '' }} 已完成，积分已到账。</p>
            </div>
        </div>
        {% endif %}

        <div class="relative group">
            <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-6">
                <!-- 套餐 1 -->
                <div class="bg-white rounded-[2.5rem] border border-slate-100 p-8 shadow-xl group">
                    <div class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4">体验测试</div>
                    <div class="flex items-baseline gap-1 mb-6">
                        <span class="text-4xl font-black text-slate-900">50</span>
                        <span class="text-sm text-slate-400 font-bold">积分</span>
                    </div>
                    <div class="space-y-4 mb-8">
                        <div class="flex items-center gap-2 text-xs font-bold text-slate-600">
                            <i data-lucide="check-circle-2" class="w-4 h-4 text-emerald-500"></i>
                            <span>快速开启 AI 体验</span>
                        </div>
                    </div>
                    <form action="/payment/create" method="POST">
                        <input type="hidden" name="package_id" value="50">
                        <button type="submit" class="w-full py-4 rounded-2xl bg-slate-900 text-white font-black text-sm">
                            ¥ 5.00 购买
                        </button>
                    </form>
                </div>

                <!-- 套餐 2 -->
                <div class="bg-white rounded-[2.5rem] border border-slate-100 p-8 shadow-xl relative">
                    <div class="absolute -top-3 right-6 bg-indigo-600 text-white text-[8px] font-black px-3 py-1 rounded-full shadow-lg uppercase">推荐</div>
                    <div class="text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4">普通创作</div>
                    <div class="flex items-baseline gap-1 mb-6">
                        <span class="text-4xl font-black text-slate-900">200</span>
                        <span class="text-sm text-slate-400 font-bold">积分</span>
                    </div>
                    <div class="space-y-4 mb-8">
                        <div class="flex items-center gap-2 text-xs font-bold text-slate-600">
                            <i data-lucide="check-circle-2" class="w-4 h-4 text-emerald-500"></i>
                            <span>满足日常生成需求</span>
                        </div>
                    </div>
                    <form action="/payment/create" method="POST">
                        <input type="hidden" name="package_id" value="200">
                        <button type="submit" class="w-full py-4 rounded-2xl bg-indigo-600 text-white font-black text-sm">
                            ¥ 20.00 购买
                        </button>
                    </form>
                </div>

                <!-- 套餐 3 -->
                <div class="bg-indigo-900 rounded-[2.5rem] border border-indigo-800 p-8 shadow-2xl">
                    <div class="text-[10px] font-black text-indigo-300 uppercase tracking-widest mb-4">量大管饱</div>
                    <div class="flex items-baseline gap-1 mb-6">
                        <span class="text-4xl font-black text-white">1000</span>
                        <span class="text-sm text-indigo-300 font-bold">积分</span>
                    </div>
                    <div class="space-y-4 mb-8">
                        <div class="flex items-center gap-2 text-xs font-bold text-indigo-100">
                            <i data-lucide="check-circle-2" class="w-4 h-4 text-amber-400"></i>
                            <span>创作自由，无需等待</span>
                        </div>
                    </div>
                    <form action="/payment/create" method="POST">
                        <input type="hidden" name="package_id" value="1000">
                        <button type="submit" class="w-full py-4 rounded-2xl bg-white text-indigo-900 font-black text-sm">
                            ¥ 100.00 购买
                        </button>
                    </form>
                </div>

                <!-- 套餐 4 -->
                <div class="bg-amber-500 rounded-[2.5rem] border border-amber-400 p-8 shadow-2xl">
                    <div class="text-[10px] font-black text-amber-900 uppercase tracking-widest mb-4">豪掷千金</div>
                    <div class="flex items-baseline gap-1 mb-6">
                        <span class="text-4xl font-black text-slate-900">5000</span>
                        <span class="text-sm text-amber-900 font-bold">积分</span>
                    </div>
                    <div class="space-y-4 mb-8">
                        <div class="flex items-center gap-2 text-xs font-bold text-amber-900">
                            <i data-lucide="check-circle-2" class="w-4 h-4 text-white"></i>
                            <span>至尊权限，顶级服务</span>
                        </div>
                    </div>
                    <form action="/payment/create" method="POST">
                        <input type="hidden" name="package_id" value="5000">
                        <button type="submit" class="w-full py-4 rounded-2xl bg-slate-900 text-white font-black text-sm">
                            ¥ 500.00 购买
                        </button>
                    </form>
                </div>
            </div>
        </div>

        <!-- 支付提示 -->
        <div class="bg-slate-100/50 rounded-3xl p-6 text-center">
            <p class="text-[10px] font-bold text-slate-400 uppercase tracking-widest">
                <i data-lucide="shield-check" class="w-3 h-3 inline-block mr-1"></i>
                支付安全保障 · 充值实时到账
            </p>
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
<script>
    // 页面加载后的逻辑
</script>
{% endblock %}