/// 创建应用菜单（中文）
#[cfg(target_os = "macos")]
pub fn create_app_menu<R: tauri::Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<tauri::menu::Menu<R>> {
    use tauri::{
        image::Image,
        menu::{AboutMetadataBuilder, MenuBuilder, SubmenuBuilder},
    };

    let default_name = "智评会议";
    let app_name = app.config().product_name.as_deref().unwrap_or(default_name);

    // 创建视图菜单
    let view_submenu = SubmenuBuilder::new(app, "视图")
        .text("zoom_in", "放大")
        .text("zoom_out", "缩小")
        .text("zoom_reset", "实际大小")
        .separator()
        .text("refresh", "刷新页面")
        .build()?;

    // 创建窗口菜单
    let window_submenu = SubmenuBuilder::new(app, "窗口")
        .minimize_with_text("最小化")
        .maximize_with_text("最大化")
        .separator()
        .close_window_with_text("关闭")
        .build()?;

    // 应用菜单（跨平台）
    let about_metadata = AboutMetadataBuilder::new()
        .copyright(Some("Copyright © 2025 智评会议".to_string()))
        .authors(Some(vec!["重庆树人教育研究院".to_string()]))
        .website_label(Some("https://www.zpingketang.com".to_string()))
        .icon(Image::from_bytes(include_bytes!("../../icons/icon.png")).ok())
        .build();

    let app_submenu = SubmenuBuilder::new(app, app_name)
        .about_with_text("关于应用", Some(about_metadata))
        .separator()
        .quit_with_text("退出应用程序")
        .build()?;

    // 构建完整菜单
    let menu = MenuBuilder::new(app).items(&[&app_submenu, &view_submenu, &window_submenu]).build()?;

    Ok(menu)
}
