import 'package:flutter/material.dart';

/// 应用颜色定义
class AppColors {
  // 主色调
  static const Color primary = Color(0xFF1890FF);
  static const Color primaryLight = Color(0xFF40A9FF);
  static const Color primaryDark = Color(0xFF096DD9);

  // 功能色
  static const Color success = Color(0xFF52C41A);
  static const Color warning = Color(0xFFFAAD14);
  static const Color error = Color(0xFFF5222D);
  static const Color info = Color(0xFF1890FF);

  // 文本颜色
  static const Color textPrimary = Color(0xFF262626);
  static const Color textSecondary = Color(0xFF8C8C8C);
  static const Color textDisabled = Color(0xFFBFBFBF);
  static const Color textWhite = Color(0xFFFFFFFF);

  // 背景颜色
  static const Color background = Color(0xFFFAFAFA);
  static const Color backgroundLight = Color(0xFFFFFFFF);
  static const Color backgroundDark = Color(0xFF141414);

  // 边框颜色
  static const Color border = Color(0xFFD9D9D9);
  static const Color borderLight = Color(0xFFF0F0F0);

  // 要素类型颜色
  static const Color amount = Color(0xFF52C41A); // 金额 - 绿色
  static const Color company = Color(0xFF1890FF); // 公司 - 蓝色
  static const Color person = Color(0xFF722ED1); // 人名 - 紫色
  static const Color location = Color(0xFFFA8C16); // 地名 - 橙色
  static const Color date = Color(0xFFEB2F96); // 日期 - 粉色
  static const Color other = Color(0xFF8C8C8C); // 其他 - 灰色

  // 状态颜色
  static const Color statusPending = Color(0xFFFAAD14);
  static const Color statusProcessing = Color(0xFF1890FF);
  static const Color statusSuccess = Color(0xFF52C41A);
  static const Color statusError = Color(0xFFF5222D);

  /// 根据要素类型获取颜色
  static Color getElementColor(String type) {
    switch (type.toLowerCase()) {
      case 'amount':
      case '金额':
        return amount;
      case 'company':
      case '公司':
        return company;
      case 'person':
      case '人名':
        return person;
      case 'location':
      case '地名':
        return location;
      default:
        return textSecondary;
    }
  }
}
