<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
    <title>دانلود نرم‌افزار حسابداری دودوتا – آخرین نگارش + نسخه‌های کارتخوان و ابزارها</title>
    <meta name="description" content="دانلود مستقیم نرم‌افزار حسابداری دودوتا (آخرین نگارش) به همراه نسخه‌های ویژه انواع کارتخوان، چاپگر، بارکدخوان، شبیه‌ساز ویندوز و فایل‌های تکمیلی. کاملاً رایگان.">
    <meta name="robots" content="index, follow">

    <!-- Open Graph -->
    <meta property="og:type" content="website">
    <meta property="og:title" content="دانلود نرم‌افزار حسابداری دودوتا – تمام نسخه‌ها">
    <meta property="og:description" content="نگارش جدید نرم‌افزار حسابداری دودوتا را برای اندروید، شبیه‌ساز ویندوز و کارتخوان‌ها دانلود کنید.">
    <meta property="og:url" content="https://do2ta.com/downloads/">
    <meta property="og:site_name" content="دودوتا">
    <meta property="og:locale" content="fa_IR">

    <!-- JSON-LD -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "SoftwareApplication",
      "name": "دودوتا حسابداری",
      "operatingSystem": "Android, Windows",
      "applicationCategory": "BusinessApplication",
      "downloadUrl": "https://do2ta.com/files/Do2ta.apk",
      "offers": { "@type": "Offer", "price": "0" }
    }
    </script>

    <style>
        @font-face {
            font-family: 'Vazirmatn';
            src: local('Vazirmatn'), local('Vazir'), url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
            font-display: swap;
        }
        * { margin:0; padding:0; box-sizing:border-box; }
        body {
            font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
            background: #f4f7fc; color: #1e2a32; padding: 24px 16px;
        }
        .container {
            max-width: 1280px; margin: 0 auto; background: white; border-radius: 32px;
            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1); padding: 30px 24px 40px;
        }
        .page-header {
            border-bottom: 2px solid #e9edf2; padding-bottom: 20px; margin-bottom: 28px;
        }
        .main-title {
            font-size: 2rem; font-weight: 800;
            background: linear-gradient(135deg, #004C41, #008b6b);
            -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px;
        }
        .subtitle {
            font-size: 1rem; color: #4b5563; margin-bottom: 16px; max-width: 700px; line-height: 1.8;
        }
        .search-section { margin-bottom: 24px; }
        .search-box {
            position: relative; display: flex; align-items: center; background: white;
            border: 1.5px solid #e2e8f0; border-radius: 60px; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
            transition: border 0.2s; overflow: hidden;
        }
        .search-box:focus-within { border-color: #00755e; box-shadow: 0 8px 20px rgba(0,117,94,0.15); }
        .search-box input {
            flex:1; padding: 16px 24px; border: none; outline: none; font-family: inherit; font-size: 1rem;
            background: transparent; color: #1e2a32;
        }
        .search-box button {
            background: linear-gradient(135deg, #004C41, #00755e); border: none; padding: 10px 24px;
            border-radius: 50px; color: white; font-weight: 600; cursor: pointer; margin: 8px;
            transition: 0.2s; font-family: inherit;
        }
        .search-box button:hover { background: linear-gradient(135deg, #00755e, #00a182); }
        .result-stats { font-size: 0.85rem; color: #5b6e8c; margin-top: 10px; padding-right: 12px; font-weight: 500; }

        /* Accordion */
        .accordion-group {
            margin-bottom: 18px; border-radius: 24px; background: #ffffff; border: 1px solid #eef2f8;
            transition: all 0.2s; overflow: hidden;
        }
        .accordion-header {
            background: #f9fafc; padding: 18px 24px; cursor: pointer; display: flex; align-items: center;
            justify-content: space-between; transition: background 0.2s; border-radius: 24px;
        }
        .accordion-header:hover { background: #f1f5f9; }
        .group-title { font-size: 1.35rem; font-weight: 700; color: #004C41; display: flex; align-items: center; gap: 12px; }
        .group-title .icon { font-size: 1.8rem; }
        .toggle-icon { font-size: 1.8rem; font-weight: 300; color: #00755e; transition: transform 0.3s ease; }
        .accordion-content {
            max-height: 0; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.33, 1, 0.68, 1);
            background: white; border-top: 0px solid transparent;
        }
        .accordion-group.open .accordion-content { max-height: 4000px; border-top: 1px solid #ecf3fa; }
        .accordion-group.open .toggle-icon { transform: rotate(180deg); }

        .links-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
            padding: 20px 20px 24px;
        }
        .download-link a {
            display: flex; align-items: center; gap: 12px; background: #fefefe; padding: 12px 18px;
            border-radius: 20px; text-decoration: none; color: #1f3a47; font-weight: 500;
            transition: all 0.25s; border: 1px solid #eef2fa; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .download-link a::before { content: "⬇️"; font-size: 1.2rem; opacity: 0.9; }
        .download-link a:hover {
            background: linear-gradient(105deg, #f0f9f5, #ffffff); border-color: #cbdde9;
            transform: translateX(6px); box-shadow: 0 8px 15px rgba(0,0,0,0.05); color: #004C41;
        }
        .no-results {
            text-align: center; padding: 48px 20px; background: #fafcff; border-radius: 36px;
            color: #6c7e97; font-size: 1.1rem;
        }
        .hide-group { display: none; }

        /* ویژگی‌های نسخه جدید (داخل آکاردئون) */
        .features-body {
            padding: 16px 24px 24px; color: #2d3a4a; line-height: 2;
            background: #f9fdfb; border-radius: 16px; margin: 10px 0;
            font-size: 0.95rem;
        }
        .features-body strong { color: #004C41; }
        .features-body h3, .features-body h4 { color: #004C41; margin: 16px 0 8px; }
        .features-body ul { margin-right: 20px; }
        .features-body li { margin-bottom: 6px; }

        @media (max-width: 680px) {
            body { padding: 12px; }
            .container { padding: 16px; }
            .group-title { font-size: 1.2rem; }
            .links-grid { grid-template-columns: 1fr; padding: 12px; }
            .accordion-header { padding: 14px 18px; }
            .main-title { font-size: 1.6rem; }
        }
    </style>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1 class="main-title">📥 دانلود نرم‌افزار حسابداری دودوتا</h1>
        <p class="subtitle">
            تمام نسخه‌های نرم‌افزار حسابداری دودوتا به‌صورت یکجا. آخرین نگارش اصلی، نسخه‌های ویژه کارتخوان، ابزارهای جانبی و فایل‌های تکمیلی. پیش از نصب، از اطلاعات خود پشتیبان تهیه کنید.
        </p>

        <div class="search-box">
            <input type="text" id="searchInput" placeholder="جستجو در فایل‌ها… مثلاً: چاپگر، کارتخوان، شبیه‌ساز" autocomplete="off">
            <button id="searchBtn">🔍 پیدا کن</button>
        </div>
        <div class="result-stats" id="resultStats"></div>
    </div>

    <!-- بخش امکانات نسخه جدید (از JSON بارگذاری می‌شود) -->
    <div class="accordion-group" id="featuresGroup">
        <div class="accordion-header">
            <div class="group-title"><span class="icon">🆕</span> قابلیت‌های جدیدترین نسخه</div>
            <div class="toggle-icon">▼</div>
        </div>
        <div class="accordion-content">
            <div class="features-body" id="featuresContent">در حال بارگذاری...</div>
        </div>
    </div>

    <div id="accordionRoot"></div>
</div>

<script>
    // ---------- تنظیمات اولیه ----------
    const FEATURES_JSON_URL = '/update/updateDo2ta.json'; // فایل روی سرور اصلی

    // ---------- داده‌های ثابت لینک‌ها ----------
    const categories = [
        {
            name: "🚀 نسخه اصلی",
            icon: "📱",
            links: [
                { title: "دانلود آخرین نگارش + دمو (اندروید)", url: "https://do2ta.com/files/Do2ta.apk" }
            ]
        },
        {
            name: "🔄 لینک‌های ویژه",
            icon: "⭐",
            links: [
                { title: "آخرین نسخه غیر رسمی بتا", url: "https://do2ta.com/files/Do2taBeta.apk" },
                { title: "بانک اطلاعاتی آنلاین (سرور شخصی)", url: "https://do2ta.com/files/DB.zip" }
            ]
        },
        {
            name: "📟 نسخه‌های ویژه کارتخوان",
            icon: "💳",
            links: [
                { title: "کارتخوان SZZT (پرداخت نوین)", url: "https://do2ta.com/files/Do2taSignSzzt.apk" },
                { title: "کارتخوان K9 و K9+", url: "https://do2ta.com/files/Do2taSignk9.apk" },
                { title: "کارتخوان P10 (به‌پرداخت ملت)", url: "https://do2ta.com/files/Do2ta_v12_2_0_BPM_signed.apk" },
                { title: "کارتخوان i80", url: "https://do2ta.com/files/Do2tai80signed_2.apk" },
                { title: "کارتخوان توسن P3 / P8 / P10 (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPx.apk" },
                { title: "کارتخوان سداد بانک ملی (P10 و P3)", url: "https://do2ta.com/files/Do2ta_Sadad_signed.apk" },
                { title: "کارتخوان i9000S (پرداخت نوین)", url: "https://do2ta.com/files/Do2taSignPN.apk" },
                { title: "کارتخوان i9000 (ایران کیش)", url: "https://do2ta.com/files/2dota.apk" },
                { title: "کارتخوان SP580", url: "https://do2ta.com/files/sign_Do2taV12-1-0.apk" }
            ]
        },
        {
            name: "🖨️ اپلیکیشن چاپگر کارتخوان",
            icon: "🧾",
            links: [
                { title: "چاپگر K9 و K9+", url: "https://do2ta.com/files/Do2taPrinterSign3.apk" },
                { title: "چاپگر i80", url: "https://do2ta.com/files/printeri80_signed (1).apk" },
                { title: "چاپگر P3/P8/P10 (به‌پرداخت ملت)", url: "https://do2ta.com/files/printerPxDodotaV3signed.apk" },
                { title: "چاپگر P10 و P3 (پرداخت نوین آرین)", url: "https://do2ta.com/files/Do2taPrinterP10V1-0-4.P3Sign.apk" },
                { title: "چاپگر توسن P10/P8 (پرداخت نوین)", url: "https://do2ta.com/files/printerPxDodotaV3signed.apk" },
                { title: "چاپگر توسن P3 (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPrinterP10V1-0-4.apk" },
                { title: "چاپگر سداد بانک ملی (P10 و P3)", url: "https://do2ta.com/files/Do2taPrinterSign3 (1)_Sadad_signed.apk" },
                { title: "چاپگر i9000S", url: "https://do2ta.com/files/Do2taPrinterSign.apk" },
                { title: "چاپگر i9000 (ایران کیش)", url: "https://do2ta.com/files/do2taprinter.apk" },
                { title: "چاپگر SZZT (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPrinterSignSzzt.apk" }
            ]
        },
        {
            name: "📸 افزونه‌های بارکدخوان",
            icon: "🔍",
            links: [
                { title: "بارکد خوان ۱ – Barcode Scanner", url: "https://cafebazaar.ir/app/com.google.zxing.client.android" },
                { title: "بارکد خوان ۲ – Scanner Tool", url: "https://play.google.com/store/apps/details?id=tool.scanner" },
                { title: "بارکدخوان پیشنهادی دودوتا (Barcode Maker)", url: "https://play.google.com/store/apps/details?id=com.shenyaocn.android.barmaker" }
            ]
        },
        {
            name: "🖨️ ابزارهای پرینتر",
            icon: "🖨️",
            links: [
                { title: "HP Print Service", url: "https://cafebazaar.ir/app/com.hp.android.printservice" },
                { title: "اپلیکیشن بیکسلون (Bixolon)", url: "https://play.google.com/store/apps/details?id=com.bixolon.mprint" },
                { title: "افزونه عمومی پوز پرینتر", url: "https://do2ta.com/files/do2taPrinter.apk" },
                { title: "پرینتر سامسونگ", url: "https://play.google.com/store/apps/details?id=com.sec.app.samsungprintservice" },
                { title: "PrinterShare (اندروید)", url: "https://do2ta.com/files/android-print-share.apk" },
                { title: "PrinterShare (ویندوز)", url: "https://do2ta.com/files/windows-print-share.exe" }
            ]
        },
        {
            name: "💻 شبیه‌ساز اندروید برای ویندوز",
            icon: "🖥️",
            links: [
                { title: "Phoenix OS", url: "https://www.yasdl.com/123213/%D8%AF%D8%A7%D9%86%D9%84%D9%88%D8%AF-phoenix-os.html" },
                { title: "Remix OS", url: "https://soft98.ir/os/android-os/677-remix-os.html" },
                { title: "BlueStacks", url: "https://www.bluestacks.com/download.html" },
                { title: "Nox (پیشنهادی)", url: "https://www.bignox.com/en/download/fullPackage?formal" }
            ]
        },
        {
            name: "🛒 اتصال به وب‌سایت فروشگاهی",
            icon: "🔗",
            links: [
                { title: "افزونه ووکامرس دودوتا", url: "https://do2ta.com/files/Do2taWpPlugin (3).zip" }
            ]
        },
        {
            name: "📊 قالب‌های خام اکسل",
            icon: "📑",
            links: [
                { title: "فایل خام اکسل کالا و خدمات", url: "https://do2ta.com/files/Product__Excel_2026_01_04_11_16_35.xlsx" },
                { title: "فایل خام اکسل مشتریان", url: "https://do2ta.com/files/Client__Excel_2026_01_04_11_19_59.xlsx" }
            ]
        },
        {
            name: "⚙️ ابزارهای مدیریتی",
            icon: "🔧",
            links: [
                { title: "ویرایشگر بانک اطلاعاتی (SQLite Editor)", url: "https://do2ta.com/files/SQLite-Editor.apk" }
            ]
        }
    ];

    // ---------- Fuzzy search ----------
    function levenshtein(a,b){if(!a.length)return b.length;if(!b.length)return a.length;const m=[];for(let i=0;i<=b.length;i++)m[i]=[i];for(let j=0;j<=a.length;j++)m[0][j]=j;for(let i=1;i<=b.length;i++){for(let j=1;j<=a.length;j++){m[i][j]=Math.min(m[i-1][j]+1,m[i][j-1]+1,m[i-1][j-1]+(a[j-1]===b[i-1]?0:1));}}return m[b.length][a.length];}
    function isSimilar(term,text){if(!term)return true;term=term.toLowerCase();text=text.toLowerCase();if(text.includes(term))return true;const dist=levenshtein(term,text);if((1-dist/Math.max(term.length,text.length))>0.7)return true;const words=term.split(/\s+/);for(let w of words){if(w.length<2)continue;if(text.includes(w))return true;for(let tw of text.split(/\s+/)){if(tw.length<2)continue;const d=levenshtein(w,tw);if((1-d/Math.max(w.length,tw.length))>0.7)return true;}}return false;}

    function escapeHtml(s){return s.replace(/[&<>]/g,m=>({ '&':'&amp;', '<':'&lt;', '>':'&gt;' })[m]);}

    // ---------- نمایش ویژگی‌ها از JSON ----------
    function renderFeaturesFromMarkdown(md) {
        if (!md) return '<p>اطلاعاتی موجود نیست.</p>';
        // تبدیل **متن** به strong
        let html = md.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
        // تبدیل خطوط جداکننده
        html = html.replace(/^---$/gm, '<hr style="border-color:#d0e0d0; margin:16px 0">');
        // تبدیل heading های ### و ##
        html = html.replace(/^### (.*?)$/gm, '<h4>$1</h4>');
        html = html.replace(/^## (.*?)$/gm, '<h3>$1</h3>');
        // تبدیل bullet points با • یا -
        html = html.replace(/^[•\-]\s+(.*?)$/gm, '<li>$1</li>');
        // بسته‌بندی خطوط لیست در ul
        html = html.replace(/((?:\s*<li>.*?<\/li>\s*)+)/g, '<ul>$1</ul>');
        // دو خط پشت سر هم را پاراگراف می‌کنیم
        html = html.replace(/\n\n/g, '</p><p>');
        html = '<p>' + html + '</p>';
        // خطوط تکی را <br>
        html = html.replace(/\n/g, '<br>');
        return html;
    }

    async function loadFeatures() {
        const container = document.getElementById('featuresContent');
        try {
            const resp = await fetch(FEATURES_JSON_URL);
            if (!resp.ok) throw new Error('Network error');
            const data = await resp.json();
            container.innerHTML = renderFeaturesFromMarkdown(data.features);
        } catch (e) {
            // در صورت خطا از داده‌های پشتیبان (همان JSON نمونه) استفاده کن
            const fallback = {
                features: "🎯 **نگارش ۱۲.۲.۰ دودوتا منتشر شد!**\n\n🧠 **هوش مالی** • تحلیل هوشمند • هشدار پیشگیرانه\n🚀 **مدیریت مالیاتی یکپارچه** • ارسال به سامانه مودیان\n👥 **CRM پیشرفته** • امتیازدهی مشتریان\n💳 **پرداخت مدرن** • اتصال مستقیم کارتخوان\n\nنسخه جدید هم اکنون قابل دانلود است."
            };
            container.innerHTML = renderFeaturesFromMarkdown(fallback.features);
        }
        // فعال‌سازی کلیک روی هدر بخش ویژگی‌ها
        document.getElementById('featuresGroup').querySelector('.accordion-header').addEventListener('click', function(e){
            this.closest('.accordion-group').classList.toggle('open');
        });
    }

    // ---------- رندر دسته‌های دانلود ----------
    function renderDownloads(searchTerm = '') {
        const root = document.getElementById('accordionRoot');
        let total = 0, html = '';
        categories.forEach((cat, idx) => {
            const filtered = searchTerm ? cat.links.filter(l => isSimilar(searchTerm, l.title)) : cat.links;
            if (!filtered.length && searchTerm) return;
            total += filtered.length;
            const hide = !filtered.length ? 'hide-group' : '';
            const open = searchTerm ? 'open' : (idx === 0 ? 'open' : '');
            html += `
            <div class="accordion-group ${hide} ${open}">
                <div class="accordion-header">
                    <div class="group-title"><span class="icon">${cat.icon}</span> ${cat.name} <small>(${filtered.length})</small></div>
                    <div class="toggle-icon">▼</div>
                </div>
                <div class="accordion-content">
                    <div class="links-grid">
                        ${filtered.map(l => `<div class="download-link"><a href="${l.url}" target="_blank" rel="noopener">${escapeHtml(l.title)}</a></div>`).join('')}
                    </div>
                </div>
            </div>`;
        });
        if (!total && searchTerm) {
            root.innerHTML = `<div class="no-results">😕 فایلی با عنوان «${escapeHtml(searchTerm)}» یافت نشد.</div>`;
            document.getElementById('resultStats').textContent = '';
        } else {
            root.innerHTML = html;
            document.getElementById('resultStats').textContent = searchTerm
                ? `✨ ${total} فایل برای «${escapeHtml(searchTerm)}» یافت شد.`
                : `📦 ${total} فایل آماده دانلود – برای شروع روی هر گروه کلیک کنید.`;
            attachAccordion();
        }
    }

    function attachAccordion() {
        document.querySelectorAll('#accordionRoot .accordion-group').forEach(group => {
            const header = group.querySelector('.accordion-header');
            if (!header) return;
            const newHeader = header.cloneNode(true);
            header.parentNode.replaceChild(newHeader, header);
            newHeader.addEventListener('click', (e) => {
                e.stopPropagation();
                group.classList.toggle('open');
            });
        });
    }

    // ---------- مدیریت جستجو و URL ----------
    function doSearch(term) {
        const url = new URL(window.location);
        if (term) url.searchParams.set('q', term);
        else url.searchParams.delete('q');
        window.history.pushState({}, '', url);
        document.getElementById('searchInput').value = term;
        renderDownloads(term);
    }

    function initSearch() {
        const params = new URLSearchParams(window.location.search);
        const q = params.get('q') || '';
        document.getElementById('searchInput').value = q;
        renderDownloads(q);
    }

    document.addEventListener('DOMContentLoaded', () => {
        loadFeatures(); // بارگذاری ویژگی‌ها از JSON
        initSearch();
        document.getElementById('searchBtn').addEventListener('click', () => doSearch(document.getElementById('searchInput').value));
        document.getElementById('searchInput').addEventListener('keyup', e => { if(e.key==='Enter') doSearch(e.target.value); });
        window.addEventListener('popstate', () => {
            const q = new URLSearchParams(window.location.search).get('q') || '';
            document.getElementById('searchInput').value = q;
            renderDownloads(q);
        });
    });
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes">
    <title>دانلود نرم‌افزار حسابداری دودوتا – آخرین نگارش + نسخه‌های کارتخوان و ابزارها</title>
    <meta name="description" content="دانلود مستقیم نرم‌افزار حسابداری دودوتا (آخرین نگارش) به همراه نسخه‌های ویژه انواع کارتخوان، چاپگر، بارکدخوان، شبیه‌ساز ویندوز و فایل‌های تکمیلی. کاملاً رایگان.">
    <meta name="robots" content="index, follow">

    <!-- Open Graph -->
    <meta property="og:type" content="website">
    <meta property="og:title" content="دانلود نرم‌افزار حسابداری دودوتا – تمام نسخه‌ها">
    <meta property="og:description" content="نگارش جدید نرم‌افزار حسابداری دودوتا را برای اندروید، شبیه‌ساز ویندوز و کارتخوان‌ها دانلود کنید.">
    <meta property="og:url" content="https://do2ta.com/downloads/">
    <meta property="og:site_name" content="دودوتا">
    <meta property="og:locale" content="fa_IR">

    <!-- JSON-LD -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "SoftwareApplication",
      "name": "دودوتا حسابداری",
      "operatingSystem": "Android, Windows",
      "applicationCategory": "BusinessApplication",
      "downloadUrl": "https://do2ta.com/files/Do2ta.apk",
      "offers": { "@type": "Offer", "price": "0" }
    }
    </script>

    <style>
        @font-face {
            font-family: 'Vazirmatn';
            src: local('Vazirmatn'), local('Vazir'), url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
            font-display: swap;
        }
        * { margin:0; padding:0; box-sizing:border-box; }
        body {
            font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
            background: #f4f7fc; color: #1e2a32; padding: 24px 16px;
        }
        .container {
            max-width: 1280px; margin: 0 auto; background: white; border-radius: 32px;
            box-shadow: 0 20px 35px -12px rgba(0,0,0,0.1); padding: 30px 24px 40px;
        }
        .page-header {
            border-bottom: 2px solid #e9edf2; padding-bottom: 20px; margin-bottom: 28px;
        }
        .main-title {
            font-size: 2rem; font-weight: 800;
            background: linear-gradient(135deg, #004C41, #008b6b);
            -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px;
        }
        .subtitle {
            font-size: 1rem; color: #4b5563; margin-bottom: 16px; max-width: 700px; line-height: 1.8;
        }
        .search-section { margin-bottom: 24px; }
        .search-box {
            position: relative; display: flex; align-items: center; background: white;
            border: 1.5px solid #e2e8f0; border-radius: 60px; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
            transition: border 0.2s; overflow: hidden;
        }
        .search-box:focus-within { border-color: #00755e; box-shadow: 0 8px 20px rgba(0,117,94,0.15); }
        .search-box input {
            flex:1; padding: 16px 24px; border: none; outline: none; font-family: inherit; font-size: 1rem;
            background: transparent; color: #1e2a32;
        }
        .search-box button {
            background: linear-gradient(135deg, #004C41, #00755e); border: none; padding: 10px 24px;
            border-radius: 50px; color: white; font-weight: 600; cursor: pointer; margin: 8px;
            transition: 0.2s; font-family: inherit;
        }
        .search-box button:hover { background: linear-gradient(135deg, #00755e, #00a182); }
        .result-stats { font-size: 0.85rem; color: #5b6e8c; margin-top: 10px; padding-right: 12px; font-weight: 500; }

        /* Accordion */
        .accordion-group {
            margin-bottom: 18px; border-radius: 24px; background: #ffffff; border: 1px solid #eef2f8;
            transition: all 0.2s; overflow: hidden;
        }
        .accordion-header {
            background: #f9fafc; padding: 18px 24px; cursor: pointer; display: flex; align-items: center;
            justify-content: space-between; transition: background 0.2s; border-radius: 24px;
        }
        .accordion-header:hover { background: #f1f5f9; }
        .group-title { font-size: 1.35rem; font-weight: 700; color: #004C41; display: flex; align-items: center; gap: 12px; }
        .group-title .icon { font-size: 1.8rem; }
        .toggle-icon { font-size: 1.8rem; font-weight: 300; color: #00755e; transition: transform 0.3s ease; }
        .accordion-content {
            max-height: 0; overflow: hidden; transition: max-height 0.45s cubic-bezier(0.33, 1, 0.68, 1);
            background: white; border-top: 0px solid transparent;
        }
        .accordion-group.open .accordion-content { max-height: 4000px; border-top: 1px solid #ecf3fa; }
        .accordion-group.open .toggle-icon { transform: rotate(180deg); }

        .links-grid {
            display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
            padding: 20px 20px 24px;
        }
        .download-link a {
            display: flex; align-items: center; gap: 12px; background: #fefefe; padding: 12px 18px;
            border-radius: 20px; text-decoration: none; color: #1f3a47; font-weight: 500;
            transition: all 0.25s; border: 1px solid #eef2fa; box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .download-link a::before { content: "⬇️"; font-size: 1.2rem; opacity: 0.9; }
        .download-link a:hover {
            background: linear-gradient(105deg, #f0f9f5, #ffffff); border-color: #cbdde9;
            transform: translateX(6px); box-shadow: 0 8px 15px rgba(0,0,0,0.05); color: #004C41;
        }
        .no-results {
            text-align: center; padding: 48px 20px; background: #fafcff; border-radius: 36px;
            color: #6c7e97; font-size: 1.1rem;
        }
        .hide-group { display: none; }

        /* ویژگی‌های نسخه جدید (داخل آکاردئون) */
        .features-body {
            padding: 16px 24px 24px; color: #2d3a4a; line-height: 2;
            background: #f9fdfb; border-radius: 16px; margin: 10px 0;
            font-size: 0.95rem;
        }
        .features-body strong { color: #004C41; }
        .features-body h3, .features-body h4 { color: #004C41; margin: 16px 0 8px; }
        .features-body ul { margin-right: 20px; }
        .features-body li { margin-bottom: 6px; }

        @media (max-width: 680px) {
            body { padding: 12px; }
            .container { padding: 16px; }
            .group-title { font-size: 1.2rem; }
            .links-grid { grid-template-columns: 1fr; padding: 12px; }
            .accordion-header { padding: 14px 18px; }
            .main-title { font-size: 1.6rem; }
        }
    </style>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1 class="main-title">📥 دانلود نرم‌افزار حسابداری دودوتا</h1>
        <p class="subtitle">
            تمام نسخه‌های نرم‌افزار حسابداری دودوتا به‌صورت یکجا. آخرین نگارش اصلی، نسخه‌های ویژه کارتخوان، ابزارهای جانبی و فایل‌های تکمیلی. پیش از نصب، از اطلاعات خود پشتیبان تهیه کنید.
        </p>

        <div class="search-box">
            <input type="text" id="searchInput" placeholder="جستجو در فایل‌ها… مثلاً: چاپگر، کارتخوان، شبیه‌ساز" autocomplete="off">
            <button id="searchBtn">🔍 پیدا کن</button>
        </div>
        <div class="result-stats" id="resultStats"></div>
    </div>

    <!-- بخش امکانات نسخه جدید (از JSON بارگذاری می‌شود) -->
    <div class="accordion-group" id="featuresGroup">
        <div class="accordion-header">
            <div class="group-title"><span class="icon">🆕</span> قابلیت‌های جدیدترین نسخه</div>
            <div class="toggle-icon">▼</div>
        </div>
        <div class="accordion-content">
            <div class="features-body" id="featuresContent">در حال بارگذاری...</div>
        </div>
    </div>

    <div id="accordionRoot"></div>
</div>

<script>
    // ---------- تنظیمات اولیه ----------
    const FEATURES_JSON_URL = '/update/updateDo2ta.json'; // فایل روی سرور اصلی

    // ---------- داده‌های ثابت لینک‌ها ----------
    const categories = [
        {
            name: "🚀 نسخه اصلی",
            icon: "📱",
            links: [
                { title: "دانلود آخرین نگارش + دمو (اندروید)", url: "https://do2ta.com/files/Do2ta.apk" }
            ]
        },
        {
            name: "🔄 لینک‌های ویژه",
            icon: "⭐",
            links: [
                { title: "آخرین نسخه غیر رسمی بتا", url: "https://do2ta.com/files/Do2taBeta.apk" },
                { title: "بانک اطلاعاتی آنلاین (سرور شخصی)", url: "https://do2ta.com/files/DB.zip" }
            ]
        },
        {
            name: "📟 نسخه‌های ویژه کارتخوان",
            icon: "💳",
            links: [
                { title: "کارتخوان SZZT (پرداخت نوین)", url: "https://do2ta.com/files/Do2taSignSzzt.apk" },
                { title: "کارتخوان K9 و K9+", url: "https://do2ta.com/files/Do2taSignk9.apk" },
                { title: "کارتخوان P10 (به‌پرداخت ملت)", url: "https://do2ta.com/files/Do2ta_v12_2_0_BPM_signed.apk" },
                { title: "کارتخوان i80", url: "https://do2ta.com/files/Do2tai80signed_2.apk" },
                { title: "کارتخوان توسن P3 / P8 / P10 (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPx.apk" },
                { title: "کارتخوان سداد بانک ملی (P10 و P3)", url: "https://do2ta.com/files/Do2ta_Sadad_signed.apk" },
                { title: "کارتخوان i9000S (پرداخت نوین)", url: "https://do2ta.com/files/Do2taSignPN.apk" },
                { title: "کارتخوان i9000 (ایران کیش)", url: "https://do2ta.com/files/2dota.apk" },
                { title: "کارتخوان SP580", url: "https://do2ta.com/files/sign_Do2taV12-1-0.apk" }
            ]
        },
        {
            name: "🖨️ اپلیکیشن چاپگر کارتخوان",
            icon: "🧾",
            links: [
                { title: "چاپگر K9 و K9+", url: "https://do2ta.com/files/Do2taPrinterSign3.apk" },
                { title: "چاپگر i80", url: "https://do2ta.com/files/printeri80_signed (1).apk" },
                { title: "چاپگر P3/P8/P10 (به‌پرداخت ملت)", url: "https://do2ta.com/files/printerPxDodotaV3signed.apk" },
                { title: "چاپگر P10 و P3 (پرداخت نوین آرین)", url: "https://do2ta.com/files/Do2taPrinterP10V1-0-4.P3Sign.apk" },
                { title: "چاپگر توسن P10/P8 (پرداخت نوین)", url: "https://do2ta.com/files/printerPxDodotaV3signed.apk" },
                { title: "چاپگر توسن P3 (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPrinterP10V1-0-4.apk" },
                { title: "چاپگر سداد بانک ملی (P10 و P3)", url: "https://do2ta.com/files/Do2taPrinterSign3 (1)_Sadad_signed.apk" },
                { title: "چاپگر i9000S", url: "https://do2ta.com/files/Do2taPrinterSign.apk" },
                { title: "چاپگر i9000 (ایران کیش)", url: "https://do2ta.com/files/do2taprinter.apk" },
                { title: "چاپگر SZZT (پرداخت نوین)", url: "https://do2ta.com/files/Do2taPrinterSignSzzt.apk" }
            ]
        },
        {
            name: "📸 افزونه‌های بارکدخوان",
            icon: "🔍",
            links: [
                { title: "بارکد خوان ۱ – Barcode Scanner", url: "https://cafebazaar.ir/app/com.google.zxing.client.android" },
                { title: "بارکد خوان ۲ – Scanner Tool", url: "https://play.google.com/store/apps/details?id=tool.scanner" },
                { title: "بارکدخوان پیشنهادی دودوتا (Barcode Maker)", url: "https://play.google.com/store/apps/details?id=com.shenyaocn.android.barmaker" }
            ]
        },
        {
            name: "🖨️ ابزارهای پرینتر",
            icon: "🖨️",
            links: [
                { title: "HP Print Service", url: "https://cafebazaar.ir/app/com.hp.android.printservice" },
                { title: "اپلیکیشن بیکسلون (Bixolon)", url: "https://play.google.com/store/apps/details?id=com.bixolon.mprint" },
                { title: "افزونه عمومی پوز پرینتر", url: "https://do2ta.com/files/do2taPrinter.apk" },
                { title: "پرینتر سامسونگ", url: "https://play.google.com/store/apps/details?id=com.sec.app.samsungprintservice" },
                { title: "PrinterShare (اندروید)", url: "https://do2ta.com/files/android-print-share.apk" },
                { title: "PrinterShare (ویندوز)", url: "https://do2ta.com/files/windows-print-share.exe" }
            ]
        },
        {
            name: "💻 شبیه‌ساز اندروید برای ویندوز",
            icon: "🖥️",
            links: [
                { title: "Phoenix OS", url: "https://www.yasdl.com/123213/%D8%AF%D8%A7%D9%86%D9%84%D9%88%D8%AF-phoenix-os.html" },
                { title: "Remix OS", url: "https://soft98.ir/os/android-os/677-remix-os.html" },
                { title: "BlueStacks", url: "https://www.bluestacks.com/download.html" },
                { title: "Nox (پیشنهادی)", url: "https://www.bignox.com/en/download/fullPackage?formal" }
            ]
        },
        {
            name: "🛒 اتصال به وب‌سایت فروشگاهی",
            icon: "🔗",
            links: [
                { title: "افزونه ووکامرس دودوتا", url: "https://do2ta.com/files/Do2taWpPlugin (3).zip" }
            ]
        },
        {
            name: "📊 قالب‌های خام اکسل",
            icon: "📑",
            links: [
                { title: "فایل خام اکسل کالا و خدمات", url: "https://do2ta.com/files/Product__Excel_2026_01_04_11_16_35.xlsx" },
                { title: "فایل خام اکسل مشتریان", url: "https://do2ta.com/files/Client__Excel_2026_01_04_11_19_59.xlsx" }
            ]
        },
        {
            name: "⚙️ ابزارهای مدیریتی",
            icon: "🔧",
            links: [
                { title: "ویرایشگر بانک اطلاعاتی (SQLite Editor)", url: "https://do2ta.com/files/SQLite-Editor.apk" }
            ]
        }
    ];

    // ---------- Fuzzy search ----------
    function levenshtein(a,b){if(!a.length)return b.length;if(!b.length)return a.length;const m=[];for(let i=0;i<=b.length;i++)m[i]=[i];for(let j=0;j<=a.length;j++)m[0][j]=j;for(let i=1;i<=b.length;i++){for(let j=1;j<=a.length;j++){m[i][j]=Math.min(m[i-1][j]+1,m[i][j-1]+1,m[i-1][j-1]+(a[j-1]===b[i-1]?0:1));}}return m[b.length][a.length];}
    function isSimilar(term,text){if(!term)return true;term=term.toLowerCase();text=text.toLowerCase();if(text.includes(term))return true;const dist=levenshtein(term,text);if((1-dist/Math.max(term.length,text.length))>0.7)return true;const words=term.split(/\s+/);for(let w of words){if(w.length<2)continue;if(text.includes(w))return true;for(let tw of text.split(/\s+/)){if(tw.length<2)continue;const d=levenshtein(w,tw);if((1-d/Math.max(w.length,tw.length))>0.7)return true;}}return false;}

    function escapeHtml(s){return s.replace(/[&<>]/g,m=>({ '&':'&amp;', '<':'&lt;', '>':'&gt;' })[m]);}

    // ---------- نمایش ویژگی‌ها از JSON ----------
    function renderFeaturesFromMarkdown(md) {
        if (!md) return '<p>اطلاعاتی موجود نیست.</p>';
        // تبدیل **متن** به strong
        let html = md.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
        // تبدیل خطوط جداکننده
        html = html.replace(/^---$/gm, '<hr style="border-color:#d0e0d0; margin:16px 0">');
        // تبدیل heading های ### و ##
        html = html.replace(/^### (.*?)$/gm, '<h4>$1</h4>');
        html = html.replace(/^## (.*?)$/gm, '<h3>$1</h3>');
        // تبدیل bullet points با • یا -
        html = html.replace(/^[•\-]\s+(.*?)$/gm, '<li>$1</li>');
        // بسته‌بندی خطوط لیست در ul
        html = html.replace(/((?:\s*<li>.*?<\/li>\s*)+)/g, '<ul>$1</ul>');
        // دو خط پشت سر هم را پاراگراف می‌کنیم
        html = html.replace(/\n\n/g, '</p><p>');
        html = '<p>' + html + '</p>';
        // خطوط تکی را <br>
        html = html.replace(/\n/g, '<br>');
        return html;
    }

    async function loadFeatures() {
        const container = document.getElementById('featuresContent');
        try {
            const resp = await fetch(FEATURES_JSON_URL);
            if (!resp.ok) throw new Error('Network error');
            const data = await resp.json();
            container.innerHTML = renderFeaturesFromMarkdown(data.features);
        } catch (e) {
            // در صورت خطا از داده‌های پشتیبان (همان JSON نمونه) استفاده کن
            const fallback = {
                features: "🎯 **نگارش ۱۲.۲.۰ دودوتا منتشر شد!**\n\n🧠 **هوش مالی** • تحلیل هوشمند • هشدار پیشگیرانه\n🚀 **مدیریت مالیاتی یکپارچه** • ارسال به سامانه مودیان\n👥 **CRM پیشرفته** • امتیازدهی مشتریان\n💳 **پرداخت مدرن** • اتصال مستقیم کارتخوان\n\nنسخه جدید هم اکنون قابل دانلود است."
            };
            container.innerHTML = renderFeaturesFromMarkdown(fallback.features);
        }
        // فعال‌سازی کلیک روی هدر بخش ویژگی‌ها
        document.getElementById('featuresGroup').querySelector('.accordion-header').addEventListener('click', function(e){
            this.closest('.accordion-group').classList.toggle('open');
        });
    }

    // ---------- رندر دسته‌های دانلود ----------
    function renderDownloads(searchTerm = '') {
        const root = document.getElementById('accordionRoot');
        let total = 0, html = '';
        categories.forEach((cat, idx) => {
            const filtered = searchTerm ? cat.links.filter(l => isSimilar(searchTerm, l.title)) : cat.links;
            if (!filtered.length && searchTerm) return;
            total += filtered.length;
            const hide = !filtered.length ? 'hide-group' : '';
            const open = searchTerm ? 'open' : (idx === 0 ? 'open' : '');
            html += `
            <div class="accordion-group ${hide} ${open}">
                <div class="accordion-header">
                    <div class="group-title"><span class="icon">${cat.icon}</span> ${cat.name} <small>(${filtered.length})</small></div>
                    <div class="toggle-icon">▼</div>
                </div>
                <div class="accordion-content">
                    <div class="links-grid">
                        ${filtered.map(l => `<div class="download-link"><a href="${l.url}" target="_blank" rel="noopener">${escapeHtml(l.title)}</a></div>`).join('')}
                    </div>
                </div>
            </div>`;
        });
        if (!total && searchTerm) {
            root.innerHTML = `<div class="no-results">😕 فایلی با عنوان «${escapeHtml(searchTerm)}» یافت نشد.</div>`;
            document.getElementById('resultStats').textContent = '';
        } else {
            root.innerHTML = html;
            document.getElementById('resultStats').textContent = searchTerm
                ? `✨ ${total} فایل برای «${escapeHtml(searchTerm)}» یافت شد.`
                : `📦 ${total} فایل آماده دانلود – برای شروع روی هر گروه کلیک کنید.`;
            attachAccordion();
        }
    }

    function attachAccordion() {
        document.querySelectorAll('#accordionRoot .accordion-group').forEach(group => {
            const header = group.querySelector('.accordion-header');
            if (!header) return;
            const newHeader = header.cloneNode(true);
            header.parentNode.replaceChild(newHeader, header);
            newHeader.addEventListener('click', (e) => {
                e.stopPropagation();
                group.classList.toggle('open');
            });
        });
    }

    // ---------- مدیریت جستجو و URL ----------
    function doSearch(term) {
        const url = new URL(window.location);
        if (term) url.searchParams.set('q', term);
        else url.searchParams.delete('q');
        window.history.pushState({}, '', url);
        document.getElementById('searchInput').value = term;
        renderDownloads(term);
    }

    function initSearch() {
        const params = new URLSearchParams(window.location.search);
        const q = params.get('q') || '';
        document.getElementById('searchInput').value = q;
        renderDownloads(q);
    }

    document.addEventListener('DOMContentLoaded', () => {
        loadFeatures(); // بارگذاری ویژگی‌ها از JSON
        initSearch();
        document.getElementById('searchBtn').addEventListener('click', () => doSearch(document.getElementById('searchInput').value));
        document.getElementById('searchInput').addEventListener('keyup', e => { if(e.key==='Enter') doSearch(e.target.value); });
        window.addEventListener('popstate', () => {
            const q = new URLSearchParams(window.location.search).get('q') || '';
            document.getElementById('searchInput').value = q;
            renderDownloads(q);
        });
    });
</script>
</body>
</html>