
/* Added by assistant: format numbers to K/M/B */
function formatCount(n){
    if(n === null || n === undefined) return n;
    n = Number(n);
    if(isNaN(n)) return n;
    var abs = Math.abs(n);
    if(abs >= 1e9) return (n/1e9).toFixed(1).replace(/\.0$/,'') + 'B';
    if(abs >= 1e6) return (n/1e6).toFixed(1).replace(/\.0$/,'') + 'M';
    if(abs >= 1e3) return (n/1e3).toFixed(1).replace(/\.0$/,'') + 'K';
    return n.toString();
}
// Try to automatically replace occurrences where counters are set like innerText = count or textContent = count
try{
    document.addEventListener('DOMContentLoaded', function(){
        document.querySelectorAll('[data-kor4e-download-count]').forEach(function(el){
            var v = el.getAttribute('data-kor4e-download-count');
            if(v) el.textContent = formatCount(v);
        });
        // also handle elements with class kor4e-download-count
        document.querySelectorAll('.kor4e-download-count').forEach(function(el){
            var v = el.textContent.replace(/[^0-9\.]/g,'');
            if(v) el.textContent = formatCount(v);
        });
    });
}catch(e){}

.did-wrapper { max-width: 1000px; margin: 0 auto; padding: 12px; box-sizing: border-box; }
.did-title { font-size: 24px; margin: 0 0 6px; text-align: center; }
.did-subtitle { font-size: 14px; margin: 0 0 12px; text-align: center; color: #555; }
.did-grid { display: flex; gap: 16px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.did-item { flex: 1 1 45%; box-sizing: border-box; text-align: center; }
.did-item .did-image { max-width: 100%; height: auto; display: block; margin: 0 auto 8px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.did-download { display: inline-block; padding: 8px 12px; text-decoration: none; border-radius: 6px; border: 1px solid #ddd; background: #fff; font-weight: 600; color: #0073aa; }
.did-empty { padding: 40px 10px; border: 1px dashed #ccc; border-radius: 6px; color: #777; }
@media (max-width:700px){ .did-item { flex-basis: 100%; } }
