// 配置管理类
class ConfigManager {
    static getConfig(key, defaultValue = null) {
        const value = localStorage.getItem(key);
        if (value === null) return defaultValue;
        try {
            return JSON.parse(value);
        } catch {
            return value;
        }
    }

    static setConfig(key, value) {
        try {
            localStorage.setItem(key, JSON.stringify(value));
        } catch {
            localStorage.setItem(key, value);
        }
    }

    static getBoolConfig(key, defaultValue = false) {
        const value = this.getConfig(key);
        return value === null ? defaultValue : value === 'true' || value === true;
    }

    static setBoolConfig(key, value) {
        this.setConfig(key, Boolean(value));
    }
}
