// 需求映射接口定义
export interface RequirementMapping {
  sceneGeneration: {
    baseScene: SceneTemplate;        // 固定场景模板
    parameters: SceneParams;         // 场景参数
    atmospherePreview: string;       // 氛围感预览图
  };
  parameterMapping: {
    colorParams: ColorMappingParams;
    spaceParams: SpaceMappingParams;
    materialParams: MaterialMappingParams;
  };
}

// 场景参数接口
export interface SceneParams {
  lighting: LightingParams;
  environment: EnvironmentParams;
  composition: CompositionParams;
  style: StyleParams;
}

// 灯光参数
export interface LightingParams {
  primaryLight: {
    type: 'natural' | 'artificial' | 'mixed';
    intensity: number; // 0-100
    temperature: number; // 色温K值
    direction: 'top' | 'front' | 'back' | 'left' | 'right' | 'multiple';
  };
  ambientLight: {
    strength: number; // 0-100
    mood: 'dramatic' | 'romantic' | 'energetic' | 'calm' | 'mysterious' | 'cheerful' | 'professional';
  };
  shadows: {
    intensity: number; // 0-100
    softness: number; // 0-100
  };
}

// 环境参数
export interface EnvironmentParams {
  setting: 'indoor' | 'outdoor' | 'studio' | 'natural';
  atmosphere: 'minimal' | 'cozy' | 'luxurious' | 'industrial' | 'natural' | 'modern';
  weatherCondition?: 'sunny' | 'cloudy' | 'overcast' | 'golden-hour' | 'blue-hour';
  timeOfDay?: 'morning' | 'noon' | 'afternoon' | 'evening' | 'night';
}

// 构图参数
export interface CompositionParams {
  viewAngle: 'close-up' | 'medium' | 'wide' | 'panoramic';
  perspective: 'eye-level' | 'high-angle' | 'low-angle' | 'bird-eye';
  focusPoint: 'center' | 'left' | 'right' | 'top' | 'bottom';
  depth: number; // 0-100 景深效果
}

// 风格参数
export interface StyleParams {
  renderStyle: 'photorealistic' | 'artistic' | 'minimalist' | 'dramatic' | 'soft' | 'vibrant';
  colorGrading: 'natural' | 'warm' | 'cool' | 'vintage' | 'modern' | 'high-contrast';
  textureDetail: 'low' | 'medium' | 'high' | 'ultra';
}

// 颜色映射参数
export interface ColorMappingParams {
  primaryColors: ColorMapping[];
  colorHarmony: 'monochromatic' | 'analogous' | 'complementary' | 'triadic' | 'split-complementary';
  saturation: number; // 0-100
  brightness: number; // 0-100
  contrast: number; // 0-100
  temperature: 'warm' | 'neutral' | 'cool';
}

// 单个颜色映射
export interface ColorMapping {
  originalColor: string; // hex color
  mappedColor: string; // hex color
  weight: number; // 0-100 在整体配色中的权重
  usage: 'primary' | 'secondary' | 'accent' | 'background';
}

// 空间映射参数
export interface SpaceMappingParams {
  dimensions: {
    width: number;
    height: number;
    depth: number;
    unit: 'meter' | 'feet';
  };
  layout: {
    type: 'open' | 'enclosed' | 'semi-open' | 'multi-level';
    flow: 'linear' | 'circular' | 'grid' | 'organic';
    zones: SpaceZone[];
  };
  scale: {
    furniture: number; // 0-100 家具比例
    ceiling: number; // 0-100 天花板高度比例
    openness: number; // 0-100 开放程度
  };
}

// 空间区域
export interface SpaceZone {
  name: string;
  function: string;
  area: number; // 占总面积百分比
  position: 'center' | 'corner' | 'wall' | 'entrance' | 'window';
}

// 材质映射参数
export interface MaterialMappingParams {
  surfaceMaterials: MaterialMapping[];
  textureScale: number; // 0-100 纹理缩放
  reflectivity: number; // 0-100 反射率
  roughness: number; // 0-100 粗糙度
  metallic: number; // 0-100 金属度
}

// 单个材质映射
export interface MaterialMapping {
  category: 'wood' | 'metal' | 'fabric' | 'stone' | 'glass' | 'ceramic' | 'plastic' | 'leather';
  subtype: string; // 具体材质类型
  finish: 'matte' | 'satin' | 'gloss' | 'textured' | 'brushed' | 'polished';
  color: string; // hex color
  coverage: number; // 0-100 覆盖面积百分比
  priority: 'primary' | 'secondary' | 'accent';
}

// 场景模板枚举
export enum SceneTemplate {
  LIVING_ROOM_MODERN = 'living_room_modern',
  LIVING_ROOM_CLASSIC = 'living_room_classic',
  BEDROOM_MINIMAL = 'bedroom_minimal',
  BEDROOM_COZY = 'bedroom_cozy',
  KITCHEN_CONTEMPORARY = 'kitchen_contemporary',
  KITCHEN_TRADITIONAL = 'kitchen_traditional',
  BATHROOM_LUXURY = 'bathroom_luxury',
  BATHROOM_MINIMAL = 'bathroom_minimal',
  OFFICE_MODERN = 'office_modern',
  OFFICE_TRADITIONAL = 'office_traditional',
  DINING_FORMAL = 'dining_formal',
  DINING_CASUAL = 'dining_casual',
  STUDIO_APARTMENT = 'studio_apartment',
  OUTDOOR_PATIO = 'outdoor_patio',
  OUTDOOR_GARDEN = 'outdoor_garden'
}

// 需求映射结果
export interface MappingResult {
  success: boolean;
  sceneId: string;
  generatedParams: SceneParams;
  previewUrl?: string;
  confidence: number; // 0-100 映射置信度
  suggestions?: string[]; // 优化建议
  errors?: string[]; // 错误信息
}