import 'package:flutter_screenutil/flutter_screenutil.dart';

/// 应用尺寸常量
/// 提供静态值和响应式值两种方式
/// 静态值用于不需要适配的场景，响应式值用于需要适配的场景
class AppDimensions {
  AppDimensions._();

  // ============ 静态间距 ============
  static const double spacingXs = 4.0;
  static const double spacingSm = 8.0;
  static const double spacingMd = 16.0;
  static const double spacingLg = 24.0;
  static const double spacingXl = 32.0;
  static const double spacingXxl = 48.0;

  // ============ 响应式间距 ============
  static double get spacingXsR => 4.w;
  static double get spacingSmR => 8.w;
  static double get spacingMdR => 16.w;
  static double get spacingLgR => 24.w;
  static double get spacingXlR => 32.w;
  static double get spacingXxlR => 48.w;

  // ============ 静态圆角 ============
  static const double radiusXs = 4.0;
  static const double radiusSm = 8.0;
  static const double radiusMd = 12.0;
  static const double radiusLg = 16.0;
  static const double radiusXl = 24.0;
  static const double radiusFull = 999.0;

  // ============ 响应式圆角 ============
  static double get radiusXsR => 4.r;
  static double get radiusSmR => 8.r;
  static double get radiusMdR => 12.r;
  static double get radiusLgR => 16.r;
  static double get radiusXlR => 24.r;

  // ============ 静态图标尺寸 ============
  static const double iconXs = 16.0;
  static const double iconSm = 20.0;
  static const double iconMd = 24.0;
  static const double iconLg = 32.0;
  static const double iconXl = 48.0;

  // ============ 响应式图标尺寸 ============
  static double get iconXsR => 16.sp;
  static double get iconSmR => 20.sp;
  static double get iconMdR => 24.sp;
  static double get iconLgR => 32.sp;
  static double get iconXlR => 48.sp;

  // ============ 静态按钮高度 ============
  static const double buttonHeightSm = 36.0;
  static const double buttonHeightMd = 44.0;
  static const double buttonHeightLg = 52.0;

  // ============ 响应式按钮高度 ============
  static double get buttonHeightSmR => 36.h;
  static double get buttonHeightMdR => 44.h;
  static double get buttonHeightLgR => 52.h;

  // ============ 静态输入框高度 ============
  static const double inputHeight = 48.0;

  // ============ 响应式输入框高度 ============
  static double get inputHeightR => 48.h;

  // ============ 静态头像尺寸 ============
  static const double avatarSm = 32.0;
  static const double avatarMd = 48.0;
  static const double avatarLg = 64.0;
  static const double avatarXl = 96.0;

  // ============ 响应式头像尺寸 ============
  static double get avatarSmR => 32.w;
  static double get avatarMdR => 48.w;
  static double get avatarLgR => 64.w;
  static double get avatarXlR => 96.w;

  // ============ 卡片 ============
  static const double cardPadding = 16.0;
  static const double cardRadius = 12.0;

  static double get cardPaddingR => 16.w;
  static double get cardRadiusR => 12.r;

  // ============ 导航栏 ============
  static const double bottomNavHeight = 65.0;
  static const double appBarHeight = 56.0;

  static double get bottomNavHeightR => 65.h;
  static double get appBarHeightR => 56.h;

  // ============ 最小点击区域 (无障碍规范要求至少 48x48) ============
  static const double minTouchTarget = 48.0;
  static double get minTouchTargetR => 48.w;
}
