<div class="page-head">
    <div><h1>轮播管理</h1><div class="desc">首页轮播图（背景支持渐变或图片）</div></div>
    <a class="btn-primary" href="<?php echo site_url('admin/banners/create'); ?>">+ 新增轮播</a>
</div>
<div class="admin-card">
    <table class="admin-table">
        <tr><th>背景</th><th>标题</th><th>副标题</th><th>链接</th><th>操作</th></tr>
        <?php foreach ($banners as $b): ?>
            <tr>
                <td><div class="thum" style="background:<?php echo e($b['image']); ?>">🖼</div></td>
                <td><b><?php echo e($b['title']); ?></b></td>
                <td class="muted"><?php echo e(mb_substr($b['subtitle'] ?? '', 0, 20)); ?></td>
                <td class="muted"><?php echo e($b['link']); ?></td>
                <td>
                    <div class="row-actions">
                        <a class="btn-soft btn-sm" href="<?php echo site_url('admin/banners/edit/' . $b['id']); ?>">编辑</a>
                        <form class="del-form" method="post" action="<?php echo site_url('admin/banners/delete/' . $b['id']); ?>"><?php echo csrf_field(); ?><button class="btn-danger btn-sm" type="submit">删除</button></form>
                    </div>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
</div>
