<?php
/**
 * CloudForge Theme - Team Members
 */
$pageDescription = '团队成员 - ' . SITE_NAME;
$breadcrumbItems = [['title' => '团队成员']];
?>
<?php echo breadcrumb($breadcrumbItems); ?>

<div class="main-content">
    <div class="container">
        <div class="section-header section-header--center">
            <span class="section-label">// TEAM</span>
            <h2 class="section-title">团队成员</h2>
            <p class="section-subtitle">我们拥有一支专业、高效、富有创造力的团队</p>
        </div>

        <?php if (empty($teamMembers)): ?>
        <div class="empty-state">
            <svg width="48" height="48" viewBox="0 0 48 48" fill="none" opacity="0.3"><circle cx="24" cy="16" r="8" stroke="currentColor" stroke-width="1.5"/><path d="M8 42c0-8 7-14 16-14s16 6 16 14" stroke="currentColor" stroke-width="1.5"/></svg>
            <p>暂无团队成员信息</p>
        </div>
        <?php else: ?>
        <div class="team-grid">
            <?php foreach ($teamMembers as $m): ?>
            <div class="team-card">
                <div class="team-avatar">
                    <?php if ($m['avatar']): ?>
                    <img src="<?php echo $m['avatar']; ?>" alt="<?php echo xss_clean($m['name']); ?>">
                    <?php else: ?>
                    <div class="team-avatar-placeholder">
                        <svg width="36" height="36" viewBox="0 0 36 36" fill="none"><circle cx="18" cy="13" r="6" stroke="currentColor" stroke-width="1.5"/><path d="M6 32c0-6 5-10 12-10s12 4 12 10" stroke="currentColor" stroke-width="1.5"/></svg>
                    </div>
                    <?php endif; ?>
                </div>
                <h3 class="team-name"><?php echo xss_clean($m['name']); ?></h3>
                <p class="team-position"><?php echo xss_clean($m['position']); ?></p>
                <?php if ($m['bio']): ?>
                <p class="team-bio"><?php echo xss_clean($m['bio']); ?></p>
                <?php endif; ?>
                <?php if ($m['content']): ?>
                <details class="team-details">
                    <summary>查看详情</summary>
                    <div class="team-detail-content"><?php echo $m['content']; ?></div>
                </details>
                <?php endif; ?>
                <div class="team-social">
                    <?php if ($m['email']): ?>
                    <a href="mailto:<?php echo $m['email']; ?>" class="team-social-link" title="邮箱">
                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="2" y="4" width="12" height="8" rx="1" stroke="currentColor" stroke-width="1"/><path d="M2 5l6 4 6-4" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/></svg>
                    </a>
                    <?php endif; ?>
                    <?php if ($m['wechat']): ?>
                    <span class="team-social-link" title="微信: <?php echo xss_clean($m['wechat']); ?>">
                        <svg width="16" height="16" viewBox="0 0 16 16" fill="none"><circle cx="6" cy="6" r="4" stroke="currentColor" stroke-width="1"/><circle cx="11" cy="10" r="3" stroke="currentColor" stroke-width="1"/></svg>
                    </span>
                    <?php endif; ?>
                </div>
            </div>
            <?php endforeach; ?>
        </div>
        <?php endif; ?>

        <div class="cta-box">
            <h3>加入我们</h3>
            <p>如果你有才华、有激情，欢迎加入我们的团队</p>
            <a href="<?php echo cms_url('contact'); ?>" class="btn btn--primary btn--lg">
                <span>联系我们</span>
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M3 8h10M9 4l4 4-4 4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
            </a>
        </div>
    </div>
</div>
