flowchart LR
    %% ======== 样式定义 ========
    classDef client fill:#e6fffb,stroke:#13c2c2,stroke-width:1px;
    classDef gateway fill:#fff7e6,stroke:#fa8c16,stroke-width:1px;
    classDef service fill:#f0f5ff,stroke:#2f54eb,stroke-width:1px;
    classDef data fill:#fff1f0,stroke:#f5222d,stroke-width:1px;

    %% ======== 客户端层 ========
    subgraph Clients[客户端层]
        HRWeb[HR Web 前端<br/>Vue / React]:::client
        CandApp[应聘者 Web / APP]:::client
    end

    %% ======== 接入层 ========
    subgraph Gateway[接入层]
        Nginx[Nginx 反向代理<br/>HTTPS 终止 + 负载均衡]:::gateway
    end

    %% ======== 应用服务层 ========
    subgraph Services[应用服务层]
        AuthSvc[Auth Service<br/>认证授权]:::service
        JobSvc[Job & Company Service<br/>岗位与企业管理]:::service
        QSvc[Question Service<br/>题库管理]:::service
        ExamSvc[Exam Service<br/>考试流程管理]:::service
        ScoreSvc[Scoring Service<br/>自动评分]:::service
        MLSvc[ML / Recommend Service<br/>智能选题与评估]:::service
        AdminSvc[Admin Console<br/>运营后台]:::service
    end

    %% ======== 数据层 ========
    subgraph DataLayer[数据层]
        DB[(关系型数据库<br/>MySQL / PostgreSQL)]:::data
        Cache[(Redis 缓存)]:::data
        ObjStore[(对象存储<br/>题目附件)]:::data
        LogStore[(日志 / 分析存储)]:::data
    end

    %% ======== 连接关系 ========
    HRWeb --> Nginx
    CandApp --> Nginx

    Nginx --> AuthSvc
    Nginx --> JobSvc
    Nginx --> QSvc
    Nginx --> ExamSvc
    Nginx --> AdminSvc

    ExamSvc --> ScoreSvc
    ExamSvc --> QSvc
    QSvc --> MLSvc

    AuthSvc --> DB
    JobSvc --> DB
    QSvc --> DB
    ExamSvc --> DB
    ScoreSvc --> DB

    Services --> Cache
    Services --> ObjStore
    Services --> LogStore
