<header class="am-topbar am-topbar-inverse admin-header">
    <!-- logo/名称信息 -->
    {{if !empty($admin_logo)}}
        <a href="{{:MyUrl('admin/index/index')}}" class="nav-logo am-fl am-block am-nbfc am-show-sm-only">
            <img src="{{$admin_logo}}" class="am-fl" />
            <span class="admin-site-vice-name am-fl am-margin-left-xs">{{:MyLang('common.admin_browser_title')}}</span>
        </a>
    {{/if}}

    <div class="header-top">
        <!-- 手机模式下导航按钮 -->
        <button
            class="am-topbar-btn am-topbar-toggle am-btn am-btn-xs am-btn-primary am-show-sm-only am-radius header-nav-submit"
            data-am-collapse="{target: '#topbar-collapse'}">
            <span class="am-sr-only">{{:MyLang('toggle_navigation_title')}}</span>
            <i class="am-icon-bars"></i>
        </button>
        <!-- 右侧内容 -->
        <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
            <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-right-list">
                <!-- 语言切换 -->
                {{if !empty($multilingual_data) and !empty($multilingual_data['data']) and !empty($multilingual_data['default']) and is_array($multilingual_data['data']) and is_array($multilingual_data['default'])}}
                    <li class="am-dropdown" data-am-dropdown="{trigger: 'hover'}" data-am-dropdown-toggle>
                        <a class="am-dropdown-toggle am-flex am-flex-row am-flex-items-center am-gap-12" href="javascript:;">
                            <i class="iconfont icon-language"></i>
                            <span class="am-show-sm-only">{{:MyLang('lang_title')}}[{{$multilingual_data.default.name}}]</span>
                        </a>
                        <ul class="am-dropdown-content am-radius-lg">
                            {{foreach $multilingual_data.data as $v}}
                                <li {{if $multilingual_default_code eq $v['code']}}class="am-active"{{/if}}>
                                    <a href="{{$v.url}}">
                                        {{if !empty($v['icon'])}}
                                            <img src="{{$v.icon}}" alt="{{$v.name}}" class="am-radius am-vertical-align-middle am-margin-right-xs" width="14" height="14" />
                                        {{/if}}
                                        <span class="am-vertical-align-middle">{{$v.name}}</span>
                                    </a>
                                </li>
                            {{/foreach}}
                        </ul>
                    </li>
                {{/if}}

                <!-- 主题配色切换 -->
                {{if !empty($theme_color_choice_data) and !empty($theme_color_choice_data['data']) and !empty($theme_color_choice_data['theme']) and !empty($theme_color_choice_data['value'])}}
                    <li class="am-dropdown" data-am-dropdown="{trigger: 'hover'}" data-am-dropdown-toggle>
                        <a class="am-dropdown-toggle am-flex am-flex-row am-flex-items-center am-gap-12" href="javascript:;">
                            <i class="iconfont icon-theme"></i>
                            <span class="am-show-sm-only">{{:MyLang('color_matching_title')}}[{{$theme_color_choice_data.theme}}]</span>
                        </a>
                        <ul class="am-dropdown-content am-radius-lg">
                            {{foreach $theme_color_choice_data.data as $v}}
                                <li {{if $theme_color_choice_data['value'] eq $v['value']}}class="am-active"{{/if}}>
                                    <a href="{{$v.url}}">
                                        <i class="am-inline-block am-padding-xs am-circle" style="background: {{$v.color}};"></i>
                                        <span class="am-margin-left-xs">{{$v.name}}</span>
                                    </a>
                                </li>
                            {{/foreach}}
                        </ul>
                    </li>
                {{/if}}

                <!-- 清除缓存 -->
                {{if AdminIsPower('cache', 'statusupdate')}}
                    <li class="am-dropdown">
                        <a href="javascript:;" class="clear-cache-html submit-ajax am-flex am-flex-row am-flex-items-center am-gap-12" data-url="{{:MyUrl('admin/cache/statusupdate')}}" data-is-confirm="0" data-is-loading="1"  data-am-popover="{content: '{{:MyLang('common.remove_cache_title')}}', trigger: 'hover focus', theme: 'sm'}">
                            <i class="iconfont icon-clear"></i>
                            <span class="am-show-sm-only">{{:MyLang('common.remove_cache_title')}}</span>
                        </a>
                    </li>
                {{/if}}

                <!-- 全屏 -->
                <li class="am-dropdown">
                    <a href="javascript:;" class="fullscreen-event am-flex am-flex-row am-flex-items-center am-gap-12" data-fulltext-open="{{:MyLang('fullscreen_open_title')}}" data-fulltext-exit="{{:MyLang('fullscreen_exit_title')}}" data-am-popover="{content: '{{:MyLang('fullscreen_open_title')}}', trigger: 'hover focus', theme: 'sm'}">
                        <i class="iconfont icon-full-screen"></i>
                        <span class="fullscreen-text am-show-sm-only">{{:MyLang('fullscreen_open_title')}}</span>
                    </a>
                </li>

                <!-- 首页 -->
                <li class="am-dropdown">
                    <a href="{{$home_url}}" class="am-flex am-flex-row am-flex-items-center am-gap-12" target="_blank" rel="noopener noreferrer" data-am-popover="{content: '{{:MyLang('shop_home_title')}}', trigger: 'hover focus', theme: 'sm'}">
                        <i class="iconfont icon-home"></i>
                        <span class="am-show-sm-only">{{:MyLang('shop_home_title')}}</span>
                    </a>
                </li>

                <!-- 公告 + 待处理（同一铃铛下拉） -->
                {{if !empty($admin) and (!empty($admin_notice) or !empty($admin_nav_pending_todo))}}
                    <li class="am-dropdown admin-nav-pending-todo" data-am-dropdown="{trigger: 'hover'}">
                        <a href="javascript:;" class="am-dropdown-toggle am-flex am-flex-row am-flex-items-center am-gap-12">
                            <i class="iconfont icon-smallbell"></i>
                            <span class="am-show-sm-only">{{:MyLang('notice_title')}}</span>
                            {{if !empty($admin_nav_pending_todo.has_pending)}}
                                <i class="hot-dot am-color-red">.</i>
                            {{/if}}
                        </a>
                        <div class="am-dropdown-content am-radius-lg am-color-333 admin-nav-pending-todo-panel">
                            {{if !empty($admin_notice)}}
                                <div class="admin-nav-pending-todo-notice-block notice-width">
                                    <div class="am-color-yellow notice-content admin-nav-pending-todo-notice-body">{{$admin_notice|raw}}</div>
                                </div>
                            {{/if}}
                            {{if !empty($admin_notice)}}
                                <hr data-am-widget="divider" class="am-divider am-divider-default am-margin-bottom-xs am-margin-top-sm" />
                            {{/if}}
                            {{if !empty($admin_nav_pending_todo.data) and is_array($admin_nav_pending_todo.data)}}
                                <ul class="am-list am-list-static am-margin-bottom-0 am-scrollable-vertical admin-nav-pending-todo-list">
                                    {{foreach $admin_nav_pending_todo.data as $v}}
                                        {{if !empty($v['name']) and !empty($v['url'])}}
                                            <li>
                                                <a href="javascript:;" class="submit-popup am-nbfc am-block am-radius" data-url="{{$v.url}}" data-title="{{if empty($v['title'])}}{{$v.name}}{{else /}}{{$v.title}}{{/if}}" data-offcanvas="right">
                                                    <span class="am-fl">{{$v.name}}</span>
                                                    <span class="am-fr am-badge am-badge{{if isset($v['count']) and $v.count gt 0}}-danger{{else /}}-secondary{{/if}} am-round">{{if isset($v['count'])}}{{$v.count}}{{else /}}0{{/if}}</span>
                                                </a>
                                            </li>
                                        {{/if}}
                                    {{/foreach}}
                                </ul>
                            {{else /}}
                                <p class="am-text-center am-color-grey am-padding-top-sm am-padding-bottom-xs">{{:MyLang('common.nav_pending_todo_empty')}}</p>
                            {{/if}}
                        </div>
                    </li>
                {{/if}}

                <!-- 管理员设置 -->
                <li class="am-dropdown" data-am-dropdown="{trigger: 'hover'}" data-am-dropdown-toggle>
                    <a class="am-dropdown-toggle" href="javascript:;">
                        {{if !empty($admin['avatar'])}}
                            <img src="{{$admin.avatar}}" class="am-img-thumbnail am-circle am-vertical-align-middle" width="30" height="30" />
                        {{/if}}
                        <span class="am-vertical-align-middle">{{$admin.username}}</span>
                    </a>
                    <ul class="am-dropdown-content am-radius-lg">
                        <li>
                            <a href="javascript:;" class="new-window" data-type="nav" data-url="{{:MyUrl('admin/admin/saveinfo', ['id'=>$admin['id'], 'is_setup'=>1])}}" data-node-name="{{:MyLang('setup_title')}}">
                                <i class="iconfont icon-setup"></i>
                                <span>{{:MyLang('setup_title')}}</span>
                            </a>
                        </li>
                        <li>
                            <a href="{{:MyUrl('admin/admin/logout')}}">
                                <i class="iconfont icon-logout"></i>
                                <span>{{:MyLang('quit_title')}}</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="tabs-list">
        <!-- 快捷导航 -->
        <div class="am-text-nowrap am-scrollable-horizontal header-menu-open-pages-list tabs-switch-horizontal-container">
            <ul></ul>
        </div>
        <div class="tabs-tool am-dropdown am-hide-sm-only am-hide" data-am-dropdown>
            <a class="am-dropdown-toggle" href="javascript:;" data-am-dropdown-toggle>
                <span class="iconfont icon-nav-tools scaleanimation"></span>
            </a>
            <ul class="am-dropdown-content am-radius-lg">
                <li>
                    <a href="javascript:;" data-key="nav-refresh">
                        <i class="iconfont icon-refresh-single am-color-666"></i>
                        <span>{{:MyLang('refresh_title')}}</span>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" data-key="nav-close">
                        <i class="iconfont icon-close-line-dot am-color-666"></i>
                        <span>{{:MyLang('close_title')}}</span>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" data-key="nav-close-other">
                        <i class="iconfont icon-close-round am-color-666"></i>
                        <span>{{:MyLang('close_other_title')}}</span>
                    </a>
                </li>
                <li>
                    <a href="javascript:;" data-key="nav-close-all">
                        <i class="iconfont icon-logout-round am-color-666"></i>
                        <span>{{:MyLang('close_all_title')}}</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</header>