scripted_gui = {
	
	CZD_crisis_system_ui = {
		context_type = decision_category
		window_name = "CZD_crisis_system_ui_window"
		
		# 追踪所有危机变量的变化
		dirty = CZD_bureaucratic_bourgeoisie_power
		dirty = CZD_counterrevolution_level
		dirty = CZD_purge_intensity
		dirty = CZD_revolutionary_momentum
		
		properties = {
			# 官僚资产阶级影响力进度条
			bureaucratic_power_bar = {
				frame = CZD_bureaucratic_bourgeoisie_power
			}
			# 反革命程度进度条
			counterrevolution_bar = {
				frame = CZD_counterrevolution_level
			}
			# 清洗力度进度条
			purge_intensity_bar = {
				frame = CZD_purge_intensity
			}
			# 革命动能进度条
			revolutionary_momentum_bar = {
				frame = CZD_revolutionary_momentum
			}
		}
		
		dynamic_lists = {
		}
		
		triggers = {
			# 显示激进线专属元素
			radical_line_visible = {
				has_country_flag = CZD_radical_path
			}
			
			# 显示历史线专属元素
			historical_line_visible = {
				has_country_flag = CZD_historical_path
			}
			
			# 显示五丈原路线专属元素
			wuzhangyuan_path_visible = {
				has_country_flag = CZD_wuzhangyuan_path
			}
			
			# 显示世界解放路线专属元素
			world_liberation_path_visible = {
				has_country_flag = CZD_world_liberation_path
			}
			
			# 危机尚未开始
			crisis_not_started = {
				NOT = { has_country_flag = CZD_crisis_started }
			}
			
			# 危机进行中
			crisis_ongoing = {
				has_country_flag = CZD_crisis_started
				NOT = { 
					has_country_flag = CZD_historical_ending_achieved
					has_country_flag = CZD_wuzhangyuan_ending_achieved
					has_country_flag = CZD_world_liberation_ending_achieved
				}
			}
			
			# 危机严重 - 官僚力量 > 70
			crisis_severe = {
				check_variable = { CZD_bureaucratic_bourgeoisie_power > 70 }
			}
			
			# 危机危险 - 官僚力量 50-70
			crisis_dangerous = {
				check_variable = { CZD_bureaucratic_bourgeoisie_power > 50 }
				NOT = { check_variable = { CZD_bureaucratic_bourgeoisie_power > 70 } }
			}
			
			# 危机可控 - 官僚力量 30-50
			crisis_manageable = {
				check_variable = { CZD_bureaucratic_bourgeoisie_power > 30 }
				NOT = { check_variable = { CZD_bureaucratic_bourgeoisie_power > 50 } }
			}
			
			# 清洗激烈
			purge_intense = {
				check_variable = { CZD_purge_intensity > 50 }
			}
			
			# 革命势头强劲
			momentum_high = {
				check_variable = { CZD_revolutionary_momentum > 50 }
			}
			
			# 反革命威胁严重
			counterrevolution_threat = {
				check_variable = { CZD_counterrevolution_level > 40 }
			}
			
			# 已达成历史结局
			historical_ending = {
				has_country_flag = CZD_historical_ending_achieved
			}
			
			# 已达成五丈原结局
			wuzhangyuan_ending = {
				has_country_flag = CZD_wuzhangyuan_ending_achieved
			}
			
			# 已达成世界解放结局
			world_liberation_ending = {
				has_country_flag = CZD_world_liberation_ending_achieved
			}
		}
		
		effects = {
		}
	}
}
