<?php
/**
 * 2026企业CMS - 默认模板联系我们页面
 */
$pageDescription = '联系我们 - ' . SITE_NAME;
$breadcrumbItems = [['title' => '联系我们']];
?>
<?php echo breadcrumb($breadcrumbItems); ?>

<div class="main-content">
    <div class="container">
        <h2 class="section-title">联系我们</h2>
        
        <div style="display:flex;gap:40px;margin-top:30px;">
            <!-- 联系信息 -->
            <div style="flex:1;">
                <div style="background:#fff;border-radius:8px;padding:30px;box-shadow:0 2px 10px rgba(0,0,0,0.1);">
                    <h3 style="font-size:20px;margin-bottom:20px;color:#333;">联系方式</h3>
                    
                    <div style="display:flex;flex-direction:column;gap:15px;color:#666;">
                        <div style="display:flex;align-items:center;gap:10px;">
                            <span style="font-size:20px;">📞</span>
                            <div>
                                <div style="font-weight:bold;color:#333;">联系电话</div>
                                <div><?php echo get_setting('contact_phone', '13874944449'); ?></div>
                            </div>
                        </div>
                        
                        <div style="display:flex;align-items:center;gap:10px;">
                            <span style="font-size:20px;">📧</span>
                            <div>
                                <div style="font-weight:bold;color:#333;">电子邮箱</div>
                                <div><?php echo get_setting('contact_email', '284795@qq.com'); ?></div>
                            </div>
                        </div>
                        
                        <div style="display:flex;align-items:center;gap:10px;">
                            <span style="font-size:20px;">📍</span>
                            <div>
                                <div style="font-weight:bold;color:#333;">公司地址</div>
                                <div><?php echo get_setting('contact_address', '长沙市开福区青竹湖街道湘江北路一段369号 金霞跨境产贸城 长沙金霞经济开发区'); ?></div>
                            </div>
                        </div>
                        
                        <?php if (get_setting('contact_qq')): ?>
                        <div style="display:flex;align-items:center;gap:10px;">
                            <span style="font-size:20px;">💬</span>
                            <div>
                                <div style="font-weight:bold;color:#333;">QQ</div>
                                <div><?php echo get_setting('contact_qq'); ?></div>
                            </div>
                        </div>
                        <?php endif; ?>
                        
                        <?php if (get_setting('contact_wechat')): ?>
                        <div style="display:flex;align-items:center;gap:10px;">
                            <span style="font-size:20px;">👤</span>
                            <div>
                                <div style="font-weight:bold;color:#333;">微信</div>
                                <div><?php echo get_setting('contact_wechat'); ?></div>
                            </div>
                        </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            
            <!-- 联系表单 -->
            <div style="flex:1;">
                <div class="contact-form">
                    <h3 style="font-size:20px;margin-bottom:20px;color:#333;">在线留言</h3>
                    
                    <?php echo $contactMsg ?? ''; ?>
                    
                    <form method="post" action="<?php echo cms_url('contact'); ?>" onsubmit="return validateForm('contactForm')" id="contactForm">
                        <div class="form-group">
                            <label>姓名 <span style="color:red;">*</span></label>
                            <input type="text" name="name" required>
                        </div>
                        
                        <div class="form-group">
                            <label>电话 <span style="color:red;">*</span></label>
                            <input type="tel" name="phone" required>
                        </div>
                        
                        <div class="form-group">
                            <label>邮箱</label>
                            <input type="email" name="email">
                        </div>
                        
                        <div class="form-group">
                            <label>公司名称</label>
                            <input type="text" name="company">
                        </div>
                        
                        <div class="form-group">
                            <label>留言内容 <span style="color:red;">*</span></label>
                            <textarea name="message" required></textarea>
                        </div>
                        
                        <button type="submit" name="contact_submit" class="btn">提交留言</button>
                    </form>
                </div>
            </div>
        </div>
        
        <!-- 公司介绍内容 -->
        <?php if (!empty($pageData['content'])): ?>
        <div style="margin-top:40px;">
            <div class="article-detail">
                <?php echo $pageData['content']; ?>
            </div>
        </div>
        <?php endif; ?>
    </div>
</div>
