```mermaid
---
title: 2.平台人员账号创建流程
---
flowchart TD
    Start((开始))
    --> Login[使用超级管理员或有权限的平台账号登录]

    Login --> HasPermission{是否具备平台账号创建权限?}
    HasPermission -->|否| NoPermission[无权限，流程终止]
    HasPermission -->|是| EnterAccountPage[进入平台账号管理]

    subgraph CreateAccountFlow[账号创建与授权]
        EnterAccountPage --> SelectAccountType{选择账号类型}
        SelectAccountType -->|平台运营账号| FillOperatorInfo[填写账号基础信息]
        SelectAccountType -->|超级管理员账号| FillSuperInfo[填写账号基础信息]

        FillOperatorInfo --> RoleAtCreate{是否在创建时分配角色?}
        RoleAtCreate -->|是| SubmitWithRole[提交创建并同步分配角色]
        RoleAtCreate -->|否| SubmitWithoutRole[先提交创建后补充角色]
        SubmitWithoutRole --> AssignRoleLater[在账号列表补充分配角色]

        FillSuperInfo --> SubmitSuper[提交创建]

        SubmitWithRole --> CreateDone[账号创建完成]
        AssignRoleLater --> CreateDone
        SubmitSuper --> CreateDone

        CreateDone --> CreateResult{创建是否成功?}
        CreateResult -->|否| FixAndRetry[修正信息后重新提交]
        FixAndRetry --> SelectAccountType
        CreateResult -->|是| StartVerify[进入验收检查]
    end

    subgraph VerifyFlow[账号验收检查]
        StartVerify --> CheckAccountList[在平台账号列表确认账号已生成]
        CheckAccountList --> CheckLogin[使用新账号登录并确认可正常使用]
        CheckLogin --> CheckScope[核对角色权限与数据范围是否正确]
        CheckScope --> VerifyResult{验收是否通过?}

        VerifyResult -->|否| HandleException[记录异常并回到账号管理处理]
        HandleException --> EnterAccountPage
        VerifyResult -->|是| End([流程结束])
    end

    %% ==================== 样式美化 ====================
    style Start fill:#90EE90,stroke:#2E7D32,stroke-width:2px
    style End fill:#FF9999,stroke:#C62828,stroke-width:2px
    style NoPermission fill:#FFCDD2,stroke:#D32F2F
    style FixAndRetry fill:#FFCCBC,stroke:#E64A19
    style HandleException fill:#FFCCBC,stroke:#E64A19

    classDef decision fill:#FFF3E0,stroke:#F57C00,stroke-width:2px
    class HasPermission,SelectAccountType,RoleAtCreate,CreateResult,VerifyResult decision
```
