﻿<?php
// 功能：产品下载
// 作者：启肯科技
// Q Q：328493711
// 微信：13738373177（同手机）
// 官网：http://www.qiken.com
// 说明：QKCMS-轻量级AI智能内容管理建站系统
// 版权：© 2025 温州启肯网络有限公司 保留所有权利，盗版必究。


define('QKCMS_APP_IDENTIFIER', 'QKCMS');

$rootDir = realpath(__DIR__ . '/../..');

if (!function_exists('get_file_structure_cn')) {
    require_once $rootDir . DIRECTORY_SEPARATOR . 'common.php';
}

$toUtf8 = function ($value) {
    if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
        return $value;
    }
    if (function_exists('iconv')) {
        $converted = @iconv('GB2312', 'UTF-8//IGNORE', $value);
        if ($converted !== false) {
            return $converted;
        }
    }
    return @mb_convert_encoding($value, 'UTF-8', 'GB2312');
};

$formatSize = function ($bytes) {
    $bytes = (int)$bytes;
    if ($bytes >= 1073741824) return number_format($bytes / 1073741824, 1) . ' GB';
    if ($bytes >= 1048576) return number_format($bytes / 1048576, 1) . ' MB';
    if ($bytes >= 1024) return number_format($bytes / 1024, 1) . ' KB';
    return $bytes . ' B';
};

$pluginNameMap = array();
$pluginTypeMap = array();
$pluginFiles = glob($rootDir . '/admin/Plugin/*.php', GLOB_NOSORT);
if ($pluginFiles) {
    foreach ($pluginFiles as $pluginFile) {
        $relativePluginPath = ltrim(str_replace('\\', '/', str_replace($rootDir, '', $pluginFile)), '/');
        $content = @file_get_contents($pluginFile);
        if ($content !== false) {
            if (preg_match('/@name\s+([^\r\n]+)/u', $content, $matches)) {
                $pluginNameMap[strtolower($relativePluginPath)] = trim($matches[1]);
            }
            if (preg_match('/@type\s+([^\r\n]+)/u', $content, $matches)) {
                $pluginTypeMap[strtolower($relativePluginPath)] = trim($matches[1]);
            }
        }
    }
}

$describePath = function ($path, $name, $isDir) use ($pluginNameMap) {
    $path = trim(str_replace('\\', '/', (string)$path), '/');
    $name = (string)$name;
    $lowerPath = strtolower($path);
    $lowerName = strtolower($name);
    if (isset($pluginNameMap[$lowerPath])) {
        return $pluginNameMap[$lowerPath];
    }

    $mappedDescription = get_file_structure_cn($path, '');
    if ($mappedDescription !== '') {
        return $mappedDescription;
    }

    if (preg_match('#^uploads/thumbnail_[^/]+\.jpg$#i', $lowerPath)) {
        return '文章缩略图';
    }

    if (preg_match('#^uploads/article_[^/]+\.jpg$#i', $lowerPath)) {
        return '文章图片';
    }

    if ($isDir) {
        if ($lowerName === 'plugin') return '插件目录';
        if ($lowerName === 'css') return '样式文件目录';
        if ($lowerName === 'js') return 'JavaScript文件目录';
        if ($lowerName === 'images') return '图片资源';
        if ($lowerName === 'skin') return '皮肤模板';
        return '';
    }

    if (substr($lowerName, -4) === '.css') return '样式文件';
    if (substr($lowerName, -3) === '.js') return '脚本文件';
    if (substr($lowerName, -4) === '.php') return 'PHP功能文件';
    if (substr($lowerName, -5) === '.html' || substr($lowerName, -4) === '.htm') return '页面模板';
    if (substr($lowerName, -3) === '.md') return '说明文档';
    if (preg_match('/\.(jpg|jpeg|png|gif|webp|svg)$/', $lowerName)) return '图片资源';

    return '';
};

$buildTree = function ($dir) use (&$buildTree, $rootDir, $toUtf8) {
    $items = array();
    $files = glob(rtrim($dir, '\\/') . DIRECTORY_SEPARATOR . '*', GLOB_NOSORT);

    if (!$files) {
        return $items;
    }

    foreach ($files as $fullPath) {
        $baseName = basename($fullPath);
        if ($baseName === '.' || $baseName === '..') {
            continue;
        }

        $isDir = is_dir($fullPath);
        $relative = str_replace($rootDir, '', $fullPath);
        $relative = ltrim(str_replace('\\', '/', $relative), '/');
        $children = $isDir ? $buildTree($fullPath) : array();

        $items[] = array(
            'name' => $toUtf8($baseName),
            'path' => $relative,
            'is_dir' => $isDir,
            'size' => $isDir ? 0 : (int)@filesize($fullPath),
            'mtime' => (int)@filemtime($fullPath),
            'children' => $children
        );
    }

    usort($items, function ($a, $b) {
        if ($a['is_dir'] && !$b['is_dir']) return -1;
        if (!$a['is_dir'] && $b['is_dir']) return 1;
        return strnatcasecmp($a['name'], $b['name']);
    });

    return $items;
};

$resolveTreeTextType = function ($path, $name, $isDir) use ($pluginTypeMap) {
    if ($isDir) {
        return 'type-default';
    }

    $lowerPath = strtolower(trim(str_replace('\\', '/', (string)$path), '/'));
    $lowerName = strtolower((string)$name);
    if (preg_match('/\.(png|jpg|jpeg|gif|webp|svg)$/i', $lowerName)) {
        return 'type-image';
    }

    $ext = strtolower(pathinfo($lowerName, PATHINFO_EXTENSION));
    if ($ext === 'php') {
        if ($lowerPath === 'common.php') {
            return 'type-php-common';
        }
        if (strpos($lowerPath, 'admin/plugin/') === 0) {
            if (isset($pluginTypeMap[$lowerPath]) && $pluginTypeMap[$lowerPath] === '插件') {
                return 'type-php-plugin';
            }
            if (isset($pluginTypeMap[$lowerPath]) && $pluginTypeMap[$lowerPath] === '工具') {
                return 'type-php-tool';
            }
        }
        if (strpos($lowerPath, 'templates/') === 0) {
            return 'type-php-template';
        }
        return 'type-php-normal';
    }
    if ($ext === 'html' || $ext === 'htm') return 'type-html';
    if ($ext === 'css') return 'type-css';
    if ($ext === 'js') return 'type-js';
    if ($ext === 'md') return 'type-md';
    if ($ext === 'sql') return 'type-sql';
    if ($ext === 'json' || $ext === 'xml' || $ext === 'txt' || $ext === 'config') return 'type-config';

    return 'type-default';
};

$renderTree = function ($items, $depth = 0) use (&$renderTree, $formatSize, $describePath, $resolveTreeTextType) {
    if (empty($items)) {
        return '';
    }

    ob_start();
    echo $depth === 0 ? '<div class="tree-list">' : '<div class="tree-children">';

    foreach ($items as $item) {
        $name = htmlspecialchars($item['name'], ENT_QUOTES, 'UTF-8');
        $path = htmlspecialchars($item['path'], ENT_QUOTES, 'UTF-8');
        $meta = $item['is_dir'] ? count($item['children']) . ' 项' : $formatSize($item['size']);
        $meta = htmlspecialchars($meta, ENT_QUOTES, 'UTF-8');
        $desc = $describePath($item['path'], $item['name'], $item['is_dir']);
        $desc = htmlspecialchars($desc, ENT_QUOTES, 'UTF-8');
        $typeClass = $resolveTreeTextType($item['path'], $item['name'], $item['is_dir']);

        echo '<div class="tree-item">';
        echo '<div class="tree-row ' . $typeClass . ($item['is_dir'] ? ' is-dir' : '') . '" data-depth="' . (int)$depth . '" data-path="' . $path . '">';
        echo '<span class="tree-toggle' . ($item['is_dir'] ? '' : ' is-empty') . '">';
        if ($item['is_dir']) {
            echo '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="9 18 15 12 9 6"></polyline></svg>';
        }
        echo '</span>';
        echo '<span class="tree-icon">';
        if ($item['is_dir']) {
            echo '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>';
        } else {
            echo '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>';
        }
        echo '</span>';
        echo '<span class="tree-main">';
        echo '<span class="tree-name">' . $name . '</span>';
        if ($desc !== '') {
            echo '<span class="tree-desc">' . $desc . '</span>';
        }
        echo '</span>';
        echo '<span class="tree-meta">' . $meta . '</span>';
        echo '</div>';

        if ($item['is_dir']) {
            if (!empty($item['children'])) {
                echo '<div class="tree-sub">';
                echo $renderTree($item['children'], $depth + 1);
                echo '</div>';
            } else {
                echo '<div class="tree-sub">';
                echo '<div class="tree-empty">当前目录为空</div>';
                echo '</div>';
            }
        }

        echo '</div>';
    }

    echo '</div>';
    return ob_get_clean();
};

$tree = $buildTree($rootDir);
?>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>{qkcms:posts_title}-{qkcms:site_name}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" content="{qkcms:posts_keywords}">
    <meta name="description" content="{qkcms:posts_description}">
    <link rel="stylesheet" href="/assets/css/ts_post.css" />
</head>

<body class="qk-post4" style="background:#F8FAFC">

    {qkcms:head.html}

    <main>

        <section class="post4-hero">
            <div class="post4-container">
                <div class="post4-hero-inner">
                    <h1 class="post4-hero-title" style="margin-top: 50px;"><span class="post4-brand"><?php echo QKCMS_APP_IDENTIFIER; ?></span></h1>
                    <p class="post4-hero-desc">轻量级AI智能 · 部署更快 · 比织梦更好用的CMS内容管理系统</p>
                    <div class="post4-actions">
                        <a href="http://www.cms.qiken.cn/qkcms.zip" class="post4-btn post4-btn-primary">
                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
                                <polyline points="7 10 12 15 17 10" />
                                <line x1="12" y1="15" x2="12" y2="3" />
                            </svg>
                            立即下载
                        </a>
                        <button type="button" class="post4-btn post4-btn-ghost post4-btn-compact" onclick="openDemoAdmin()">
                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <circle cx="12" cy="12" r="9" />
                                <polygon points="10 8.5 16 12 10 15.5 10 8.5" />
                            </svg>
                            后台体验
                        </button>
                        <a href="http://www.qkcms.com" class="post4-btn post4-btn-ghost post4-btn-compact" target="_blank">
                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <rect x="2" y="4" width="20" height="14" rx="2" ry="2" />
                                <line x1="8" y1="20" x2="16" y2="20" />
                                <line x1="12" y1="18" x2="12" y2="20" />
                            </svg>
                            前端演示
                        </a>
                        <button type="button" class="post4-btn post4-btn-ghost" onclick="openProjectFilesModal()">
                            <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M3 7a2 2 0 0 1 2-2h4l2 2h4a2 2 0 0 1 2 2v1" />
                                <path d="M3 9v8a2 2 0 0 0 2 2h6" />
                                <circle cx="17.5" cy="16.5" r="3.5" />
                                <line x1="20.2" y1="19.2" x2="22" y2="21" />
                            </svg>
                            查看项目文件
                        </button>
                    </div>
                    <div class="post4-trust">
                        <span>上手更简单</span>
                        <span>企业级安全</span>
                        <span>适用做任何类型网站</span>
                    </div>
                </div>
            </div>


            <svg class="hero-waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
                <defs>
                    <path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
                </defs>
                <g class="parallax">
                    <use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.3)" />
                    <use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.2)" />
                    <use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.1)" />
                    <use xlink:href="#gentle-wave" x="48" y="7" fill="rgba(255,255,255,0.05)" />
                </g>
            </svg>
        </section>


        <section class="post4-section">
            <div class="post4-container">
                <h2 class="post4-title">核心能力 <span class="post4-title-light">· 极智体验</span></h2>
                <div class="post4-grid post4-grid-3">
                    <div class="post4-card post4-card-1">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" />
                                </svg></span>AI 智能提效</h3>
                        <p>结合 AI 能力辅助内容生成、文案整理与建站提效，让建站、运营和日常维护都更省时省力，效率提升更明显。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>AI辅助 · 建站提效</div>
                    </div>
                    <div class="post4-card post4-card-2">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" />
                                </svg></span>轻量级架构</h3>
                        <p>系统结构精简清晰，无需复杂依赖和繁琐配置，资源占用更轻，适合企业官网与内容站快速上线。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>精简高效 · 运行更轻</div>
                    </div>
                    <div class="post4-card post4-card-3">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" />
                                </svg></span>标签化模板</h3>
                        <p>采用简单直观的模板标签语法，结构清晰、门槛更低，新手也能快速修改和定制页面模板。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>上手简单 · 灵活定制</div>
                    </div>
                    <div class="post4-card post4-card-4">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
                                </svg></span>安全防护</h3>
                        <p>内置常用安全防护能力，兼顾后台管理、数据交互与内容发布，让网站运行更稳定、更安全。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>安全加固 · 稳定可靠</div>
                    </div>
                    <div class="post4-card post4-card-5">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M4 17l4.5-4.5 3.5 3.5L20 8" />
                                    <polyline points="14 8 20 8 20 14" />
                                </svg></span>快速部署</h3>
                        <p>环境要求更轻，安装配置更省心，适合快速搭建企业官网、资讯站和内容站，部署上线更高效。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>配置更省 · 上线更快</div>
                    </div>
                    <div class="post4-card post4-card-6">
                        <h3><span class="post4-card-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
                                    <polyline points="3.27 6.96 12 12.01 20.73 6.96" />
                                    <line x1="12" y1="22.08" x2="12" y2="12" />
                                </svg></span>插件扩展</h3>
                        <p>支持插件扩展与功能增强，可按需求叠加下载、支付、工具和内容增强能力，更贴合商业站点运营。</p>
                        <div class="post4-meta"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                <path d="M12 2l1.8 6.2L20 10l-6.2 1.8L12 18l-1.8-6.2L4 10l6.2-1.8L12 2z" />
                            </svg>按需扩展 · 更易变现</div>
                    </div>
                </div>


                <?php if (!empty($files)): ?>
                    <div class="post4-files">
                        <div class="post4-files-header">
                            <h3>文件资源</h3>
                            <span>📁 共 <?php echo count($files); ?> 个文件</span>
                        </div>
                        <div class="post4-files-grid">
                            <?php foreach ($files as $file): ?>
                                <div class="post4-file">
                                    <span class="post4-file-name"><?php echo htmlspecialchars($file['name']); ?></span>
                                    <span class="post4-file-size"><?php echo $file['size']; ?></span>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
        </section>


        <section class="post4-section">
            <div class="post4-container">
                <h2 class="post4-title" style="margin-top:0px;">常见问题 <span class="post4-title-light">· 答疑解惑</span></h2>
                <div class="post4-faq">
                    <details class="post4-faq-item" open>
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text"><?php echo QKCMS_APP_IDENTIFIER; ?> 到底适合做哪些类型的网站项目？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: <?php echo QKCMS_APP_IDENTIFIER; ?> 可做企业官网、产品展示站、资讯内容站、资源下载站，也能按需扩展商城和论坛等业务场景，适合需要长期运营和持续更新内容的项目。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">和传统老 CMS 相比，<?php echo QKCMS_APP_IDENTIFIER; ?> 的核心优势是什么？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 当前项目主打轻量级、部署更快、模板标签更直观、插件扩展更灵活，整体比传统老 CMS 更省心好上手，也更适合企业官网和内容站快速落地上线。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">第一次使用的话，<?php echo QKCMS_APP_IDENTIFIER; ?> 安装部署复杂吗？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 首次安装访问 `templates/install.php`，先保持 `DB_INIT_STATUS=init`，完成数据库和管理员配置后程序会自动改为 `done`，这样后续就不会重复进入初始化。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">如果是普通服务器环境，能顺利运行 <?php echo QKCMS_APP_IDENTIFIER; ?> 吗？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 可以，当前项目基于 PHP + MySQL，常见虚拟主机、云服务器以及普通 LNMP/LAMP 环境都能顺利部署运行，对常规企业网站服务器也比较友好。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">前台页面和风格样式，是否支持按需求定制修改？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 支持，模板主要集中在 `templates/skin`，可按 QKCMS 标签机制直接修改页面结构、样式展示和内容调用，做专题页、产品页和文章页改版都比较方便。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">后期如果要增加功能，是否支持插件扩展和功能叠加？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 支持，`admin/Plugin` 目录可继续接入支付、下载、内容增强、AI发布、AI视频等各类功能插件，后期有新业务需求时也方便继续按模块叠加扩展。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text"><?php echo QKCMS_APP_IDENTIFIER; ?> 的 AI 智能能力，主要能帮我做什么？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 当前 AI 主要用于内容生成、定时发布和视频生成这类场景，核心作用就是提升建站效率和日常运营效率，也能帮助站长减少重复性的内容处理工作。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">如果用于正式商用网站，<?php echo QKCMS_APP_IDENTIFIER; ?> 的安全性怎么样？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 可以商用，项目本身就是按企业官网和内容站方向设计，同时也带有基础的安装状态保护和稳定运行机制，用于正式上线和长期维护都没有问题。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">如果我有特殊需求，是否支持二次开发和商业定制服务？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 支持，可继续承接模板定制、插件定制、功能开发以及各类商业项目落地和后续迭代需求，适合有个性化业务流程和界面要求的客户。</div>
                    </details>
                    <details class="post4-faq-item">
                        <summary class="post4-faq-q"><span class="post4-q-mark">Q</span><span class="post4-faq-text">购买授权或服务之后，后续技术支持一般怎么对接？</span><span class="post4-faq-arrow"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
                                    <polyline points="6 9 12 15 18 9"></polyline>
                                </svg></span></summary>
                        <div class="post4-faq-a">A: 可通过官网、QQ、微信等官方联系方式获取安装指导、使用咨询、技术支持以及后续定制服务对接，出现部署和使用问题时也能及时沟通处理。</div>
                    </details>
                </div>
            </div>
        </section>

    </main>

    <div class="project-files-modal" id="projectFilesModal" onclick="closeProjectFilesModal(event)">
        <div class="project-files-backdrop"></div>
        <div class="project-files-dialog">
            <div class="project-files-header">
                <div>
                    <h3 class="project-files-title">{qkcms:site_name}项目文件结构</h3>
                </div>
                <button type="button" class="project-files-close" onclick="closeProjectFilesModal()">
                    <svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
                        <line x1="18" y1="6" x2="6" y2="18"></line>
                        <line x1="6" y1="6" x2="18" y2="18"></line>
                    </svg>
                </button>
            </div>
            <div class="project-files-body">
                <div class="tree-wrap">
                    <?php echo $renderTree($tree); ?>
                </div>
            </div>
        </div>
    </div>

    {qkcms:footer.html}

    <script>
        function openDemoAdmin() {
            var targetName = 'qkcms_demo_admin_' + Date.now();
            var demoWindow = window.open('about:blank', targetName);
            if (!demoWindow) return;
            var form = document.createElement('form');
            form.method = 'post';
            form.action = 'http://www.demo1.qiken.cn/login';
            form.target = targetName;
            form.style.display = 'none';
            var fields = {
                username: 'dome',
                password: '123456',
                login: '1'
            };
            Object.keys(fields).forEach(function(name) {
                var input = document.createElement('input');
                input.type = 'hidden';
                input.name = name;
                input.value = fields[name];
                form.appendChild(input);
            });
            document.body.appendChild(form);
            form.submit();
            document.body.removeChild(form);
        }

        function openProjectFilesModal() {
            var modal = document.getElementById('projectFilesModal');
            if (!modal) return;
            modal.classList.add('active');
            document.body.style.overflow = 'hidden';
        }

        function closeProjectFilesModal(event) {
            if (event && event.target) {
                var backdrop = event.target.classList && event.target.classList.contains('project-files-backdrop');
                var modal = event.target.classList && event.target.classList.contains('project-files-modal');
                if (!backdrop && !modal && event.type === 'click') {
                    return;
                }
            }
            var modal = document.getElementById('projectFilesModal');
            if (!modal) return;
            modal.classList.remove('active');
            document.body.style.overflow = '';
        }

        document.addEventListener('click', function(event) {
            var row = event.target.closest('.project-files-dialog .tree-row.is-dir');
            if (!row) {
                return;
            }

            var item = row.parentElement;
            if (!item || !item.classList.contains('tree-item')) {
                return;
            }

            item.classList.toggle('open');
        });

        document.addEventListener('keydown', function(event) {
            if (event.key === 'Escape') {
                closeProjectFilesModal();
            }
        });
    </script>

</body>

</html>

