/**
 * i18n Constants — zh-CN
 * Centralized Chinese text constants for the Web UI.
 * Every user-facing string must have a key here.
 */
const zhCN = {
  // ─── App ───
  appName: 'xbot',
  appSubtitle: '智能对话助手',
  loading: 'Loading...',
  logoutBtn: '退出登录',
  skipToContent: '跳到主内容',

  // ─── Auth ───
  login: '登录',
  register: '注册',
  logout: '退出登录',
  username: '用户名',
  password: '密码',
  loginFailed: '登录失败',
  registerFailed: '注册成功但登录失败，请手动登录',
  networkError: '网络错误',
  operationFailed: '操作失败',
  enterUsername: '输入用户名',
  enterPassword: '输入密码',
  noAccount: '没有账号？注册',
  hasAccount: '已有账号？登录',
  createAccount: '创建账号',
  feishuLogin: '飞书登录',
  feishuAccountLogin: '飞书账号登录',
  feishuLoginFailed: '飞书登录失败',
  feishuUserId: '飞书用户 ID',
  feishuPassword: '关联的 Web 账号密码',
  feishuPasswordLabel: 'Web 密码',
  feishuBindHint: '需要先在飞书中绑定 Web 账号，使用绑定时设置的密码登录。',
  feishuPlaceholder: 'ou_xxx 或 open_id',
  backToPasswordLogin: '← 返回账号密码登录',
  loginViaFeishu: '通过飞书用户 ID 登录 →',

  // ─── Chat ───
  startConversation: '开始一段对话',
  sendFirstMessage: '发送消息开始与 AI 助手交流',
  searchHistory: '搜索历史消息',
  viewCommands: '查看快捷指令',
  inputPlaceholder: '输入消息... (Shift+Enter 换行)',
  connecting: '连接中...',
  send: '发送',
  sendMessage: '发送消息',
  stopGeneration: '停止生成',
  scrollToBottom: '滚动到底部',
  newMessages: '新消息',
  conversationCleared: '对话已清空',
  newConversation: '新对话',
  copyContent: '复制内容',
  copied: '✓ 已复制',
  copyCode: '复制代码',
  searchKbHint: '搜索历史消息',
  commandHint: '查看快捷指令',
  switchedToModel: '已切换到 {model}',
  openSettings: '打开设置',
  messagesAriaLabel: '消息',
  imagePreview: '图片预览',
  closePreview: '关闭预览',
  imagePreviewAlt: '预览',
  cancelGeneration: '取消当前生成',
  helpTitle: '可用命令',

  // ─── Status ───
  connected: '● Connected',
  connectingStatus: '◐ Connecting...',
  disconnected: '○ Disconnected',
  serverDisconnected: '⛔ 服务已断开，请刷新页面重新连接',
  reconnecting: '⚠️ 连接断开，正在尝试重连...',
  contextUsage: '上下文使用',
  contextUsageTitle: '上下文使用: {prompt} / {max} tokens',

  // ─── Settings ───
  settings: '⚙️ 设置',
  closeSettings: '关闭设置',
  saving: '保存中...',
  appearance: '外观',
  sessions: '会话',
  presets: '快捷指令',
  llm: 'LLM',
  runner: 'Runner',
  market: '市场',
  theme: '主题',
  dark: '深色',
  light: '浅色',
  fontSize: '字体大小',
  nickname: '昵称',
  switchModel: '切换模型',
  modelSelect: '模型选择',
  settingsSaved: '设置已保存',
  saveFailed: '保存失败，请重试',

  // ─── Search ───
  searchMessages: '搜索消息历史...',
  searching: '搜索中...',
  noResults: '未找到匹配结果',

  // ─── File upload ───
  uploadFile: '上传文件',
  uploadFailed: '上传失败',
  fileTooLarge: '文件超过 10MB 限制',
  uploadResponseError: '上传响应异常',
  dragToUpload: '拖拽文件到此处上传',
  dragSupportedTypes: '支持图片、文档、代码等文件',
  remove: '移除',

  // ─── Commands ───
  cmdClear: '清空对话',
  cmdNew: '新对话',
  cmdCompact: '压缩上下文',
  cmdHelp: '显示帮助',
  cmdCancel: '取消当前生成',

  // ─── AskUser ───
  agentNeedsInput: 'Agent 需要你的输入',
  inputAnswer: '输入你的回答...',
  submit: '提交',
  previousQuestion: '← 上一题',
  cancel: '取消',

  // ─── Progress ───
  thinking: '思考中...',
  rendering: '渲染图表中...',
  executingTool: '执行工具...',
  processing: '处理中...',
  preparing: '准备中...',

  // ─── Mermaid ───
  mermaidRenderFailed: 'Mermaid 渲染失败',

  // ─── Image / File ───
  image: '图片',
  file: '文件',

  // ─── Confirm dialog ───
  confirm: '确定',

  // ─── Sidebar ───
  searchPlaceholder: '搜索会话...',
  expandSidebar: '展开会话列表',
  chatSessions: '💬 会话',
  newSession: '新建会话',
  collapseSidebar: '收起',
  unnamedSession: '未命名',
  currentSession: '当前',
  refreshSessions: '🔄 刷新',
  noSessions: '暂无会话',
  deleteSession: '删除会话',
  renameSession: '重命名',
  confirmDeleteSession: '确定要删除此会话吗？此操作不可撤销。',
  sidebarLoading: '加载中...',

  // ─── Errors ───
  switchFailed: '切换失败',

  // ─── Runner ───
  local: '本地',
  workspaceEnv: '🖥️ 工作环境',
  manageRunners: '管理远程 Runner，点击卡片切换活跃环境。',
  noRunners: '尚未添加工作环境',
  addRunnerHint: '添加 Runner 后可远程执行命令',
  activeBadge: '活跃',
  dockerSandbox: '🐳 Docker Sandbox (内置)',
  builtinEnv: '内置环境',
  copyConnectCommand: '复制连接命令',
  copiedCommand: '已复制!',
  deleteRunner: '删除',
  confirmDeleteRunner: '确认删除',
  confirmDeleteRunnerText: '确定要删除 {name} 吗？',
  runnerOnlineWarning: '⚠️ 此 Runner 当前在线，删除后将断开连接。',
  runnerName: '名称',
  runnerNamePlaceholder: '例如：MacBook Pro',
  runMode: '运行模式',
  nativeMode: '🖥️ 原生',
  dockerMode: '🐳 Docker',
  dockerImage: 'Docker 镜像',
  workspace: '工作目录',
  workspacePlaceholder: '例如：/home/user/project（留空则由 Runner 自动设定）',
  workspaceHint: 'Runner 连接后将使用此目录作为工作区',
  creating: '⏳ 创建中...',
  create: '✨ 创建',
  addWorkspace: '➕ 添加工作环境',

  // ─── Offline ───
  offlineMessage: '📶 网络已断开，部分功能不可用',
  backOnline: '📶 网络已恢复',

  // ─── Error boundary ───
  errorBoundaryTitle: '页面出错了',
  errorBoundaryMessage: '发生了意外错误，请尝试刷新页面。',
  errorBoundaryRetry: '重试',
  refreshPage: '刷新页面',
  errorDetails: '错误详情',

  // ─── Tokens ───
  tokens: 'tokens',

  // ─── Appearance Tab ───
  appearanceTitle: '🎨 外观',
  themeLabel: '主题',
  fontSizeLabel: '字体大小',
  nicknameLabel: '昵称',
  languageLabel: '语言',
  smallSize: '小',
  mediumSize: '中',
  largeSize: '大',
  enterNickname: '输入昵称...',

  // ─── Sessions Tab ───
  chatRooms: '💬 ChatRooms',
  chatRoomDesc: '所有对话都是 ChatRoom — 人↔Agent、Agent↔Agent 统一管理。',
  backToList: '← 返回列表',
  mainSession: '👤 主会话',
  agentSession: '🤖 Agent',
  running: '运行中',
  completed: '已完成',
  noMessages: '暂无消息记录',
  noChatRooms: '暂无 ChatRoom',
  loadingDots: '加载中...',
  refresh: '🔄 刷新',

  // ─── LLM Tab ───
  llmTitle: '🧠 个人 LLM 配置',
  fetchConfigFailed: '获取配置失败',
  providerLabel: '提供商',
  currentModelLabel: '当前模型',
  usingPersonalModel: '当前使用个人模型。可切换模型或删除配置以恢复系统默认。',
  addLLMConfig: '添加个人 LLM 配置',
  baseURLRequired: 'Base URL 和 API Key 为必填项',
  configSaved: '配置已保存',
  modelSwitched: '模型已切换',
  switchModelFailed: '切换模型失败',
  configDeleted: '配置已删除',
  deleteFailed: '删除失败',
  deleteLLMConfig: '确认删除个人 LLM 配置？删除后将恢复使用系统默认模型。',
  deleteConfig: '删除配置',
  addConfig: '添加配置',
  saveConfig: '保存配置',
  save: '保存',
  defaultModel: '默认',
  apiKeyMasked: '••••••••',
  maxContextLabel: '最大上下文 Tokens',
  maxOutputLabel: '最大输出 Tokens',
  thinkingModeLabel: '思考模式',
  thinkingAuto: '自动',
  thinkingOn: '开启',
  thinkingOff: '关闭',
  baseURLLabel: 'Base URL',
  apiKeyLabel: 'API Key',
  modelLabel: '模型',
  enterModelName: '输入模型名称...',

  // ─── Presets Tab ───
  presetsTitle: '⚡ 快捷指令',
  presetsDesc: '配置常用指令，在聊天输入框上方快速触发。最多 20 条。',
  presetIcon: '图标',
  presetLabel: '名称',
  presetContent: '内容',
  presetContentPlaceholder: '点击后发送的内容...',
  fillMode: '填充模式（填入输入框而非直接发送）',
  savePreset: '💾 保存',
  confirmDeletePreset: '确认删除此快捷指令？',
  noPresets: '暂无快捷指令',
  moveUp: '上移',
  moveDown: '下移',
  editPreset: '编辑',
  deletePreset: '删除',

  // ─── Market Tab ───
  marketTitle: '🏪 市场',
  publishSuccess: '发布成功',
  unpublishSuccess: '已取消发布',
  installSuccess: '安装成功',
  uninstallSuccess: '卸载成功',
  installFailed: '安装失败',
  uninstallFailed: '卸载失败',

  // ─── AssistantTurn ───
  thinkingProcess: '思考过程',
  iterationProcess: '迭代过程',
  expandAll: '展开全部',
  collapse: '折叠',

  // ─── Tab labels ───
  tabAppearance: '外观',
  tabSessions: '会话',
  tabPresets: '快捷指令',
  tabLLM: 'LLM',
  tabRunner: 'Runner',
  tabMarket: '市场',

  // ─── Message Actions ───
  deleteMessage: '删除消息',
  regenerate: '重新生成',
  messageDeleted: '消息已删除',
  regenerateFailed: '重新生成失败',

  // ─── Search ───
  searchResults: '{count} 个结果',

  // ─── Misc ───
  refreshPageHint: '请刷新页面重新连接',
  delete: '删除',
  exportMarkdown: '导出 Markdown',
  exportJSON: '导出 JSON',
  exportChat: '导出会话',
  edit: '编辑',
  preview: '预览',
  returnToLogin: '返回登录',
  // ─── Reply ───
  replyMessage: '回复',
  replyingTo: '正在回复',
  cancelReply: '取消回复',

  // ─── Tab Bar ───
  closeTab: '关闭标签',
  newTab: '新会话',
  noOpenTabs: '暂无打开的会话',

  // ─── Notification ───
  enableNotification: '开启桌面通知',
  newMessageNotification: 'xbot 新消息',
  notificationClickToView: '点击查看',
  notificationEnabled: '通知已开启',
  notificationDenied: '通知权限被拒绝',
  expandCodeBlock: '展开 ({lines} 行)',
  collapseCodeBlock: '折叠',

  // ─── WebSocket Status ───
  wsConnected: '● 已连接',
  wsConnecting: '◐ 连接中...',
  wsDisconnected: '○ 已断开',
  wsReconnecting: '⚠️ 重连中',
  reconnectAttemptN: '第 {n} 次',
  nextRetryIn: '{n}s 后重试',
  reconnectSyncHint: '重连后将自动同步断线期间的消息',

  // ─── Settings Advanced ───
  searchSettings: '搜索设置...',
  noMatchingSettings: '无匹配设置项',
  exportSettings: '导出设置',
  importSettings: '导入设置',
  importSuccess: '设置导入成功',
  importFailed: '导入失败：格式无效',
  resetToDefaults: '重置为默认值',
  confirmResetSettings: '确定要重置所有外观设置为默认值吗？',
  settingsReset: '设置已重置',

  // ─── Message Status ───
  sending: '发送中...',
  sendFailed: '发送失败',
  retry: '重试',
  edited: '(已编辑)',
  charCount: '{count} 字',
  justNow: '刚刚',
  minutesAgo: '{n}分钟前',
  hoursAgo: '{n}小时前',
  daysAgo: '{n}天前',

  // ─── Image Brightness ───
  imageBrightnessLabel: '图片亮度',
  imageBrightnessHint: '调整暗色模式下图片显示亮度',

  // ─── Upload Queue (Batch 2) ───
  uploadQueue: '上传队列',
  uploadProgress: '{percent}%',
  uploadComplete: '上传完成',
  uploadCancelled: '上传已取消',
  uploadRetrying: '重试中...',
  cancelUpload: '取消上传',
  retryUpload: '重试上传',
  queueEmpty: '暂无上传任务',
  uploading: '上传中...',
  uploadError: '上传出错',
  filesSelected: '已选择 {count} 个文件',
  uploadAll: '全部上传',
  clearCompleted: '清除已完成',
  uploadSpeed: '{speed}/s',
  uploadRemaining: '剩余 {time}',
  parallelUploads: '并行上传数',
  uploadPaused: '已暂停',
  pauseUpload: '暂停',
  resumeUpload: '继续',

  // ─── Swipe & Context Menu (Batch 3) ───
  swipeToReply: '← 滑动回复',
  doubleClickToReply: '双击回复',
  copyMessageLink: '复制消息链接',
  quoteMessage: '引用',
  forwardMessage: '转发',
  messageActions: '消息操作',
  pinMessage: '置顶',
  unpinMessage: '取消置顶',

  // ─── Command Palette (Batch 4) ───
  commandPalette: '命令面板',
  commandPaletteHint: '输入命令或搜索...',
  commandPaletteTabCommands: '命令',
  commandPaletteTabSearch: '搜索',
  noMatchingCommands: '无匹配命令',
  quickActions: '快捷操作',
  openCommandPalette: 'Ctrl+K 命令面板',
  runCommand: '执行',

  // ─── Onboarding (Batch 4) ───
  onboardingTip: '💡 按 Ctrl+K 打开命令面板，快速搜索和执行操作',
  onboardingDismiss: '知道了',
  onboardingPrev: '上一步',
  onboardingNext: '下一步',
  onboardingDone: '开始使用',
  onboardingStep1Title: '输入框',
  onboardingStep1Desc: '输入消息与 AI 对话',
  onboardingStep2Title: '文件上传',
  onboardingStep2Desc: '支持拖拽或粘贴上传文件',
  onboardingStep3Title: '命令面板',
  onboardingStep3Desc: '按 Ctrl+K 快速搜索和执行操作',

  // ─── Media Player (Batch 5) ───
  audioPlayer: '音频播放器',
  videoPlayer: '视频播放器',
  play: '播放',
  pause: '暂停',
  volume: '音量',
  mute: '静音',
  unmute: '取消静音',
  fullscreen: '全屏',
  exitFullscreen: '退出全屏',
  mediaNotSupported: '浏览器不支持此媒体格式',
  playbackSpeed: '播放速度',
  normalSpeed: '正常',
  pip: '画中画',
  exitPip: '退出画中画',

  // ─── Media Player Enhancements (Batch 6) ───
  playbackRate: '播放速率',
  rate0_5: '0.5x',
  rate0_75: '0.75x',
  rate1: '1x',
  rate1_25: '1.25x',
  rate1_5: '1.5x',
  rate2: '2x',

  // ─── Keyboard Navigation ───
  keyboardHelp: '键盘快捷键',
  vimNavigation: 'Vim 导航',
  navigation: '导航',
  actions: '操作',
  mediaControl: '媒体控制',
  scrollDown: '向下滚动',
  scrollUp: '向上滚动',
  goToTop: '跳到顶部',
  goToBottom: '跳到底部',
  halfPageUp: '向上翻半页',
  halfPageDown: '向下翻半页',
  toggleKeyboardHelp: '键盘帮助',
  playPause: '播放/暂停',
  seekBackForward: '快进/快退',
  volumeUpDown: '音量调节',

  // ─── Bookmarks & Theme ───
  bookmarkMessage: '收藏消息',
  bookmarks: '书签',
  themeEditor: '主题编辑器',
  customTheme: '自定义主题',
  importTheme: '导入主题',
  exportTheme: '导出主题',
  previewTheme: '预览主题',
  resetTheme: '重置主题',
  safeArea: '安全区域',
  foldScreen: '折叠屏',
  landscapeMode: '横屏模式',
  noBookmarks: '暂无书签',
  jumpToBookmark: '跳转',
  removeBookmark: '取消收藏',

  // ─── Reactions (Round 14) ───
  reactions: '反应',
  addReaction: '添加反应',
  reactionLike: '👍 赞',
  reactionLove: '❤️ 爱心',
  reactionLaugh: '😂 笑',
  reactionWow: '😮 惊讶',
  reactionSad: '😢 难过',
  reactionAngry: '😠 生气',
  reactionCount: '{count}',
  reactionTooltip: '{emoji} {count} 人',

  // ─── Threads (Round 14) ───
  thread: '话题',
  threads: '话题',
  newThread: '新话题',
  replyInThread: '在话题中回复',
  threadReplies: '{count} 条回复',
  threadParticipants: '{count} 位参与者',
  closeThread: '关闭话题',
  threadEmpty: '话题暂无回复',
  threadLastReply: '最后回复',
  threadCreated: '话题已创建',
  deleteThread: '删除话题',

  // ─── Notifications (Round 14) ───
  notificationCenter: '通知中心',
  notificationSettings: '通知设置',
  markAllRead: '全部已读',
  noNotifications: '暂无通知',
  notificationSound: '通知音效',
  notificationSoundOn: '音效已开启',
  notificationSoundOff: '音效已关闭',
  notificationType: '通知类型',
  notifyOnMention: '被提及',
  notifyOnReply: '被回复',
  notifyOnNewMessage: '新消息',
  notifyOnWsChange: '连接状态变化',
  notificationPreview: '通知预览',
  notificationPermissionRequired: '需要开启通知权限',
  clearNotifications: '清空通知',
  unreadCount: '{count} 条未读',

  // ─── Snapshot (Round 14) ───
  snapshot: '快照',
  takeSnapshot: '截图',
  snapshotCopied: '快照已复制到剪贴板',
  snapshotFailed: '截图失败',
  snapshotTitle: '消息快照',
  snapshotTimestamp: '截图时间',

  // ─── Search Enhancements (Round 14) ───
  searchFilter: '过滤器',
  searchFilterAll: '全部',
  searchFilterUser: '用户消息',
  searchFilterAssistant: '助手消息',
  searchFilterDate: '日期范围',
  searchFilterToday: '今天',
  searchFilterWeek: '本周',
  searchFilterMonth: '本月',
  searchFilterCustom: '自定义',
  searchHistoryR14: '搜索记录',
  clearSearchHistory: '清除搜索历史',
  searchContext: '上下文',
  showContext: '显示上下文',
  hideContext: '隐藏上下文',
  contextLines: '{count} 行上下文',

  // ─── Sound Feedback (Round 14) ───
  soundFeedback: '声音反馈',
  soundOn: '🔊 声音已开启',
  soundOff: '🔇 声音已关闭',
  soundVolume: '音量',
  soundType: '音效类型',
  soundSent: '发送音效',
  soundReceive: '接收音效',
  soundNotify: '通知音效',
  soundBeep: '提示音',
  soundChime: '铃声',
  soundPop: '弹出音',

} as const

export type I18nKey = keyof typeof zhCN
export default zhCN
