<div class="group {{#if level}}group-level-{{level}}{{else}}group-level-3{{/if}}" 
     data-type="group" 
     data-name="{{name}}" 
     data-icon="{{icon}}"
     data-level="{{#if level}}{{level}}{{else}}3{{/if}}">
    
    <div class="group-header"{{#ifCond subgroups '||' sites}} data-toggle="group"{{/ifCond}}>
        <h{{#if level}}{{add level 1}}{{else}}4{{/if}} data-editable="group-name">
            <i class="{{icon}}"></i> 
            {{name}}
            {{#ifCond subgroups '||' sites}}
                <span class="toggle-icon">
                    <i class="fas fa-chevron-down"></i>
                </span>
            {{/ifCond}}
        </h{{#if level}}{{add level 1}}{{else}}4{{/if}}>
    </div>
    
    <div class="group-content">
        {{#if subgroups}}
            <div class="subgroups-container" data-container="subgroups">
                {{#each subgroups}}
                    {{> group level=4}}
                {{/each}}
            </div>
        {{/if}}

        {{#if sites}}
            <div class="sites-grid" data-container="sites">
                {{#if sites.length}}
                    {{#each sites}}
                        {{> site-card style=@root.siteCardStyle}}
                    {{/each}}
                {{else}}
                    <p class="empty-sites">暂无网站</p>
                {{/if}}
            </div>
        {{/if}}

        {{#unless subgroups}}
        {{#unless sites}}
            <p class="empty-content">暂无网站</p>
        {{/unless}}
        {{/unless}}
    </div>
</div>
