/** 产品标识（对外展示） */
export const PRODUCT_NAME_CN = '检澜'
export const PRODUCT_NAME_EN = 'DockScope'
export const PRODUCT_TITLE = '检澜 DockScope'
export const PRODUCT_TAGLINE = '桥梁安全隐患智能检测工作台'

/** 桥梁安全隐患检测 — 统一用户可见文案 */
export const COPY = {
  navDetection: '桥梁安全隐患检测',
  navDetectionRecords: '安全隐患检测记录',
  navDefectLedger: '安全隐患台账',
  navBatchDetection: '批量安全隐患检测',
  hazardCategory: '隐患类别',
  hazardType: '隐患类型',
  hazardGrade: '隐患等级',
  msgDetectionPrefix: '【安全隐患检测】',
}

export const GITCC_LOGO_URL =
  'https://www.gitcc.com/uploads/-/system/appearance/header_logo/1/gitpp.png'
export const GITCC_COMMUNITY_URL = 'https://www.gitcc.com/'

/** 规范化 GitCC OpenAI 兼容 Base，必须以 /v1 结尾（默认 https） */
export function normalizeGitccV1Base(raw) {
  const fallback = 'https://api.gitcc.com/v1'
  let u = (raw || import.meta.env?.VITE_GITCC_API_BASE || fallback).trim()
  if (!/^https?:\/\//i.test(u)) u = `https://${u}`
  try {
    const url = new URL(u)
    if (url.hostname === 'api.gitcc.com') {
      return `${url.origin}/v1`
    }
    return url.toString().replace(/\/+$/, '')
  } catch {
    return fallback
  }
}

export const GITCC_API_BASE = normalizeGitccV1Base()
export const GITCC_API_KEY_STORAGE = 'gitcc_api_key'
export const GITCC_MODEL_DEFAULT = 'gpt-4.1-mini'

/** 导出报表等文件名前缀 */
export const EXPORT_PREFIX = '检澜'
