<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>下载 Oraset</title>
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
    <div class="layout">
        <nav class="sidebar">
            <div class="sidebar-section">
                <div class="sidebar-section-title">Oraset</div>
                <ul>
                    <li><a href="index.php">首页</a></li>
                    <li><a href="download.php" class="active">下载</a></li>
                    <li><a href="releases.php">历史版本</a></li>
                </ul>
            </div>
            <div class="sidebar-section">
                <div class="sidebar-section-title">文档</div>
                <ul>
                    <li><a href="docs/index.php?list">文档列表</a></li>
                </ul>
                <ul id="doc-nav-list">
                    <li><span class="sidebar-loading">加载中...</span></li>
                </ul>
            </div>
        </nav>
        
        <main class="main">
            <h1>下载</h1>
            
            <h2>最新版本：B-5</h2>
            <p class="version-note">构建日期: 2026.7.22 | 全新升级版本</p>
            
            <h2>Windows <span class="version-badge">B-5</span></h2>
            <p><strong>EXE 可执行文件</strong></p>
            <ul>
                <li><a href="download/exe/Oraset-B-5.exe">Oraset-B-5.exe</a></li>
            </ul>
            
            <hr>
            
            <h2>macOS <span class="version-badge">B-5</span></h2>
            <p><strong>PKG 安装包</strong></p>
            <ul>
                <li><a href="download/pkg/Oraset-B5.pkg">Oraset-B5.pkg</a></li>
            </ul>
            <pre>wget https://oraset.parlz.com/download/pkg/Oraset-B5.pkg
sudo installer -pkg Oraset-B5.pkg -target /</pre>
            
            <hr>
            
            <h2>历史版本</h2>
            <ul>
                <li><strong>Re+4.0.1-BetaN(+AU)</strong> - 2026.6.12 新增自动更新功能
                    <br><a href="download/source/Oraset-Re+4.0.1-BetaN(+AU)-source.tar.gz">源码下载</a>
                </li>
                <li><strong>Re+4.0.1-Beta</strong> - 2026.6.12 测试版本
                    <br><a href="download/source/Oraset-Re+4.0.1-Beta(..26:.6:12)-source.tar.gz">源码下载</a>
                </li>
                <li><strong>Re+4.0.0-Release</strong> - 2026年早期稳定版本
                    <br><a href="download/source/Oraset-Re+4.0.0-Release-source.tar.gz">源码下载</a>
                </li>
                <li><strong>Re+4.0.0-Beta</strong> - 2026年早期测试版本
                    <br><a href="download/source/Oraset-Re+4.0.0-Beta-source.tar.gz">源码下载</a>
                </li>
            </ul>
            
            <h2>系统要求</h2>
            <ul>
                <li>Windows 10/11 (64位)</li>
                <li>macOS 10.15+</li>
                <li>Linux x86_64</li>
            </ul>
            
            <hr>
            <p>Oraset Project &copy; 2026</p>
        </main>
    </div>
    
    <script>
    fetch('docs/api.php')
        .then(function(response) {
            if (!response.ok) {
                throw new Error('Network response was not ok');
            }
            return response.json();
        })
        .then(function(data) {
            var navList = document.getElementById('doc-nav-list');
            navList.innerHTML = '';
            if (data.articles && data.articles.length > 0) {
                data.articles.forEach(function(article) {
                    var li = document.createElement('li');
                    var a = document.createElement('a');
                    a.href = 'docs/index.php?doc=' + article.name;
                    a.textContent = article.title;
                    li.appendChild(a);
                    navList.appendChild(li);
                });
            } else {
                navList.innerHTML = '<li><span class="sidebar-loading">暂无文档</span></li>';
            }
        })
        .catch(function(error) {
            console.error('Error loading document list:', error);
            document.getElementById('doc-nav-list').innerHTML = '<li><span class="sidebar-loading">加载失败</span></li>';
        });
    </script>
</body>
</html>