<?php
require_once __DIR__ . '/db/config.php';

// Fetch settings from DB
$pdo = db();
$settings_res = $pdo->query("SELECT `key`, `value` FROM website_settings")->fetchAll();
$settings = [];
foreach ($settings_res as $row) {
    $settings[$row['key']] = $row['value'];
}

$project_name = $settings['site_name'] ?? '智域科技';
$project_description = $settings['seo_description'] ?? '全球领先的IT数字化架构与行业解决方案专家';
$logo_path = $settings['site_logo'] ?? 'assets/pasted-20260226-073317-a8105f30.png';
$wechat_qr = $settings['wechat_qr'] ?? 'assets/pasted-20260226-110355-12dfa7de.png';
$wechat_id = $settings['wechat_id'] ?? 'zhiyukj888';
$tg_link = $settings['tg_link'] ?? 'https://t.me/zhangshihao818';

// 辅助函数：根据颜色生成浅色背景
function get_soft_bg($color, $opacity = '10') {
    return $color . $opacity;
}

// 手机端视图逻辑
$view = $_GET['v'] ?? 'home';
$body_class = 'view-' . $view;
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= htmlspecialchars($settings['seo_title'] ?? $project_name) ?></title>
    <meta name="keywords" content="<?= htmlspecialchars($settings['seo_keywords'] ?? '') ?>">
    <meta name="description" content="<?= htmlspecialchars($settings['seo_description'] ?? '') ?>">
    <link rel="icon" href="<?= $logo_path ?>" type="image/png">
    <!-- Fonts & Icons -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&family=Ma+Shan+Zheng&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    <link href="assets/css/custom.css?v=<?= time() ?>" rel="stylesheet">
</head>
<body class="<?= $body_class ?>">

    <!-- ① 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light fixed-top">
        <div class="container">
            <a class="navbar-brand d-flex align-items-center gap-2" href="/">
                <img src="<?= $logo_path ?>" alt="<?= htmlspecialchars($project_name) ?>">
                <div class="brand-text-dynamic">
                    <span class="char-1">智</span>
                    <span class="char-2">域</span>
                    <span class="char-3">科</span>
                    <span class="char-4">技</span>
                </div>
            </a>
            <button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto align-items-center gap-lg-4 mt-3 mt-lg-0">
                    <li class="nav-item"><a class="nav-link" href="#cases">声誉作品</a></li>
                    <li class="nav-item"><a class="nav-link" href="#core-services">核心服务</a></li>
                    <li class="nav-item"><a class="nav-link" href="#capabilities">核心能力</a></li>
                    <li class="nav-item"><a class="nav-link" href="#tech">技术底座</a></li>
                    <li class="nav-item"><a class="nav-link" href="#pricing">报价方案</a></li>
                    <li class="nav-item ms-lg-2">
                        <a class="btn btn-primary px-4 shadow-sm fw-bold" href="<?= $tg_link ?>">立即咨询 <i class="bi bi-telegram ms-1"></i></a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- ② 英雄首屏 & 自动播放轮播图 -->
    <section class="hero-section">
        <div class="container">
            <div class="row align-items-center g-5">
                <div class="col-lg-6">
                    <span class="section-subtitle text-start mb-2">领先的数字化架构专家</span>
                    <h1 class="hero-title">
                        <span class="text-gradient">分布式技术节点</span><br>
                        全天候平稳运行中
                    </h1>
                    <p class="lead text-muted mb-5 pe-lg-4">
                        智域科技不仅提供系统开发。我们结合行业深度洞察与前沿架构技术，为复杂业务提供稳定、安全、可无限扩展的数字化基座。
                    </p>
                    <div class="d-flex flex-wrap gap-3">
                        <a href="<?= $tg_link ?>" class="btn btn-primary px-5 py-3 fw-bold">立即免费咨询 <i class="bi bi-lightning-charge-fill ms-1"></i></a>
                        <a href="#capabilities" class="btn btn-outline-dark px-5 py-3 fw-bold">了解核心技术</a>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div id="heroCarousel" class="carousel slide carousel-fade hero-carousel shadow-lg" data-bs-ride="carousel" data-bs-interval="3500">
                        <div class="carousel-inner">
                            <div class="carousel-item active">
                                <img src="assets/images/carousel-1.jpg" alt="智慧金融与分布式架构">
                                <div class="carousel-caption glass-panel">
                                    <p class="small mb-0 fw-bold"><i class="bi bi-bank2 me-2 text-primary"></i> 智慧金融分布式技术架构</p>
                                </div>
                            </div>
                            <div class="carousel-item">
                                <img src="assets/images/carousel-2.png" alt="数字化转型实践">
                                <div class="carousel-caption glass-panel">
                                    <p class="small mb-0 fw-bold"><i class="bi bi-cpu-fill me-2 text-success"></i> 赋能企业数字化转型实践</p>
                                </div>
                            </div>
                            <div class="carousel-item">
                                <img src="assets/images/carousel-3.png" alt="AI驱动的智能决策">
                                <div class="carousel-caption glass-panel">
                                    <p class="small mb-0 fw-bold"><i class="bi bi-robot me-2 text-info"></i> AI驱动的智能业务决策引擎</p>
                                </div>
                            </div>
                            <div class="carousel-item">
                                <img src="assets/images/carousel-4.png" alt="全球化系统部署">
                                <div class="carousel-caption glass-panel">
                                    <p class="small mb-0 fw-bold"><i class="bi bi-globe-americas me-2 text-warning"></i> 全球化高可用系统部署方案</p>
                                </div>
                            </div>
                        </div>
                        <button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
                            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                            <span class="visually-hidden">Previous</span>
                        </button>
                        <button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
                            <span class="carousel-control-next-icon" aria-hidden="true"></span>
                            <span class="visually-hidden">Next</span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- ⑦ 作品展示区域 -->
    <section id="cases" class="py-5">
        <div class="container py-5">
            <div class="d-flex justify-content-between align-items-end mb-4 flex-wrap gap-3">
                <div>
                    <span class="section-subtitle text-start mb-1">作品展示</span>
                    <h2 class="section-title mb-0">每一个项目都是我们的声誉</h2>
                </div>
                <a href="cases.php" class="btn btn-primary px-4 py-2 fw-bold shadow-sm mb-2 d-none d-md-inline-block">查看更多案例展示 <i class="bi bi-grid-3x3-gap ms-2"></i></a>
            </div>
            <div class="grid-4">
                <?php
                // 从数据库获取精选案例
                $featured_cases = $pdo->query("SELECT * FROM cases WHERE is_visible = 1 ORDER BY is_featured DESC, sort_order ASC, created_at DESC LIMIT 8")->fetchAll();
                foreach ($featured_cases as $case): ?>
                <div class="case-card">
                    <div class="case-image-wrapper">
                        <img src="<?= htmlspecialchars($case['img']) ?>" alt="<?= htmlspecialchars($case['title']) ?>" class="case-image">
                    </div>
                    <div class="case-content p-4">
                        <span class="badge bg-primary bg-opacity-10 text-primary mb-2"><?= htmlspecialchars($case['tag']) ?></span>
                        <h6 class="fw-bold mb-3"><?= htmlspecialchars($case['title']) ?></h6>
                        <p class="x-small text-muted mb-4"><?= htmlspecialchars($case['description']) ?></p>
                        <a href="case-detail.php?id=<?= $case['slug'] ?>" class="text-primary small text-decoration-none fw-bold">查看案例细节 <i class="bi bi-chevron-right"></i></a>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
            <div class="text-center mt-5 d-md-none">
                <a href="cases.php" class="btn btn-outline-primary btn-lg px-5 py-3 fw-bold shadow-sm">
                    查看更多案例展示 <i class="bi bi-grid-3x3-gap ms-2"></i>
                </a>
            </div>
        </div>
    </section>

    <!-- 专业核心服务区域 -->
    <section id="core-services" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">服务生态</span>
            <h2 class="section-title">专业核心服务区域</h2>
            <div class="grid-4">
                <?php
                // 可从数据库获取 services 表，目前先保留硬编码或之后在后台添加
                $core_services = [
                    ['title' => '搭建写盘', 'icon' => 'hdd-network', 'color' => '#0d6efd'],
                    ['title' => '软件开发', 'icon' => 'code-square', 'color' => '#6610f2'],
                    ['title' => '盘口定制', 'icon' => 'graph-up', 'color' => '#6f42c1'],
                    ['title' => '挂马修复', 'icon' => 'shield-shaded', 'color' => '#d63384'],
                    ['title' => '过毒免杀', 'icon' => 'bug-fill', 'color' => '#dc3545'],
                    ['title' => '服务器域名', 'icon' => 'globe', 'color' => '#fd7e14'],
                    ['title' => '源码出售', 'icon' => 'file-earmark-code', 'color' => '#ffc107'],
                    ['title' => '搭建交易所', 'icon' => 'currency-exchange', 'color' => '#198754'],
                    ['title' => '资金盘开发', 'icon' => 'cash-coin', 'color' => '#20c997'],
                    ['title' => 'API接口对接', 'icon' => 'connector', 'color' => '#0dcaf0'],
                    ['title' => '高防CDN加速', 'icon' => 'shield-check', 'color' => '#007bff'],
                    ['title' => '分布式架构设计', 'icon' => 'diagram-3', 'color' => '#17a2b8']
                ];
                foreach ($core_services as $s): ?>
                <div class="tech-card p-4 d-flex flex-row align-items-center gap-3 shadow-sm border-0" style="background: <?= get_soft_bg($s['color'], '08') ?>;">
                    <div class="icon-box-colorful mb-0 flex-shrink-0" style="width: 52px; height: 52px; font-size: 1.5rem; background: <?= $s['color'] ?>20; color: <?= $s['color'] ?>;">
                        <i class="bi bi-<?= $s['icon'] ?>"></i>
                    </div>
                    <h6 class="fw-bold mb-0"><?= $s['title'] ?></h6>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>

    <!-- 承接业务范围区域 -->
    <section id="scope" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">业务范围</span>
            <h2 class="section-title">承接业务范围区域</h2>
            <div class="grid-6">
                <?php
                $scope_items = [
                    ['n' => '海外资金盘', 'i' => 'globe-americas', 'c' => '#0d6efd'],
                    ['n' => '点赞盘', 'i' => 'hand-thumbs-up', 'c' => '#34a853'],
                    ['n' => '刷单盘', 'i' => 'cart-check', 'c' => '#fbbc05'],
                    ['n' => '商城盘', 'i' => 'shop', 'c' => '#ea4335'],
                    ['n' => '云矿机', 'i' => 'cpu', 'c' => '#673ab7'],
                    ['n' => '新能源', 'i' => 'lightning-charge', 'c' => '#00bcd4'],
                    ['n' => '投资理财', 'i' => 'wallet2', 'c' => '#ff5722'],
                    ['n' => '反波胆', 'i' => 'arrow-left-right', 'c' => '#4285f4'],
                    ['n' => '微交易', 'i' => 'phone-flip', 'c' => '#795548'],
                    ['n' => '时间盘', 'i' => 'clock-history', 'c' => '#6c757d'],
                    ['n' => '交易所', 'i' => 'bank', 'c' => '#198754'],
                    ['n' => '各类小程序', 'i' => 'app-indicator', 'c' => '#0dcaf0'],
                    ['n' => '机器人', 'i' => 'robot', 'c' => '#fd7e14'],
                    ['n' => '落地页定制', 'i' => 'window-stack', 'c' => '#d63384'],
                    ['n' => '远控系统', 'i' => 'display', 'c' => '#000000'],
                    ['n' => '授权系统', 'i' => 'key', 'c' => '#6610f2'],
                    ['n' => '在线客服', 'i' => 'headset', 'c' => '#0d6efd'],
                    ['n' => '获取通讯录', 'i' => 'person-rolodex', 'c' => '#dc3545']
                ];
                foreach ($scope_items as $item): ?>
                <div class="tech-card p-3 text-center d-flex flex-column align-items-center justify-content-center border-0 shadow-sm" style="background: <?= get_soft_bg($item['c'], '06') ?>;">
                    <i class="bi bi-<?= $item['i'] ?> mb-2" style="font-size: 1.6rem; color: <?= $item['c'] ?>;"></i>
                    <span class="small fw-bold"><?= $item['n'] ?></span>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>

    <!-- 业务核心能力区域 -->
    <section id="capabilities" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">核心能力</span>
            <h2 class="section-title">业务核心能力区域</h2>
            <div class="grid-4">
                <?php
                $caps = [
                    ['icon' => 'laptop', 'title' => '定制软件开发', 'desc' => '针对企业独特业务流提供深度定制的原生架构方案。', 'color' => '#4285f4'],
                    ['icon' => 'cloud-arrow-up', 'title' => '云原生架构转型', 'desc' => '平滑迁移至微服务架构，实现系统极致的弹性扩展。', 'color' => '#34a853'],
                    ['icon' => 'shield-lock', 'title' => '金融级安全审计', 'desc' => '全链条加密与双重审计体系，筑造坚不可摧的数据防线。', 'color' => '#fbbc05'],
                    ['icon' => 'robot', 'title' => 'AI业务化集成', 'desc' => '将LLM与业务流程无缝打通，实现全链路智能化提效。', 'color' => '#ea4335'],
                    ['icon' => 'database-check', 'title' => '大数据治理', 'desc' => '亿级数据实时处理与清洗，将零散数据转化为决策资产。', 'color' => '#673ab7'],
                    ['icon' => 'gear-wide-connected', 'title' => '工业互联网集成', 'desc' => '打破软硬件壁垒，实现IT与OT的深度融合与协同。', 'color' => '#00bcd4'],
                    ['icon' => 'graph-up-arrow', 'title' => '敏捷增长引擎', 'desc' => '通过数据中台驱动业务增长，快速响应市场剧烈波动。', 'color' => '#ff5722'],
                    ['icon' => 'patch-check', 'title' => '合规与风险控管', 'desc' => '深度符合全球各行业标准，确保业务在全球范围合规。', 'color' => '#795548']
                ];
                foreach ($caps as $c): ?>
                <div class="tech-card border-0 shadow-sm" style="background: <?= get_soft_bg($c['color'], '08') ?>;">
                    <div class="icon-box-colorful" style="background: <?= $c['color'] ?>20; color: <?= $c['color'] ?>;">
                        <i class="bi bi-<?= $c['icon'] ?>"></i>
                    </div>
                    <h5 class="fw-bold mb-3"><?= $c['title'] ?></h5>
                    <p class="small text-muted mb-0"><?= $c['desc'] ?></p>
                </div>
                <?php endforeach; ?>
            </div>

            <!-- 💯 承诺 -->
            <div class="tech-card border-0 shadow-lg p-4 mt-5" style="background: linear-gradient(135deg, #ffffff 0%, #f3f0ff 100%);">
                <div class="d-flex align-items-start gap-3">
                    <div class="icon-box-colorful bg-warning bg-opacity-20 text-warning mb-0 flex-shrink-0" style="width: 54px; height: 54px; font-size: 1.6rem;">
                        <i class="bi bi-award-fill"></i>
                    </div>
                    <div>
                        <p class="mb-0 fw-bold text-dark" style="font-size: 1.15rem; line-height: 1.7;">
                            专注于专业领域，追求卓越质量，赢得良好口碑！在这个市场环境复杂的当下，相信你再三比较后会发现我是你最可靠的选择！
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 技术底座区域 -->
    <section id="tech" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">技术底座</span>
            <h2 class="section-title">技术底座区域</h2>
            <div class="grid-6">
                <?php
                $techs = [
                    ['name' => 'Golang', 'cat' => '高性能并发', 'icon' => 'terminal', 'color' => '#00ADD8'],
                    ['name' => 'React', 'cat' => '前端交互', 'icon' => 'code-slash', 'color' => '#61DAFB'],
                    ['name' => 'Laravel', 'cat' => '后端引擎', 'icon' => 'server', 'color' => '#FF2D20'],
                    ['name' => 'PyTorch', 'cat' => 'AI模型', 'icon' => 'magic', 'color' => '#EE4C2C'],
                    ['name' => 'MySQL', 'cat' => '关系型数据库', 'icon' => 'database', 'color' => '#4479A1'],
                    ['name' => 'Redis', 'cat' => '极速缓存', 'icon' => 'lightning-fill', 'color' => '#DC382D'],
                    ['name' => 'Docker', 'cat' => '容器化', 'icon' => 'box-seam', 'color' => '#2496ED'],
                    ['name' => 'K8s', 'cat' => '集群编排', 'icon' => 'layers', 'color' => '#326CE5'],
                    ['name' => 'Kafka', 'cat' => '消息中间件', 'icon' => 'broadcast-pin', 'color' => '#231F20'],
                    ['name' => 'Postgres', 'cat' => '高级数据库', 'icon' => 'hdd-stack', 'color' => '#336791'],
                    ['name' => 'Next.js', 'cat' => '全栈框架', 'icon' => 'window', 'color' => '#000000'],
                    ['name' => 'Rust', 'cat' => '系统级语言', 'icon' => 'cpu', 'color' => '#000000']
                ];
                foreach ($techs as $t): ?>
                <div class="tech-card p-4 text-center d-flex flex-column align-items-center border-0 shadow-sm" style="background: <?= get_soft_bg($t['color'], '06') ?>;">
                    <i class="bi bi-<?= $t['icon'] ?> mb-3" style="font-size: 2.3rem; color: <?= $t['color'] ?>;"></i>
                    <h6 class="fw-bold mb-1"><?= $t['name'] ?></h6>
                    <span class="x-small text-muted"><?= $t['cat'] ?></span>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>

    <!-- 报价方案区域 -->
    <section id="pricing" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">报价方案</span>
            <h2 class="section-title">报价方案区域</h2>
            <div class="grid-4">
                <?php
                $pricing = [
                    ['icon' => 'speedometer2', 'title' => '基础MVP版', 'desc' => '适用于快速验证业务逻辑的小型系统，包含核心基础功能。', 'price' => '¥49,900 起', 'color' => '#4285f4'],
                    ['icon' => 'award', 'title' => '企业标准版', 'desc' => '涵盖主流业务场景，集成高可用架构 with 基础安全策略。', 'price' => '¥99,900 起', 'color' => '#34a853'],
                    ['icon' => 'gem', 'title' => '旗舰定制版', 'desc' => '全链路深度定制，支撑超大规模业务并发与复杂逻辑。', 'price' => '¥199,900 起', 'color' => '#fbbc05'],
                    ['icon' => 'building-gear', 'title' => '集团生态版', 'desc' => '多端互联与私有化部署，深度契合大型集团合规性要求。', 'price' => '面议', 'color' => '#ea4335']
                ];
                foreach ($pricing as $p): ?>
                <div class="tech-card border-bottom border-4 shadow-sm" style="border-color: <?= $p['color'] ?> !important; background: <?= get_soft_bg($p['color'], '08') ?>;">
                    <div class="icon-box-colorful" style="background: <?= $p['color'] ?>20; color: <?= $p['color'] ?>;">
                        <i class="bi bi-<?= $p['icon'] ?>"></i>
                    </div>
                    <h5 class="fw-bold mb-3"><?= $p['title'] ?></h5>
                    <p class="small text-muted mb-4"><?= $p['desc'] ?></p>
                    <div class="mt-auto">
                        <span class="h4 fw-bold text-primary"><?= $p['price'] ?></span>
                        <a href="<?= $tg_link ?>" class="btn btn-outline-primary btn-sm w-100 mt-3 fw-bold py-2">获取详细报价单</a>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>

    <!-- 全球合作伙伴区域 -->
    <section id="partners" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">合作伙伴</span>
            <h2 class="section-title">全球合作伙伴区域</h2>
            <div class="partners-grid">
                <?php
                $partners = [
                    ['icon' => 'bi-microsoft', 'name' => 'Microsoft', 'color' => '#00a4ef'],
                    ['icon' => 'bi-google', 'name' => 'Google Cloud', 'color' => '#4285f4'],
                    ['icon' => 'bi-amazon', 'name' => 'AWS', 'color' => '#ff9900'],
                    ['icon' => 'bi-nvidia', 'name' => 'NVIDIA', 'color' => '#76b900'],
                    ['icon' => 'bi-tencent-qq', 'name' => 'Tencent', 'color' => '#0052d9'],
                    ['icon' => 'bi-apple', 'name' => 'Apple Business', 'color' => '#000000'],
                    ['icon' => 'bi-meta', 'name' => 'Meta AI', 'color' => '#0668E1'],
                    ['icon' => 'bi-stripe', 'name' => 'Stripe', 'color' => '#008cdd'],
                    ['icon' => 'bi-paypal', 'name' => 'PayPal', 'color' => '#003087'],
                    ['icon' => 'bi-github', 'name' => 'GitHub', 'color' => '#181717'],
                    ['icon' => 'bi-dropbox', 'name' => 'Dropbox', 'color' => '#0061FF'],
                    ['icon' => 'bi-slack', 'name' => 'Slack', 'color' => '#4A154B'],
                    ['icon' => 'bi-spotify', 'name' => 'Spotify', 'color' => '#1DB954'],
                    ['icon' => 'bi-android2', 'name' => 'Android', 'color' => '#3DDC84'],
                    ['icon' => 'bi-cloud-fill', 'name' => 'Salesforce', 'color' => '#00A1E0'],
                    ['icon' => 'bi-box-seam', 'name' => 'DigitalOcean', 'color' => '#0080FF'],
                    ['icon' => 'bi-layers-half', 'name' => 'Cloudflare', 'color' => '#F38020'],
                    ['icon' => 'bi-terminal-fill', 'name' => 'Oracle', 'color' => '#F80000']
                ];
                foreach ($partners as $p): ?>
                <div class="partner-item border-0 shadow-sm" style="background: <?= get_soft_bg($p['color'], '08') ?>;">
                    <i class="bi <?= $p['icon'] ?> partner-icon" style="color: <?= $p['color'] ?>; font-size: 2.2rem;"></i>
                    <span class="partner-name fw-bold" style="font-size: 0.85rem;"><?= $p['name'] ?></span>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </section>

    <!-- 交付标准区域 -->
    <section id="delivery" class="py-5">
        <div class="container py-5">
            <span class="section-subtitle">交付标准</span>
            <h2 class="section-title">交付标准区域</h2>
            <div class="grid-4">
                <div class="tech-card border-top border-4 border-primary shadow-sm" style="background: #f0f7ff;">
                    <div class="icon-box-colorful bg-primary bg-opacity-10 text-primary mb-4">
                        <i class="bi bi-search"></i>
                    </div>
                    <h5 class="fw-bold">深度需求对齐</h5>
                    <p class="small text-muted mb-0">通过专家工作坊进行业务逻辑深度拆解，确保技术路线与商业战略完美契合。</p>
                </div>
                <div class="tech-card border-top border-4 border-success shadow-sm" style="background: #f0fdf4;">
                    <div class="icon-box-colorful bg-success bg-opacity-10 text-success mb-4">
                        <i class="bi bi-diagram-3"></i>
                    </div>
                    <h5 class="fw-bold">架构技术选型</h5>
                    <p class="small text-muted mb-0">基于未来5年业务量预估进行基座搭建，选用最具扩展性的工业级技术栈。</p>
                </div>
                <div class="tech-card border-top border-4 border-warning shadow-sm" style="background: #fffbeb;">
                    <div class="icon-box-colorful bg-warning bg-opacity-10 text-warning mb-4">
                        <i class="bi bi-terminal"></i>
                    </div>
                    <h5 class="fw-bold">敏捷迭代开发</h5>
                    <p class="small text-muted mb-0">采用标准Scrum流程，周周可见交付成果，确保项目进度与质量透明可控。</p>
                </div>
                <div class="tech-card border-top border-4 border-danger shadow-sm" style="background: #fef2f2;">
                    <div class="icon-box-colorful bg-danger bg-opacity-10 text-danger mb-4">
                        <i class="bi bi-check-all"></i>
                    </div>
                    <h5 class="fw-bold">自动化验收</h5>
                    <p class="small text-muted mb-0">集成全自动压测与安全扫描，通过数万项用例验证后方可平滑上线。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- ⑨ 限时免费咨询 -->
    <section class="container py-5 mb-5 footer-cta">
        <div class="tech-card bg-primary text-white p-5 text-center overflow-hidden shadow-lg border-0">
            <div class="position-absolute top-0 start-0 w-100 h-100 opacity-10" style="background: url('https://www.transparenttextures.com/patterns/carbon-fibre.png');"></div>
            <div class="position-relative z-1">
                <div class="icon-box-colorful bg-white text-primary mx-auto mb-4" style="width: 80px; height: 80px; font-size: 2.5rem;">
                    <i class="bi bi-chat-heart"></i>
                </div>
                <h2 class="fw-bold mb-3">准备好开启数字化转型之旅了吗？</h2>
                <p class="lead mb-5 opacity-75">智域科技专家团队 24/7 在线，为您提供免费的初步架构诊断与方案咨询。</p>
                <div class="d-flex justify-content-center gap-3 flex-wrap">
                    <a href="<?= $tg_link ?>" class="btn btn-light btn-lg px-5 py-3 shadow">
                        <i class="bi bi-telegram me-2"></i> 立即通过 Telegram 咨询
                    </a>
                    <a href="contact.php" class="btn btn-outline-light btn-lg px-5 py-3">
                        提交需求申请表
                    </a>
                </div>
            </div>
        </div>
    </section>

    <!-- ⑩ 页脚 -->
    <footer class="bg-white text-dark pt-5 pb-4 border-top">
        <div class="container">
            <div class="row g-5">
                <div class="col-lg-4">
                    <a class="navbar-brand d-flex align-items-center gap-2 mb-4" href="/">
                        <img src="<?= $logo_path ?>" alt="<?= htmlspecialchars($project_name) ?>">
                        <div class="brand-text-dynamic">
                            <span class="char-1">智</span>
                            <span class="char-2">域</span>
                            <span class="char-3">科</span>
                            <span class="char-4">技</span>
                        </div>
                    </a>
                    <p class="small text-muted mb-4">智域科技是全球领先的分布式系统专家，致力于通过尖端架构技术赋能企业实现无感数字化转型。</p>
                    <div class="d-flex gap-3">
                        <a href="#" class="text-dark opacity-50 hover-opacity-100"><i class="bi bi-twitter-x"></i></a>
                        <a href="#" class="text-dark opacity-50 hover-opacity-100"><i class="bi bi-linkedin"></i></a>
                        <a href="<?= $tg_link ?>" class="text-dark opacity-50 hover-opacity-100"><i class="bi bi-telegram"></i></a>
                    </div>
                </div>
                <div class="col-6 col-lg-2">
                    <h6 class="fw-bold mb-4">核心服务</h6>
                    <ul class="list-unstyled small text-muted">
                        <li class="mb-2"><a href="service-detail.php?type=软件开发" class="text-decoration-none text-reset">定制软件开发</a></li>
                        <li class="mb-2"><a href="service-detail.php?type=云原生" class="text-decoration-none text-reset">云原生架构</a></li>
                        <li class="mb-2"><a href="service-detail.php?type=安全审计" class="text-decoration-none text-reset">安全合规审计</a></li>
                        <li class="mb-2"><a href="service-detail.php?type=AI集成" class="text-decoration-none text-reset">AI集成方案</a></li>
                    </ul>
                </div>
                <div class="col-6 col-lg-2">
                    <h6 class="fw-bold mb-4">关于我们</h6>
                    <ul class="list-unstyled small text-muted">
                        <li class="mb-2"><a href="#cases" class="text-decoration-none text-reset">经典案例</a></li>
                        <li class="mb-2"><a href="privacy.php" class="text-decoration-none text-reset">隐私政策</a></li>
                        <li class="mb-2"><a href="agreement.php" class="text-decoration-none text-reset">服务协议</a></li>
                        <li class="mb-2"><a href="contact.php" class="text-decoration-none text-reset">联系我们</a></li>
                    </ul>
                </div>
                <div class="col-lg-4">
                    <h6 class="fw-bold mb-4">订阅技术简报</h6>
                    <p class="small text-muted mb-4">每月获取最新的分布式架构趋势与安全动态。</p>
                    <div class="input-group">
                        <input type="email" class="form-control bg-light border-0 text-dark" placeholder="您的邮箱地址">
                        <button class="btn btn-primary px-4 fw-bold">订阅</button>
                    </div>
                </div>
            </div>
            <hr class="my-5 opacity-10">
            <div class="row align-items-center">
                <div class="col-md-6 text-center text-md-start">
                    <p class="small text-muted mb-0">&copy; 2020 <?= htmlspecialchars($project_name) ?>. 版权所有。</p>
                </div>
                <div class="col-md-6 text-center text-md-end mt-3 mt-md-0">
                    <span class="small text-muted">系统状态: <span class="text-success"><i class="bi bi-check-circle-fill me-1"></i> 所有节点正常运行</span></span>
                </div>
            </div>
        </div>
    </footer>

    <!-- 手机端底部菜单 -->
    <div class="mobile-bottom-nav">
        <a href="index.php?v=home" class="mobile-nav-item <?= $view == 'home' ? 'active' : '' ?>">
            <i class="bi bi-house-door"></i>
            <span>首页</span>
        </a>
        <a href="cases.php" class="mobile-nav-item <?= $view == 'works' ? 'active' : '' ?>">
            <i class="bi bi-briefcase"></i>
            <span>作品</span>
        </a>
        <a href="index.php?v=pricing#pricing" class="mobile-nav-item <?= $view == 'pricing' ? 'active' : '' ?>">
            <i class="bi bi-tags"></i>
            <span>报价</span>
        </a>
        <a href="<?= $tg_link ?>" class="mobile-nav-item highlight">
            <i class="bi bi-telegram"></i>
            <span>咨询</span>
        </a>
    </div>

    <!-- 悬浮按钮组 -->
    <div class="floating-controls">
        <a href="javascript:void(0)" class="float-btn float-btn-wx" title="微信咨询" data-bs-toggle="modal" data-bs-target="#wechatModal">
            <i class="bi bi-wechat"></i>
        </a>
        <a href="<?= $tg_link ?>" target="_blank" class="float-btn float-btn-tg" title="Telegram 咨询">
            <i class="bi bi-telegram"></i>
        </a>
        <button class="float-btn float-btn-up" title="返回顶部">
            <i class="bi bi-arrow-up"></i>
        </button>
    </div>

    <!-- 微信二维码 Modal -->
    <div class="modal fade" id="wechatModal" tabindex="-1" aria-labelledby="wechatModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content border-0 shadow-lg" style="border-radius: 24px; overflow: hidden;">
                <div class="modal-header border-0 pb-0">
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body text-center p-4 pt-0">
                    <div class="icon-box-colorful bg-success bg-opacity-10 text-success mx-auto mb-3" style="width: 60px; height: 60px; font-size: 1.8rem;">
                        <i class="bi bi-wechat"></i>
                    </div>
                    <h5 class="fw-bold mb-2">添加微信好友</h5>
                    <p class="small text-muted mb-4">扫描下方二维码或长按保存图片</p>
                    
                    <div class="qr-code-wrapper p-3 bg-light rounded-4 mb-4 d-inline-block shadow-sm">
                        <img src="<?= $wechat_qr ?>" alt="WeChat QR Code" class="img-fluid" style="max-width: 240px; border-radius: 12px;">
                    </div>
                    
                    <div class="d-grid gap-2">
                        <div class="p-3 bg-light rounded-3 mb-3 d-flex align-items-center justify-content-between">
                            <span class="small fw-bold text-muted">微信号: <span class="text-dark"><?= $wechat_id ?></span></span>
                            <button class="btn btn-sm btn-outline-success px-3" onclick="copyWeChatId()">复制</button>
                        </div>
                        <a href="weixin://dl/chat?username=<?= $wechat_id ?>" class="btn btn-success py-3 fw-bold shadow-sm">
                            <i class="bi bi-chat-dots me-2"></i> 尝试直接打开微信
                        </a>
                    </div>
                </div>
                <div class="modal-footer border-0 justify-content-center pb-4">
                    <p class="x-small text-muted mb-0">如有疑问，请通过 Telegram 咨询</p>
                </div>
            </div>
        </div>
    </div>

    <script>
    function copyWeChatId() {
        const id = '<?= $wechat_id ?>';
        navigator.clipboard.writeText(id).then(() => {
            alert('微信号已复制: ' + id);
        }).catch(err => {
            console.error('复制失败', err);
        });
    }
    </script>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="assets/js/main.js?v=<?= time() ?>"></script>
</body>
</html>