MESSAGES = {
    "project_not_found": "项目 '{name}' 不存在或未初始化",
    "video_capabilities_unresolved": "无法解析项目 '{name}' 的视频模型能力：{reason}",
    "scope_invalid": "scope 必须为 full 或 current",
    "download_expired": "下载链接已过期，请重新导出",
    "download_token_mismatch": "下载 token 与目标项目不匹配",
    "download_token_invalid": "下载 token 无效",
    "jianying_path_invalid": "请提供有效的剪映草稿目录路径",
    "jianying_path_too_long": "草稿目录路径过长",
    "jianying_path_illegal": "草稿目录路径包含非法字符",
    "jianying_export_failed": "剪映草稿导出失败，请稍后重试",
    "title_required": "项目标题不能为空",
    "project_exists": "项目 '{name}' 已存在",
    "script_not_found": "剧本 '{name}' 不存在",
    "scene_not_found": "场景 '{id}' 不存在",
    "segment_not_found": "片段 '{id}' 不存在",
    "script_missing": "剧本不存在",
    "narration_mode_required": "该剧本不是说书模式，请使用场景更新接口",
    "content_or_file_required": "需要提供 content（文本内容）或 file（文件上传）其中之一",
    "one_of_content_or_file": "content 和 file 不能同时提供，请选择其一",
    "unsupported_file_type": "仅支持 .txt / .md 文件，收到: {name}",
    "file_too_large": "文件大小超出限制（最大约 {max_chars} 字符）",
    "invalid_encoding": "文件编码错误，请使用 UTF-8 编码的文本文件",
    "unauthorized": "用户名或密码错误",
    "task_not_found": "任务 '{id}' 不存在",
    "prompt_must_be_string_or_scene_object": "prompt 必须是字符串或包含 scene/composition 的对象",
    "prompt_scene_empty": "prompt.scene 不能为空",
    "prompt_must_be_string_or_object": "prompt 必须是字符串或对象",
    "prompt_text_empty": "prompt 不能为空",
    "storyboard_task_submitted": "分镜「{segment_id}」生成任务已提交",
    "generate_storyboard_first": "请先生成分镜图 scene_{segment_id}.png",
    "video_prompt_must_be_string_or_action_object": "prompt 必须是字符串或包含 action/camera_motion 的对象",
    "video_prompt_action_empty": "prompt.action 不能为空",
    "video_prompt_dialogue_array": "prompt.dialogue 必须是数组",
    "video_task_submitted": "视频「{segment_id}」生成任务已提交",
    "character_not_found": "角色「{name}」不存在",
    "character_task_submitted": "角色「{name}」设计图生成任务已提交",
    "scene_task_submitted": "场景「{name}」设计图生成任务已提交",
    "prop_task_submitted": "道具「{name}」设计图生成任务已提交",
    # Files
    "file_not_found": "文件不存在: {path}",
    "forbidden_access": "禁止访问项目目录外的文件",
    "invalid_upload_type": "无效的上传类型: {upload_type}",
    "missing_filename": "上传的文件缺少文件名",
    "unsupported_image_type": "不支持的文件类型 {ext}，允许的类型: {allowed}",
    "invalid_image_file": "无效的图片文件，无法解析",
    "invalid_asset_type": "资产类型必须为 character / scene / prop",
    "invalid_asset_filename": "文件名不能包含路径分隔符或 ..",
    "invalid_step_num": "无效的步骤编号: {step_num}",
    "draft_file_not_found": "草稿文件不存在",
    "draft_event_label": "第 {episode} 集{label_prefix}",
    "normalized_script": "规范化剧本",
    "segment_splitting": "片段拆分",
    # Source loader
    "source_unsupported_format": "不支持的源文件格式：{ext}（支持 .txt / .md / .docx / .epub / .pdf）",
    "source_decode_failed": "源文件「{filename}」解码失败（已尝试：{tried}）",
    "source_corrupt_file": "源文件「{filename}」无法解析：{reason}",
    "source_too_large": "源文件「{filename}」过大（{size_mb} MB > {limit_mb} MB）",
    "source_conflict": "源文件「{existing}」已存在，建议改名为「{suggested}」",
    # Providers
    "unknown_provider": "未知供应商: {provider_id}",
    "credentials_not_found": "凭证不存在",
    "vertex_json_read_failed": "读取上传文件失败",
    "vertex_json_too_large": "凭证文件过大",
    "vertex_json_invalid": "无效的 JSON 凭证文件",
    "vertex_json_missing_project_id": "凭证文件缺少 project_id",
    "connection_success": "连接成功",
    "connection_timeout": "连接超时，请检查网络或 API 配置",
    "connection_failed": "连接失败: {err_msg}",
    "unsupported_test": "供应商 {provider_id} 暂不支持连接测试",
    "missing_credentials": "缺少凭证配置，请先添加密钥",
    # Assistant
    "session_not_found": "会话 '{session_id}' 不存在",
    "session_or_project_not_found": "会话或项目不存在",
    "sdk_session_timeout": "SDK 会话创建超时",
    "agent_startup_failed": "Agent 启动失败：\n{details}",
    "interface_offline": "该接口已下线，请使用推荐的接口",
    "answers_required": "answers 不能为空",
    # Custom Providers
    "price_input_required": "设置 price_output 时必须同时设置 price_input",
    "model_id_required": "已启用的模型必须填写 model_id",
    "duplicate_model_id": "model_id 重复: {model_id}",
    "default_model_conflict": "每个 media_type 最多只能有一个默认模型，冲突: {conflict}",
    "provider_not_found": "供应商不存在",
    "at_least_one_field_required": "至少需要提供一个更新字段",
    "discovery_failed": "模型发现失败: {err_msg}",
    "anthropic_discovery_no_key": "未配置 API Key，无法发现模型",
    "unknown_endpoint": "未知 endpoint: {endpoint}",
    "unknown_discovery_format": "不支持的 discovery_format: {discovery_format}",
    "endpoint_required": "已启用的模型必须填写 endpoint",
    "endpoint_media_type_mismatch": "模型 endpoint 与媒体类型不一致: {detail}",
    "backend_creation_failed": "Backend 创建失败: {err_msg}",
    "unsupported_discovery_format": "供应商 {discovery_format} 暂不支持连接测试",
    # Projects
    "unknown_style_template": "未知的风格模版: {template_id}",
    "project_id_not_editable": "项目创建后不支持修改 content_mode",
    "project_deleted": "项目 '{name}' 已删除",
    "scene_updated": "场景 '{scene_id}' 已更新",
    "segment_updated": "片段 '{segment_id}' 已更新",
    # Characters / Scenes / Props
    "character_already_exists": "角色「{name}」已存在",
    "character_deleted": "角色「{name}」已删除",
    "project_scene_already_exists": "场景「{name}」已存在",
    "project_scene_not_found": "场景「{name}」不存在",
    "project_scene_deleted": "场景「{name}」已删除",
    "prop_already_exists": "道具「{name}」已存在",
    "prop_not_found": "道具「{name}」不存在",
    "prop_deleted": "道具「{name}」已删除",
    # API Keys
    "jwt_auth_required": "API Key 无权执行此操作，请使用 JWT 认证",
    "api_key_name_exists": "名称 '{name}' 已存在",
    "api_key_not_found": "API Key {key_id} 不存在",
    # Agent Chat
    "session_project_mismatch": "会话 '{session_id}' 属于项目 '{session_project}'，与请求项目 '{request_project}' 不符",
    # Cost Estimation
    "cost_estimation_failed": "费用估算失败，请稍后重试",
    # Validators
    "invalid_backend_format": "{field_name} 格式应为 provider/model",
    # Versions
    "unsupported_resource_type": "不支持的资源类型: {resource_type}",
    # Reference Video
    "ref_missing_asset": "参考图引用的{type}「{name}」不在项目资产库中，请先生成",
    "ref_duration_exceeded": "参考视频单元时长 {duration}s 超出 {model} 上限 {max_duration}s，已裁剪",
    "ref_too_many_images": "参考图数量 {count} 超出 {model} 上限 {max_count}，已取前 {max_count} 张",
    "ref_payload_too_large": "参考图请求体超出供应商限制，已二次压缩重试",
    "ref_sora_single_ref": "Sora 参考模式暂不支持多图，已降级为单图",
    "ref_shot_parse_fallback": "未识别到 Shot N (Xs): 标记，按单镜头处理",
    "ref_episode_not_found": "第 {episode} 集不存在",
    "ref_not_reference_video_mode": "该集剧本不是参考生视频模式",
    "ref_not_registered": "引用的资产未注册：{missing}",
    "ref_unit_not_found": "视频单元「{unit_id}」不存在",
    "ref_unit_ids_length_mismatch": "unit_ids 数量与现有单元不一致",
    "ref_duplicate_unit_ids": "unit_ids 存在重复",
    "ref_unit_ids_mismatch": "unit_ids 与现有单元不匹配",
    "ref_script_missing": "该集绑定的剧本文件不存在",
    "ref_script_rebound": "该集剧本绑定已变更，请重试",
    "about_update_check_failed": "检查更新失败，请稍后重试",
    "about_version_read_failed": "读取应用版本失败",
    # Image Capability
    "image_endpoint_mismatch_no_i2i": "模型 {model} 仅支持文生图（不支持 /v1/images/edits）；请去掉参考图或换一个支持图生图的模型",
    "image_endpoint_mismatch_no_t2i": "模型 {model} 仅支持图生图（必须传参考图）；请提供参考图或换一个支持文生图的模型",
    "image_capability_missing_i2i": "{provider}/{model} 不支持图生图；请配置一个支持图生图的默认模型",
    "image_capability_missing_t2i": "{provider}/{model} 不支持文生图；请配置一个支持文生图的默认模型",
    # Agent credentials
    "agent_preset_unknown": "未知预设供应商: {preset_id}",
    "agent_base_url_required_custom": "自定义配置需要填写 base_url",
    "agent_no_fields_to_update": "没有需要更新的字段",
    "agent_credential_not_found": "凭证不存在",
    "agent_cannot_delete_active": "无法删除当前活跃凭证，请先切换到其他凭证",
    "agent_test_validation_error": "测试连接失败：{error}",
}
