import streamlit as st
import matplotlib.pyplot as plt
import numpy as np

def run_streamlit_visualization():
    """ 运行 Streamlit 交互式界面 """
    st.set_page_config(page_title="🏡 住房市场模拟", layout="wide")
    st.title("🏡 住房市场模拟 (ABM)")

    st.sidebar.header("📌 调整关键变量")
    price_to_income_ratio = st.sidebar.slider("房价收入比", 5, 40, 10, step=1)

    fig, ax = plt.subplots()
    x = np.linspace(0, 10, 100)
    y = x ** 2
    ax.plot(x, y)
    st.pyplot(fig)
