{{template "admin/layout/base.html" .}}
        <div class="page-header">
            <h1>用户管理</h1>
            <p class="page-desc">搜索、查看和管理本站用户</p>
        </div>

        <!-- 搜索与筛选 -->
        <div class="filter-bar">
            <input type="text" id="searchInput" class="filter-input" placeholder="搜索邮箱或用户名..." autocomplete="off">
            <select id="roleFilter" class="filter-select">
                <option value="">全部角色</option>
                {{range $val, $label := .RoleNames}}
                <option value="{{$val}}">{{$label}}</option>
                {{end}}
            </select>
            <select id="statusFilter" class="filter-select">
                <option value="">全部状态</option>
                {{range $val, $label := .StatusNames}}
                <option value="{{$val}}">{{$label}}</option>
                {{end}}
            </select>
            <button id="searchBtn" class="btn btn-primary">搜索</button>
        </div>

        <!-- 用户表格 -->
        <div class="table-container">
            <table class="data-table">
                <thead>
                    <tr>
                        <th>UID</th>
                        <th>用户名</th>
                        <th>邮箱</th>
                        <th>角色</th>
                        <th>状态</th>
                        <th>注册时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody id="userTableBody">
                    <tr class="table-loading"><td colspan="7">加载中...</td></tr>
                </tbody>
            </table>
        </div>

        <!-- 分页 -->
        <div class="pagination-bar" id="paginationBar"></div>
<script>
window.__currentUid = {{.UID}};
window.__isOwner = {{if .IsOwner}}true{{else}}false{{end}};
// 由服务端 model.RoleDisplayNames / StatusDisplayNames 作为唯一数据源注入
window.__ROLE_NAMES = {
    {{range $val, $label := .RoleNames}}"{{$val}}": "{{$label}}",
    {{end}}
};
window.__STATUS_NAMES = {
    {{range $val, $label := .StatusNames}}"{{$val}}": "{{$label}}",
    {{end}}
};
</script>
{{template "admin/layout/footer.html" .}}
