// ── Vue Router meta 类型扩展 ───────────────────────────
declare module 'vue-router' {
  interface RouteMeta {
    title?: string
    requiresAuth?: boolean
    guestOnly?: boolean
  }
}

// ── 用户 ──────────────────────────────────────────────

export interface User {
  email: string
  token: string
  uid?: string
}

// ── 行情 ──────────────────────────────────────────────

export type MarketType = 'futures' | 'spot'

export interface MarketItem {
  symbol: string       // e.g. "BTC/USDT"
  name: string         // e.g. "比特币"
  type: 'futures' | 'spot'
  icon: string         // coin icon url
  price: number
  change24h: number    // 百分比，如 +21.26
  high24h: number
  low24h: number
  volume24h: number    // 成交量
}

export interface CoinDetail {
  symbol: string
  name: string
  icon: string
  marketCap: string
  circulatingSupply: string
  totalSupply: string
  allTimeHigh: number
  currentPrice: number
  priceChange: number
  priceChangePct: number
  stats: PeriodStat[]
  chartData: ChartPoint[]
}

export interface PeriodStat {
  label: string   // 近1年 / 3个月 / 30天 / 7天
  changePct: number
  price: number
}

export interface ChartPoint {
  time: string
  price: number
}

export type ChartRange = '24h' | '1w' | '1m' | '1y'

// ── 公告 ──────────────────────────────────────────────

export interface Announcement {
  id: string | number
  title: string
  content?: string
  publishedAt: string  // ISO string
  author?: string
}

// ── VIP 费率 ──────────────────────────────────────────

export interface VipTier {
  level: string        // VIP1 ~ VIP5
  minHolding: number   // 最低持仓 USDT
  spotMaker: number
  spotTaker: number
  futuresMaker: number
  futuresTaker: number
}

// ── 导航 ──────────────────────────────────────────────

export interface NavItem {
  label: string
  to: string
}

// ── 资产 ──────────────────────────────────────────────

export interface AssetItem {
  coin: string         // e.g. "BTC"
  name: string         // e.g. "比特币"
  available: number    // 可用
  frozen: number       // 冻结
  usdtValue: number    // 折合 USDT
}

export interface AssetOverview {
  totalUsdt: number
  totalCny: number
  assets: AssetItem[]
}

export type TransferAccount = 'fund' | 'futures' | 'copy'
