<?php
/**
 * 2026企业CMS - 默认模板案例列表页
 */
$pageDescription = '成功案例展示 - ' . SITE_NAME;
$breadcrumbItems = [['title' => '成功案例']];
?>
<?php echo breadcrumb($breadcrumbItems); ?>

<div class="main-content">
    <div class="container">
        <h2 class="section-title">成功案例</h2>
        
        <?php if (empty($cases)): ?>
        <div style="text-align:center;padding:60px;color:#999;">暂无案例</div>
        <?php else: ?>
        <div class="grid">
            <?php foreach ($cases as $c): ?>
            <div class="card">
                <a href="<?php echo cms_url('case', ['slug' => $c['slug']]); ?>">
                    <div class="card-img" style="height:220px;background:#f5f5f5;display:flex;align-items:center;justify-content:center;">
                        <?php if ($c['cover_image']): ?>
                        <img src="<?php echo $c['cover_image']; ?>" alt="<?php echo xss_clean($c['title']); ?>" style="width:100%;height:100%;object-fit:cover;">
                        <?php else: ?>
                        <span style="font-size:48px;color:#ccc;">📁</span>
                        <?php endif; ?>
                    </div>
                    <div class="card-body">
                        <div class="card-title"><?php echo xss_clean($c['title']); ?></div>
                        <div class="card-desc"><?php echo xss_clean(str_cut($c['summary'],80)); ?></div>
                        <?php if ($c['client_name']): ?>
                        <div style="color:#999; font-size:12px;margin-top:8px;">客户：<?php echo xss_clean($c['client_name']); ?></div>
                        <?php endif; ?>
                    </div>
                </a>
            </div>
            <?php endforeach; ?>
        </div>
        <?php endif; ?>
    </div>
</div>
